How to detect a moving object robustly?

3 vues (au cours des 30 derniers jours)
tethys
tethys le 15 Juil 2016
Commenté : Image Analyst le 18 Juil 2016
Hi, I have collected some images for Particle Image Velocimetry. In addition to the small particles (which I use to calculate the velocities), I have an additional circular object in the flow, which also moves with the dynamic water surface. I would like to get the centroid of the large circular object, and track it through many images. I have benefited a lot from the forum. However, I could not detect the object in a robust way in all images. I have tried difference of Gaussians with a variety of sigma values, which also did not work effectively. How can I achieve this? Additionally, is there a robust way to detect the coordinates of the moving water surface and exclude the particles (data) above it - making them zero like a dynamic masking?
A = imread(image);
% Equalize contrast
% A = double(A);
% Filtsize = 20; Level = 60;
% domain = ones(Filtsize, Filtsize);
% N = size(domain,1)*size(domain,2);
% low = filter2(domain, ordfilt2(A,1,domain))/N;
% upp = filter2(domain, ordfilt2(A,N,domain))/N;
% contrast = upp-low;
% cont = immultiply(contrast > Level, contrast-Level) + Level;
% A = 64*imdivide((A)-(low),cont);
% A = mat2gray(A);
level = 0.35;
B = im2bw(A,level);
se = strel('disk',2);
C = imdilate(B,se);
D = bwareaopen(C,1000);
E = imfill(D,'holes');
F = edge(E);
radii = 100:10:300;
h = circle_hough(F, radii,'same');
[~,maxIndex] = max(h(:));
[i,j,k] = ind2sub(size(h), maxIndex);
radius = radii(k);
center.x = j;
center.y = i;

Réponses (1)

Image Analyst
Image Analyst le 15 Juil 2016
You can pull out the large blob from your binary image with bwareafilt():
largestBlobOnly = bwareafilt(binaryImage, 1);
Then do whatever you want, such as finding it's centroid with regionprops() and storing that centroid location as a function of video frame number.
  2 commentaires
tethys
tethys le 18 Juil 2016
Image Analyst, thanks for your response. I tried your suggestion, but since I cannot completely remove the line, I found that the centroid is located on the line. How can I happen to remove the line automatically?
Image Analyst
Image Analyst le 18 Juil 2016
Show me a screenshot. I find it hard to believe that the centroid of the biggest white region would be located on the thin white line, even though it does go through the large roundish white blob.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Particle & Nuclear Physics dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by