Re: Problem with histogram calculation - please need help [message #59960] |
Mon, 21 April 2008 08:35 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> You will have to investigate what those
> numbers are and plug those into your HISTOGRAM command. Then
> I am sure the output will look the same. :-)
Looks to me like you can find this information if you
look in the Histogram window of ENVI. Choose Options ->
Histogram Parameters to see how it has chosen to
configure the histogram for your image.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Problem with histogram calculation - please need help [message #59961 is a reply to message #59960] |
Mon, 21 April 2008 08:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
moxament@gmail.com writes:
> Thank you very much for your response. I did what you said and I did
> not get the error message. But the resulted histogram is incorrect. I
> can see the histogram of the image (array) in ENVI correctly but what
> I want is to calculate the histogram in my algorithm code using the
> HISTOGRAM function. I can not understand what I can do and why I have
> so much troubles with this function. It is critical for me to
> calculate the histogram of the image (array) using the HISTOGRAM
> function. Please, do you know why the resulted histogram from this
> function is wrong and what I can to in order to calculate the same
> histogram that the ENVI shows.
I seriously doubt that the histogram is "wrong". You may
not be using the same bin size (or number of bins) that ENVI
uses with this data. You will have to investigate what those
numbers are and plug those into your HISTOGRAM command. Then
I am sure the output will look the same. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Problem with histogram calculation - please need help [message #59965 is a reply to message #59961] |
Mon, 21 April 2008 07:52  |
moxament
Messages: 26 Registered: April 2008
|
Junior Member |
|
|
On 21 Απρ, 16:43, David Fanning <n...@dfanning.com> wrote:
> moxam...@gmail.com writes:
>> I have a floating-point array d with dimensions 300x300. The minimum
>> value of the array is 3.07527 x 10^9 and the maximum value is 1054.91
>> x 10^9. I can not calculate the histogram of the array. I get the
>> following message:
>
>> ENVI> hist = HISTOGRAM(d)
>> % Array has too many elements.
>> % Execution halted at: $MAIN$.
>
>> Can anyone tell me how can I overcome this problem please.
>
> I think I would set your bin size more appropriately. :-)
>
> Something like this would probably work:
>
> binsize = (Max(array) - Min(array)) / 100
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Hi Dr. Fanning,
Thank you very much for your response. I did what you said and I did
not get the error message. But the resulted histogram is incorrect. I
can see the histogram of the image (array) in ENVI correctly but what
I want is to calculate the histogram in my algorithm code using the
HISTOGRAM function. I can not understand what I can do and why I have
so much troubles with this function. It is critical for me to
calculate the histogram of the image (array) using the HISTOGRAM
function. Please, do you know why the resulted histogram from this
function is wrong and what I can to in order to calculate the same
histogram that the ENVI shows.
your help is appreciated,
Dabboor
|
|
|
Re: Problem with histogram calculation - please need help [message #59966 is a reply to message #59965] |
Mon, 21 April 2008 06:43  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
moxament@gmail.com writes:
> I have a floating-point array d with dimensions 300x300. The minimum
> value of the array is 3.07527 x 10^9 and the maximum value is 1054.91
> x 10^9. I can not calculate the histogram of the array. I get the
> following message:
>
> ENVI> hist = HISTOGRAM(d)
> % Array has too many elements.
> % Execution halted at: $MAIN$.
>
> Can anyone tell me how can I overcome this problem please.
I think I would set your bin size more appropriately. :-)
Something like this would probably work:
binsize = (Max(array) - Min(array)) / 100
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|