Package com.irurueta.geometry
Class Camera
java.lang.Object
com.irurueta.geometry.Camera
- Direct Known Subclasses:
PinholeCamera
A camera defines relations between 3D and 2D worlds.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackProject(Conic conic) Back-projects a 2D conic into a 3D quadric.abstract voidbackProject(Conic conic, Quadric result) Back-projects a 2D conic into a 3D quadric and stores the result into provided instance.backProject(DualConic dualConic) Back-projects a 2D dual conic into a 3D dual quadric.voidbackProject(DualConic dualConic, DualQuadric result) Back-projects a 2D dual conic into a 3D dual quadric and stores the result into provided dual quadric instance.backProject(Line2D line) Back-projects a 2D line into a 3D plane.abstract voidbackProject(Line2D line, Plane result) Back-projects a line into a plane and stores the result into provided instance.backProject(Point2D point) Back-projects provided 2D point into a 3D point.abstract voidbackProject(Point2D point, Point3D result) Back-projects provided 2D point into a 3D point and stores the result into provided instance.backProjectLines(List<Line2D> lines) Back-projects provided 2D lines into their corresponding 3D planes.voidbackProjectLines(List<Line2D> lines, List<Plane> result) Back-projects provided 2D lines into their corresponding 3D planes and stores the result into provided list.backProjectPoints(List<Point2D> points) Back-projects provided 2D points into their corresponding 3D points.voidbackProjectPoints(List<Point2D> points, List<Point3D> result) Back-projects provided 2D points into their corresponding 3D points and stores the result into provided list.static Cameracreate()Creates an instance of a camera using default type.abstract CameraTypegetType()Returns the type of this camera.project(DualQuadric dualQuadric) Projects a 3D dual quadric into a 2D dual conic.abstract voidproject(DualQuadric dualQuadric, DualConic result) Projects a 3D dual quadric into a 2D dual conic and stores the result into provided instance.Projects a 3D point into a 2D point in a retinal plane.abstract voidProjects a 3D point into a 2D point in a retinal plane and stores the result into provided instance.Projects a 3D quadric into a 2D conic.voidProjects a 3D quadric into a 2D conic and stores the result into provided conic instance.Projects 3D points into 2D points in a retinal plane.voidProjects 3D points into 2D points in a retinal plane and stores the result into provided list.
-
Field Details
-
DEFAULT_CAMERA_TYPE
Constant defining default camera type.
-
-
Constructor Details
-
Camera
public Camera()
-
-
Method Details
-
project
Projects a 3D point into a 2D point in a retinal plane.- Parameters:
point- 3D point to be projected.- Returns:
- 2D projected point.
-
project
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
Projects 3D points into 2D points in a retinal plane.- Parameters:
points- 3D points to be projected.- Returns:
- 2D projected points.
-
project
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
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
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
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
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
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
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
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
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
Back-projects a 2D conic into a 3D quadric.- Parameters:
conic- 2D conic to be back-projected.- Returns:
- A back-projected 3D quadric.
-
backProject
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
Projects a 3D dual quadric into a 2D dual conic.- Parameters:
dualQuadric- 3D dual quadric to be projected.- Returns:
- A 2D dual conic.
-
project
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
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
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
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
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
Returns the type of this camera.- Returns:
- Type of this camera.
-
create
Creates an instance of a camera using default type.- Returns:
- A newly instantiated camera.
-