[Insight-users] Re: Initial Level : Tracking motion in video sequences & GeodesicActiveContours.

Luis Ibanez luis.ibanez at kitware.com
Tue, 27 Apr 2004 15:28:02 -0400


Hi Jayant,


The BinaryMedianFilter will fill in holes that are
surrounding by a larger number of "On" pixels.
Therefore it depends on how large you select the
neighborhood of the filter to be.

You can also use Mathematical Morphology operations
such as closening (dilation + erosion), but again,
you must use structuring element that are comparable
in size to the radius of the holes in the mask.

Using GAC for filling in the mask may be an overkill,
but... it is up to you to evaluate if speed is a
concern for your application or not. Math.Morphology
should be more efficient.


2) A mask with a rough estimate should be ok for the
    LevelSet method. What you want to avoid is to use
    masks that are so far from the object that end up
    being closer to other objects in the scene. If the
    mask is going too far, simply apply morphological
    Erosion on it.


3) For a description of the Sigmoid filter parameters,
    please read the LevelSet Chapter on the SoftwareGuide.
    The use of the Sigmoid is explained there in detail.
    There is also a section on the Sigmoid filter under
    the Filtering chapter.



4)  There are many ways of using Level Sets.
     Note that if you use the mask filled image as the
     initial level set, the original image I(t) (the most
     recent frame) is *not* the feature image. The feature
     image is the Sigmoid of the Gradient Magnitude of I(t).

     The feature image should have low values in the edges
     and high values on the regions that you want to be the
     interior of the objects. Please look at the figures in
     the LevelSet chapter in the SoftwareGuide.

     You don't wnat to use the initial level set for constructing
     the feature image. That will be a circular definition.
     The feature image should contain information about the
     shape that you are targeting.



5) You can just carry the binary version of your application
    into the new computer. There is no need for you to install
    ITK over there. I assume that you are going to a similar
    operating system,  aren't you ?




Regards,


     Luis



---------------------
Jayant Chauhan wrote:

> 
> 
> 
> 
> Hi Luis,
> 
> You were right. It worked. But the BinaryMedianImageFilter did not work. 
> Even a radius of 5 was not enough to fill it and create the mask. I 
> created the mask by running GACLevelSet on the difference image first, 
> and then using the ThresholdFilter I got a rough estimage. Is that a 
> decent approach. ? As in, its quite a rough approximate, so will 
> Levelset work with this as the initial level set ??
> 
> Though when I use this initial level set on my Frame I(t), it gets stuck 
> on the some other edges outside (the small trees a lil far (2-3 pixels). 
> Anything that can be done about taht ??
> 
> 3) Could you please explain as to what alpha and beta are in the sigmoid 
> filter, since I think they play a very crucial role in determining the 
> convergence (as a matter of fact, they determine whether we will get 
> correct results or not ). If you could explain them to me, maybe I could 
> work on some math, so as to figure out dynamically for any image as to 
> what values to be used.
> 
> 4) THis one is a funny one. Are these 2 ways of usng LevelSet the same. 
> One is as you had said in the earlier mail that I use the binarized form 
> of filled difference image as the initial level set and the feature 
> image as I(t). Now is this the same as have the speed function as given 
> in the image attached along with this mail, and the initial level set 
> being either the difference image or some thing else containing the 
> difference image ?? In a way, is the initial level set also a part of 
> the speed function in the differential equation of the form d(u)/dt = 
> -F.|nabla(u)|
> 
> 5) Is there anyway I can minimize the installation of ITK on a new 
> computer where I just want to run this code of mine, since I would have 
> to run this in my lab, where I have to show these results, and dont have 
> enough permissions plus disk quota to install ITK ?? If not, I will have 
> to ask the admin to install ITK on one of the computers
> 
>  
> 
> with regards
> 
> Yours Sincerely
> 
> Jayant Chauhan
> 
> 
> 
>  
> 
>  >From: Luis Ibanez <luis.ibanez at kitware.com>
>  >To: Jayant Chauhan <gripened at hotmail.com>
>  >CC: "'insight-users at itk.org'" <insight-users at itk.org>
>  >Subject: Re: [Insight-users] Re: Initial Level : Tracking motion in 
> video sequences & GeodesicActiveContours.
>  >Date: Sat, 24 Apr 2004 20:09:42 -0400
>  >
>  >
>  >Hi Jayant,
>  >
>  >You probably want to combine both the information from
>  >the difference image and the original images.
>  >
>  >For example, in order to generate a mask for the subject
>  >that is walking in the scene, you could take the current
>  >binarization of the difference image and perform on it
>  >morphological operations in order to fill the inside.
>  >Note that a filter such as the BinaryMedianImageFilter
>  >http://www.itk.org/Insight/Doxygen/html/classitk_1_1BinaryMedianImageFilter.html
>  >will produce a similar effect, and probably much faster,
>  >specially if you use masks on the order of 5 pixels wide.
>  >
>  >One great advantage in your case is that the mask that you
>  >provide to the GAC level set filter doesn't have to be perfect,
>  >a rough initialization around the object is enought.
>  >
>  >The speed image should be computed from the *most*
>  >recent image in the sequence. Not from the difference
>  >image.  The goal in the speed image is to capture the edges
>  >from the image to which you want to fit the contour
>  >implicitly represented by the level set.
>  >
>  >So, if you have two images
>  >
>  >    Ai          Ai+1
>  >
>  >and their differnce   Di = Ai+1  - Ai
>  >
>  >you can generate a level set  Li = Median( Di )
>  >and feed it as input to the GAC.
>  >
>  >The speed image will be
>  >
>  >  Si = Sigmoid( GradientMagnitude(  Ai+1 ) )
>  >
>  >This speed image will be passed to the GAC filter.
>  >
>  >
>  >Note also that if you have a long sequece of A images,
>  >you only need to do the initailization of the level set
>  >for the first pair of images.  After that, you simply
>  >keep changing the Speed image by the speed image
>  >of the next A image in the series .
>  >
>  >The resulting level set of one pair will be used as
>  >the inital level set of the next pair.
>  >
>  >
>  >  Regards,
>  >
>  >
>  >     Luis
>  >
>  >
>  >-------------------------
>  >Jayant Chauhan wrote:
>  >
>  >>Hey Luis,
>  >>
>  >>Thanks for clarifying my blunder :)
>  >>
>  >>One last doubt regarding this. As you have said, I should not give
>  >>a contour but a region. But is that with reference to just the
>  >>initial level set or is even the feature image supposed to be like
>  >>that ? (as in, I was a bit confused by u asking me to " filling in
>  >>the inside of the figure that you define as the object" ). Because
>  >>I dont have any prior knowledge of the object, only the difference
>  >>image. So is it just the init level set that you meant, as in a
>  >>solid rectangle instead of just the rectangular mesh ???
>  >>
>  >>with regards
>  >>
>  >>Jayant Chauhan
>  >>
>  >>
>  >>
>  >
>  >
>  >
>  >_______________________________________________
>  >Insight-users mailing list
>  >Insight-users at itk.org
>  >http://www.itk.org/mailman/listinfo/insight-users
> 
> ------------------------------------------------------------------------
> BharatMatrimony.com. ? The No 1 Indian matrimony. 
> <http://g.msn.com/8HMBENIN/2740??PS=>
> ------------------------------------------------------------------------
>