Please help me in understanding these code snippets

#1)
maxa= area;
boundingBox = Iprops.BoundingBox;
for i=1:count
if maxa<Iprops(i).Area
maxa=Iprops(i).Area;
boundingBox=Iprops(i).BoundingBox;
end
end
#2)
noPlate=[]; % Initializing the variable of number plate string.
for i=1:count
ow = length(Iprops(i).Image(1,:));
oh = length(Iprops(i).Image(:,1));
if ow<(h/2) & oh>(h/3)
letter=readLetter(Iprops(i).Image); % Reading the letter corresponding the binary image 'N'.
figure; imshow(Iprops(i).Image);
noPlate=[noPlate letter]; % Appending every subsequent character in noPlate variable.
end
end
I've been looking into a project named "Car Plate Number Recognition system and I don't exactly get these pieces of code. Even a brief summary of these codes would be highly appreciated.
Please help, thanks.

 Respuesta aceptada

DGM
DGM el 5 de Mayo de 2021
1: This seems like a convoluted way of finding the maximum of all object areas. That whole thing can be replaced with
[maxa idx] = max([Iprops.Area]);
boundingBox = Iprops(idx).BoundingBox;
2: In this part of the code, the image of the plate has been segregated from the rest of the vehicle, and it's been reduced to 12 distinct objects. The code steps through each object, looking at its height and width. If the aspect ratio of the object is sensible, it assumes it's a character and tries to convert it. This is important, because not all objects in the plate image are characters.
for n=1:12
subplot(3,4,n)
imshow(1-Iprops(n).Image)
end
There are probably other regionprops that could have been used to do the same, but that's the concept.

2 comentarios

Thank you so much kind sir, it has been really helpful !
DGM
DGM el 5 de Mayo de 2021
If that answer is satisfactory for your needs, please click 'Accept' so that the question gets put into the right category.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Centro de ayuda y File Exchange.

Productos

Versión

R2017a

Preguntada:

el 5 de Mayo de 2021

Comentada:

DGM
el 5 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by