i got error "Undefined variable "handles" or function "handles.slider1". plz help me

1 visualización (últimos 30 días)
threshold = get(handles.slider1,'Value');
t = get(handles.slider1,'value');%position of X slider
set(handles.text1,'String', num2str(x)); %read the value of threshold from GUI slider
handles.t=t;
guidata(hObject,handles)
%start a for loop that equal the number of images usually infinity
for l = 1:inf
flag=get(handles.togglebutton1,'value'); %This flag is used to check if stop button was pressed
if (flag==1)
a=a+1;
v= getsnapshot(vobj); %read image from camera and save it in variable v
w= getsnapshot(vobj); %read image from camera and save it in variable w
x= rgb2gray (v); %convert image to gray scale
y= rgb2gray(w); %convert image to gray scale
z = imabsdiff(x,y); %get absolute diffrence between both images
zz= sum(z,1); %calculate SAD
zzz= sum(zz)/ 76800; %scale the value of SAD by dividing by number of pixels
h(a) = zzz; %put values of SAD in array h
hh=[ h(a-1) h(a) ]; %calculate variance value
var_value=var(hh,1);
var_values(a)=var_value; %put values of variance in array var_value

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by