Package org.opencv.objdetect
Class Board
- java.lang.Object
-
- org.opencv.objdetect.Board
-
- Direct Known Subclasses:
CharucoBoard
,GridBoard
public class Board extends java.lang.Object
Board of ArUco markers A board is a set of markers in the 3D space with a common coordinate system. The common form of a board of marker is a planar (2D) board, however any 3D layout can be used. A Board object is composed by: - The object points of the marker corners, i.e. their coordinates respect to the board system. - The dictionary which indicates the type of markers of the board - The identifier of all the markers in the board.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
nativeObj
-
Constructor Summary
Constructors Modifier Constructor Description protected
Board(long addr)
Board(java.util.List<Mat> objPoints, Dictionary dictionary, Mat ids)
Common Board constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Board
__fromPtr__(long addr)
protected void
finalize()
void
generateImage(Size outSize, Mat img)
Draw a planar boardvoid
generateImage(Size outSize, Mat img, int marginSize)
Draw a planar boardvoid
generateImage(Size outSize, Mat img, int marginSize, int borderBits)
Draw a planar boardDictionary
getDictionary()
return the Dictionary of markers employed for this boardMatOfInt
getIds()
vector of the identifiers of the markers in the board (should be the same size as objPoints)long
getNativeObjAddr()
java.util.List<MatOfPoint3f>
getObjPoints()
return array of object points of all the marker corners in the board.Point3
getRightBottomCorner()
get coordinate of the bottom right corner of the board, is set when calling the function create()void
matchImagePoints(java.util.List<Mat> detectedCorners, Mat detectedIds, Mat objPoints, Mat imgPoints)
Given a board configuration and a set of detected markers, returns the corresponding image points and object points to call solvePnP()
-
-
-
Constructor Detail
-
Board
protected Board(long addr)
-
Board
public Board(java.util.List<Mat> objPoints, Dictionary dictionary, Mat ids)
Common Board constructor- Parameters:
objPoints
- array of object points of all the marker corners in the boarddictionary
- the dictionary of markers employed for this boardids
- vector of the identifiers of the markers in the board
-
-
Method Detail
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static Board __fromPtr__(long addr)
-
getDictionary
public Dictionary getDictionary()
return the Dictionary of markers employed for this board- Returns:
- automatically generated
-
getObjPoints
public java.util.List<MatOfPoint3f> getObjPoints()
return array of object points of all the marker corners in the board. Each marker include its 4 corners in this order: - objPoints[i][0] - left-top point of i-th marker - objPoints[i][1] - right-top point of i-th marker - objPoints[i][2] - right-bottom point of i-th marker - objPoints[i][3] - left-bottom point of i-th marker Markers are placed in a certain order - row by row, left to right in every row. For M markers, the size is Mx4.- Returns:
- automatically generated
-
getIds
public MatOfInt getIds()
vector of the identifiers of the markers in the board (should be the same size as objPoints)- Returns:
- vector of the identifiers of the markers
-
getRightBottomCorner
public Point3 getRightBottomCorner()
get coordinate of the bottom right corner of the board, is set when calling the function create()- Returns:
- automatically generated
-
matchImagePoints
public void matchImagePoints(java.util.List<Mat> detectedCorners, Mat detectedIds, Mat objPoints, Mat imgPoints)
Given a board configuration and a set of detected markers, returns the corresponding image points and object points to call solvePnP()- Parameters:
detectedCorners
- List of detected marker corners of the board. For CharucoBoard class you can set list of charuco corners.detectedIds
- List of identifiers for each marker or list of charuco identifiers for each corner. For CharucoBoard class you can set list of charuco identifiers for each corner.objPoints
- Vector of vectors of board marker points in the board coordinate space.imgPoints
- Vector of vectors of the projections of board marker corner points.
-
generateImage
public void generateImage(Size outSize, Mat img, int marginSize, int borderBits)
Draw a planar board- Parameters:
outSize
- size of the output image in pixels.img
- output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.marginSize
- minimum margins (in pixels) of the board in the output imageborderBits
- width of the marker borders. This function return the image of the board, ready to be printed.
-
generateImage
public void generateImage(Size outSize, Mat img, int marginSize)
Draw a planar board- Parameters:
outSize
- size of the output image in pixels.img
- output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.marginSize
- minimum margins (in pixels) of the board in the output image This function return the image of the board, ready to be printed.
-
generateImage
public void generateImage(Size outSize, Mat img)
Draw a planar board- Parameters:
outSize
- size of the output image in pixels.img
- output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions. This function return the image of the board, ready to be printed.
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-