frame=cv2.imread('lena.jpg')
hsv=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
l_b=np.array([110,50,50])
u_b=np.array([130,255,255])
mask=cv2.inRange(hsv,l_b,u_b)
cv2.imshow('frame',mask)
Error-
OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\coresrc\arithm.cpp:1758: error: (-209:Sizes of input arguments do not match) The lower boundary is neither an array of the same size and same type as src, nor a scalar in function 'cv::inRange'
Is there anyway to overcome this error and get the output in opencv python environment?
Something like https://github.com/bytedeco/javacv/issues/101#issuecomment-546221139?
I am having the same problem as this guy.
https://github.com/bytedeco/javacv/issues/684
You have also given him the answer. But that was in java environment. I am programming in python and was wondering what I should change in the code
I found out the problem.
#replace this line
hsv=cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
Most helpful comment
I found out the problem.
#replace this linehsv=cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)