class frc_apriltags.Calibrate(cap, camNum: int, numImages: int = 15, dirPath: str = '/home/robolions/Documents/2023-Jetson-Code-Test')

Bases: object

Use this class to calibrate your USBCamera.

Parameters:
  • cap – The cv2.VideoCapture object.

  • camNum – The camera number.

  • numImages – The number of calibration images to take.

  • dirPath – Should be aquired by running Path(__file__).absolute().parent.__str__() in the script calling this method.

calculateRepredictionError()

Calulates the reprediction error.

Returns:

The mean reprediction error.

calibrateCamera()

Calibrates the given camera at a certain resolution.

Returns:

Calibration successful.

Returns:

The intrinsic camera matrix.

Returns:

The camera’s distortion.

Returns:

The camera’s rotation vectors.

Returns:

The camera’s translation vectors.

createCalibrationImages()

Creates a number of images to calibrate the camera.

enableLogging()

Enables logging for this class.

getPathExistance() bool

Gets the existance of a directory at self.PATH.

Returns:

Is the directory present?