Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
Keiichi Hirayama
Keiichi Hirayama il 18 Lug 2018
Commentato: michio il 18 Lug 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 Commento
michio
michio il 18 Lug 2018
コード部分表示修正しました。コード部分を選択した上で以下添付画像中の {}Code ボタンをクリック頂ければコード表示となります。参考まで。

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by