How can I move a binary image to the center?
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm trying to make a character segmentation. I've succesfully extracted the characters but now I need to keep the important bits in the center of the 28x28 image AUTOMATICALLY since it somehow messes up classification. In this instance, this 1 somehow gets read as a 7
.
댓글 수: 0
답변 (2개)
DGM
2022년 5월 31일
편집: DGM
2022년 5월 31일
Without knowing how the object images were obtained, it's hard to say how to change the process. You should have the bounding box information for each object. It's then up to you to get that image region and pad it to a fixed geometry. You can use padarray(), but you'll have to calculate individual padding widths.
This is an example using rice grains. A lot of the discussion about masking can be ignored. The relevant part is the padding.
댓글 수: 0
Image Analyst
2022년 5월 31일
I don't think it should matter if you're doing classification properly. Here's one way:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!