Showing posts with label closing. Show all posts
Showing posts with label closing. Show all posts

Thursday, May 27, 2010

Identify and track the center of the logical object


after morphological operation.
check if the area of blob is greater than a threshold

sedisk = strel('square',15);
fg = imclose(fg, sedisk);
fg = imfill(fg,'holes');
RLL = bwlabel(fg);

stats = regionprops(RLL,'basic','Centroid');
figure(1),imshow(fr_bw)
hold on

for n = 1:length(stats)
if(stats(n).Area > 100)
plot(stats(n).Centroid(1), stats(n).Centroid(2),'r*')
end
end

Problem: can track less 50% of the cars, however there are too many outiners because of the transformation done during stabilization. also hard to determine the area, i did it using trial and error to get the best fit

Saturday, May 22, 2010

Matlab morphological operation

IM2 = imdilate(IM,SE) dilates the grayscale, binary, or packed binary image IM, returning the dilated image, IM2.
IM2 = imerode(IM,SE) erodes the grayscale, binary, or packed binary image IM, returning the eroded image IM2.


The argument SE is a structuring element object or array of structuring element objects returned by the strel function.


The morphological close operation is a dilation followed by an erosion, using the same structuring element for both operations. The morphological open operation is an erosion followed by a dilation, using the same structuring element for both operations.

these operations are performed on a stabilized video sequence done by SIFT. and basic background subtraction.

se1 = strel('square',11) % 11-by-11 square
se2 = strel('line',10,45) % line, length 10, angle 45 degrees
se3 = strel('disk',15) % disk, radius 15
se4 = strel('ball',15,5) % ball, radius 15, height 5


sedisk = strel('square',10);
fg = imclose(fg, sedisk);


sedisk = strel('line',10,90);
fg = imclose(fg, sedisk);

sedisk = strel('line',15,5);
fg = imclose(fg, sedisk);


sedisk = strel('disk',10);
fg = imclose(fg, sedisk);


Deciding on the morphological structure is much harder than deciding on the threshold of background subtraction