Re: Image proceesing in IDL [message #60791] |
Fri, 13 June 2008 16:59  |
enod
Messages: 41 Registered: November 2004
|
Member |
|
|
On Jun 14, 1:28 am, arun <mailtosa...@gmail.com> wrote:
> Hi,
> I have a tiff image of the dimesion 3000 x 3000 which is actually a
> gray scale image.I want to calculate the amount of soil,water and air
> present in the image.I tried using histogram to apply threshold but
> its not working fine.Can anyone suggest me how to do it.I am an
> invoice so any help would be appreciated.Below is the code which i
> have used.
>
> nPixels = n_elements(rotateImg)
>
soilSubscripts = where(rotateImg ge 24000and rotateImg lt 30000,
~~syntax error?
> nSoilPixels)
>
> percentSoil = float(nSoilPixels) / nPixels
>
> waterSubscripts = where(rotateImg ge 18000 and rotateImg lt 23000,
> nWaterPixels)
>
> percentWater = float(nWaterPixels) / nPixels
>
> PRINT, percentSoil
> PRINT, percentWater
>
> With Regards
> Arun
|
|
|
|
|
Re: Image proceesing in IDL [message #60806 is a reply to message #60805] |
Fri, 13 June 2008 10:44   |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On Jun 13, 12:28 pm, arun <mailtosa...@gmail.com> wrote:
> Hi,
> I have a tiff image of the dimesion 3000 x 3000 which is actually a
> gray scale image.I want to calculate the amount of soil,water and air
> present in the image.I tried using histogram to apply threshold but
> its not working fine.Can anyone suggest me how to do it.I am an
> invoice so any help would be appreciated.Below is the code which i
> have used.
>
> nPixels = n_elements(rotateImg)
>
> soilSubscripts = where(rotateImg ge 24000and rotateImg lt 30000,
> nSoilPixels)
>
> percentSoil = float(nSoilPixels) / nPixels
>
> waterSubscripts = where(rotateImg ge 18000 and rotateImg lt 23000,
> nWaterPixels)
>
> percentWater = float(nWaterPixels) / nPixels
>
> PRINT, percentSoil
> PRINT, percentWater
>
> With Regards
> Arun
Looks fine to me - what does 'its not working fine.' mean, exactly?
|
|
|
Re: Image proceesing in IDL [message #60898 is a reply to message #60806] |
Mon, 16 June 2008 11:07  |
arun
Messages: 6 Registered: June 2008
|
Junior Member |
|
|
Hi Vince,
The histogram contains 2 peaks of the same size.SO the result
has to be 50% each.But the output is as follows.....
Soil Percent = 0.140934
Water percent = 0.140398
I want to know is there any method to calculate themfrom histogram
Thanks & Regards
Arun
|
|
|