Package boofcv.abst.fiducial
Class FiducialDetectorPnP<T extends ImageBase<T>>
java.lang.Object
boofcv.abst.fiducial.FiducialDetectorPnP<T>
- All Implemented Interfaces:
FiducialDetector<T>
- Direct Known Subclasses:
CalibrationFiducialDetector
,ECoCheck_to_FiducialDetector
,MicroQrCodeDetectorPnP
,QrCodeDetectorPnP
,SquareBase_to_FiducialDetector
,Uchiya_to_FiducialDetector
public abstract class FiducialDetectorPnP<T extends ImageBase<T>>
extends Object
implements FiducialDetector<T>
Provides everything you need to convert a image based fiducial detector into one which can estimate the fiducial's pose given control points. The camera pose is found using a solution to the Pose-N-Point (PnP) problem.
Stability is computed by perturbing each control point by the user provided amount of disturbance. The largest delta for location and orientation is then found and saved.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
computeStability
(int which, double disturbance, FiducialStability results) Estimates the stability by perturbing each land mark by the specified number of pixels in the distorted image.protected boolean
estimatePose
(int which, List<Point2D3D> points, Se3_F64 fiducialToCamera) Given the mapping of 2D observations to known 3D points estimate the pose of the fiducial.getControl3D
(int which) 3D location of control points in the fiducial reference frameabstract List<PointIndex2D_F64>
getDetectedControl
(int which) Returns a list of detected control points in the image for the specified fiducial.boolean
getFiducialToCamera
(int which, Se3_F64 fiducialToCamera) Used to retrieve the transformation from the fiducial's reference frame to the camera's reference frame.@Nullable LensDistortionNarrowFOV
Returns the intrinsic parameters that itabstract double
getSideHeight
(int which) Height of the fiducial.abstract double
getSideWidth
(int which) Width of the fiducial.boolean
is3D()
If true then 3D information is available for the fiducial.void
setLensDistortion
(@Nullable LensDistortionNarrowFOV distortion, int width, int height) Specifies how to remove lens distortion from the input image and how to convert pixels into normalized image coordinates.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface boofcv.abst.fiducial.FiducialDetector
detect, getBounds, getCenter, getId, getInputType, getMessage, getWidth, hasID, hasMessage, totalFound
-
Field Details
-
pixelToNorm
-
-
Constructor Details
-
FiducialDetectorPnP
public FiducialDetectorPnP()
-
-
Method Details
-
getSideWidth
public abstract double getSideWidth(int which) Width of the fiducial. used to compute stability- Parameters:
which
- specifies which fiducial- Returns:
- the width
-
getSideHeight
public abstract double getSideHeight(int which) Height of the fiducial. used to compute stability- Parameters:
which
- specifies which fiducial- Returns:
- the height
-
computeStability
Estimates the stability by perturbing each land mark by the specified number of pixels in the distorted image.- Specified by:
computeStability
in interfaceFiducialDetector<T extends ImageBase<T>>
- Parameters:
which
- Index of which fiducial the stability is being requested fromdisturbance
- Amount of the applied disturbance, in pixels. Try 0.25results
- (output) Storage for stability metrics.- Returns:
- true if successful or false if it failed for some reason
-
setLensDistortion
public void setLensDistortion(@Nullable @Nullable LensDistortionNarrowFOV distortion, int width, int height) Description copied from interface:FiducialDetector
Specifies how to remove lens distortion from the input image and how to convert pixels into normalized image coordinates.- Specified by:
setLensDistortion
in interfaceFiducialDetector<T extends ImageBase<T>>
- Parameters:
distortion
- Lens distortion model. null if you want to remove a lens distortion model that had previously been set.width
- Input image's width.height
- Input image's height
-
getLensDistortion
Description copied from interface:FiducialDetector
Returns the intrinsic parameters that it- Specified by:
getLensDistortion
in interfaceFiducialDetector<T extends ImageBase<T>>
- Returns:
- intrinsic parameters
-
getFiducialToCamera
Description copied from interface:FiducialDetector
Used to retrieve the transformation from the fiducial's reference frame to the camera's reference frame.- Specified by:
getFiducialToCamera
in interfaceFiducialDetector<T extends ImageBase<T>>
- Parameters:
which
- Fiducial's indexfiducialToCamera
- (output) Storage for the transform. modified.- Returns:
- true if could estimate the location or false if it couldn't
-
estimatePose
Given the mapping of 2D observations to known 3D points estimate the pose of the fiducial. This solves the P-n-P problem. Do a simple form of robust estimation. Prune points which are greater than 3 standard deviations and likely noise the recompute the pose -
getDetectedControl
Returns a list of detected control points in the image for the specified fiducial. Observations will be in distorted image pixels. -
getControl3D
3D location of control points in the fiducial reference frame- Returns:
- 3D location of control points
-
is3D
public boolean is3D()Description copied from interface:FiducialDetector
If true then 3D information is available for the fiducial. In general a len distortion model must be provided by invokingFiducialDetector.setLensDistortion(LensDistortionNarrowFOV, int, int)
. The following functions are then enabled:- Specified by:
is3D
in interfaceFiducialDetector<T extends ImageBase<T>>
-