Equirec2Perspec icon indicating copy to clipboard operation
Equirec2Perspec copied to clipboard

regarding output

Open pankajkmr22 opened this issue 2 years ago • 3 comments

This is very well written I really thanks a lot This code is very helpful for me but i am not able to see the output (perspective images) I have used this code (below), foe showing output but the perspective image is not showing

I requested to please suggest to me or write a code for showing the perspective images.

if name == 'main': img = im.imread('/content/drive/MyDrive/Street View 360_1.jpg') equ = Equirectangular('/content/drive/MyDrive/Street View 360_1.jpg') # Load equirectangular image img = equ.GetPerspective(60, 0, 0, 720, 1080) # Specify parameters(FOV, theta, phi, height, width) #persp.toEquirectangular(img, center_point)

pankajkmr22 avatar Aug 04 '23 16:08 pankajkmr22

` from PIL import Image # +++++++ import Equirec2Perspec as E2P

if name == 'main': equ = E2P.Equirectangular('src/image.jpg') # Load equirectangular image

#
# FOV unit is degree
# theta is z-axis angle(right direction is positive, left direction is negative)
# phi is y-axis angle(up direction positive, down direction negative)
# height and width is output image dimension
#
img = equ.GetPerspective(60, 0, 0, 720, 1080)  # Specify parameters(FOV, theta, phi, height, width)

img = img[:, :, ::-1]  # +++++++
img1 = Image.fromarray(img.astype('uint8')).convert('RGB')  # ++++++

img1.save("./out_img.jpg")  # +++++

`

You must add the line " # +++++".

guyanf avatar Aug 07 '23 02:08 guyanf

Thank you so much sir for your response

pankajkmr22 avatar Aug 07 '23 05:08 pankajkmr22

Thank you so much sir for your response. This code is very important for usRegardsPankaj KumarPh.D Research scholarDepartment of Civil Engineering(Specialization: Transportation Engineering)Indian Institute of Technology KanpurKanpur - 208016, U.P. , INDIAContact: +91- 6202689789On Aug 7, 2023 07:59, Thomas @.***> wrote: ` from PIL import Image # +++++++ import Equirec2Perspec as E2P if name == 'main': equ = E2P.Equirectangular('src/image.jpg') # Load equirectangular image

FOV unit is degree

theta is z-axis angle(right direction is positive, left direction is negative)

phi is y-axis angle(up direction positive, down direction negative)

height and width is output image dimension

img = equ.GetPerspective(60, 0, 0, 720, 1080) # Specify parameters(FOV, theta, phi, height, width)

img = img[:, :, ::-1] # +++++++ img1 = Image.fromarray(img.astype('uint8')).convert('RGB') # ++++++

img1.save("./out_img.jpg") # +++++

` You must add the line " # +++++".

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

pankajkmr22 avatar Aug 07 '23 06:08 pankajkmr22