2013-08-01 1 views
2

나는 차량 플레이트에서 캐릭터의 세분화를하고 싶다. 템플릿 매칭으로 인식 할 수있다.
그러나 이미지 처리에서 몇 가지 기본 단계를 수행하면 출력 이미지에 테두리가 생겨 테두리가 다른 문자로 감지됩니다.
해결 방법 ?? 문자matlab에서 문자 인식을위한 가장자리의 테두리를 삭제하는 방법은 무엇입니까?

processed image with the border in the character

의 테두리가 상기 가공 화상 여기

original image http://www.plateshack.com/y2k/Indonesia/bandung,west_java.jpg

되고 여기

% 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); 

원본 이미지이다 : 여기

내 코드
+0

나는 어떤 국경을 가리키는 지 이해하지 못합니다. D 또는 G 주위의 것, 또는 다른 것? – Marcin

+0

예, arround D 및 G –

+0

간단히 말하면. 당신의 형태학적인 진술 'imerode'와 'imdialate'는 이익보다 해를 끼치는 것처럼 보입니다. 이러한 함수의 필요성을 재평가하고 sauvola 또는 로컬 적응 임계 값과 같은 타일링 된 임계 값 방법을 사용해보십시오. 필요한 경우이 단계 후에 수정을 수행하십시오. –

답변

0

먼저, 알고리즘이 실제로 최적화되었는지 확실하지 않습니다. 그것은 정교하지만 귀하의 문제에 부합하지 않는 것 같습니다.

나는 단순히 "논리"명령을 사용하지 않고 이진화를 시도한 다음 imerode 및 bwareaopen을 사용하여 문자 주위의 작은 물건을 제거합니다. 이것은 귀하의 코드보다 간단해야합니다 ...

관련 문제