Binarizing an image simplifies the separation of background from ROI. However, the optimum threshold must be found by examing the histogram.
In this activity, paper cut outs (with equal areas) were scanned in a flat bed scanner. The image was cropped in different positions and saved in a different image file. Each cropped image file was then processed by separating it from the background and binarizing the image file. After the binarization process the image file, morphological operations were done to eliminate pixels which were not to be the region of interest the ; the closing operation and the opening operation, which are just combinations of erosion and dilation operation. The structuring element used in the program was a 4x4 square image. The original image file is shown in Figure 1.
Figure 1. Original scanned image of cut outs
Problem encountered in approximating the area was the overlapping of circles which cannot be separated by my program. These overlaps gave me large area which obviously I can simply eliminate in my data. I limit my data on areas from 400 pixels to 600 pixels because greater or less than this range were considered to be noise or overlapping. Histogram of the areas is shown on Figure 2.Figure 2. Histogram of approximate area
The mean of the histogram is 541.4821 pixels and the standard deviation is 17.3184.
In this activity, I acknowledge the help of Rafael Jaculbia on how to get the histogram of my data in Microsoft Office Excel 2007. I will give myself a grade of 10 because I believe that I did all my best in this activity.
Appendix:
Source code in Scilab:
pict = imread("E:\AP 186\Act9\cropped11.jpg");
pict2 = im2gray(pict);
mat = size(pict);
newpict = pict2;
for i = 1:mat(1) // Number of rows
for j = 1:mat(2) // Number of columns
if newpict(i,j) < se_sq =" [];" i =" 1:4" j ="1:4" image_close1 =" erode(dilate(newpict,SE_sq),SE_sq);//Closing" image_open1 =" dilate(erode(Image_close1,SE_sq),SE_sq);//Opening" image_close2 =" erode(dilate(Image_open1,SE_sq),SE_sq);//Closing" image_open2 =" dilate(erode(Image_close2,SE_sq),SE_sq);//Opening" labelled =" bwlabel(Image_open2);//" count =" []" i =" 1:max(Labelled)" w =" find(Labelled" k =" size(w);">
Source:
[1] Activity 9 manual provided by Dr. Maricor Soriano
In this activity, I acknowledge the help of Rafael Jaculbia on how to get the histogram of my data in Microsoft Office Excel 2007. I will give myself a grade of 10 because I believe that I did all my best in this activity.
Appendix:
Source code in Scilab:
pict = imread("E:\AP 186\Act9\cropped11.jpg");
pict2 = im2gray(pict);
mat = size(pict);
newpict = pict2;
for i = 1:mat(1) // Number of rows
for j = 1:mat(2) // Number of columns
if newpict(i,j) < se_sq =" [];" i =" 1:4" j ="1:4" image_close1 =" erode(dilate(newpict,SE_sq),SE_sq);//Closing" image_open1 =" dilate(erode(Image_close1,SE_sq),SE_sq);//Opening" image_close2 =" erode(dilate(Image_open1,SE_sq),SE_sq);//Closing" image_open2 =" dilate(erode(Image_close2,SE_sq),SE_sq);//Opening" labelled =" bwlabel(Image_open2);//" count =" []" i =" 1:max(Labelled)" w =" find(Labelled" k =" size(w);">
Source:
[1] Activity 9 manual provided by Dr. Maricor Soriano
1 comment:
Well done Jorge. You deserve a 10 for this one.
Post a Comment