필터 지우기
필터 지우기

Get coordinates from struct created with bwconncomp

조회 수: 3 (최근 30일)
Stefan Lang
Stefan Lang 2021년 4월 28일
댓글: Matt J 2021년 4월 28일
Hello guys
I have a binary image as a prediction from a neural network. This image has several regions (vertebras of the spine). When i run bwconncomp(binary_image), i get as a result a struct with 17-19 Objects (vertebras). Now i need to find the coordinates of the regions. [y x] = find(binary_image) just gives me all coordinates, but i need this separated for each region, so 17-19 coordinate arrays. How do i get this?

채택된 답변

Matt J
Matt J 2021년 4월 28일
편집: Matt J 2021년 4월 28일
Use regionprops instead,
stats=regionprops(BW,'PixelList')
  댓글 수: 6
Stefan Lang
Stefan Lang 2021년 4월 28일
Ooh, i used the array and did not convert it into a logical. Now that worked. Thank you!
Matt J
Matt J 2021년 4월 28일
You should have had the same problem with bwconncomp.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by