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

metre_pixel_x,metre_pixel_y,coordinate,affine_correct_parameters=analyze_chessboard(image,affine_correct_flag) TypeError: cannot unpack non-iterable NoneType object #1

Open
leisther opened this issue Feb 4, 2019 · 13 comments

Comments

@leisther
Copy link

leisther commented Feb 4, 2019

how to fix this?

@ankesh007
Copy link
Owner

Hi. I have updated code and README. Please try running again and let me know if there are issues. Use final_saket type images for testing.

@ankesh007
Copy link
Owner

True/ False

@leisther
Copy link
Author

leisther commented Feb 5, 2019

File "code2.py", line 228, in analyze_chessboard
cv2.setMouseCallback(window_name1, click_and_crop)
cv2.error: OpenCV(4.0.0) /io/opencv/modules/highgui/src/window_QT.cpp:714: error: (-27:Null pointer) NULL window handler in function 'cvSetMouseCallback'

I'm getting this error

@ankesh007
Copy link
Owner

https://stackoverflow.com/questions/45964751/python3-opencv-cv2-error-215-unable-to-show-captured-image

@leisther
Copy link
Author

leisther commented Feb 6, 2019

screenshot from 2019-02-06 14-37-27

File "code2.py", line 226, in analyze_chessboard
clone = image.copy()
AttributeError: 'NoneType' object has no attribute 'copy'

how to fix this error?

@ankesh007
Copy link
Owner

It is not able to find image. Please enter correct path

@leisther
Copy link
Author

leisther commented Feb 7, 2019

python code2.py -i1 /home/leisther/Downloads/Body-Measurement-using-Computer-Vision-master/Images/final_saket1.jpg -i2 /home/leisther/Downloads/Body-Measurement-using-Computer-Vision-master/Images/final_saket2.jpg -i3 /home/leisther/Downloads/Body-Measurement-using-Computer-Vision-master/Images/final_saket3.jpg -a "True"

I haven't solve the error NULL window handler in function 'cvSetMouseCallback' any idea of what to do with this?

@ankesh007
Copy link
Owner

I am not sure of what this error means. Maybe google.

@tash149
Copy link

tash149 commented Jun 20, 2019

I'm not sure, but it could be because of OpenCV version as the project is made in version 2.4.13.6 and we're using a higher version(for me its 4.0.0)

@KK-Repos
Copy link

(3024L, 4032L, 3L)
Segmentation Completed 1
Traceback (most recent call last):
File "code2.py", line 399, in
main()
File "code2.py", line 379, in main
segmented_arm_image=segment.segmenter(arm_spread_image)
File "C:\Users\kishore\Downloads\Body-Measurement-using-Computer-Vision-master\Body-Measurement-using-Computer-Vision-master\src\segment.py", line 106, in segmenter
print img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

I'm Getting this error

@StPov
Copy link

StPov commented Jul 13, 2020

(3024L, 4032L, 3L)
Segmentation Completed 1
Traceback (most recent call last):
File "code2.py", line 399, in
main()
File "code2.py", line 379, in main
segmented_arm_image=segment.segmenter(arm_spread_image)
File "C:\Users\kishore\Downloads\Body-Measurement-using-Computer-Vision-master\Body-Measurement-using-Computer-Vision-master\src\segment.py", line 106, in segmenter
print img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

I'm Getting this error

@KishorePyDev
For sure you will get the error
print(img.shape) is the answer

@StPov
Copy link

StPov commented Jul 13, 2020

File "code2.py", line 228, in analyze_chessboard
cv2.setMouseCallback(window_name1, click_and_crop)
cv2.error: OpenCV(4.0.0) /io/opencv/modules/highgui/src/window_QT.cpp:714: error: (-27:Null pointer) NULL window handler in function 'cvSetMouseCallback'

I'm getting this error

@leisther, simply add
cv2.namedWindow(window_name1) before cv2.setMouseCallback(window_name1, click_and_crop)

@StPov
Copy link

StPov commented Jul 13, 2020

screenshot from 2019-02-06 14-37-27

File "code2.py", line 226, in analyze_chessboard
clone = image.copy()
AttributeError: 'NoneType' object has no attribute 'copy'

how to fix this error?

@leisther, replace
clone = image.copy() with clone = np.copy(image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants