Activity 9 – Video Processing

00437 055

in this activity our group (Ariel Canete, Jessica Nasayao, and Jeremy Hilado) decided to measure the period of a pendulum hanging on a string measuring 90cm. different ROI’s taken from different frames were converted into 2D histograms that were combined and used to segment the pendulum. the following are the ROI’s used for the experiment, and the combined 2D histogram:

ROIhist_combined

the frames used for processing were taken 10 frames apart from the original video.

after isolating the pendulum, and performing morphological operations, the following .gif file was made, showing the segmented pendulum:

segmented

getting the x-centroid (from using the function regionprops) of the ball for each frame resulted to this graph:

12312119_1163394950355838_1555238802_n

the graph show that the period of the ball lasted 2.1 s. comparing that to the calculated period of the ball [T = 2pi*sqrt(L/g)], which is 1.9 s, the percent error was at 10%.

Activity 7 – Image Segmentation

in this activity we were tasked to perform image segmentation on images. image segmentation is used to isolate relevant parts of an image, parts that are needed to be extracted for useful information.

the first task is to segment the letters of a grayscale image shown below:

cropped_grayscale_check

a histogram was made, showing the pixel number vs the intensity value. it shows how frequent a particular pixel value comes up inside an image.

histogram check

judging from this histogram one can deduce that the relevant pixels have intensities between 160 and 210. i used two thresholds, 160 and 180, to eliminate pixels below 160, and also pixels above 180. the resulting image is shown below.

threshold check

then we were talked to isolate objects from an RGB image. there are two kinds of segmentation based on color: parametric, and non-parametric segmentation. parametric segmentation extracts objects that fall under a certain probability, which is determined by an extracted cropped template. the product of the probabilities in red and green space (blue is not necessary, since it is just a linear combination of red and green) is the joint probability. if a pixel falls into that joint probability, then it is considered more or less the same color.

below is a frame from a UAAP basketball game between Far Eastern University and De La Salle University.feu thingy

a patch was extracted from a green-jerseyed player (see blue square above), and a patch was extracted, shown below:

green patch

and below are shown the resulting mask, and the extracted objects from the original image.

parametric maskparametric pic

non-parametric segmentation on the other hand requires one to make a 2D-histogram, which shows the position of the color values in an r-g space. if the value of the pixel falls inside that position, then it can be considered the same color.

below is the histogram used:

histogram

and below are the mask, and the extracted objects.

nonparametric masknonparametric pic