Borrar filtros
Borrar filtros

How to extract the plate area only from black background

2 visualizaciones (últimos 30 días)
mohamed
mohamed el 3 de Ag. de 2012
Comentada: Rinku el 31 de Dic. de 2014
Hi, i want to know how to crop the plate area only from the image shown below my code takes the RGB image & outputs this image, so i need only a way to extract the numbers area only here is the output picture
thanks in advance

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 3 de Ag. de 2012
II=im2bw(I);
s=regionprops(II,'Area','BoundingBox');
[ii,ii] = sort([s.Area],'descend');
out = imcrop(I,s(ii(2)).BoundingBox);
  2 comentarios
mohamed
mohamed el 3 de Ag. de 2012
Editada: mohamed el 3 de Ag. de 2012
thanks for you all i did it at last thanks again but u must fix your code like this:
II=im2bw(I);
s=regionprops(II,'Area','BoundingBox');
[~,ii] = sort([s.Area],'descend');
out = imcrop(I,s(ii(1)).BoundingBox);
Rinku
Rinku el 31 de Dic. de 2014
thank you both of you..this code is help me very much..

Iniciar sesión para comentar.

Más respuestas (2)

Image Analyst
Image Analyst el 3 de Ag. de 2012
You could pass the image into regionprops() and ask for area and eccentricity. The plate will have a lower eccentricity than the lines, and probably but not necessarily a larger area than any/most/all of the lines. But I can't tell that that rectangular blob with a bunch of holes in it in the lower left is not also another license plate. At least for this one particular image, you could get rid of that based on area or FilledArea.

Thomas
Thomas el 3 de Ag. de 2012

Categorías

Más información sobre Agriculture en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by