sksurgeryimage.calibration.point_detector module¶
Base class for a PointDetector.
e.g. Chessboard corners, SIFT points, Charuco points etc.
-
class
sksurgeryimage.calibration.point_detector.
PointDetector
(scale=(1, 1), camera_intrinsics=None, distortion_coefficients=None)[source]¶ Bases:
object
Class to detect points in a 2D video image.
These point detectors are often used to detect points for camera calibration. However, it would also be possible for some subclasses to utilise camera intrinsics and distortion coefficients in order to improve the point detection process itself. It would be up to the derived class to decide how to use them, if at all.
Parameters: - scale – tuple (x scale, y scale) to scale up/down the image
- camera_intrinsics – [3x3] camera matrix
- distortion_coefficients – [1xn] distortion coefficients
-
get_camera_parameters
()[source]¶ Returns a copy of the camera matrix, and distortion coefficients. Throws RuntimeError if either are None.
Returns: [3x3], [1xn] matrices
-
get_model_points
()[source]¶ Derived classes should override this, to detector returns the complete model of 3D points. e.g. for a chessboard this would be all the corners in chessboard coordinates (e.g. z=0).
By design, this can return an ndarray with zero rows, if the detector does not support 3D coordinates.
Returns: [Nx3] numpy ndarray representing model points.