## Target Tracking Using Matlab Image Processing Toolbox

I started working on this algorithm in 2006 whenever I found a minute. here are the results coming from my program.

I have to personally thank Don Orofino from Mathworks who helped me a lot. I have put one of his emails on this page he completely explains how to write such a system. the original code is in MATLAB 7.

[this page contains some ActiveX video that might not run on IE unless you unblock the content]

### Some Image Processing Tips (originally written by Don Orofino )

Your approach will depend on the resolution of the image sequence, the quality of the frames (eg, "can you see the mouse pixels clearly?"), if there's any change of lighting over time within the images, etc.  You might also have motion of the mouse competing with motion of other parts of the video image.  If the ONLY OBJECT moving in the image sequences is the mouse, and ALL other things are simple/constant, then this may not be difficult.  Otherwise, it's still possible, but harder.  Here are some basic phases of tracking that will help you get started.

MOTION ESTIMATION
Compute an image in which just the mouse motion appears.  Try absolute differences: take two successive image frames, subtract them, take the absolute value, then look at the resulting image.  Do the difference pixels "make sense"?  Do they correspond to the mouse motion only?  If not, can you compute/filter/transform things to get there?

You may need to content with image artifacts: the detection will not likely give you a single pixel point that is the mouse.  It will give you a noisy, blob-like region.  You may need to use morphological operations in image toolbox, such as dilation and erosion, to fill gaps in the detected pixels, enlarge them, then thin them down, until simple, small, full regions are produced.  This helps the next phase.

DETECTION
Now you must "find" the blobs.  Blob analysis is actually the name of this step, and image toolbox includes a few algorithms to help you do this.  Make sure the mouse motion can be extracted as a "blob" of some sort.

ASSOCIATION
From one motion frame to the next, can you link the mouse-blobs from one frame to the next?  If there are no other parts of the image moving, \u003c/span\>\u003c/div\>",1] ); //--> this should be possible.  You might need to adjust your motion estimation or detection post-processing to clean up your track associations, especially if multiple objects are moving.

Here you might need to contend with motion that is much greater than the frame rate of image capture.  That is, the blob motion may be
significant from one frame to the next, and you may not be able to reconstruct the actual mouse path ... just the start and end of any one
segment of motion.

CALIBRATION/EXTRACTION
Depending on your need, you may need to adjust things, or compute other data from the track associations.  For example, you may want to compute velocity or acceleration of motion, or record an abstract sequence of motion, such as "the mouse went up, lingered, then moved right."  That requires deductions based on the tracked data.

Filtering, morphological operators, blob analysis, are all relevant. Often we use intensity/binary versions of an image to simplify the
computations significantly.