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.

 采纳的回答

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 个评论

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

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Images 的更多信息

产品

版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by