It's not clear from your description what an "even background" should look like. I would interpret that as "make the background all one color". And in that case I wonder why one cannot just filter with a simple threshold value and WHERE function, e.g.
threshold = 100 ; All light intensities under 100 should be assigned one even color
backgroundPixelLocs = where(myImage lt threshold)
myImage[backgroundPixelLocs] eq 0 ; Set all background pixels to black
I bet your problem is more complex than this, but I cannot see this from your description above. If I am correct, perhaps describing your problem with some specific example data values will help.
James Jones
|