[Insight-users] Motion Estimation, urgent help
Luis Ibanez
luis.ibanez at kitware.com
Sun, 11 Apr 2004 16:40:32 -0400
Hi Jayant,
ITK uses Doxygen for documenting all the classes.
The first place to look for functionalities that
you need in ITK is the web page with the alphabetical
list of all the classes. You may want to bookmark this
page:
http://www.itk.org/Insight/Doxygen/html/classes.html
1) Image subtraction can be done with the SubtractImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1SubtractImageFilter.html
2) I don't clearly see why you want to compute the Gaussian
mixture model of the difference image... but if you think
that you need it, you could take advantage of the
Statistical framework in ITK. You will find a built in
set of classes that can be used for computing a Gaussian
Mixture Model. Please look at Chapter 10 of the SoftwareGuide.
3) ...I'm not sure this is necessary....
are you just trying to improve signal/noise ratio ?
4) Your initial level set cannot be just an image set
to 255. You should provide an image with positive
and negative values, where the zero crossing represents
the initial shape. Note that if you initialize this
too far from the edges of the real moving object, it
will take a long time for the zero set to move and
reach the edges of the object. This may be too slow
for a motion tracking application.
If there is an object moving in between two frames,
the differnce image will only show high intensities
in the "front" and "back" of the object. If you take
this as an initial level set, you will have a contour
that goes "around" the front and another contour that
goes "around" that back of the moving object.
5) To get a contour around the area of the moving object
you really need to perform some sort of segmentation.
Do you have any apriori knowledge of the objects moving
in the scene ? That will help a lot in the process of
segmentation.
6) Yeap, that's the idea. If you succed to fit a zero set
to one of the frames, then you can use it as the initial
level set for the next frame, and let the PDE solver
compute the evolution of the level set until it fits to
the next frame.
7) for building the speed function we typically use Sigmoids
of the gradient magnitude computed from the input image.
you could also use the Exponential. There are specific
filters for this in ITK, for example the
EdgePotentialImageFilter and the SigmoidImageFilter.
http://www.itk.org/Insight/Doxygen/html/classes.html
--
Before you go further. Please take the time of reading
the LevelSet chapter on the SoftwareGuide and get familiar
with the ITK implementation. Running some of the examples
will help you on this. Note also that there are many
LevelSet demo applications in the CVS InsightApplications
checkout.
Regards,
Luis
----------------------
Jayant Chauhan wrote:
> Thank you Luis for the thoroughly detailed reply. I
> surely got to know a lot more than I could have
> imagined. Got to know some other cool stuff aswell.
> Well the aim right now is just Motion detection,
> but surely we could add a few more abilities. I would
> be grateful if you could let me know if I got it
> right, just tell me where I am wrong. This is what I
> propose to do :
>
> 1) Find the difference image of 2 consecutive frames
> ( Is there a direct way of subtracting images, or do I
> have to use iterators for it ?? )
>
> 2) Then I model the difference image as a mixture of
> 2 Gaussian distributions, find the model parameters
> (which are just the a priori probabilities and the
> standard deviations, assuming zero mean).
>
> 3) get a better difference image using the
> distribution. Lets call this I_diff
>
> 4) Now I apply LEVEL set on this I_diff; so my initial
> levet is just an image with the boundaries being set
> at 255 and everything else as 0. ie, a rectangle as
> the initial level set.??!!! (Is this correct ? )
>
> 5) From set 4 I get phi(X,T). To get the contour about
> the moving area (union of the moving object of the 2
> frames) I use itk::ZeroCrossingImageFilter ?? (AM I
> correct ? )
> 6) Then I use this contour is my initial level set and
> apply level set method again on the first frame. So
> now I have the contour about the exact object
> boundaries .
>
> Now I wanted to unify step 4,5 and 6. As in modify my
> speed function, which depends both on the difference
> image and the first frame.
>
> I am sending you as attachment the speed function that
> I have, where "g" is a monotonically decreasing
> function, could be sigmoid etc. Also the form of my
> level set equation.
> Could you please let me know how to do this.
>
> Thanking you in advance
>
> with regards
> Yours Sincerely
> Jayant Chauhan
>
> --- Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>>Hi Jayant,
>>
>>The only LevelSet filter in ITK that requires
>>seed points is the FastMarching ImageFilter.
>>
>>ShapeDetection and GeodesicActiveContours
>>use an initial level set. (The examples in
>>the software guide use a FastMarching filter
>>in order to provide this initialization, but
>>this is just one among many possible options.)
>>
>>CannyEdgeDetectionLevelSet uses an input
>>image and computes from it the Canny edges
>>then attracts the zero set to the Canny edges.
>>
>>ThresholdLevelSet use two thresholds to binarize
>>an input image and then use the edges as attractors
>>for the zero set.
>>
>>Do you need this motion tracking to go fast ?
>>let's say at video rates ? 30Hz ?, 10 Hz ?
>>
>>
>>How big are your images ?
>>regular video like 640 x 480 ?
>>
>>If you do an initial segmentation in one of the
>>first frames, you could take advantage of the
>>fact that most ITK level set filters use narrow
>>banding and therefore you could use the current
>>narrow band after convergence in one image in
>>order to follow to the next frame. Then use the
>>evolution of the Narrow band as output of the
>>motion estimation.
>>
>>You could also modify the DemonsDeformable
>>registration in order to compute displacement
>>vectors between two consecutive frames. Demons
>>is based on the concept of optical flow that is
>>commonly used in motion tracking and video
>>compression. Note that this may require some
>>programming effort on your part.
>>
>>Do you know the shape of the object that you expect
>>to track ? or is this just a motion detection
>>system like the ones used for tele-surveillance ?
>>
>>If you know something about the shapes of the moving
>>objects you could also explore the use of
>>SpatialObjects
>>to-Image registration, since by registering a
>>SpatialObject shape to the subject that you want
>>to track as seen in the first frame, you could then
>>use this position as initialization for registering
>>the same shape against frame 2, then the resulting
>>value will be used for registering againg frame 3
>>and so on. The SpatialObject registration will
>>probably be the fastest option (at run time) since
>>a minimum number of image pixels need to be probed.
>>Note that this technique has been used in ITK for
>>image guided surgery.
>>
>>
>>Regards,
>>
>>
>> Luis
>>
>>
>>----------------------
>>Jayant Chauhan wrote:
>>
>>
>>>Hey Fellas
>>>I am working on a project on Motion estimation and
>>
>>tracking, following
>>
>>>the works of Nikos Paragios and Denise Ritchie,
>>
>>using Geodesic Active
>>
>>>Regions and Level Set Methods. Has anyone worked
>>
>>on this ??!! Please let
>>
>>>me know. My problem is that, since we have a
>>
>>sequence of frames, we use
>>
>>>the difference image between 2 consecutive frames,
>>
>>and start of with the
>>
>>>initial contour to be the image boundary, and we
>>
>>propagate it inwards
>>
>>>bla...bla...blah. As in chapter 9 of ITK guide,
>>
>>all implemented filters
>>
>>>need seed points. But in my case we have to do
>>
>>without the seed points,
>>
>>>they are not required. Also my speed function is a
>>
>>funtion of the
>>
>>>curvature as well as the gradient of the
>>
>>difference image. Can anyone
>>
>>>please help me out with it, I am completely new
>>>with ITK.
>>>
>>>I have to implement this and not much time, most
>>
>>time spent of the
>>
>>>mathematics and formulating a scheme of my own.
>>>
>>>with regards
>>>
>>>Jayant Chauhan
>>>
>>>
>>
> _________________________________________________________________
>
>>>Buzz on your screen! Download on your screen.
>>>http://www.msn.co.in/Download/screensaver/ Keep
>>
>>yourself smiling!
>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
>
>
> ------------------------------------------------------------------------
>