11

I try to create an illumination invariant image with openCV like in this paper here: http://www.cvc.uab.es/adas/publications/alvarez_2008.pdf

Has someone an idea how one can create that image from the log-log plot image in OpenCV?

2 Answers 2

4

+1 for the link to an interesting paper.

I guess I would build a function to convert to log, divide the channels, rotate by theta, and project onto one axis. Then I would build a function to measure the quality of the resulting invariant image. Then I would set up a search over theta to optimize the quality. That looks like what Alvarez is doing.

But first, I would study the Luv color space, it might be the closest approximation to this scheme that is possible without the special narrowband camera. Project the uv space onto a vector at angle theta, and see what happens.

2
  • 2
    here i found another detailed paper: cs.sfu.ca/~mark/ftp/Eccv04/intrinsicfromentropy.pdf thanks for the hint with the luv color space...i will look at that now...maybe you could explain me that more detailed?
    – rouge
    Commented Jun 11, 2012 at 7:37
  • I'd like to try this out aswell, but I dont know how you would project the uv space onto a vector. How does it work? Are there any OpenCV functions that would do the job?
    – Sean M.
    Commented Nov 25, 2014 at 21:58
4

As far as I can understand the two papers, they are proceeding from a false premise and arriving at an interesting method for getting 1D illumination invariant information from 2D (such as uv from Luv, HS from HSV, etc) color space.

They say illumination invariant, but they show a method of obtaining Color Temperature invariant information from log ratio of color pairs, say {log(R/G),log(B/G)}. You can imagine the setup, with a lamp on a dimmer, and they plot the color ratios: dim the lights, yes, the illumination changes, but so does the color temperature T.

Not to mention that light is not all blackbody color temperature Lambertian. How in the world can this method work? But their results look good.

So, on to the interesting method: Maximum Entropy
As in answer above, project the (log of) uv space onto a vector at angle theta. What should theta be? Search theta to maximize entropy of the result. That is, to get the sharpest peaks in the 1D result. Sort of like an auto-focus.

To answer your question though, use calcHist in opencv. After computing the log, of course.

3
  • ok then i take the log(u) * cos(angle) + log(v) * sin(angle)? my problem is in opencv i dont know how to store calculated u-v image?
    – rouge
    Commented Jun 12, 2012 at 6:53
  • Can you please explain what you mean with "Search theta to maximize entropy of the result." ? Commented Apr 24, 2014 at 5:35
  • Gosh, that was years ago now.. But I think basically you adjust theta until the results look good. The least muddy, the sharpest picture, using whatever criterion you have at hand. Commented Apr 26, 2014 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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