comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » finding boundary in image having multiple region of interest
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
finding boundary in image having multiple region of interest [message #93586] Mon, 29 August 2016 23:07 Go to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
Hi all,
I need to select roi having combined pixel area above 3493pixels and intensity above 1.25.

I tried using find_boundary which gives the pixel area for pixels above the threshold for one roi that we give as input. But in one image I have multiple rois to be selected. so find_boundary will not work.

I have several images like this.

So do anyone have any idea to do this.

The threshold should be the intensity should be more than 1.25 and the combined pixel area should be greater than 3493 pixels.

thanks
Re: finding boundary in image having multiple region of interest [message #93587 is a reply to message #93586] Tue, 30 August 2016 01:52 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, August 30, 2016 at 8:07:48 AM UTC+2, sin wrote:
> Hi all,
> I need to select roi having combined pixel area above 3493pixels and intensity above 1.25.
>
> I tried using find_boundary which gives the pixel area for pixels above the threshold for one roi that we give as input. But in one image I have multiple rois to be selected. so find_boundary will not work.
>
> I have several images like this.
>
> So do anyone have any idea to do this.
>
> The threshold should be the intensity should be more than 1.25 and the combined pixel area should be greater than 3493 pixels.
>
> thanks

Hi,
I don't understand why you tried find boundary. But I think what you're looking for is a combination of "greater then" and label_region.

subImage = myImage gt 1.25
lr = label_region(subImage)

then use histogram to identify the regions and look for the one's with more than 3493 pixels. In case of doubt, follow the example given for label_region:
http://www.harrisgeospatial.com/docs/LABEL_REGION.html

Here is what is of interest for you:

h = histogram(lr, REVERSE_INDICES=r)

; Print the mean and standard deviation of each region
FOR i=0, N_ELEMENTS(h)-1 DO if h[i] gt 3493 then $
PRINT, 'This region ', i, ', has a population greater than 3493 and has = ', h[i], $
', elements. The indices of this region are between ', r[i],' and ', r[i+1]-1

I hope this helps.

Cheers,
Helder
Re: finding boundary in image having multiple region of interest [message #93589 is a reply to message #93587] Tue, 30 August 2016 23:21 Go to previous messageGo to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Tuesday, August 30, 2016 at 2:22:18 PM UTC+5:30, Helder wrote:
> On Tuesday, August 30, 2016 at 8:07:48 AM UTC+2, sin wrote:
>> Hi all,
>> I need to select roi having combined pixel area above 3493pixels and intensity above 1.25.
>>
>> I tried using find_boundary which gives the pixel area for pixels above the threshold for one roi that we give as input. But in one image I have multiple rois to be selected. so find_boundary will not work.
>>
>> I have several images like this.
>>
>> So do anyone have any idea to do this.
>>
>> The threshold should be the intensity should be more than 1.25 and the combined pixel area should be greater than 3493 pixels.
>>
>> thanks
>
> Hi,
> I don't understand why you tried find boundary. But I think what you're looking for is a combination of "greater then" and label_region.
>
> subImage = myImage gt 1.25
> lr = label_region(subImage)
>
> then use histogram to identify the regions and look for the one's with more than 3493 pixels. In case of doubt, follow the example given for label_region:
> http://www.harrisgeospatial.com/docs/LABEL_REGION.html
>
> Here is what is of interest for you:
>
> h = histogram(lr, REVERSE_INDICES=r)
>
> ; Print the mean and standard deviation of each region
> FOR i=0, N_ELEMENTS(h)-1 DO if h[i] gt 3493 then $
> PRINT, 'This region ', i, ', has a population greater than 3493 and has = ', h[i], $
> ', elements. The indices of this region are between ', r[i],' and ', r[i+1]-1
>
> I hope this helps.
>
> Cheers,
> Helder

Thanks a lot helder, it is very helpful.
But I couldnt understand how to get array x,y coordinates from the indices r(i).
can i use array_indices for this purpose.
I tried but i am not sure whether it is correct or not.

thanks
Re: finding boundary in image having multiple region of interest [message #93590 is a reply to message #93589] Wed, 31 August 2016 02:37 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I can't tell if what you did is correct or not, but if you want to convert one-dimensional subscript to two dimensional, then array_indices is the way to go.
For some examples, to learn how to use it, have a look at the help pages:
http://www.harrisgeospatial.com/docs/ARRAY_INDICES.html

I also think that the label_region page has an example on how to use the reverse_indices of the histogram function to retrieve one-dimensional subscripts:
http://www.harrisgeospatial.com/docs/LABEL_REGION.html
I think the last line of the example is the most important one:
img[r[r[i]:r[i+1]-1]]

The histogram function help page also has some more info on how to use the reverse indices:
http://www.harrisgeospatial.com/docs/histogram.html

Good luck,
Helder


On Wednesday, August 31, 2016 at 8:21:46 AM UTC+2, sin wrote:
> On Tuesday, August 30, 2016 at 2:22:18 PM UTC+5:30, Helder wrote:
>> On Tuesday, August 30, 2016 at 8:07:48 AM UTC+2, sin wrote:
>>> Hi all,
>>> I need to select roi having combined pixel area above 3493pixels and intensity above 1.25.
>>>
>>> I tried using find_boundary which gives the pixel area for pixels above the threshold for one roi that we give as input. But in one image I have multiple rois to be selected. so find_boundary will not work.
>>>
>>> I have several images like this.
>>>
>>> So do anyone have any idea to do this.
>>>
>>> The threshold should be the intensity should be more than 1.25 and the combined pixel area should be greater than 3493 pixels.
>>>
>>> thanks
>>
>> Hi,
>> I don't understand why you tried find boundary. But I think what you're looking for is a combination of "greater then" and label_region.
>>
>> subImage = myImage gt 1.25
>> lr = label_region(subImage)
>>
>> then use histogram to identify the regions and look for the one's with more than 3493 pixels. In case of doubt, follow the example given for label_region:
>> http://www.harrisgeospatial.com/docs/LABEL_REGION.html
>>
>> Here is what is of interest for you:
>>
>> h = histogram(lr, REVERSE_INDICES=r)
>>
>> ; Print the mean and standard deviation of each region
>> FOR i=0, N_ELEMENTS(h)-1 DO if h[i] gt 3493 then $
>> PRINT, 'This region ', i, ', has a population greater than 3493 and has = ', h[i], $
>> ', elements. The indices of this region are between ', r[i],' and ', r[i+1]-1
>>
>> I hope this helps.
>>
>> Cheers,
>> Helder
>
> Thanks a lot helder, it is very helpful.
> But I couldnt understand how to get array x,y coordinates from the indices r(i).
> can i use array_indices for this purpose.
> I tried but i am not sure whether it is correct or not.
>
> thanks
Re: finding boundary in image having multiple region of interest [message #93591 is a reply to message #93590] Wed, 31 August 2016 03:46 Go to previous message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Wednesday, August 31, 2016 at 3:07:14 PM UTC+5:30, Helder wrote:
> Hi,
> I can't tell if what you did is correct or not, but if you want to convert one-dimensional subscript to two dimensional, then array_indices is the way to go.
> For some examples, to learn how to use it, have a look at the help pages:
> http://www.harrisgeospatial.com/docs/ARRAY_INDICES.html
>
> I also think that the label_region page has an example on how to use the reverse_indices of the histogram function to retrieve one-dimensional subscripts:
> http://www.harrisgeospatial.com/docs/LABEL_REGION.html
> I think the last line of the example is the most important one:
> img[r[r[i]:r[i+1]-1]]
>
> The histogram function help page also has some more info on how to use the reverse indices:
> http://www.harrisgeospatial.com/docs/histogram.html
>
> Good luck,
> Helder
>
>
> On Wednesday, August 31, 2016 at 8:21:46 AM UTC+2, sin wrote:
>> On Tuesday, August 30, 2016 at 2:22:18 PM UTC+5:30, Helder wrote:
>>> On Tuesday, August 30, 2016 at 8:07:48 AM UTC+2, sin wrote:
>>>> Hi all,
>>>> I need to select roi having combined pixel area above 3493pixels and intensity above 1.25.
>>>>
>>>> I tried using find_boundary which gives the pixel area for pixels above the threshold for one roi that we give as input. But in one image I have multiple rois to be selected. so find_boundary will not work.
>>>>
>>>> I have several images like this.
>>>>
>>>> So do anyone have any idea to do this.
>>>>
>>>> The threshold should be the intensity should be more than 1.25 and the combined pixel area should be greater than 3493 pixels.
>>>>
>>>> thanks
>>>
>>> Hi,
>>> I don't understand why you tried find boundary. But I think what you're looking for is a combination of "greater then" and label_region.
>>>
>>> subImage = myImage gt 1.25
>>> lr = label_region(subImage)
>>>
>>> then use histogram to identify the regions and look for the one's with more than 3493 pixels. In case of doubt, follow the example given for label_region:
>>> http://www.harrisgeospatial.com/docs/LABEL_REGION.html
>>>
>>> Here is what is of interest for you:
>>>
>>> h = histogram(lr, REVERSE_INDICES=r)
>>>
>>> ; Print the mean and standard deviation of each region
>>> FOR i=0, N_ELEMENTS(h)-1 DO if h[i] gt 3493 then $
>>> PRINT, 'This region ', i, ', has a population greater than 3493 and has = ', h[i], $
>>> ', elements. The indices of this region are between ', r[i],' and ', r[i+1]-1
>>>
>>> I hope this helps.
>>>
>>> Cheers,
>>> Helder
>>
>> Thanks a lot helder, it is very helpful.
>> But I couldnt understand how to get array x,y coordinates from the indices r(i).
>> can i use array_indices for this purpose.
>> I tried but i am not sure whether it is correct or not.
>>
>> thanks

Thanks a lot helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: installing IDL 8.5.1 on Ubuntu 16.04
Next Topic: Band Math

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:39:55 PDT 2025

Total time taken to generate the page: 0.00392 seconds