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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Calculating Head and Pitch of point on 360 panorama picture
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

xequte

38608 Posts

Posted - Jan 27 2022 :  14:58:08  Show Profile  Reply
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: