how to crop aportion of an image from in bounding box.?

6 visualizaciones (últimos 30 días)
oza san
oza san el 1 de Mayo de 2017
Comentada: Image Analyst el 2 de Mayo de 2017
i use open source code in the link to detect text and finally i get an image like below with more than one bounding box and i need to crop each of the bounding box.i know imcrop with for loop can do this.plaese help me?
textBBoxes = [xmin ymin xmax-xmin+1 ymax-ymin+1];
textBBoxes = [xmin ymin xmax-xmin+1 ymax-ymin+1];
numRegionsInGroup = histcounts(componentIndices);
textBBoxes(numRegionsInGroup == 1, :) = [];
ITextRegion = insertShape(colorImage, 'Rectangle', textBBoxes,'LineWidth',3);
figure imshow(ITextRegion) title('Detected Text')

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Mayo de 2017
Loop over all boxes, calling imcrop() while passing it the rectangle (xLeft, yTop, width, height] for the box.
  2 comentarios
Image Analyst
Image Analyst el 2 de Mayo de 2017
text() is a built-in function - don't use that. Also textBBoxes should be an N by 4 array of doubles, not text. Finally, you need to have the K index with textBBoxes when you send it into imcrop().

Iniciar sesión para comentar.

Más respuestas (0)


Más información sobre Computer Vision with Simulink en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by