(zooming on cluster of points in (2D)- calculate Z coord. for which α = β

56 Views Asked by At

I am writing a script which zooms a camera on a given object (set of points in 3D). I have to take perspective into account (the further a point on the object is from the camera, the smaller it appears) for determining the camera height for which the object is perfectly centered.

I have simplified the problem to a 2D problem by projecting the 3d points onto the YZ plane (projected points form a 2D point cluster) and have written the problem down in terms of angles, variables and distances: Please take a look at the image via the following link:

IMAGE: Sketch of problem (Zoom on 2d point cluster)

Given:

  • The coordinates of all points in the 2D point cluster (y,z)
  • Y-coordinate of point C
  • lines AC, BC, DE, FC, GC intersect @point C
  • Angle γ is known and constant (γ is the same for all camera heights).
  • lines AC, BC intersect the object (2D point cluster) at ≥ 2 points such that:
    • all points in the cluster lie between lines AC, BC

Find:

Find the Z coordinate of point C for which α = β

Extra info: The lines FC, GC represent the Field of View lines of the camera. The area between lines FC, GC represents the projection of the view frustum onto the YZ plane. Since there is only 1 camera height for which the object is perfectly centered I think this problem has a single solution (where Z∈R, aka Z is part of real numbers).

The main issue I am faced with is that the points where lines AC, BC intersect the 2d point cluster are dependent on the camera height Z. The points where lines AC, BC intersect the 2d point cluster are different for different values of Z, see image below for an example:

IMAGE: Intersection points dependent on Z value

If any clarification/extra info is needed please let me know

Any help would be greatly appreciated, thank you :)