How to equalize airphoto's contrast and other params?

Grass package grass at sun1.bham.ac.uk
Mon Oct 10 05:14:38 EDT 1994


Ania Oldak writes:
> 
>    I have several scanned airphotos which I'm trying to join together.
> They are of quite good resolution (214 dpi), but their overall bright-
> ness and contrast differ rather a lot. My problem is as follow. While
> the rectification went without any snags, I'm still unable to find a way
> to adjust their various contrast scales and to give a common one to all.

Any overall difference in brightness and contrast between two photographs
will show up in the image histograms that you plot with the d.histogram
command (use d.erase red before you invoke this command). From the 
histograms you can decide what the useful range of pixel values in a
photograph is, say 40 - 210. You can then use r.rescale to create a new
image with values 0 - 255. If you do this for all photographs in your set, 
the brightness problem will be solved. The contrast problem can then be
tackled by applying a contrast equalized greyscale to the images using
r.colors map=name color=grey.eq. NOTE: rescaling, I think, actually changes
the pixel values in your images, while contrast equalisation doesn't.

> I was trying to use r.mapcalc, but only managed to 'discover' something
> which I find rather strange. From the overlapping area of two adjacant,
> rectified photos, I picked all pixels with a given value, say 63, of one
> photo. I was expecting that the corresponding pixels from the second
> photo will have their values spread in a relatively narrow range. How-
> ever, just the opposite was true. E.g. the spread was as broad as from 40
> to 210 in some cases. It might be relevant here to mention that the resi-
> duals rms were never bigger than about 3 during rectification. The reason
> for this eludes me, though maybe it has something to do with rectification
> errors after all. Any suggestions are welcome.
Rectification errors are caused by the resolution of the source image and 
the map error in the georeference points used, besides the RMS error reported
during rectification. Again, you may have used i.rectify or i.rectify2 to
do the rectification and may have used a simple algorithm (2nd degree 
polynomial) instead of using i.ortho.photo which can also correct for 
camera parameters and digital elevation model....
	So the error may, in places, be much larger than the one reported 
by grass, which may have caused the range of pixel values you found when 
comparing the two photographs. Also, if there is a displacement of even 
1 pixel between the two, values for corresponding pixels may vary widely,
for instance where they are situated at the edge of a road. So perhaps 
you should not look at the total spread of pixel values, but only at the
central part of the distribution.
> 
Hope this helps,

		Martijn van Leusen



More information about the grass-user mailing list