how can solve this problem. (complate code and error messages )

1 回表示 (過去 30 日間)
seref sönmez
seref sönmez 2017 年 5 月 18 日
編集済み: seref sönmez 2017 年 5 月 24 日
|
how can solve this problem
%-- 24.04.2017 15:17 --%
cam=ipcam('http://192.168.1.3:8080/videofeed');
set(cam, 'FramesPerTrigger', Inf);
set(cam, 'ReturnedColorspace', 'rgb')
cam.FrameGrabInterval = 3;
s = Bluetooth('HC-06',1);
fopen(s);
start(cam)
i=1;
q=1;
c='A';
min=5500;
max=10500;
while(i<=300)
i=i+1;
obj_found=0;
data = getsnapshot(cam);
[y x c]=size(data);
x1=x/2;
x2=x1-40;
x3=x1+40;
% IMAGE SEPERATION BLOCK ---------------------
diff_im = imsubtract(data(:,:,1), rgb2gray(data));
diff_im = medfilt2(diff_im, [3 3]);
diff_im = im2bw(diff_im,0.18);
diff_im = bwareaopen(diff_im,100);
bw = bwlabel(diff_im, 8);
stats = regionprops(bw, 'all');
imshow(data)
hold on
for object = 1:length(stats)
obj_found=1;
bb = stats(object).BoundingBox;
bc = stats(object).Centroid;
ar=stats(object).Area;
rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
plot(bc(1),bc(2), '-m+')
pix=((((ar<=max)&(ar>=min))*2)+((ar>max)*4)+((ar<min)*5));
if (bc(1)>x2)&(bc(1)<x3)
disp('ortada')
switch (pix)
case 2
r=1;
case 4
r=4;
case 5
r=5;
end
else if bc(1)<x2
r=2;
disp('sol')
else if bc(1)>x3
r=3;
disp('sağ');
else
end
end
end
y1=1:y;
plot(x2,y1);
plot(x3,y1);
switch(r)
case 1
fwrite(s,'C');
case 2
fwrite(s,'L');
case 3
fwrite(s,'R');
case 4
fwrite(s,'B');
case 5
fwrite(s,'F');
otherwise
fwrite(s,'N');
end
end
if obj_found == 0
fwrite(s,'C');
disp('nesne yok')
end
hold off
end
fwrite(s,'C');
stop(cam);
flushdata(cam);
fclose(s);
clear all
clc
-----------------------------------------------------------------------------------
The name 'FramesPerTrigger' is not an accessible property for an instance of class 'ipcam'.
Error in ipcam/set (line 339)
set@hgsetget(obj, varargin{:});
Error in Untitled1 (line 3)
set(cam, 'FramesPerTrigger', Inf);|
  1 件のコメント
Jan
Jan 2017 年 5 月 18 日
This is only a part of the error message. Pleas edit the question and insert the complete message.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by