Tracking a circle in video:

31 Views Asked by At

I am trying to track a bubble moving in channel using "imfindcirclebut" in Matlab it detects most of the times but failed some of them.

F1 = read(v,frames(1)); %Read the frame
crop = imcrop(F1,[300 -150 300 1024]);
gray = im2gray(crop);
thres = (gray<50); 
isolate = bwareaopen(thres,300); 
fill = imfill(isolate,"holes"); 
[centers,radius] = imfindcircles(fill,[6 1000],'ObjectPolarity', 'bright',"EdgeThreshold",0.3,"Method","twostage");

Where are the problems? What Should I do?

.enter image description here

0

There are 0 best solutions below