Drawing bounding box for the skew text regions
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Y.L.K KHUMAN
el 4 de Dic. de 2017
Respondida: Image Analyst
el 4 de Dic. de 2017
I want to draw the bounding box for the skew text regions. Like the given Image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170596/image.jpeg)
0 comentarios
Respuesta aceptada
Image Analyst
el 4 de Dic. de 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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!