Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Malta
Malta le 11 Nov 2013
Commenté : Walter Roberson le 12 Nov 2013
how to crop an image id-card only ..? using regionprops.
  1 commentaire
Malta
Malta le 11 Nov 2013
help me....!!

Connectez-vous pour commenter.

Réponses (2)

Walter Roberson
Walter Roberson le 11 Nov 2013
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 commentaires
Image Analyst
Image Analyst le 12 Nov 2013
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 le 12 Nov 2013
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.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 11 Nov 2013
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

Catégories

En savoir plus sur Image Segmentation and Analysis dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by