Split the license plate letters
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I need to split the license plate letters. My program consists in uploading a photo, finding the image of the license plate and cutting out the plate. I just need to split the numbers and letters of this array right now. I don't know exactly how to do this. Does anyone know how it should look like? I will present the effect that I want to achieve in the attachment. The result he wants to achieve is shown on the first appendix
Regards
0 Commenti
Risposte (1)
yanqi liu
il 29 Nov 2021
yes,sir,may be use
clc; clear all; close all;
img = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/807304/obraz_2021-11-20_110914.png');
img2 = imcrop(img, [94 129 1086 217]);
bw = im2bw(img2);
bw = ~bw;
bw = imclearborder(bw);
bw = bwareaopen(bw, round(numel(bw)*0.01));
[L,num] = bwlabel(bw);
stats = regionprops(L);
rects = cat(1, stats.BoundingBox);
rects = sortrows(rects, 1);
ims = [];
figure('Color', [0.8 0.8 0.8]);
for i = 1 : size(rects, 1)
ims{i} = imcrop(img2, round(rects(i,:)));
bwi = ~im2bw(ims{i});
bwi = imresize(bwi, [48 28], 'bilinear');
subplot(1,size(rects, 1),i); imshow(bwi, []);
end
2 Commenti
yanqi liu
il 30 Nov 2021
clc; clear all; close all;
img = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/807304/obraz_2021-11-20_110914.png');
img2 = imcrop(img, [94 129 1086 217]);
bw = im2bw(img2);
bw = ~bw;
bw = imclearborder(bw);
im4 = bwareaopen(bw, round(numel(bw)*0.01));
Iprops=regionprops(im4,'BoundingBox','Area', 'Image');
area = Iprops.Area;
count = numel(Iprops);
maxa= area;
boundingBox = Iprops.BoundingBox;
for i=1:count
if maxa<Iprops(i).Area
maxa=Iprops(i).Area;
boundingBox=Iprops(i).BoundingBox;
end
end
im = imresize(im4, 240/size(im4, 1), 'bilinear');
im = imopen(im, strel('rectangle', [4 4]));
%%figure(6), imshowpair(im,im_neg,'montage');
im = imclose(im, strel('rectangle', [2 2]));
labeledImage= bwlabel(im);
% use the follow code
stats = regionprops(labeledImage);
rects = cat(1, stats.BoundingBox);
rects = sortrows(rects, 1);
ims = [];
figure('Color', [0.8 0.8 0.8]);
for i = 1 : size(rects, 1)
imi = imcrop(im, round(rects(i,:)));
imi = imresize(imi, [48 28], 'bilinear');
subplot(1,size(rects, 1),i); imshow(imi, []);
end
Vedere anche
Categorie
Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!