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

Type exception raised with OpenCV 4.5.2. #26

Closed
ddonohoe opened this issue May 21, 2021 · 3 comments
Closed

Type exception raised with OpenCV 4.5.2. #26

ddonohoe opened this issue May 21, 2021 · 3 comments

Comments

@ddonohoe
Copy link

I moved to a fresh install today, and this happened:

Traceback (most recent call last):
File "/home/davidd/git/UB-ISP/scripts/color_calib", line 88, in
result = detect_colour_checkers_segmentation(img, additional_data=True)
File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 771, in detect_colour_checkers_segmentation
for colour_checker in extract_colour_checkers_segmentation(image):
File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 694, in extract_colour_checkers_segmentation
colour_checker = crop_and_level_image_with_rectangle(
File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 463, in crop_and_level_image_with_rectangle
M_r = cv2.getRotationMatrix2D(centroid, angle, 1)
TypeError: Can't parse 'center'. Sequence item with index 0 has a wrong type

Previously cv2 was at version 4.5.1, but with the fresh install it had moved to 4.5.2.

Modifying segmentation.py (line 451) from:
centroid = as_int_array(contour_centroid(cv2.boxPoints(rectangle)))
to:
centroid = as_float_array(contour_centroid(cv2.boxPoints(rectangle)))

fixed it for me.

@KelSolaar
Copy link
Member

Hi @ddonohoe,

Thanks and sorry for the late answer! I have a few things that I will need to squeeze in when I have some spare cycles, this will be included!

Cheers,

Thomas

@KelSolaar
Copy link
Member

Hi @ddonohoe,

This should be fixed in develop!

Cheers,

Thomas

@ddonohoe
Copy link
Author

Many thanks Thomas!

@KelSolaar KelSolaar changed the title Type exception with OpenCV 4.5.2 Type exception raised with OpenCV 4.5.2. Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants