Package boofcv.abst.fiducial
Interface FiducialDetector<T extends ImageBase<T>>
- All Known Subinterfaces:
FiducialTracker<T>
- All Known Implementing Classes:
CalibrationFiducialDetector
,ECoCheck_to_FiducialDetector
,FiducialDetectorPnP
,MicroQrCodeDetectorPnP
,QrCodeDetectorPnP
,SquareBase_to_FiducialDetector
,SquareBinary_to_FiducialDetector
,SquareHamming_to_FiducialDetector
,SquareImage_to_FiducialDetector
,Uchiya_to_FiducialDetector
public interface FiducialDetector<T extends ImageBase<T>>
Interface for detecting fiducial markers and their location in the image. Optionally, some implementations
can produce a unique ID for each fiducial and their 3D pose in the world. Implementations of this interface
will be detectors only, meaning that they are not trackers, meaning that each call to detect will produce
identical results only dependent on the input image and not the past history.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
computeStability
(int which, double disturbance, FiducialStability results) Computes metrics which represents the fiducial's pose estimate stability given its current observed state.void
Detects fiducials inside the image.getBounds
(int which, @Nullable Polygon2D_F64 storage) Used to retrieve the bounds around a marker in the image.void
getCenter
(int which, Point2D_F64 location) Returns where in the image the fiducial is.boolean
getFiducialToCamera
(int which, Se3_F64 fiducialToCamera) Used to retrieve the transformation from the fiducial's reference frame to the camera's reference frame.long
getId
(int which) If applicable, returns the ID of the fiducial found.Type of input image@Nullable LensDistortionNarrowFOV
Returns the intrinsic parameters that itgetMessage
(int which) If applicable, returns a message associated with the fiducial.double
getWidth
(int which) Returns the width of the fiducial in world units.boolean
hasID()
If true thengetId(int)
returns a valid unique numberboolean
If true thengetMessage(int)
returns a valid messageboolean
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.int
The total number of fiducial found
-
Method Details
-
detect
Detects fiducials inside the image. Each call to this function only depends upon the input image. The previous calls do not affect it's outcome.- Parameters:
input
- Input image. Not modified.
-
totalFound
int totalFound()The total number of fiducial found- Returns:
- number of targets found
-
getCenter
Returns where in the image the fiducial is. Typically this will be the fiducial's visual center. Note that the visual center is unlikely to be the projection of the 3D geometric center. To find the former you need to reproject it using the found fiducialToCamera.NOTE: The reprojected center might not be the same as the location returned here.
- Parameters:
which
- Fiducial's indexlocation
- (output) Storage for the transform. modified.
-
getBounds
Used to retrieve the bounds around a marker in the image. How the bounds are defined is left up the implementation. It could be a simple rectangle or it could be corner features.- Parameters:
which
- Which fiducial.storage
- (Optional) Storage for fiducials.- Returns:
- Found marker. Points are owned by the caller and will not be modified in the future.
-
getId
long getId(int which) If applicable, returns the ID of the fiducial found. CallhasID()
to see if this function returns a valid value.- Parameters:
which
- Detected fiducial's index- Returns:
- ID of the fiducial
-
getMessage
If applicable, returns a message associated with the fiducial. CallhasMessage()
()} to see if this function returns a valid value.- Parameters:
which
- Detected fiducial's index- Returns:
- Encoded message
-
setLensDistortion
void setLensDistortion(@Nullable @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.- 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
Returns the intrinsic parameters that it- Returns:
- intrinsic parameters
-
computeStability
Computes metrics which represents the fiducial's pose estimate stability given its current observed state. This can be viewed as an estimate of the pose estimate's precision, but not its accuracy. These numbers are generated by perturbing landmarks (by the user provided amount) and seeing how it affects the pose estimate..
The metrics should be considered more qualitative than quantitative since exactly how this metric is computed isn't specified and can vary depending on target type of implementation type. The results could every vary each time its called, even with the the exact same inputs.
- 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
-
getFiducialToCamera
Used to retrieve the transformation from the fiducial's reference frame to the camera's reference frame.- Parameters:
which
- Fiducial's indexfiducialToCamera
- (output) Storage for the transform. modified.- Returns:
- true if could estimate the location or false if it couldn't
-
getWidth
double getWidth(int which) Returns the width of the fiducial in world units. If not square then it returns a reasonable approximation. Intended for use in visualization and not precise calculations.- Parameters:
which
- Fiducial's index- Returns:
- Fiducial's width.
-
is3D
boolean is3D()If true then 3D information is available for the fiducial. In general a len distortion model must be provided by invokingsetLensDistortion(LensDistortionNarrowFOV, int, int)
. The following functions are then enabled: -
hasID
boolean hasID()If true thengetId(int)
returns a valid unique number- Returns:
- boolean
-
hasMessage
boolean hasMessage()If true thengetMessage(int)
returns a valid message- Returns:
- boolean
-
getInputType
Type of input image
-