Hello!
Help me, please.
Try to use cv2 with rtsp, but receiving errors:
Traceback (most recent call last):
File "C:/Users/usr6243828/PycharmProjects/traffic-count/traffic.py", line 120, in
main()
File "C:/Users/usr6243828/PycharmProjects/traffic-count/traffic.py", line 109, in main
pipeline.run()
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 57, in run
self.context = p(self.context)
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 379, in call
frame = self.draw_ui(frame, vehicle_count, exit_masks)
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 363, in draw_ui
mask = cv2.bitwise_and(_img, _img, mask=exit_mask)
cv2.error: OpenCV(4.3.0) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:250: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'cv::binary_op'
Hello! Help me, please. Try to use cv2 with rtsp, but receiving errors:
Traceback (most recent call last): File "C:/Users/usr6243828/PycharmProjects/traffic-count/traffic.py", line 120, in
main()
File "C:/Users/usr6243828/PycharmProjects/traffic-count/traffic.py", line 109, in main
pipeline.run()
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 57, in run
self.context = p(self.context)
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 379, in call
frame = self.draw_ui(frame, vehicle_count, exit_masks)
File "C:\Users\usr6243828\PycharmProjects\traffic-count\pipeline.py", line 363, in draw_ui
mask = cv2.bitwise_and(_img, _img, mask=exit_mask)
cv2.error: OpenCV(4.3.0) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:250: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'cv::binary_op'