Borrar filtros
Borrar filtros

webカメラを用いて​差分をとり動くものの​カウントをしたい

1 visualización (últimos 30 días)
Keiichi Hirayama
Keiichi Hirayama el 18 de Jul. de 2018
Comentada: michio el 18 de Jul. de 2018
現在できている分がこんな感じで 動いた部分を差分で白くなるようにはできているのですが、そこから動くものをどうカウントしたらいいかわかりません。
clear all; close all;
runloop = true;
numPts = 0;
frameCount = 0;
%Create the webcam object.
cam = webcam();
video_tmp = snapshot(cam);
im_tmp=im2bw(video_tmp);
figure;
while runloop
%Capture one frame to get its size.
videoFrame = snapshot(cam);
im_video=im2bw(videoFrame);
subplot(1,3,1)
imshow(videoFrame);
subplot(1,3,2)
imshow(im_video);
subplot(1,3,3)
%imshowpair(im_video,im_tmp,'diff')
h=im_video-im_tmp;
imshow(h)
video_tmp=videoFrame;
im_tmp=im_video;
drawnow;
end
  1 comentario
michio
michio el 18 de Jul. de 2018
コード部分表示修正しました。コード部分を選択した上で以下添付画像中の {}Code ボタンをクリック頂ければコード表示となります。参考まで。

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by