Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Found the solution

OpenCV: setting all pixels of specific BGR value to another BGR value

This was the open line solution of numpy fancy indexing with condition

Copied image

Used np.where

cim1 = cim.copy()
cim1[np.where((cim1==[49,51,31]).all(axis=2))]=[255,255,255]

I just took 0.13535053000123298 seconds