I have a binary mask prediction imported into matlab from neural network training. It's just a large array filled with zeros, except where the predictied structures lies, it is filled with ones. The predicted structure looks more ore less like a rectangle and i need to get these 4 corner coordinates from the predicted mask. So my idea would be to fit a rectangle to the predicted mask and read out the corner coordinates of the rectangle. Is there an existing function for this? Or does anyone have another approach?

 채택된 답변

Matt J
Matt J 2021년 4월 23일
편집: Matt J 2021년 4월 23일

0 개 추천

See the FEX submission pgonCorners (which you must Download).

댓글 수: 4

Stefan Lang
Stefan Lang 2021년 4월 30일
Is there any way to fit a rectangle to these corner points? Sometimes 2 of the proposed corner points from pgonCorners lie in the same corner region. If i ask to propose e.g. 8 points, each corner region has some corner points in it. How can i fit a rectangle to these 8 points and get the corner coordinates of the rectangle?
Matt J
Matt J 2021년 4월 30일
Sometimes 2 of the proposed corner points from pgonCorners lie in the same corner region.
It would be good to see a sample image where that occurs. That shouldn't happen if pgonCorners is run with the right settings.
Stefan Lang
Stefan Lang 2021년 4월 30일
I tried it with the attached file and the following code:
vertebra_corners_frontal = corner_prediction(vertebras_frontal,4,100)
pgonCorners is inside corner_prediction. Some vertebras get 2 corner points in one corner. If i adjust angular sample, i even sometimes get only 3 points for each region.
Matt J
Matt J 2021년 5월 1일
Again, it would be good to see a sample image where that occurs.

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

추가 답변 (0개)

카테고리

태그

질문:

2021년 4월 23일

댓글:

2021년 5월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by