ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Calculating Head and Pitch of point on 360 panorama picture

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
xequte Posted - Jan 27 2022 : 14:58:08
Unfortunately, we have not had much success from this.

You might try the response at:

https://stackoverflow.com/questions/43741885/how-to-convert-spherical-coordinates-to-equirectangular-projection-coordinates

This was our best attempt, but it does not take into account the non-linearity of the photosphere, so it is very imprecise on the sides of the center.

procedure PitchHeadFromClientCoords(viewer: TImageEnView; X, Y: integer; var pitch, heading: double);
var
  fov: double;
  uX, uY: double;
  odx, ody: double;
begin
  with (viewer.IEBitmap.VirtualBitmapProvider as TIEEquirectangularRenderer) do
  begin
    fov     := CamFov;
    pitch   := CamPitch;
    heading := CamHeading;
  end;
  // unitary desidered point
  uX := X / viewer.ExtentX;
  uY := Y / viewer.ExtentY;
  // unitary distances from center to desidered point
  odx := 0.5 - uX;
  ody := 0.5 - uY;
  mainform.Label10.Caption:=floattostr(odx);
  // calc and add offset from current position
  pitch   := pitch   - ody * fov;
  heading := heading + odx * fov;
end;


Nigel
Xequte Software
www.imageen.com