Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛠️ fix(calibration_utils): Fix marker_corners variables initialization #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions calibration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from functools import reduce
from collections import deque
from typing import Optional
import re
# Creates a set of 13 polygon coordinates
rectProjectionMode = 0

Expand Down Expand Up @@ -918,6 +919,9 @@ def sgdEpipolar(self, images_left, images_right, M_lp, d_l, M_rp, d_r, r_l, r_r,
res2_l = self.detect_charuco_board(image_data_pair[0])
res2_r = self.detect_charuco_board(image_data_pair[1])

marker_corners_l = 0 if res2_l is None else res2_l[3]
marker_corners_r = 0 if res2_r is None else res2_r[3]

if res2_l[1] is not None and res2_r[2] is not None and len(res2_l[1]) > 3 and len(res2_r[1]) > 3:

cv2.cornerSubPix(image_data_pair[0], res2_l[1],
Expand Down Expand Up @@ -1155,6 +1159,9 @@ def test_epipolar_charuco(self, left_img_pth, right_img_pth, M_l, d_l, M_r, d_r,
for i, image_data_pair in enumerate(image_data_pairs):
res2_l = self.detect_charuco_board(image_data_pair[0])
res2_r = self.detect_charuco_board(image_data_pair[1])

marker_corners_l = 0 if res2_l is None else res2_l[3]
marker_corners_r = 0 if res2_r is None else res2_r[3]

if self.traceLevel == 2 or self.traceLevel == 4 or self.traceLevel == 10:
print(f'Marekrs length for pair {i} is: L {len(res2_l[1])} | R {len(res2_r[1])} ')
Expand Down