def skew_calibration(calibImages, camera_number, scanner_camera): """ Calculate skew correction values Args: calibImages camera_number Returns: None """ scanner_camera.setSkewCorrectionValues(calibImages) # Config file configCom = ConfigCommunicator() configCom.setSkew(scanner_camera.skew_mtx, scanner_camera.skew_dist, scanner_camera.skew_newcameramtx, camera_number) configCom.saveConfig()
def scale_calibration(scaleDetect, image, objx, objy, units): """ calibrates the scale and saves to config file Args: scaleDetect (ScaleDetection): image: the calibration image objx: width of calibration object objy: height of calibration object units (string): units to use Returns: True on success, False on failure """ configCom = ConfigCommunicator() success = scaleDetect.calibrate(image, objx, objy, units) dictionary = {'x_scale': str(scaleDetect.x_scale), 'y_scale': str(scaleDetect.y_scale), 'units': scaleDetect.units} configCom.setScale(dictionary) configCom.saveConfig() return success