I have an image and want to make a rectangle around black part which is in the middle of image.
조회 수: 2 (최근 30일)
이전 댓글 표시
I have an image and want to make a rectangle around black part which is in the middle of image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164690/image.jpeg)
댓글 수: 0
답변 (2개)
Dishant Arora
2014년 6월 23일
Go for connected component labelling and check out for bounding boxes parameter, plot it. For more information check out this demo by image analyst Image Segmentation Tutorial ("BlobsDemo")
Image Analyst
2014년 6월 23일
What are you starting with? A gray scale image, or that binary image? If you have that binary image, you might want to call imclose() to connect some regions together, then call bwareaopen() to get rid of small noise regions, Then call regionprops and get the centroids and bounding boxes. Find the centroid closest to the center of the image and extract only that one with ismember.
댓글 수: 9
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!