[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting and image rescaling



Bill wrote:

>
> Some of our band images are on the order of 2500 by 10000. For such band
> images this line can take over 30 seconds per band. This is a moderate
> nuisance at the moment, but we are planning to update our calibration ,
> and reprocess 1000s of multiband images with a new calibration.
> Naturally we want to update the jpegs to reflect this new calibration.
> It appears that this single line will extend reprocessing by a couple of
> days. I don't like this. This yields the following questions:
>
> 1. Does anyone know a better general approach to such a rescaling that
> avoids the need to sort the data, or sort more than a fraction of the
> data?

Provided your images are well-behaved, I would think it would suffice to
sample a few thousand pixels distributed uniformly over your image to
establish the scaling.       For all the but the most bizarre histograms of
pixel intensities, I would think a few thousand samples is a good
approximation.

An astronomical application can be found in the program sky.pro in
http://idlastro.gsfc.nasa.gov/ftp/pro/idlphot/.    This program establishes
a grid of about 4000 pixel values uniformly distributed across the
image.      It then runs a fairly complicated program to throw out outliers
(assumed in astronomy to be overwhelmingly positive) to establish a mean
sky and sigma.      For display purposes one can then choose to display
between say sky - 2*sigma to sky + 20*sigma.

--Wayne Landsman   landsman@mpb.gsfc.nasa.gov