Trait opencv::objdetect::BoardTraitConst
source · pub trait BoardTraitConst {
// Required method
fn as_raw_Board(&self) -> *const c_void;
// Provided methods
fn get_dictionary(&self) -> Result<Dictionary> { ... }
fn get_obj_points(&self) -> Result<Vector<Vector<Point3f>>> { ... }
fn get_ids(&self) -> Result<Vector<i32>> { ... }
fn get_right_bottom_corner(&self) -> Result<Point3f> { ... }
fn match_image_points(
&self,
detected_corners: &impl ToInputArray,
detected_ids: &impl ToInputArray,
obj_points: &mut impl ToOutputArray,
img_points: &mut impl ToOutputArray
) -> Result<()> { ... }
fn generate_image(
&self,
out_size: Size,
img: &mut impl ToOutputArray,
margin_size: i32,
border_bits: i32
) -> Result<()> { ... }
fn generate_image_def(
&self,
out_size: Size,
img: &mut impl ToOutputArray
) -> Result<()> { ... }
}
Expand description
Constant methods for crate::objdetect::Board
Required Methods§
fn as_raw_Board(&self) -> *const c_void
Provided Methods§
sourcefn get_dictionary(&self) -> Result<Dictionary>
fn get_dictionary(&self) -> Result<Dictionary>
return the Dictionary of markers employed for this board
sourcefn get_obj_points(&self) -> Result<Vector<Vector<Point3f>>>
fn get_obj_points(&self) -> Result<Vector<Vector<Point3f>>>
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.
sourcefn get_ids(&self) -> Result<Vector<i32>>
fn get_ids(&self) -> Result<Vector<i32>>
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
sourcefn get_right_bottom_corner(&self) -> Result<Point3f>
fn get_right_bottom_corner(&self) -> Result<Point3f>
get coordinate of the bottom right corner of the board, is set when calling the function create()
sourcefn match_image_points(
&self,
detected_corners: &impl ToInputArray,
detected_ids: &impl ToInputArray,
obj_points: &mut impl ToOutputArray,
img_points: &mut impl ToOutputArray
) -> Result<()>
fn match_image_points( &self, detected_corners: &impl ToInputArray, detected_ids: &impl ToInputArray, obj_points: &mut impl ToOutputArray, img_points: &mut impl ToOutputArray ) -> Result<()>
Given a board configuration and a set of detected markers, returns the corresponding image points and object points, can be used in solvePnP()
§Parameters
-
detectedCorners: List of detected marker corners of the board. For cv::Board and cv::GridBoard the method expects std::vector<std::vector
> or std::vector with Aruco marker corners. For cv::CharucoBoard the method expects std::vector or Mat with ChAruco corners (chess board corners matched with Aruco markers). -
detectedIds: List of identifiers for each marker or charuco corner. For any Board class the method expects std::vector
or Mat. -
objPoints: Vector of marker points in the board coordinate space. For any Board class the method expects std::vectorcv::Point3f objectPoints or cv::Mat
-
imgPoints: Vector of marker points in the image coordinate space. For any Board class the method expects std::vectorcv::Point2f objectPoints or cv::Mat
§See also
solvePnP
sourcefn generate_image(
&self,
out_size: Size,
img: &mut impl ToOutputArray,
margin_size: i32,
border_bits: i32
) -> Result<()>
fn generate_image( &self, out_size: Size, img: &mut impl ToOutputArray, margin_size: i32, border_bits: i32 ) -> Result<()>
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
- borderBits: width of the marker borders.
This function return the image of the board, ready to be printed.
§C++ default parameters
- margin_size: 0
- border_bits: 1
sourcefn generate_image_def(
&self,
out_size: Size,
img: &mut impl ToOutputArray
) -> Result<()>
fn generate_image_def( &self, out_size: Size, img: &mut impl ToOutputArray ) -> Result<()>
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
- borderBits: width of the marker borders.
This function return the image of the board, ready to be printed.
§Note
This alternative version of BoardTraitConst::generate_image function uses the following default values for its arguments:
- margin_size: 0
- border_bits: 1