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

Home » Public Forums » archive » Re: label_region tracking queries
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
Re: label_region tracking queries [message #55364] Fri, 17 August 2007 07:06
id6684 is currently offline  id6684
Messages: 3
Registered: August 2007
Junior Member
excellent. I have read much about the boundary problems in the past
few hours, and hope to be learning fast. The above fit_ellipse code
looks ideal once I get some real time in calculating the rest, must
have missed this before. Response was much appreciated,

OtherDavid.
Re: label_region tracking queries [message #55365 is a reply to message #55364] Fri, 17 August 2007 06:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
id6684@googlemail.com writes:

> I am essentially looking at isolating structures within a series of
> images, with a goal of tracking/recording their movement. Having
> perfromed various kinds of filtering, I've settled on the initial
> isolation method and am using Label _regions (without, I admit, fully
> understanding all of the steps - I have but a basic idea of
> morphology) and would like to know if there's any way to plot
> individually the regions that label_region isolates?

First of all, if you work with LABEL_REGION you need to know
there are problems at its boundary. Typically, we fix this by
adding a border around the image, often like this:

s = Size(image, /Dimensions)
border = BytArr(s[0]+2, s[1]+2) + MIN(image)
border[1,1] = image

Then, you can find your regions:

regions = LABEL_REGION(border)

Now, regions is a two dimensional array, with each region
labeled with a unique number (or identifier, if you like).
Suppose you were interested in the 10th one of those, you could
look at it in isolation like this:

indices = Where(regions EQ 9)
isolated = BytArr(s[0]+2, s[1]+2)
isolated[indices] = 255B
TV, isolated

Or, you could look at it in the context of your real
image, by doing something like this:

real = BytArr(s[0]+2, s[1]+2)
real[1,1] = image
real = BytScl(Temporary(real), Top=254)
real[indices] = 255B
LOADCT, 0, NCOLORS=254
TVLCT, 255, 255, 0, 255 ; Yellow color
TVImage, real, /TV

> As well as this, a quick piece of code that may assume that a region
> in image one is the same as a region in the next image if it lies
> within a certain size/location of the original? I see this being easy
> if I work out how to display the individual regions and calculate
> their vector distance from the origin.

You will have to work this out for yourself. You can find code
on my web page to help you identify and characterize your "blob".
For example, you can track the centroid, find out if it is rotating
and translating, etc. You will probably have to be creative in how
you locate and identify the same blob in subsequent images. It will
depend on your data, etc.

http://www.dfanning.com/ip_tips/fit_ellipse.html

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Thank you Devin! I am one step closer now!!!
Next Topic: Re: how to study IDL?

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

Current Time: Thu Oct 09 20:02:55 PDT 2025

Total time taken to generate the page: 0.64087 seconds