Remove region with certain color from image

asked 2014-07-30 06:07:19 -0500

tleyden gravatar image

Given an image such as:

image description

I want to remove the "red text" from this image.

There will be a lot of lighting variations in the images I need to process, and I've read that using the HSV color model would be more robust against lighting variations, but I'm not sure where to go from there.

edit retag flag offensive close merge delete


A quick guess, since you didn't provide any code attempts:

  1. Convert your image using the cvtColor function with the CV_BGR2HSV parameter.
  2. In that region define thresholds on the H S and V channel that will isolate the red text in different situations.
  3. Make a mask based on the pixes that fall within your thresholds.
  4. Fill the mask region with the general background color of the pixels around the mask pixels.

Quite interested in where you are going to use this for. Seeing red text with violations always urges me to think their will be ethical issues when helping you out :)

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-30 06:45:18 -0500 )edit

No ethical issues -- I'm just trying to find a specific field in a form. Actually, to flip the question around .. in case it's easier, I want to get the region which includes the text "VC22500E - DRIVEWAY".

tleyden gravatar imagetleyden ( 2014-07-30 07:38:59 -0500 )edit