creotiv / object_detection_projects

My public projects about object detection algorithms
347 stars 225 forks source link

Issue with binary_op #3

Closed ghost closed 6 years ago

ghost commented 6 years ago

mask = cv2.bitwise_and(_img, _img, mask=exit_mask)

cv2.error: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/arithm.cpp:241: error: (-215) (mtype == 0 || mtype == 1) && _mask.sameSize(*psrc1) in function binary_op

creotiv commented 6 years ago

you image and mask should be the same size, if you changed source images, you should also change mask size.

creotiv commented 6 years ago

as you see https://github.com/creotiv/object_detection_projects/blob/master/opencv_traffic_counting/traffic.py#L27 current video shape size is SHAPE = (720, 1280) # h, w

ghost commented 6 years ago

Thanks