How to extract the license plate

조회 수: 3 (최근 30일)
ezhil K
ezhil K 2019년 2월 1일
I have used connected component analysis algorithm to identify the connected components in an image and reduced those components.But,in some case I don't exactly extract the license plate region.How can I rectify it?I have attached my code and the image on which I apply the code.Please help me in rectifying it.
figure,subplot(2, 1, 1);
imshow(c);
if ndims(c) > 1
c = c(:,:,1); % Take red plane
end
%binaryImage = imbinarize(c);
% Get rid of anything touching the edge of the image
% because this will definitely not be a license plate.
c = imclearborder(c);
% Extract the biggest blobs
c = imclearborder(c);
mask2 = imfill(c, 'holes');
mask2 = bwareafilt(mask2, 1); % Take largest.
% Use it to mask original
c(~mask2) = false;
%figure,imshow(c);
subplot(2, 1, 2);
imshow(c);
Screenshot (50).png

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by