public class PerspectiveOps
extends java.lang.Object
| Constructor and Description |
|---|
PerspectiveOps() |
| Modifier and Type | Method and Description |
|---|---|
static IntrinsicParameters |
adjustIntrinsic(IntrinsicParameters parameters,
org.ejml.data.DenseMatrix64F adjustMatrix,
IntrinsicParameters adjustedParam)
Recomputes the
IntrinsicParameters given an adjustment matrix. |
static org.ejml.data.DenseMatrix64F |
calibrationMatrix(double fx,
double fy,
double skew,
double xc,
double yc)
Given the intrinsic parameters create a calibration matrix
|
static org.ejml.data.DenseMatrix64F |
calibrationMatrix(IntrinsicParameters param,
org.ejml.data.DenseMatrix64F K)
Given the intrinsic parameters create a calibration matrix
|
static georegression.struct.point.Point2D_F64 |
convertNormToPixel(org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point2D_F64 norm,
georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
|
static georegression.struct.point.Point2D_F64 |
convertNormToPixel(IntrinsicParameters param,
double x,
double y,
georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
|
static georegression.struct.point.Point2D_F32 |
convertNormToPixel(IntrinsicParameters param,
float x,
float y,
georegression.struct.point.Point2D_F32 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
|
static georegression.struct.point.Point2D_F64 |
convertNormToPixel(IntrinsicParameters param,
georegression.struct.point.Point2D_F64 norm,
georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
|
static georegression.struct.point.Point2D_F64 |
convertPixelToNorm(org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point2D_F64 pixel,
georegression.struct.point.Point2D_F64 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
|
static georegression.struct.point.Point2D_F32 |
convertPixelToNorm(IntrinsicParameters param,
georegression.struct.point.Point2D_F32 pixel,
georegression.struct.point.Point2D_F32 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
|
static georegression.struct.point.Point2D_F64 |
convertPixelToNorm(IntrinsicParameters param,
georegression.struct.point.Point2D_F64 pixel,
georegression.struct.point.Point2D_F64 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
|
static org.ejml.data.DenseMatrix64F |
createCameraMatrix(org.ejml.data.DenseMatrix64F R,
georegression.struct.point.Vector3D_F64 T,
org.ejml.data.DenseMatrix64F K,
org.ejml.data.DenseMatrix64F ret)
Create a 3x4 camera matrix.
|
static IntrinsicParameters |
createIntrinsic(int width,
int height,
double hfov)
Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics.
|
static IntrinsicParameters |
createIntrinsic(int width,
int height,
double hfov,
double vfov)
Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics
|
static WorldToCameraToPixel |
createWorldToPixel(IntrinsicParameters intrinsic,
georegression.struct.se.Se3_F64 worldToCamera)
Creates a transform from world coordinates into pixel coordinates.
|
static IntrinsicParameters |
matrixToParam(org.ejml.data.DenseMatrix64F K,
int width,
int height,
IntrinsicParameters param)
Converts a calibration matrix into intrinsic parameters
|
static georegression.struct.point.Point2D_F64 |
renderPixel(org.ejml.data.DenseMatrix64F worldToCamera,
georegression.struct.point.Point3D_F64 X)
Computes the image coordinate of a point given its 3D location and the camera matrix.
|
static georegression.struct.point.Point2D_F64 |
renderPixel(IntrinsicParameters intrinsic,
georegression.struct.point.Point3D_F64 X)
Renders a point in camera coordinates into the image plane in pixels.
|
static georegression.struct.point.Point2D_F64 |
renderPixel(georegression.struct.se.Se3_F64 worldToCamera,
org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point3D_F64 X)
Renders a point in world coordinates into the image plane in pixels or normalized image
coordinates.
|
static void |
scaleIntrinsic(IntrinsicParameters param,
double scale)
Multiplies each element of the intrinsic parameters by the provided scale factor.
|
static void |
splitAssociated(java.util.List<AssociatedPair> pairs,
java.util.List<georegression.struct.point.Point2D_F64> view1,
java.util.List<georegression.struct.point.Point2D_F64> view2)
Takes a list of
AssociatedPair as input and breaks it up into two lists for each view. |
static void |
splitAssociated(java.util.List<AssociatedTriple> pairs,
java.util.List<georegression.struct.point.Point2D_F64> view1,
java.util.List<georegression.struct.point.Point2D_F64> view2,
java.util.List<georegression.struct.point.Point2D_F64> view3)
Takes a list of
AssociatedTriple as input and breaks it up into three lists for each view. |
public static IntrinsicParameters createIntrinsic(int width, int height, double hfov, double vfov)
width - Image widthheight - Image heighthfov - Horizontal FOV in degreesvfov - Vertical FOV in degreespublic static IntrinsicParameters createIntrinsic(int width, int height, double hfov)
width - Image widthheight - Image heighthfov - Horizontal FOV in degreespublic static void scaleIntrinsic(IntrinsicParameters param, double scale)
param - Intrinsic parametersscale - Scale factor that input image is being scaled by.public static IntrinsicParameters adjustIntrinsic(IntrinsicParameters parameters, org.ejml.data.DenseMatrix64F adjustMatrix, IntrinsicParameters adjustedParam)
Recomputes the IntrinsicParameters given an adjustment matrix.
NOTE: Distortion parameters are ignored in the provided IntrinsicParameters class.
parameters - (Input) Original intrinsic parameters. Not modified.adjustMatrix - (Input) Adjustment matrix. Not modified.adjustedParam - (Output) Optional storage for adjusted intrinsic parameters. Can be null.public static org.ejml.data.DenseMatrix64F calibrationMatrix(double fx,
double fy,
double skew,
double xc,
double yc)
fx - Focal length x-axis in pixelsfy - Focal length y-axis in pixelsskew - skew in pixelsxc - camera center x-axis in pixelsyc - center center y-axis in pixelspublic static org.ejml.data.DenseMatrix64F calibrationMatrix(IntrinsicParameters param, org.ejml.data.DenseMatrix64F K)
param - Intrinsic parameters structure that is to be converted into a matrixK - Storage for calibration matrix, must be 3x3. If null then a new matrix is declaredpublic static IntrinsicParameters matrixToParam(org.ejml.data.DenseMatrix64F K, int width, int height, IntrinsicParameters param)
K - Camera calibration matrix.width - Image width in pixelsheight - Image height in pixelsparam - Where the intrinsic parameter are written to. If null then a new instance is declared.public static georegression.struct.point.Point2D_F64 convertNormToPixel(IntrinsicParameters param, double x, double y, georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then NormalizedToPixel_F64 should be used instead.
param - Intrinsic camera parametersx - X-coordinate of normalized.y - Y-coordinate of normalized.pixel - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F32 convertNormToPixel(IntrinsicParameters param, float x, float y, georegression.struct.point.Point2D_F32 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then NormalizedToPixel_F32 should be used instead.
param - Intrinsic camera parametersx - X-coordinate of normalized.y - Y-coordinate of normalized.pixel - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F64 convertNormToPixel(IntrinsicParameters param, georegression.struct.point.Point2D_F64 norm, georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then NormalizedToPixel_F64 should be used instead.
param - Intrinsic camera parametersnorm - Normalized image coordinate.pixel - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F64 convertNormToPixel(org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point2D_F64 norm,
georegression.struct.point.Point2D_F64 pixel)
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then NormalizedToPixel_F64 should be used instead.
K - Intrinsic camera calibration matrixnorm - Normalized image coordinate.pixel - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F64 convertPixelToNorm(IntrinsicParameters param, georegression.struct.point.Point2D_F64 pixel, georegression.struct.point.Point2D_F64 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then PixelToNormalized_F64 should be used instead.
param - Intrinsic camera parameterspixel - Pixel coordinatenorm - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F32 convertPixelToNorm(IntrinsicParameters param, georegression.struct.point.Point2D_F32 pixel, georegression.struct.point.Point2D_F32 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then PixelToNormalized_F32 should be used instead.
param - Intrinsic camera parameterspixel - Pixel coordinatenorm - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F64 convertPixelToNorm(org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point2D_F64 pixel,
georegression.struct.point.Point2D_F64 norm)
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then PixelToNormalized_F64 should be used instead.
K - Intrinsic camera calibration matrixpixel - Pixel coordinate.norm - Optional storage for output. If null a new instance will be declared.public static georegression.struct.point.Point2D_F64 renderPixel(georegression.struct.se.Se3_F64 worldToCamera,
org.ejml.data.DenseMatrix64F K,
georegression.struct.point.Point3D_F64 X)
worldToCamera - Transform from world to camera frameK - Optional. Intrinsic camera calibration matrix. If null then normalized image coordinates are returned.X - 3D Point in world reference frame..public static georegression.struct.point.Point2D_F64 renderPixel(IntrinsicParameters intrinsic, georegression.struct.point.Point3D_F64 X)
intrinsic - Intrinsic camera parameters.X - 3D Point in world reference frame..public static georegression.struct.point.Point2D_F64 renderPixel(org.ejml.data.DenseMatrix64F worldToCamera,
georegression.struct.point.Point3D_F64 X)
worldToCamera - 3x4 camera matrix for transforming a 3D point from world to image coordinates.X - 3D Point in world reference frame..public static void splitAssociated(java.util.List<AssociatedPair> pairs, java.util.List<georegression.struct.point.Point2D_F64> view1, java.util.List<georegression.struct.point.Point2D_F64> view2)
AssociatedPair as input and breaks it up into two lists for each view.pairs - Input: List of associated pairs.view1 - Output: List of observations from view 1view2 - Output: List of observations from view 2public static void splitAssociated(java.util.List<AssociatedTriple> pairs, java.util.List<georegression.struct.point.Point2D_F64> view1, java.util.List<georegression.struct.point.Point2D_F64> view2, java.util.List<georegression.struct.point.Point2D_F64> view3)
AssociatedTriple as input and breaks it up into three lists for each view.pairs - Input: List of associated triples.view1 - Output: List of observations from view 1view2 - Output: List of observations from view 2view3 - Output: List of observations from view 3public static org.ejml.data.DenseMatrix64F createCameraMatrix(org.ejml.data.DenseMatrix64F R,
georegression.struct.point.Vector3D_F64 T,
org.ejml.data.DenseMatrix64F K,
org.ejml.data.DenseMatrix64F ret)
R - Rotation matrix. 3x3T - Translation vector.K - Optional camera calibration matrix 3x3.ret - Storage for camera calibration matrix. If null a new instance will be created.public static WorldToCameraToPixel createWorldToPixel(IntrinsicParameters intrinsic, georegression.struct.se.Se3_F64 worldToCamera)