Ask Your Question

Revision history [back]

cvtColor and inRange in single pass?

Hi, I am new to OpenCV, but have plenty of programming experience. I have played around with image detection based on color. Everyone's code does something like:

hsvFrame = cv2.cvtColor( frame, cv2.COLOR_BGR2HSV )
mask = cv2.inRange( hsvFrame, lowLimitHSV, highLimitHSV )

This does work, but seems inefficient. At least for my task (and others I saw on the web), the HSV frame is only needed to do the thresholding.

My question is: why is there no standard routine to combine cvtColor and inRange in a single pass? Has it been tried? Is it not efficient enough? Just trying to get an idea.

Thanks.