2

車両プレートから文字のセグメンテーションを行い、テンプレート マッチングで認識したいと考えています。
しかし、画像処理の基本的な手順を実行した後、出力画像に境界線があるため、境界線が別の文字として検出されます。
それを修正する方法??

これが私のコードです:

% Resizing the image keeping aspect ratio same.
citra=imresize(citra,[400 NaN]);

% Converting the RGB (color) image to gray (intensity).
citra_bw=rgb2gray(citra);

citra_bw= imclearborder(citra_bw);
imshow(citra_bw);

% Median filtering to remove noise.
citra_filt=medfilt2(citra_bw,[5 5]); 
se=strel('disk',3);

% Dilating the gray image with the structural element.
citra_dilasi=imdilate(citra_filt,se); 

% Eroding the gray image with structural element.
citra_eroding=imerode(citra_filt,se);

% Morphological Gradient for edges enhancement.
citra_edge_enhacement=imsubtract(citra_dilasi,citra_eroding); 

imshow(citra_edge_enhacement);

% Converting the class to double.
citra_edge_enhacement_double=mat2gray(double(citra_edge_enhacement)); 

% Convolution of the double image f
citra_double_konv=conv2(citra_edge_enhacement_double,[1 1;1 1]); 

% Intensity scaling between the range 0 to 1.
citra_intens=imadjust(citra_double_konv,[0.5 0.7],[0 1],0.1); 

% Conversion of the class from double to binary.
% Eliminating the possible horizontal lines 
% from the output image of regiongrow
% that could be edges of license plate.
citra_logic=logical(citra_intens);  


citra_line_delete=imsubtract(citra_logic,(imerode(citra_logic,...
                                                  strel('line',50,0))));

% Filling all the regions of the image.
citra_fill=imfill(citra_line_delete,'holes');

% Thinning the image to ensure character isolation.         
citra_thinning_eroding=imerode((bwmorph(citra_fill,'thin',1)),...
                               (strel('line',3,90)));

%Selecting all the regions that are of pixel area more than 100.
citra_final=bwareaopen(citra_thinning_eroding,125);
imshow(citra_final);

元の画像は次のとおりです。

元の画像
(出典:plateshack.com

そして、これが文字に境界線を付けた処理済みの画像です

文字に枠を付けた加工画像

4

1 に答える 1

0

まず、アルゴリズムが本当に最適化されているかどうかわかりません。精巧なようですが、あなたの問題には当てはまりません。

私は単に二値化を試み(「論理」コマンドを使用せずに)、imerode と bwareaopen をいじって、文字の周りの小さなものを取り除きます。これはあなたのコードよりも簡単なはずです...

于 2013-08-14T21:21:48.563 に答える