Effacer les filtres
Effacer les filtres

How to calculate the center of white part?

3 vues (au cours des 30 derniers jours)
kanika bhalla
kanika bhalla le 21 Avr 2021
Commenté : kanika bhalla le 21 Avr 2021
How can I find the center of white part in the image?e Any help is much appreciated!!

Réponse acceptée

Rik
Rik le 21 Avr 2021
The best way is to use something like regionprops, but since you only have a single patch, you can use find to get a list of coordinates and calculate the mean.
[c,r]=find(IM);
c=mean(c);
r=mean(r);
  1 commentaire
kanika bhalla
kanika bhalla le 21 Avr 2021
Thank you very much for your great answer to my question. It successfully solved my problem. I had spent so much time on this problem but unable to solve it. But your answer really helped me. I am really grateful to you for your help!!

Connectez-vous pour commenter.

Plus de réponses (1)

Stephan
Stephan le 21 Avr 2021
Look at the regionprops examples.
  1 commentaire
kanika bhalla
kanika bhalla le 21 Avr 2021
Thank you for your response and help!!
But solution provided by @Rik has successfully solved my problem.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by