Info

This question is closed. Reopen it to edit or answer.

whenever i call the recognition push button in my gui interface the error message is showing

1 view (last 30 days)
CODE
% --- Executes on button press in Recognation.
function Recognation_Callback(hObject, eventdata, handles)
% hObject handle to Recognation (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
CCoeff = corr2(A,B)
if CCoeff > 0.7 % (choose a value < 1) % image 1 and image 2 are compared
msgbox('Both A and B are similar', 'MESSAGE');
else
msgbox('A and B are not similar', 'MESSAGE');
end
ERROR
Error in matching (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)matching('Recognation_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

Answers (1)

Geoff Hayes
Geoff Hayes on 1 May 2020
indrani - you haven't posted the full error message but presumably it has something to do with
CCoeff = corr2(A,B)
where A and B aren't defined. How or where have these variables been set previously in your code? Consider adding them to the handles structure so that all callbacks have access to this data. See guidata for details on how you can do this.
  6 Comments
indrani dalui
indrani dalui on 2 May 2020
sir, if i want to put the following code instade of the previous matching part what changes should i have to make.
% FINGERPRINT MATCHING SCORE
%
% Usage: [ S ] = match( M1, M2, display_flag );
%
% Argument: M1 - First Minutiae
% M2 - Second Minutiae
% display_flag
%
% Returns: S - Similarity Measure
function [ S ] = match( M1, M2, display_flag )
if nargin==2; display_flag=0; end
M1=M1(M1(:,3)<5,:);
M2=M2(M2(:,3)<5,:);
count1=size(M1,1); count2=size(M2,1);
bi=0; bj=0; ba=0; % Best i,j,alpha
S=0; % Best Similarity Score
for i=1:count1
T1=transform(M1,i);
for j=1:count2
if M1(i,3)==M2(j,3)
T2=transform(M2,j);
for a=-5:5 %Alpha
T3=transform2(T2,a*pi/180);
sm=score(T1,T3);
if S<sm
S=sm;
bi=i; bj=j; ba=a;
end
end
end
end
end
if display_flag==1
figure, title(['Similarity Measure : ' num2str(S)]);
T1=transform(M1,bi);
T2=transform(M2,bj);
T3=transform2(T2,ba*pi/180);
plot_data(T1,1);
plot_data(T3,2);
end
end

Community Treasure Hunt

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

Start Hunting!