[Insight-users] Image processing question

Luis Ibanez luis.ibanez@kitware.com
Tue, 04 Feb 2003 19:04:04 -0500


Hi Steve,

The processing pipeline that you describe
can be easily configured with ITK.

As you pointed out, the only  tricky
part is the computation of moments.
Moment computation is implemented in ITK
as a Calculator, not as an ImageFilter.
This means that you don't have update
calls in a pipeline.

The calculator class is described in:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageMomentsCalculator.html

So, at this point you would have to update
the last filter (thresholding) and then
take the output to be passed to the
Calculator.

About the real-time issue there is room
for some discussion. Usually by real time
we understand: "very fast" as opossed to
a synchronous process.

There is a demo application you may want to
take a look at. It combines VTK with ITK
to take advantage of the MatroxVideoSource
class of VTK.

This class gets an image from a frame grabber,
(which digitalizes the camera input). The
output image is converted to an ITK image.

You could add your pipeline at the output
of the VTK-ITK adaptor.

The demo-application in question is in

    Insight/Applications/MatroxInput

The only way to be sure about the frame-rate
is to run a couple of tries... Note that
you will have to run in demand-mode since
ITK and VTK pipelines are output-driven as
opposed to triggered by input.

If there are several objects to track in the
same image, you may want to go rather with
the itkSpatialObject and perform registration
between two itkEllipseSpatialObjects and the
thresholded image.

Julien Jomier added recently an example that
explains how to do this.  In your case, infact
you may want to skip the thresholding since
for registration is more useful to have the
blurred input image, this extends the capture
radius of the optimization.

The example can be found in

Insight/Examples/Registration/ModelToImageRegistration1.cxx

And is dicussed in the SoftwareGuide.pdf

http://www.itk.org/ItkSoftwareGuide.pdf

Section 7.14 on pdf-page 224

----

The more traditional approach for tracking,
as you probably know, is KalmanFiltering.

There is a KalmanLinearEstimator in ITK
http://www.itk.org/Insight/Doxygen/html/classitk_1_1KalmanLinearEstimator.html

It is actually one of the oldest classes in the
toolkit. You could use it to dynamically estimate
an initial position for the registration process
on each new frame based on the positions of previous
frames. This will account for compensating the speed
of the balls-targets on the video image.

Curiously your question is quite relevant to medical
applications since this is the typical configuration
of an image guided surgery system. E.g tracking a
needle for doing biopsies.

---

Please let us know if you have further questions,

Thanks

   Luis

---------------------------------------------
Steve Boyd wrote:
> Hello,
> 
> I'm just getting started with ITK and would like to use the toolkit to
> process image data in real time.  I was hoping I could get feedback on
> whether ITK is suitable for my task (I think it is), and any feedback on
> my methodology.   
> 
> The task, in short, is to use video to track the position of a ball
> rolling across the floor. My pipeline should look something like this I
> think:
> 
> [ImageSource] -> 
> [SubtrackImageFilter (to subtract the background image without a ball)]
> -> 
> [DiscreteGaussianImageFilter (smoothing -- maybe not necessary)] -> 
> [BinaryThresholdImageFilter (extract the ball image)] -> 
> [Calculate COM (centre of mass of ball image)] -> (output xy image
> coords of ball COM)
> 
> All the filters are available in ITK it seems, with the exception of
> [Calculate Centre of Mass], correct?  I'll write that filter if it
> doesn't exist already.
> 
> There are two issues that I'm concerned about: 
> (1) the capability to do this in real-time (streaming 30 frames/s, 1MB
> B/W images). 
> (2) if there were two or more balls could they each be tracked
> independently? (would require calculating COM for each ball!?!).
> 
> If anybody has any pointers, caveats, suggestions it would be very much
> appreciated.  It's my first stab at real-time image processing...
> 
> Sincerely,
> 
> Steve
> 
> 
> 
>