Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Choose the desired coordinate under the know conditions

2 Ansichten (letzte 30 Tage)
Neil Liu
Neil Liu am 9 Apr. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello everybody! Wish you have a good day!
I want to select the center masspoint in this image
And I use these code:
closeMRIim = imcomplement(closeMRI1);
[Lim, numim] = bwlabel(closeMRIim);
stats = regionprops(Lim, 'Centroid');
figure, imshow(closeMRI1); hold on;
for i = 1 : length(stats)
temp = stats(i).Centroid;
plot(temp(1), temp(2), 'r.');
end
plot(temp(1), temp(2), 'r.');
centroids = cat(1, stats.Centroid)
for i = 1 : length(stats)
if(centroids < 900 && centroids > 700 && centroids > 300 && centroids < 700)
centerx1 = centroids;
centery1 = centroids;
break
else
continue
end
end
I have got the masspoint of all the objects, and now I want to choose the center one:
But my code didn't find the center masspoint and its coordinate(I have put a data cursor on it). Could you please tell me how to change the code?
Best regards Neil

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by