Attempting to understand what you are saying.
Assume that I want an image (for now a 2D array of grey values) which
contains pixels as follows:
(i) im[r, c] = sin(2.PI.r/Nr).sin(2.PI.c/Nc), where r = 0..Nr-1 is the
row index and c is the column index.
1. I can store the image in an array, say in C or C++ or Java, as
float im[Nr][Nc];
and execute a nested loop to compute the values and store them in im.
then I can use pixval= im[r][c] to access the value.
2. Or, assuming we have use an image (object) class, we can have
Image im;
im.create(sine);
pixval = im.get(r, c); // which reads and returns im]r][c]
3. Or, instead of storing all the values, I can write an indication that
im has been assigned (i), and have an alternative 'get' that either
(a) computes the nested loop mentioned in 1. and then uses a similar
'get' to 2. or (b) I can compute (i) just for the required (r, c).
You might call 3. 'lazy' implementations ('lazy' in the sense used in
functional programming languages) or something like 'compute on demand'.
Almost like in graphics, raster representation versus vector representation.
Is that what you mean? But I probably interpreted you wrongly.
Best regards,
Jon C.
--
Jonathan Campbell www.jgcampbell.com BT48, UK.
> (i) im[r, c] = sin(2.PI.r/Nr).sin(2.PI.c/Nc), where r = 0..Nr-1 is the
> row index and c is the column index.
If I am right you have sampled the image to a mathematical formula
in terms of sine , but the raster may contain discrete pixel that
may not necessarily follow this model.
> 1. I can store the image in an array, say in C or C++ or Java, as
>
> float im[Nr][Nc];
>
> and execute a nested loop to compute the values and store them in im.
>
> then I can use pixval= im[r][c] to access the value.
>
> 2. Or, assuming we have use an image (object) class, we can have
>
> Image im;
>
> im.create(sine);
> pixval = im.get(r, c); // which reads and returns im]r][c]
>
> 3. Or, instead of storing all the values, I can write an indication that
> im has been assigned (i), and have an alternative 'get' that either
> (a) computes the nested loop mentioned in 1. and then uses a similar
> 'get' to 2. or (b) I can compute (i) just for the required (r, c).
>
> You might call 3. 'lazy' implementations ('lazy' in the sense used in
> functional programming languages) or something like 'compute on demand'.
>
> Almost like in graphics, raster representation versus vector representation.
I am afraid to tell that you are more technically strong than
my level of understanding . Even then , I assume that
there must be some sort of statistical computation for breaking
the raster to several segments and each segment follow
the definite mathematical model as ur first formula says .
Then the function imcreate() can be used .
Can you tell me which language you have used to explain the codes .
Is it MATLAB ?
regards ,
Chandan
I was assuming that r, c are integer; hence sampling / spatial
discretisation.
>
[...]
>> Almost like in graphics, raster representation versus vector representation.
>
> I am afraid to tell that you are more technically strong than
> my level of understanding . Even then , I assume that
> there must be some sort of statistical computation for breaking
> the raster to several segments and each segment follow
> the definite mathematical model as ur first formula says .
So you want to take a numerical image and (using a model) deduce the
parameters of the model? --- to get what is in effect a formula?
>
> Then the function imcreate() can be used .
> Can you tell me which language you have used to explain the codes .
> Is it MATLAB ?
I was thinking of Java or C++ --- but if you exclude mention of class /
object, then it may not be too far from MATLAB. I don't really know
MATLAB, and have rarely used it.
For the speed question, you'd have to look at the tradeoff between
saving and recalling less data versus the time to decompress it, since
it must be decompressed before display. For example, if I can save a
10 megapixel photo in 500 kb, can I recall and decompress
(reconstruct) the 10 megapixel image in less time that if I simply
saved all 10 megapixels and recalled them all without having to do
decompression?
Regards
Chandan
----------------------------------------------
You can use a lossless compression such as PNG, jpeg2000, etc.
Not necessarily. Neither are all compression formats lossy. JPEG-LS
isn't, original JPEG has a lossless path (though unknown to many), JPEG
2000 does have a lossless path. The easiest, fastest and one of the best
is probably JPEG-LS. Lossless in the sense that it re-creates a 2D array
of integer values without loss. How that 2D array relates to the
original image is a second question, of course, and just *obtaining*
that array from a real-world scene creates loss of some sort.
> What can be the algorithm that preserves the original image
> content ( radiometric , spectral and spatial aspects ) .
"Radiometric"? That requires you to record more than a matrix of
grey-levels. Spectral properties are neither preserved because, usually,
color images are stored as triples representing colors in a suitable
color space. For that, you would need to use a multi-spectral
representation, but as frequency is a continous signal (similar to
space), you do have some loss already when sampling the signal. JPEG
2000 can compress multi-spectral images, also losslessy.
What do you mean by "spatial aspects"? Again, as soon as you have
pixels, you sampled the original signal already and created loss by a
limited spatial resolution, but this is a sensor problem and not a
compression problem.
So long,
Thomas