diff --git a/sksurgeryimage/calibration/charuco.py b/sksurgeryimage/calibration/charuco.py index 6b96978..92dc2f9 100644 --- a/sksurgeryimage/calibration/charuco.py +++ b/sksurgeryimage/calibration/charuco.py @@ -236,12 +236,16 @@ def make_charuco_with_chessboard( charuco_squares[1] * charuco_pixels_per_square) ) - centre_of_image = (((charuco_squares[0] * charuco_pixels_per_square) - 1) / 2.0, - ((charuco_squares[1] * charuco_pixels_per_square) - 1) / 2.0) + centre_of_image = ( + ((charuco_squares[0] * charuco_pixels_per_square) - 1) / 2.0, + ((charuco_squares[1] * charuco_pixels_per_square) - 1) / 2.0 + ) # Creates minimum size chessboard, one pixel per chessboard square. chessboard_image = np.zeros((chessboard_squares[1], chessboard_squares[0]), dtype=np.uint8) + + # pylint: disable=invalid-name for x in range(0, chessboard_squares[0]): for y in range(0, chessboard_squares[1]): if x % 2 == 0 and y % 2 == 0 or x % 2 == 1 and y % 2 == 1: @@ -257,8 +261,10 @@ def make_charuco_with_chessboard( # Draw white polygon around chessboard corners = np.zeros((4, 2)) - corner_offsets = (((chessboard_squares[0] / 2) + chessboard_border) * chessboard_scale, - ((chessboard_squares[1] / 2) + chessboard_border) * chessboard_scale) + corner_offsets = ( + ((chessboard_squares[0] / 2) + chessboard_border) * chessboard_scale, + ((chessboard_squares[1] / 2) + chessboard_border) * chessboard_scale + ) corners[0][0] = int(centre_of_image[0] - corner_offsets[0]) corners[0][1] = int(centre_of_image[1] - corner_offsets[1]) corners[1][0] = int(centre_of_image[0] + corner_offsets[0]) diff --git a/sksurgeryimage/calibration/point_detector_utils.py b/sksurgeryimage/calibration/point_detector_utils.py index 124e113..b433966 100644 --- a/sksurgeryimage/calibration/point_detector_utils.py +++ b/sksurgeryimage/calibration/point_detector_utils.py @@ -14,10 +14,17 @@ def write_annotated_image(input_image, ids, image_points, image_file_name): image = copy.deepcopy(input_image) font = cv2.FONT_HERSHEY_SIMPLEX for counter in range(ids.shape[0]): - cv2.putText(image, str(ids[counter][0]), (int(image_points[counter][0]), int(image_points[counter][1])), font, 0.5, (0, 255, 0), 2, cv2.LINE_AA) + cv2.putText(image, + str(ids[counter][0]), + (int(image_points[counter][0]), + int(image_points[counter][1])), + font, 0.5, (0, 255, 0), 2, cv2.LINE_AA) split_path = os.path.splitext(image_file_name) previous_dir = os.path.dirname(split_path[0]) previous_dir = os.path.basename(previous_dir) base_name = os.path.basename(split_path[0]) - output_file = os.path.join('tests/output', base_name + '_' + previous_dir + '_labelled.png') + output_file = os.path.join('tests/output', base_name + + '_' + + previous_dir + + '_labelled.png') cv2.imwrite(output_file, image)