ME 423 Object Tracking Using Imaging Processing

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

V.

Kartik
IIT Bombay

ME 423 Machine Design


Object Tracking using Image Processing

The objective of this activity is to track a small object in a video using simple image processing
methods. ‘Tracking’ here refers to obtaining the instantaneous X and Y coordinates of the
object with respect to a fixed point (the ‘origin’, that is generally fixed/stationary). Knowing
the above at several time instants, relations between certain input and output parameters can be
obtained.

Basics of Image Processing


Any video is a sequence of images (frames) played at a time interval of 1/frame rate. Here, the
‘frame rate’ of the video is defined as the number of frames played over a time duration of one
second. It is expressed as ‘frames per second’ or FPS. Each image/frame is comprised of a
number of pixels. The image’s quality (or ‘ resolution’) is generally described in PPI or parts
(or pixels) per inch. Higher the resolution, larger the number of pixels in the image, and higher
the quality of the image.

Any colour can be expressed as a combination of three basic colours, viz., Red, Green and
Blue. The intensity of any of these colours is commonly expressed as an RGB value. A single
pixel is defined by a set of RGB values and its location from a known (typically, top-left corner)
location within the image. The most common way of expressing RGB values is in terms of
resolution in 8-bits for each colour, giving 24-bit resolution in total. This provides 28 or 256
possible values for each one of Red, Green and Blue. The values taken generally are from 0-
255.

Application to the Impact Testing Setup


Figure 1 shows a general (home-made!) setup for impact testing of a specimen, in order to
determine its ‘toughness’. In the setup shown, the specimen (here, chalk) is firmly held with
a pair of pliers, and an iron block is used as a pendulum mass.
V. Kartik
IIT Bombay

Fig. 1: Impact Testing setup

As shown in Fig. 2, the pendulum mass is released from height ℎ! and it rises to height ℎ"
after impacting the specimen. Here, ℎ! and ℎ" are measured with reference to the bottom
most position of the pendulum mass.

Fig. 2: Working principle for impact testing.

The size of the feature (or attached marker) on the pendulum mass should be appropriate
(neither too large, nor too small) so as to track the position correctly. Also, a sufficient distance
should be maintained between the camera and the setup in order to minimize the parallax error.
V. Kartik
IIT Bombay

A Simple Image Processing Code and Exercise

A sample video Red_laser.avi is provided, alongwith a MATLAB code Red_laser_trace.m.


Go through the code and understand how an object (here, a red dot from a laser) can be traced
using simple image processing. The output video BW_Tracing_laser.mp4 (obtained using
this code) is also provided for reference. You may need to go through the following
functions in MATLAB in order to properly understand the code:
• imshow()
• imtool()
• imcrop()
• imfill()
• im2bw()
• rgb2gray()
• imguidedfilter()
• find()

Note that a scale factor needs to be applied in the code in order to convert pixel data (from
your video) into (actual) length data in engineering units (such as mm).
𝐴𝑐𝑡𝑢𝑎𝑙 𝑙𝑒𝑛𝑔𝑡ℎ 𝑖𝑛 𝑚𝑚
𝑆𝑐𝑎𝑙𝑒 =
𝐿𝑒𝑛𝑔𝑡ℎ 𝑖𝑛 𝑝𝑖𝑥𝑒𝑙𝑠

You might also like