pyorc.CameraConfig.set_lens_calibration#
- CameraConfig.set_lens_calibration(fn: str, chessboard_size: Optional[Tuple] = (9, 6), max_imgs: Optional[int] = 30, plot: Optional[bool] = True, progress_bar: Optional[bool] = True, **kwargs)[source]#
Calibrates and sets the properties
camera_matrix
anddist_coeffs
using a video of a chessboard pattern. Follows methods described on https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html- Parameters:
fn (str) – path to video file
df (int, optional) – amount of frames to skip after a valid frame with corner points is found, defaults to fps of video.
chessboard_size (tuple, optional) – amount of internal corner points expected on chessboard pattern, default is (9, 6).
max_imgs (int, optional) – maximum amount of images to use for calibration (default: 30).
tolerance (float, optional) – error tolerance alowed for reprojection of corner points (default: 0.1, if set to None, no filtering will be done). images that exceed the tolerance are excluded from calibration. This is to remove images with spuriously defined points, or blurry images.
plot (bool, optional) – if set, chosen frames will be plotted for the user to inspect on-=the-fly with a one-second delay (default: True).
progress_bar (bool, optional) – if set, a progress bar going through the frames is plotted (default: True).