0

I have a C# app and I am using Emgu.

I want to brighten up dull images. When I use EqualHist the detail is there but a bit too strong. Are there ways to enhance the existing details of an image but not as vibrant as the EqualHist? Thanks..

Sample images:

enter image description here

nbanic
  • 1,270
  • 1
  • 8
  • 11
Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
  • This is really vague, I think you going to have to get a lot more specific to get a useful answer. For instance, I'm not sure you understand what exactly histogram changes like this do. – asawyer Mar 14 '14 at 18:19
  • hi, Fair enough comment, I do not. I think it eliminates the extremes of the colors and stretches the rest out? I want to enhance the edges of the images more - if this makes sense? – Andrew Simpson Mar 14 '14 at 18:22
  • 1
    Sorry Andre I honestly don't know the answer for you. Histogram transformations like this will **reduce** details though by reducing high end dynamic range of the image, though it will increase low brightness contrast significantly. Watch this video to understand why: http://www.youtube.com/watch?v=lWXj6Pc_hog&noredirect=1 – asawyer Mar 14 '14 at 18:26
  • hi thanks for that link. I will try to better myself :) – Andrew Simpson Mar 14 '14 at 18:28
  • 1
    The clip is in context of astrophotography but it's a good primer on histograms. How you looked at maybe some type of sharpness filters? I'm not familiar with Emgu but maybe some type of sharpening mask will work ? http://stackoverflow.com/questions/4993082/how-to-sharpen-an-image-in-opencv – asawyer Mar 14 '14 at 18:31
  • hi - thanks for link will check that out now – Andrew Simpson Mar 14 '14 at 18:33
  • Can you post some images, so I can see what is the problem ? It is hard to suggest what to use without concrete samples. – dajuric Apr 08 '14 at 19:19
  • @dajuric Hi, so sorry it took so long to get back to you. Really hectic week. 1st) thanks so much for taking an interest. 2nd) Please see that I have now added some images – Andrew Simpson Apr 11 '14 at 17:03

1 Answers1

1

Try using StretchContrast (AForge.NET). http://www.aforgenet.com/framework/docs/html/e7e63ac5-7c1b-5dc2-40b2-8c80e217a946.htm

Update: Well I do not know much about color and lighting correction, but I can recommend these algorithms:

Global: Gray-World - http://scien.stanford.edu/pages/labsite/2000/psych221/projects/00/trek/GWimages.html

(I think that a C# version exist)

         code: http://www.fer.unizg.hr/ipg/resources/color_constancy    
         (repository at the bottom)

White-Patch - http://staff.science.uva.nl/~gijsenij/colorconstancy/index_how.php

(I think that a C# version exists)

         code: http://www.fer.unizg.hr/ipg/resources/color_constancy
         (repository at the bottom)

Local: (performs local corrections): Light Random Sprays Retinex - http://en.wikipedia.org/wiki/Color_constancy

         code: http://www.fer.unizg.hr/ipg/resources/color_constancy
         (repository at the bottom)

The codes are written in C++ but they are easy to read (and compile) so you can try them on your samples.

The problem with these algorithms is that some of them are slow and can not be directly applied for real-time applications; the codes on http://www.fer.unizg.hr/ipg/resources/color_constancy greatly improve their performance (all improvements are done by changing the algorithm, not by using special C++ tricks nor SIMD instructions).

moonlightcheese
  • 10,664
  • 9
  • 49
  • 75
dajuric
  • 2,373
  • 2
  • 20
  • 43