How to separate bounding boxes into separate images(figures)?
Mostra commenti meno recenti
Asking for a personal project on number plate recognition.
I have managed to isolate the number plate and get this:

I even managed to create the bounding boxes with help of MATLAB documentations and youtube. I have managed to get this :

Now i am stuck. I do not know how to extract the rectangles(the characters on Number plate) separately and form different figures of them.
Please help me. Thanks in advance.
Here is the part of my code:
%% reading the number plate
%we must now separate out the numbers on the numberplate to read them.
%to this, we use BoundingBox method.
figure(8)
imshow(no_plate)
title('Number plate character recognition - bounding boxes')
hold on
%hold on retains the current plot and certain axes properties so that
%subsequent graphing commands add to the existing graph.
labeledImage = bwlabel(no_plate, 8);
[L Ne] = bwlabel(no_plate, 8);
%bwlabel returns vectors of indices for the pixels that make up a
%specific object. Here 8 represents connectivity.
measurements = regionprops(labeledImage, 'BoundingBox', 'Area');
%regionprops is used to get the bunding boxes around the numbers.
%measurements is a structure with two fields area and boundingbox vector.
for k = 1 : length(measurements)
thisBB = measurements(k).BoundingBox;
rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],...
'EdgeColor','r','LineWidth',2 )
% drawing rectangle over each bounding box.
end
hold off
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!