ankesh007 / Body-Measurement-using-Computer-Vision

Given 2D image, determine real-world body measurements
127 stars 54 forks source link

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 5 years ago

leisther commented 5 years ago

how to fix this?

ankesh007 commented 5 years ago

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 commented 5 years ago

True/ False

leisther commented 5 years ago

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 commented 5 years ago

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

leisther commented 5 years ago

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 commented 5 years ago

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

leisther commented 5 years ago

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 commented 5 years ago

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

tash149 commented 5 years ago

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 commented 4 years ago

(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 commented 4 years ago

(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 commented 4 years ago

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 commented 4 years ago

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)