5
$\begingroup$

I want to amplify regions with a specified color in an image. For this purpose I have defined a simple function

$B(x,y)=s_r(x,y) \cdot w_r + s_g(x,y) \cdot w_g + s_b(x,y) \cdot w_b$

which produces a gray scale image B(x,y).

The weights I have defined with

$w_r \in [-2,2],w_g \in [-2,2], w_b \in [-2,2]$

The channels of the images are the functions $s_x$ for each channel. I use the result of this amplification for a color thresholding. For example for yellow I have manually defined $w_r=1$, $w_g=1$ and $w_b = -2$. My Problem now is, to get "good" values for the weights automatically. First I thought taking the maximal values of histograms would be a good way, but the results are not satisfactorily.

How can I automatically determine the weights for the amplification?

How would you deal with white and black?

Or is there a better way to amplify the regions with a specific color?

$\endgroup$
  • $\begingroup$ Why don't try working in HSB ... seems much easier $\endgroup$ – Dr. belisarius Jan 17 '12 at 4:29
  • $\begingroup$ Do you want to amplify regions matching exactly a color or do you want to make a more or less smooth amplification include colors close to your chosen one? $\endgroup$ – halirutan Jan 17 '12 at 14:30
  • $\begingroup$ The second, I want to amplify a color range. $\endgroup$ – martin Jan 20 '12 at 13:36
  • $\begingroup$ @martin, I would like to attenuate regions matching exactly a "True" RGB color where I know the bounding box x and y coordinates. How might I do that? $\endgroup$ – Frank Feb 14 '16 at 8:32
1
$\begingroup$

Let us assume you are doing a binary classification with the desired color region set as 1 after applying your algorithm. Then you can provide a set of color images (histograms) and desired outputs. The weights can be posed as the unknown quantities for this set of linear equations. Lo you have a overdetermined system & you can apply any method like Moore-penrose inversion to estimate the weights.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.