Find location of 2 black dots in the image
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ankit Gupta
am 6 Feb. 2023
Kommentiert: Ankit Gupta
am 6 Feb. 2023
Hi,
I have a videfile with around 330 frames in each frame I have 2 dots whose location changes in each frame. How can i find the location(x, y value) of 2 dots in a given frame. See attached frame image.
Thanks,
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 6 Feb. 2023
3 Kommentare
Walter Roberson
am 6 Feb. 2023
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1286115/im1.png';
a = imread(filename);
BW = imbinarize(imcomplement(rgb2gray(a)));
BW = bwareafilt(BW, 2);
s = regionprops(BW, 'centroid');
centroids = cat(1, s.Centroid);
image(a);
hold on
scatter(centroids(:,1), centroids(:,2), 'r*')
hold off
The small black marks on the image are the place the time is written.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!