mahaveerverma / hand-gesture-recognition-opencv

A project on hand detection and hand gesture recognition developed using OpenCV on Python 2.7.
MIT License
315 stars 132 forks source link

OpenCV error. Current version installed is : 2.4.11 #1

Closed KathiravanNatarajan closed 7 years ago

KathiravanNatarajan commented 7 years ago

OpenCV Error: Assertion failed ((src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.type() == dst.type() && src.size() == dst.size() && src.data != dst.data) in bilateralFilter_8u, file /home/travis/miniconda/conda-bld/work/opencv-2.4.11/modules/imgproc/src/smooth.cpp, line 1925 Traceback (most recent call last): File "HandRecognition.py", line 185, in frame=cv2.bilateralFilter(frame,5,50,100) cv2.error: /home/travis/miniconda/conda-bld/work/opencv-2.4.11/modules/imgproc/src/smooth.cpp:1925: error: (-215) (src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.type() == dst.type() && src.size() == dst.size() && src.data != dst.data in function bilateralFilter_8u

mahaveerverma commented 7 years ago

Try adding the following line before frame=cv2.bilateralFilter frame.astype(np.uint8)

Source: http://stackoverflow.com/questions/32592950/python-opencv-template-matching-error

This error can also probably be removed if using OpenCV2.4.8 but I don't think there is any reason for it to not work with 2.4.11. Either ways you can also remove that line altogether because without bilateral filtering too the code will work almost with the same effeciency.