Skip to main content

Activity 12: Basic Video Processing

Hello! In this activity we will try to process a video of a kinematic event in order to extract information such as constants, frequencies, etc. For our group, we took a video of a 3D spring pendulum which we observed in one plane. We would like to trace its path and then try to determine its phase-space plot. The mass was covered in masking tape with the bottom colored red to facilitate easier segmentation.

The video was taken using a Canon D10 camera at frame rate of 30fps. 

Media 1. Video of the spring pendulum (first 50 frames only)

The frames of the video were then extracted using Avidemux 2.5. The mass was then segmented from each frame using parametric segmentation. The patch of the region of interest (ROI) used for color segmentation is shown in Figure 1.
Figure 1. Patch used to segment ROI 

Using morphological operations, particularly Open and Close operations, the segmented images were cleaned. The extracted frames for different observation time t and the corresponding segmented images are shown in Figure 2.

In order to ensure that there is only one blob and there are no more "dots" in the segmented  image, we filter all the images by size. From the area histogram (Figure 3) and by observation, the area of the blob of the mass is between 250 to 1000. Hence, we consider only those blobs that fall within this range.

Figure 3. Area histogram used to get size threshold for the blob of the mass
From the filtered images, we trace the position of the mass at different times by computing for the centroid. The plot in Figure 4 shows the track of the mass. The values for the y-component were negated so that it becomes easier to compare the track computed track with the images. The green and red dots represent the starting and end points, respectively. The mass follows an elliptical path which shifts over time.
 
Figure 4. Trajectory of the mass 

Now, we get the phase-space plot for both the x and y axes by taking the displacement for each axis and dividing it by the time interval dt (dt = 1f /30 fps). The phase space plots are for both axes are elliptic spirals as shown in Figure 5. However, the phase plot for the x component is noisier than that of the y component. 
(a) Phase space plot for motion along x
(b) Phase space plot for motion along y
Figure 5. Phase plots of motion along x and y

I give myself a grade of 9/10 for this activity because I am not very satisfied with what I have shown. I would like to thank my groupmates in doing the experiment, Ms. Aimee Rarugal and Mr. Benjur Emmanuel Borja.

References:
[1] M. Soriano, "Basic Video Processing", AP 186 Manual, 2012

Comments

Popular posts from this blog

Activity 10 Applications of Morphological Operation 3 of 3: Looping through images

When doing image-based measurements, we often want to separate the region of interest (ROI) from the background. One way to do this is by representing the ROIs as blobs. Binarizing the image using the optimum threshold obtained from the image histogram simplifies the task of segmenting the ROI. Usually, we want to examine or process several ROIs in one image. We solve this by looping through the subimages and processing each. The binarized images may be cleaned using morphological operations.  In this activity, we want to be able to distinguish simulated "normal cells" from simulated "cancer cells" by comparing their areas. We do this by taking the best estimate of the area of a "normal cell" and making it our reference.  Figure 1 shows a scanned image of scattered punched papers which we imagine to be cells examined under the microscope. These will be the "normal cells." Figure 1. Scattered punched paper digitized using flatbe...

Activity 2: SciLab basics

For the second activity we had a bit of practice in using the SciLab programming language. We had to produce the following synthetic images: a.        Centered square aperture b.       Sine wave along x direction (corrugated roof) c.        Grating along x direction d.       Annulus e.       Circular aperture with graded transparency (Gaussian function) But first we had to follow a sample code given by Dr. Soriano. The code produced a 100 x 100 pixel – image of a centered circular aperture with radius of 35 pixels (Figure 1). Figure 1. Code and synthetic image for centered circular aperture After doing the centered circular aperture I am ready to do the other synthetic images. The easiest was the annulus since you just have to tweak the code for the centered circular aperture. I just replaced line 7 of the code with: A(find(r...

Activity 11: Color image segmentation

In image segmentation, we want to segment or separate a region of interest (ROI) from the entire image. We usually do this to extract useful information or identify objects from the image. The segmentation is done based on the features unique to the ROI.  In this activity, we want to segment objects from the background based on their color information. But real 3D objects in images, although monochromatic, may have shading variations. Hence, it is better to use the normalized chromaticity coordinates (NCC) instead of the RGB color space to enable the separation of brightness and pure color information.  To do this, we consider each pixel and the image and let the total intensity,  I, for that pixel be  I = R + G + B. Then for that pixel, the normalized chromaticity coordinates are computed as: r = R/I;                g = G/I;                   b = B/I The sum of all thre...