Class Camera

java.lang.Object
com.irurueta.geometry.Camera
Direct Known Subclasses:
PinholeCamera

public abstract class Camera extends Object
A camera defines relations between 3D and 2D worlds.
  • Field Details

    • DEFAULT_CAMERA_TYPE

      public static final CameraType DEFAULT_CAMERA_TYPE
      Constant defining default camera type.
  • Constructor Details

    • Camera

      public Camera()
  • Method Details

    • project

      public Point2D project(Point3D point)
      Projects a 3D point into a 2D point in a retinal plane.
      Parameters:
      point - 3D point to be projected.
      Returns:
      2D projected point.
    • project

      public abstract void project(Point3D inputPoint, Point2D result)
      Projects a 3D point into a 2D point in a retinal plane and stores the result into provided instance.
      Parameters:
      inputPoint - 3D point to be projected.
      result - Instance where 2D projected point result is stored.
    • project

      public List<Point2D> project(List<Point3D> points)
      Projects 3D points into 2D points in a retinal plane.
      Parameters:
      points - 3D points to be projected.
      Returns:
      2D projected points.
    • project

      public void project(List<Point3D> inputPoints, List<Point2D> result)
      Projects 3D points into 2D points in a retinal plane and stores the result into provided list. Note that if result list is not empty, it will be cleared when calling this method and then the estimated 2D points will be stored in it.
      Parameters:
      inputPoints - 3D points to be projected.
      result - Instance where 2D projected points are stored.
    • backProject

      public Plane backProject(Line2D line)
      Back-projects a 2D line into a 3D plane.
      Parameters:
      line - 2D line to be back-projected.
      Returns:
      3D plane that has been back-projected.
    • backProject

      public abstract void backProject(Line2D line, Plane result)
      Back-projects a line into a plane and stores the result into provided instance.
      Parameters:
      line - 2D line to be back-projected.
      result - Instance where computed back-projected 3D plane data is stored.
    • backProjectLines

      public List<Plane> backProjectLines(List<Line2D> lines)
      Back-projects provided 2D lines into their corresponding 3D planes.
      Parameters:
      lines - 2D lines to be back-projected.
      Returns:
      3D planes that have been back-projected.
    • backProjectLines

      public void backProjectLines(List<Line2D> lines, List<Plane> result)
      Back-projects provided 2D lines into their corresponding 3D planes and stores the result into provided list. Note that if result list is not empty, its contents will be cleared when calling this method and then the estimated 3D planes will be stored in it.
      Parameters:
      lines - 2D lines to be back-projected.
      result - 3D planes that have been back-projected.
    • backProject

      public Point3D backProject(Point2D point) throws CameraException
      Back-projects provided 2D point into a 3D point. Notice that estimated solution is not unique, since back-projecting a 2D point results in an infinite number of 3D points located in the same ray of light. This method only returns one possible solution. Any possible solution can be computed as a linear combination between the camera center and the estimated point.
      Parameters:
      point - 2D point to be back-projected.
      Returns:
      A back-projected 3D point.
      Throws:
      CameraException - thrown if 2D point cannot be back-projected because camera is degenerate.
    • backProject

      public abstract void backProject(Point2D point, Point3D result) throws CameraException
      Back-projects provided 2D point into a 3D point and stores the result into provided instance. Notice that estimated solution is not unique, since back-projecting a 2D point results in an infinite number of 3D points located in the same ray of light. This method only computes one possible solution. Any other solution can be computed as a linear combination between the camera center and the estimated back-projected point.
      Parameters:
      point - 2D point to be back-projected.
      result - Instance where back-projected 3D point data will be stored
      Throws:
      CameraException - thrown if 2D point cannot be back-projected because camera is degenerate.
    • backProjectPoints

      public List<Point3D> backProjectPoints(List<Point2D> points) throws CameraException
      Back-projects provided 2D points into their corresponding 3D points.
      Parameters:
      points - 2D points to be back-projected.
      Returns:
      3D points that have been back-projected.
      Throws:
      CameraException - thrown if 2D point cannot be back-projected because camera is degenerate.
    • backProjectPoints

      public void backProjectPoints(List<Point2D> points, List<Point3D> result) throws CameraException
      Back-projects provided 2D points into their corresponding 3D points and stores the result into provided list. Note that if result list is not empty, its contents will be cleared when calling this method and then the estimated 3D points will be stored in it.
      Parameters:
      points - 2D points to be back-projected.
      result - 3D points that have been back-projected.
      Throws:
      CameraException - thrown if 2D point cannot be back-projected because camera is degenerate.
    • backProject

      public Quadric backProject(Conic conic)
      Back-projects a 2D conic into a 3D quadric.
      Parameters:
      conic - 2D conic to be back-projected.
      Returns:
      A back-projected 3D quadric.
    • backProject

      public abstract void backProject(Conic conic, Quadric result)
      Back-projects a 2D conic into a 3D quadric and stores the result into provided instance.
      Parameters:
      conic - 2D conic to be back-projected.
      result - Instance where data of back-projected 3D quadric will be stored.
    • project

      public DualConic project(DualQuadric dualQuadric)
      Projects a 3D dual quadric into a 2D dual conic.
      Parameters:
      dualQuadric - 3D dual quadric to be projected.
      Returns:
      A 2D dual conic.
    • project

      public abstract void project(DualQuadric dualQuadric, DualConic result)
      Projects a 3D dual quadric into a 2D dual conic and stores the result into provided instance.
      Parameters:
      dualQuadric - 3D dual quadric to be projected.
      result - Instance where data of projected 2D dual conic will be stored.
    • project

      public Conic project(Quadric quadric) throws CameraException
      Projects a 3D quadric into a 2D conic. The internal implementation of this method needs to compute the dual quadric of provided quadric, and also needs to compute the resulting conic from an internal dual conic, for that reason a CameraException might be raised if provided quadric is degenerate or if internal estimated dual conic is degenerate and cannot be converted into a conic.
      Parameters:
      quadric - 3D quadric to be projected.
      Returns:
      A projected 2D conic.
      Throws:
      CameraException - thrown if there are geometric degeneracies.
    • project

      public void project(Quadric quadric, Conic result) throws CameraException
      Projects a 3D quadric into a 2D conic and stores the result into provided conic instance. The internal implementation of this method needs to compute the dual quadric of provided quadric, and also needs to compute the resulting conic from an internal dual conic, for that reason a CameraException might be raised if provided quadric is degenerate or if internal estimated dual conic is degenerate and cannot be converted into a conic.
      Parameters:
      quadric - 3D quadric to be projected.
      result - Instance where data of projected 2D conic will be stored.
      Throws:
      CameraException - thrown if there are geometric degeneracies.
    • backProject

      public DualQuadric backProject(DualConic dualConic) throws CameraException
      Back-projects a 2D dual conic into a 3D dual quadric. The internal implementation of this method needs to compute a conic from provided dual conic, and also needs to compute the resulting dual quadric from an internal quadric. For that reason a CameraException might be raised if provided dual conic is degenerate or if internal estimated quadric is degenerate and cannot be converted into a dual quadric.
      Parameters:
      dualConic - 2D dual conic to be back-projected.
      Returns:
      A back-projected 3D dual quadric.
      Throws:
      CameraException - thrown if there are geometric degeneracies.
    • backProject

      public void backProject(DualConic dualConic, DualQuadric result) throws CameraException
      Back-projects a 2D dual conic into a 3D dual quadric and stores the result into provided dual quadric instance. The internal implementation of this method needs to compute a conic from provided dual conic, and also needs to compute the resulting dual quadric from an internal quadric. For that reason a CameraException might be raised if provided dual conic is degenerate or if internal estimated quadric is degenerate and cannot be converted into a dual quadric.
      Parameters:
      dualConic - 2D dual conic to be back-projected.
      result - Instance where data of back-projected 3D dual quadric will be stored.
      Throws:
      CameraException - thrown if there are geometric degeneracies.
    • getType

      public abstract CameraType getType()
      Returns the type of this camera.
      Returns:
      Type of this camera.
    • create

      public static Camera create()
      Creates an instance of a camera using default type.
      Returns:
      A newly instantiated camera.