Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Keiichi Hirayama
Keiichi Hirayama le 18 Juil 2018
Commenté : michio le 18 Juil 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 commentaire
michio
michio le 18 Juil 2018
コード部分表示修正しました。コード部分を選択した上で以下添付画像中の {}Code ボタンをクリック頂ければコード表示となります。参考まで。

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by