Tuesday, September 9, 2008

Activity 17: Basic Video Processing

For this activity, we applied basic video and image processing techniques to a diffusive system. We used a drop of a very concentrated black ink and allow it to diffuse in warm water (warm for faster diffusion rate). We used a transparent beaker and a white background for easier thresholding of the resulting images which we will convert to a binary image. Water level is kept low to assume a 2D diffusion. The threshold used is the threshold for the image where the system has uniformly distributed concentration. Pixel values above this threshold is included in the pixel counting which corresponds to the total concentration at that time. The area of diffusing ink is expected to increase (Ref. S.Lee et.al.,"Ink diffusion in water",EJP).

In our experiment,we obtained the same behavior of area as a function of time which can fit with the right fitting parameters.



The ROI is the diffusing ink in the middle. Some boundaries reached or surpassed the threshold which adds to the error in area calculation. This was minimized by labeling the blobs, considering only the middle blob to be counted.

Rating: Based from literature existing, I was able to reproduce the resulting dynamics of an ink diffusing in water. Also, I was able to familiarize myself with some basic video processing techniques and integrate the previous area calculation method. Therefore,I'll give myself 10.0 points.

Code:
t=110/255;
c=[];
for i=1:9
im=imread('C:\Documents and Settings\gpedemonte\Desktop\ap186_a17\vid000'+string(i)+'.png');
imb=im2bw(im, t);
imwrite(imb,'C:\Documents and Settings\gpedemonte\Desktop\recon\vid000'+string(i)+'.png');
c(i)=sum(abs(1-imb));
end
for i=10:99
im=imread('C:\Documents and Settings\gpedemonte\Desktop\ap186_a17\vid00'+string(i)+'.jpg');
imb=im2bw(im, t);
imwrite(imb,'C:\Documents and Settings\gpedemonte\Desktop\recon\vid00'+string(i)+'.png');
c(i)=sum(abs(1-imb));
end
plot(c);

No comments: