필터 지우기
필터 지우기

how to crop an image id-card only ..?

조회 수: 1 (최근 30일)
Malta
Malta 2013년 11월 11일
댓글: Walter Roberson 2013년 11월 12일
how to crop an image id-card only ..? using regionprops.

답변 (2개)

Walter Roberson
Walter Roberson 2013년 11월 11일
First you threshold based on brightness. regionprops() and look for the one with the largest Area. Fill the inside of the pixel boundaries for that. The result will be a mask that you can use to extract the ID card from the color image.
  댓글 수: 5
Image Analyst
Image Analyst 2013년 11월 12일
If by fixed you mean always in the same location, it does not matter. regionprops() will find the blobs in the binary or labeled image regardless of where they are locataed in the image, or how they are oriented.
Walter Roberson
Walter Roberson 2013년 11월 12일
And also regardless of if they are a constant size.
What you do need to worry about is the thresholding method, if they can be different colors. You are, for example, likely to have problems with a pure black ID-card that lights up in black with black letters.

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


Image Analyst
Image Analyst 2013년 11월 11일
Get a monochrome image, for example by looking for white, if the cards are always white. Then threshold and find the largest white blob. This is done in my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial-blobsdemo
If you want to get a perfect rectangle from the blob, get the filled object and then use http://www.mathworks.com/matlabcentral/fileexchange/34767-a-suite-of-minimal-bounding-objects

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by