# MATLAB代做-python代做-FPGA代做- 形态学数字识别

### 时间：2019-4-18 1:34:36 点击：

核心提示：MATLAB代做-python代做-FPGA代做- 形态学数字识别 ...
function intrec(Z)
%INTREC Performs morphological character recognition
%INTREC(X) recognizes the characters (in integer form) present in the
%image X and displays it as output. INTREC uses morphological operations(like
%Dilation and Hit-or-Miss transform) to recognize characters.The charecter
%size of the integers present in the image should be exactly 26, otherwise
%it may not recognize it.
%
%Example:
%imshow(X)
%intrec(X)
%The digits found in the image are:
%0
%3
%5
%--------------------------------------------------------------------------
%Department of Electrical Engineering
%University of Engineering and Technology, Lahore, Pakistan.
%--------------------------------------------------------------------------

%SE 2
SE = strel('square',3);

K=imdilate(A,SE);A2=K-A;

L=imdilate(B,SE);B2=L-B;

M=imdilate(C,SE);C2=M-C;

N=imdilate(D,SE);D2=N-D;

O=imdilate(E,SE);E2=O-E;

P=imdilate(F,SE);F2=P-F;

Q=imdilate(G,SE);G2=Q-G;

R=imdilate(H,SE);H2=R-H;

S=imdilate(I,SE);I2=S-I;

T=imdilate(J,SE);J2=T-J;
%-------------------------
%Hit or Miss
%-------------------------
disp('The digits found in the image are:');
if ~isempty(nonzeros(bwhitmiss(Z,A,A2)))
disp('0');
end
%imshow('num1.bmp')
%U=bwhitmiss(Z,F,F2);
%figure
%imshow(U)
if ~isempty(nonzeros(bwhitmiss(Z,B,B2)))
disp('1');
end

if ~isempty(nonzeros(bwhitmiss(Z,C,C2)))
disp('2');
end

if ~isempty(nonzeros(bwhitmiss(Z,D,D2)))
disp('3');
end

if ~isempty(nonzeros(bwhitmiss(Z,E,E2)))
disp('4');
end

if ~isempty(nonzeros(bwhitmiss(Z,F,F2)))
disp('5');
end

if ~isempty(nonzeros(bwhitmiss(Z,G,G2)))
disp('6');
end

if ~isempty(nonzeros(bwhitmiss(Z,H,H2)))
disp('7');
end

if ~isempty(nonzeros(bwhitmiss(Z,I,I2)))
disp('8');
end

if ~isempty(nonzeros(bwhitmiss(Z,J,J2)))
disp('9');
end

QQ ：1224848052

• 没有相关文章
• 大名：
• 内容：