Help To Crop Dilated Images

조회 수: 1 (최근 30일)
Tip Riel
Tip Riel 2016년 2월 5일
댓글: Tip Riel 2016년 2월 6일
hi, how can I crop or get the ROI of the white area (the rectangle) of the image? I used imdilate then imfill.
here's the code:
%Dilation
Id = imdilate(gg1, strel('diamond', 1));
figure, imshow(Id); title('Dilation');
%Fill
If = imfill(Id, 'holes');
figure, imshow(If); title('Fill');

답변 (3개)

Walter Roberson
Walter Roberson 2016년 2월 5일
bwareafilt() and then look for the blob that best matches the right aspect ratio (in the bounding box) out of what is left ?

Image Analyst
Image Analyst 2016년 2월 5일
If you know it's the blob closest to the center, you can compute the distance from the centroid to the center of the image and take the one that is closest. Or adapt my attached demo to find rectangles.
  댓글 수: 1
Tip Riel
Tip Riel 2016년 2월 6일
thanks sir I will try this one

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


Dima Lisin
Dima Lisin 2016년 2월 5일
I would use regionprops. It can compute many shape parameters, such as area, perimeter, eccentricity, etc. You can probably come up with a some combination of those parameters, that will let you tell the license plane from the other shapes.
  댓글 수: 1
Tip Riel
Tip Riel 2016년 2월 6일
thanks sir I will try this one

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

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by