How to calculate the center of white part?

조회 수: 1 (최근 30일)
kanika bhalla
kanika bhalla 2021년 4월 21일
댓글: kanika bhalla 2021년 4월 21일
How can I find the center of white part in the image?e Any help is much appreciated!!

채택된 답변

Rik
Rik 2021년 4월 21일
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
kanika bhalla
kanika bhalla 2021년 4월 21일
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!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Stephan
Stephan 2021년 4월 21일
Look at the regionprops examples.
  댓글 수: 1
kanika bhalla
kanika bhalla 2021년 4월 21일
Thank you for your response and help!!
But solution provided by @Rik has successfully solved my problem.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by