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

Home » Public Forums » archive » Identifying tags within a region
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Identifying tags within a region [message #94130 is a reply to message #94115] Mon, 23 January 2017 02:29 Go to previous messageGo to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On Friday, 20.01.2017 17:23 Alice wrote:
> On Friday, 20 January 2017 17:11:34 UTC+1, Markus Schmassmann wrote:
>> On 01/20/2017 04:29 PM, Alice wrote:
>>> Does anyone know how to retrieve the tags in a chosen region?
>>> Using where condition I chose pixels (ref_ppix) that satisfy a certain condition.
>>> This region have multiple number tags starting from 1.
>>> The command I used is:
>>> loc_p = where(id_chk[ref_ppix] gt 0)
>>>
>>> Here, ref_ppix comes from one image and I collect loc_p in a different image id_chk, which returns locations that have tag > 0.
>>>
>>> I want to know how many tags are there and the method to get those tags.
>>>
>>> Any help would be appreciated.
>> I'm not sure I understand what you want to do, but if I do, LABEL_REGION
>> might be what you are looking for.
>>
>> http://www.harrisgeospatial.com/docs/LABEL_REGION.html
> I have two images that I already labelled with numbers.
> Now, I chose a small region from image1 and want to get the tags in image2 that share the same spatial locations.
assuming labels1 & labels2 are arrays with unsigned integers
containing the labels for image1 & image2 respectively,
furthermore assuming these images have the same dimensions, I would try
something like this:

h1=histogram(labels1,min=0,reverse_indices=ri1)
max1=max(labels1)
nlabels=ulong(max1)
p1=ptrarr(max1,/allocate_heap)
for i=0,max1 do begin
thisLabels=labels2[r1[r1[i]:r[i+1]-1]]
u=uniq(thisLabels,sort(thisLabels))
nlabels[i]=n_elements(u)-(u[0] eq 0)
*p1[i]=u[(u[0] eq 0):-1]
endfor

This code is untested, if it does not work and you don't find the bug
yourself, pleas send me some sample data, then I can do some debugging.

Good Luck, Markus
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: VELOVECT Procedure
Next Topic: GDL 0.9.7 delivered

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

Current Time: Wed Oct 08 19:29:27 PDT 2025

Total time taken to generate the page: 0.00461 seconds