From: Ashar on
Hi everyone, i m currently working on object tracking for undergraduate final project.
i'm using regionprops to get bounding box for every object on my image. but... i just want to track single object, how to eliminate other object that i dont need ?
this is my code :

for i=1:1:193 %(number of image)

file_name=strcat('beta_',int2str(i),'.jpg');
im1=imread(file_name);


image=adaptivethreshold(im1,10,0.08,0); %additional adaptive threshold


SE = strel('square', 5);
biner_dilate=imdilate(image,SE); %pixel dilatation

biner_filter= bwareaopen(biner_dilate,150);

SE = strel('square', 20);
biner_dilate_2=imdilate(biner_filter,SE); %pixel dilatation


region=regionprops(biner_dilate_2); %regionprops

koordinat_x=region(1,1).BoundingBox(1,1);
koordinat_y=region(1,1).BoundingBox(1,2);
width_x=region(1,1).BoundingBox(1,3);
width_y=region(1,1).BoundingBox(1,4);

center_x=region(1,1).Centroid(1,1);
center_y=region(1,1).Centroid(1,2);


figure(1)

frame_count=strcat('frame ke :',int2str(i));
subplot(2,2,1); imshow(im1); title(frame_count);

subplot(2,2,2); imshow(image); title('adaptive threshold');

subplot(2,2,3); imshow(biner_dilate_2); title('test dilate 2');

subplot(2,2,4); imshow(biner_filter); title('filter');

subplot(2,2,1),rectangle('Position',[koordinat_x,koordinat_y,width_x,width_y], 'Edge', 'g', 'LineWidth',2);
hold on
subplot(2,2,1),plot(center_x,center_y,'g+');
hold off

end

From: ImageAnalyst on
How is it supposed to know which one of the dozens of blobs there is
the one that you want to keep? You have to tell it, by giving it
instructions that identify the blob you're interested in. It could be
thresholding on area, perimeter, intensity, etc. But whatever
characteristics your blob has that makes it unique from all other
blobs is what you have to program in there.
From: Ashar on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <603e5ec5-4f8c-4961-8d36-5af57040df51(a)20g2000vbr.googlegroups.com>...
> How is it supposed to know which one of the dozens of blobs there is
> the one that you want to keep? You have to tell it, by giving it
> instructions that identify the blob you're interested in. It could be
> thresholding on area, perimeter, intensity, etc. But whatever
> characteristics your blob has that makes it unique from all other
> blobs is what you have to program in there.


hmm... okey... you right. thank you very much imageanalyst. :D

you open my mind, hehe...