Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Multiple object tracking

Subject: Multiple object tracking

From: Ashar

Date: 16 Apr, 2010 00:14:06

Message: 1 of 3

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
    

Subject: Multiple object tracking

From: ImageAnalyst

Date: 16 Apr, 2010 02:45:32

Message: 2 of 3

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.

Subject: Multiple object tracking

From: Ashar

Date: 16 Apr, 2010 06:34:08

Message: 3 of 3

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <603e5ec5-4f8c-4961-8d36-5af57040df51@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...

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us