pub trait CharucoDetectorTraitConst: AlgorithmTraitConst {
// Required method
fn as_raw_CharucoDetector(&self) -> *const c_void;
// Provided methods
fn get_board(&self) -> Result<CharucoBoard> { ... }
fn get_charuco_parameters(&self) -> Result<CharucoParameters> { ... }
fn get_detector_parameters(&self) -> Result<DetectorParameters> { ... }
fn get_refine_parameters(&self) -> Result<RefineParameters> { ... }
fn detect_board(
&self,
image: &impl ToInputArray,
charuco_corners: &mut impl ToOutputArray,
charuco_ids: &mut impl ToOutputArray,
marker_corners: &mut impl ToInputOutputArray,
marker_ids: &mut impl ToInputOutputArray,
) -> Result<()> { ... }
fn detect_board_def(
&self,
image: &impl ToInputArray,
charuco_corners: &mut impl ToOutputArray,
charuco_ids: &mut impl ToOutputArray,
) -> Result<()> { ... }
fn detect_diamonds(
&self,
image: &impl ToInputArray,
diamond_corners: &mut impl ToOutputArray,
diamond_ids: &mut impl ToOutputArray,
marker_corners: &mut impl ToInputOutputArray,
marker_ids: &mut impl ToInputOutputArray,
) -> Result<()> { ... }
fn detect_diamonds_def(
&self,
image: &impl ToInputArray,
diamond_corners: &mut impl ToOutputArray,
diamond_ids: &mut impl ToOutputArray,
) -> Result<()> { ... }
}
Expand description
Constant methods for crate::objdetect::CharucoDetector
Required Methods§
fn as_raw_CharucoDetector(&self) -> *const c_void
Provided Methods§
fn get_board(&self) -> Result<CharucoBoard>
fn get_charuco_parameters(&self) -> Result<CharucoParameters>
fn get_detector_parameters(&self) -> Result<DetectorParameters>
fn get_refine_parameters(&self) -> Result<RefineParameters>
Sourcefn detect_board(
&self,
image: &impl ToInputArray,
charuco_corners: &mut impl ToOutputArray,
charuco_ids: &mut impl ToOutputArray,
marker_corners: &mut impl ToInputOutputArray,
marker_ids: &mut impl ToInputOutputArray,
) -> Result<()>
fn detect_board( &self, image: &impl ToInputArray, charuco_corners: &mut impl ToOutputArray, charuco_ids: &mut impl ToOutputArray, marker_corners: &mut impl ToInputOutputArray, marker_ids: &mut impl ToInputOutputArray, ) -> Result<()>
detect aruco markers and interpolate position of ChArUco board corners
§Parameters
- image: input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
- charucoCorners: interpolated chessboard corners.
- charucoIds: interpolated chessboard corners identifiers.
- markerCorners: vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vectorcv::Point2f > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
- markerIds: list of identifiers for each marker in corners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers.
If markerCorners and markerCorners are empty, the detectMarkers() will run and detect aruco markers and ids.
If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds.
§See also
findChessboardCorners
Note: After OpenCV 4.6.0, there was an incompatible change in the ChArUco pattern generation algorithm for even row counts. Use cv::aruco::CharucoBoard::setLegacyPattern() to ensure compatibility with patterns created using OpenCV versions prior to 4.6.0. For more information, see the issue: https://github.com/opencv/opencv/issues/23152
§C++ default parameters
- marker_corners: noArray()
- marker_ids: noArray()
Sourcefn detect_board_def(
&self,
image: &impl ToInputArray,
charuco_corners: &mut impl ToOutputArray,
charuco_ids: &mut impl ToOutputArray,
) -> Result<()>
fn detect_board_def( &self, image: &impl ToInputArray, charuco_corners: &mut impl ToOutputArray, charuco_ids: &mut impl ToOutputArray, ) -> Result<()>
detect aruco markers and interpolate position of ChArUco board corners
§Parameters
- image: input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
- charucoCorners: interpolated chessboard corners.
- charucoIds: interpolated chessboard corners identifiers.
- markerCorners: vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vectorcv::Point2f > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
- markerIds: list of identifiers for each marker in corners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers.
If markerCorners and markerCorners are empty, the detectMarkers() will run and detect aruco markers and ids.
If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds.
§See also
findChessboardCorners
Note: After OpenCV 4.6.0, there was an incompatible change in the ChArUco pattern generation algorithm for even row counts. Use cv::aruco::CharucoBoard::setLegacyPattern() to ensure compatibility with patterns created using OpenCV versions prior to 4.6.0. For more information, see the issue: https://github.com/opencv/opencv/issues/23152
§Note
This alternative version of CharucoDetectorTraitConst::detect_board function uses the following default values for its arguments:
- marker_corners: noArray()
- marker_ids: noArray()
Sourcefn detect_diamonds(
&self,
image: &impl ToInputArray,
diamond_corners: &mut impl ToOutputArray,
diamond_ids: &mut impl ToOutputArray,
marker_corners: &mut impl ToInputOutputArray,
marker_ids: &mut impl ToInputOutputArray,
) -> Result<()>
fn detect_diamonds( &self, image: &impl ToInputArray, diamond_corners: &mut impl ToOutputArray, diamond_ids: &mut impl ToOutputArray, marker_corners: &mut impl ToInputOutputArray, marker_ids: &mut impl ToInputOutputArray, ) -> Result<()>
Detect ChArUco Diamond markers
§Parameters
- image: input image necessary for corner subpixel.
- diamondCorners: output list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vectorcv::Point2f > ).
- diamondIds: ids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond.
- markerCorners: list of detected marker corners from detectMarkers function. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
- markerIds: list of marker ids in markerCorners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection, but less accurate.
§C++ default parameters
- marker_corners: noArray()
- marker_ids: noArray()
Sourcefn detect_diamonds_def(
&self,
image: &impl ToInputArray,
diamond_corners: &mut impl ToOutputArray,
diamond_ids: &mut impl ToOutputArray,
) -> Result<()>
fn detect_diamonds_def( &self, image: &impl ToInputArray, diamond_corners: &mut impl ToOutputArray, diamond_ids: &mut impl ToOutputArray, ) -> Result<()>
Detect ChArUco Diamond markers
§Parameters
- image: input image necessary for corner subpixel.
- diamondCorners: output list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vectorcv::Point2f > ).
- diamondIds: ids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond.
- markerCorners: list of detected marker corners from detectMarkers function. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
- markerIds: list of marker ids in markerCorners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection, but less accurate.
§Note
This alternative version of CharucoDetectorTraitConst::detect_diamonds function uses the following default values for its arguments:
- marker_corners: noArray()
- marker_ids: noArray()
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.