Effacer les filtres
Effacer les filtres

Drawing bounding box for the skew text regions

2 vues (au cours des 30 derniers jours)
Y.L.K KHUMAN
Y.L.K KHUMAN le 4 Déc 2017
I want to draw the bounding box for the skew text regions. Like the given Image.

Réponse acceptée

Image Analyst
Image Analyst le 4 Déc 2017
Use bwconvhull() and regionprops()
binaryImage = grayImage < 128; % Threshold.
joinedBlobs = bwconvhull(binaryImage, 'union'); % Get convex hull of all blobs.
props = regionprops(joinedBlobs, 'BoundingBox'); % Find bounding box.
boundingBox = props.BoundingBox; % Pull from field of structure into 1x4 vector.
You'll have to get rid of that outer black box first though so that you have ONLY the letters and not some frame or boundary.
To determine angle of skew, you might look at the radon transform. Demo attached.

Plus de réponses (0)

Catégories

En savoir plus sur Geometric Transformation and Image Registration 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