Package boofcv.abst.fiducial
Class MicroQrCodeDetectorPnP<T extends ImageGray<T>>
java.lang.Object
boofcv.abst.fiducial.FiducialDetectorPnP<T>
boofcv.abst.fiducial.MicroQrCodeDetectorPnP<T>
- All Implemented Interfaces:
FiducialDetector<T>
Wrapper around
MicroQrCodeDetector
which allows the 3D pose of a Micro QR Code to be detected using
FiducialDetectorPnP
. The marker width defaults to 1. If all your qr codes have a width of one
and it's up to the user to multiply the translation vector by the actual width.
The 3D coordinate system of a Micro QR Code is shown below. +x right, +y up, and +z up.
-
Field Summary
Fields inherited from class boofcv.abst.fiducial.FiducialDetectorPnP
pixelToNorm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getControl3D
(int which) 3D location of control points in the fiducial reference framegetDetectedControl
(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.long
getId
(int which) If applicable, returns the ID of the fiducial found.Type of input imagegetMessage
(int which) If applicable, returns a message associated with the fiducial.double
getSideHeight
(int which) Height of the fiducial.double
getSideWidth
(int which) Width of the fiducial.double
getWidth
(int which) Returns the width of the fiducial in world units.boolean
hasID()
If true thenFiducialDetector.getId(int)
returns a valid unique numberboolean
If true thenFiducialDetector.getMessage(int)
returns a valid messagevoid
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.void
setMarkerWidth
(double markerWidth) int
The total number of fiducial foundMethods inherited from class boofcv.abst.fiducial.FiducialDetectorPnP
computeStability, estimatePose, getLensDistortion, is3D
-
Constructor Details
-
MicroQrCodeDetectorPnP
-
-
Method Details
-
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 ImageGray<T>>
- Overrides:
setLensDistortion
in classFiducialDetectorPnP<T extends ImageGray<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
-
getSideWidth
public double getSideWidth(int which) Description copied from class:FiducialDetectorPnP
Width of the fiducial. used to compute stability- Specified by:
getSideWidth
in classFiducialDetectorPnP<T extends ImageGray<T>>
- Parameters:
which
- specifies which fiducial- Returns:
- the width
-
getSideHeight
public double getSideHeight(int which) Description copied from class:FiducialDetectorPnP
Height of the fiducial. used to compute stability- Specified by:
getSideHeight
in classFiducialDetectorPnP<T extends ImageGray<T>>
- Parameters:
which
- specifies which fiducial- Returns:
- the height
-
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 ImageGray<T>>
- Overrides:
getFiducialToCamera
in classFiducialDetectorPnP<T extends ImageGray<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
-
getDetectedControl
Description copied from class:FiducialDetectorPnP
Returns a list of detected control points in the image for the specified fiducial. Observations will be in distorted image pixels.- Specified by:
getDetectedControl
in classFiducialDetectorPnP<T extends ImageGray<T>>
-
getControl3D
Description copied from class:FiducialDetectorPnP
3D location of control points in the fiducial reference frame- Specified by:
getControl3D
in classFiducialDetectorPnP<T extends ImageGray<T>>
- Returns:
- 3D location of control points
-
detect
Description copied from interface:FiducialDetector
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
public int totalFound()Description copied from interface:FiducialDetector
The total number of fiducial found- Returns:
- number of targets found
-
getCenter
Description copied from interface:FiducialDetector
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
Description copied from interface:FiducialDetector
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
public long getId(int which) Description copied from interface:FiducialDetector
If applicable, returns the ID of the fiducial found. CallFiducialDetector.hasID()
to see if this function returns a valid value.- Parameters:
which
- Detected fiducial's index- Returns:
- ID of the fiducial
-
getMessage
Description copied from interface:FiducialDetector
If applicable, returns a message associated with the fiducial. CallFiducialDetector.hasMessage()
()} to see if this function returns a valid value.- Parameters:
which
- Detected fiducial's index- Returns:
- Encoded message
-
getWidth
public double getWidth(int which) Description copied from interface:FiducialDetector
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.
-
setMarkerWidth
public void setMarkerWidth(double markerWidth) -
hasID
public boolean hasID()Description copied from interface:FiducialDetector
If true thenFiducialDetector.getId(int)
returns a valid unique number- Returns:
- boolean
-
hasMessage
public boolean hasMessage()Description copied from interface:FiducialDetector
If true thenFiducialDetector.getMessage(int)
returns a valid message- Returns:
- boolean
-
getInputType
Description copied from interface:FiducialDetector
Type of input image
-