Click here to Skip to main content
15,888,253 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
blahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblah
Posted
Updated 1-Dec-11 5:52am
v13
Comments
Manfred Rudolf Bihy 30-Nov-11 6:29am    
Please add code tags when inserting code fragments and use proper indentation. It is much easier to read that way and looks way neater than without them.
Thanks for your cooperation!
CPallini 30-Nov-11 6:42am    
Why it shouldn't re-calculate? Could you please elaborate?
Richard MacCutchan 1-Dec-11 11:43am    
What is this?

It is best to start with the original image data because otherwise data would get lost in the process. When you click the button the result now would be the same every time. Otherwise the normalization would be done on an already normalized image and eventually the image won't be normal at all. It's like when you would bring all the values somewhat closer the average. If you repeat that process over and over, eventually all the values will just be the average.

Good luck!
 
Share this answer
 
Comments
Albert Holguin 30-Nov-11 10:14am    
grrr... stop pasting your code everywhere...
Maybe I made a mistake in my computations, anyway, your trasnformation migh be written

d'r,b = dr,b - Sr(dr,b)/Sr + Srb(dr,b)/Srb


where
  • Sr is sum on index r
  • Srb is sum on indices r,b.


The formula maybe re-written as

d'r,b = dr,b - F(b) + G


If you apply again the transformation, then you obtain (after some calculations)

d"r,b = dr,b - 2 F(b) + 2 G


and so on.


BTW there are some programming mistakes in the posted code (for instance, you forgot to free some allocated memory and you used C++'s delete for memory allocated with C's malloc).
 
Share this answer
 
v3
Comments
CPallini 30-Nov-11 8:39am    
Well, if my computations were good then I've just shown your normalization formula doesn't really normalize. I haven't the right one.
Albert Holguin 30-Nov-11 10:15am    
Modify the code using my variables? ...that's your job.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900