[GRASSLIST:7640] Re: color balancing in mosaic

Jonathan Greenberg jgreenberg at arc.nasa.gov
Wed Jul 20 13:09:19 EDT 2005


Histogram matching is certainly another technique you can use. The problem
with histogram matching arises when your scenes have drastically different
scene components (so the histograms shouldn't match anyway).  Most
differences between two images are not as complex as requiring the
application of a probability distribution, rather just modifying the gain
and offset (the differences are almost always linear).  The empirical line
technique can be applied in a semi- or fully automated way, and does not
have any real restriction short of requiring the two images to overlap.

--j


On 7/20/05 9:58 AM, "Feng Tan" <feng at lynxseismicdata.com> wrote:

> Hi, Guys,
> 
> I am very interested in developing the tool for color balancing in GRASS.
> Jonathan's ideas make sense that uses overlapping information of the images,
> but it only considered a few sampling areas, plus the regression part
> involves the R/Grass interface which I haven't get my computer works yet. I
> am thinking about combine Hamish's histogram idea with Jonathan's overlapping
> ideas together. That is:
> 
> 1) d.histogram for both images (for example, R channel) in the overlapping
> area
> 2) r.rescale the histogram of the image according to the reference image in
> the overlapping area.
> 3) apply the modified histogram to the entire images (I don't know how to do
> this in GRASS6.0 ,maybe r.rescale again? ). In this step, some cell values
> are changed if they exist in the overlapping area, some cell values will not
> change if they don't exist in the overlapping area.
> 
> Please tell me if this makes sense?
> 
> Thanks,
> 
> Feng
> On Monday 18 July 2005 16:18, you wrote:
>> Feng:
>> 
>> The "official" way you can do this (this will work for "true"
>> radiometric normalization so, by definition, will work for the "photo"
>> normalization) is using image-to-image empirical line.  Here's the basic
>> idea (I have no idea how to do this in GRASS, by the way, maybe someone can
>> translate these instructions into GRASS capabilities or, if any programmers
>> are interested, I can help direct the development of an add-on to GRASS):
>> 
>> 1) Make sure your images are georegistered to one another (they should be
>> if you want to mosaick anyway).
>> 2) Pick 10-50 locations of varying brightness in the overlap regions
>> between two images.
>> 3) Choose one of the two images as the "reference image".  I'll refer to
>> the other overlapping image as the uncalibrated image.
>> 4) For each band (in your case, probably R G B), do a linear regression
>> between reference image pixels and the corresponding uncalibrated image
>> pixels.
>> 5) (Optional) Remove any outliers in the analysis.
>> 6) You now have a slope and offset coefficient that you can apply to the
>> uncalibrated image which will now radiometrically register this with the
>> reference image.
>> 
>> Voila!
>> 
>> --j
>> 
>> -----Original Message-----
>> From: Feng Tan [mailto:feng at lynxseismicdata.com]
>> Sent: Monday, July 18, 2005 3:10 PM
>> To: Hamish
>> Cc: jgreenberg at arc.nasa.gov; GRASSLIST at baylor.edu
>> Subject: Re: [GRASSLIST:7563] Re: color balancing in mosaic
>> 
>> Hi, Hamish,
>> 
>> Thanks for give me ideas! I use i.fusion.brovey to sharppen the image to
>> 15m
>> 
>> resolution first, then adjust the color from brovey's RGB channels
>> according
>> 
>> a reference image in the mosaic. I am trying your idea, but it doesn't work
>> very well, at least it does not process automatically. It is hard to choose
>> the proper min, max  from histogram. Maybe I should do more testing. Any
>> more
>> suggestion?
>> 
>> Feng
>> 
>> On Sunday 17 July 2005 20:36, you wrote:
>>>> Thank you very much for your reply!! Yes, I only use the mosaiced
>>>> images for  "good looking" not for classification purpose. (I know it
>>>> takes raw image for  classification, so we don't change their spectral
>>>> information, thanks for  remind me this!). I believe you have ideas
>>>> how to color balancing for my  mosaiced, color composited landsat
>>>> images for viewing.
>>> 
>>> I am no RS expert, but for nice looking LANDSAT output here are some
>>> things you might try.
>>> 
>>> Use d.histogram to do a subjective or r.stats to do an objective
>>> analysis of each band's distribution. Rescale with r.rescale or
>>> r.rescale.eq (?) and gate filter back to (0,255) with r.mapcalc.
>>> Or try r.univar and resample to +/- 1.5 stdev's from the mean or
>>> whatever is appropriate.
>>> 
>>> 
>>> Then use i.oif to see which combination of three bands show the most
>>> information and try displaying different RGB combinations of those three
>>> bands with d.rgb & see what looks good.
>>> 
>>> 
>>> 
>>> Hamish


-- 
Jonathan A. Greenberg, PhD
NRC Research Associate
NASA Ames Research Center
MS 242-4
Moffett Field, CA 94035-1000
650-604-5896
AIM: jgrn307
MSN: jgrn307 at hotmail.com




More information about the grass-user mailing list