Filter löschen
Filter löschen

動画解析での物体の追​跡・カウントを行う際​の計上対象の選別方法

4 Ansichten (letzte 30 Tage)
Noruji Muto
Noruji Muto am 11 Dez. 2021
Kommentiert: Noruji Muto am 12 Dez. 2021
お世話になります。
とある微粒子が浮上する現象に関する研究しています。
微粒子が浮上する所を動画撮影し、浮上した粒子の個数を動画解析にて取得したいのですが、
数えたくないものまで数えてしまっているようです。↓
浮上した微粒子のみを追跡、カウントしたいのです。↓
尚、現在使用しているコードは以下の通りです。
「success_Trim3.mp4」はzipにてこの質問に添付してありますのでご参照下さい。
VideoSize = [432 528];
filename = 'success_Trim3.mp4';
hvfr = VideoReader(filename);
hblob = vision.BlobAnalysis( ...
'AreaOutputPort', false, ...
'BoundingBoxOutputPort', false, ...
'OutputDataType', 'single', ...
'MinimumBlobArea', 7, ...
'MaximumBlobArea', 300, ...
'MaximumCount', 1500);
% Acknowledgement
%ackText = ['Data set courtesy of Jonathan Young and Michael Elowitz, ' ...
% 'California Institute of Technology'];
hVideo = vision.VideoPlayer;
hVideo.Name = 'Results';
hVideo.Position(1) = round(hVideo.Position(1));
hVideo.Position(2) = round(hVideo.Position(2));
hVideo.Position([4 3]) = 30+VideoSize;
frameCount = int16(1);
while hasFrame(hvfr)
% Read input video frame
image = rgb2gray(im2single(readFrame(hvfr)));%ここでエラーが発生
% Apply a combination of morphological dilation and image arithmetic
% operations to remove uneven illumination and to emphasize the
% boundaries between the cells.
y1 = 2*image - imdilate(image, strel('square',7));
y1(y1<0) = 0;
y1(y1>1) = 1;
y2 = imdilate(y1, strel('square',7)) - y1;
th = multithresh(y2); % Determine threshold using Otsu's method
y3 = (y2 <= th*0.7); % Binarize the image.
Centroid = step(hblob, y3); % Calculate the centroid
numBlobs = size(Centroid,1); % and number of cells.
% Display the number of frames and cells.
frameBlobTxt = sprintf('Frame %d, Count %d', frameCount, numBlobs);
image = insertText(image, [1 1], frameBlobTxt, ...
'FontSize', 16, 'BoxOpacity', 0, 'TextColor', 'white');
image = insertText(image, [1 size(image,1)], ackText, ...
'FontSize', 10, 'AnchorPoint', 'LeftBottom', ...
'BoxOpacity', 0, 'TextColor', 'white');
% Display video
image_out = insertMarker(image, Centroid, '*', 'Color', 'green');
step(hVideo, image_out);
frameCount = frameCount + 1;
end
数えたいものを設定し、数えたくないものを計上対象から除外する方法をご存知の方、
是非ご教示いただけないでしょうか?
よろしくお願いいたします。
  2 Kommentare
Atsushi Ueno
Atsushi Ueno am 12 Dez. 2021
対象の画素も少なく(小さく)、数えたくないものの特徴を選り分ける事が難しそうですね。
撮影条件を整えて、微粒子が浮上する範囲を特定出来るようにすれば良いのではないでしょうか?
Noruji Muto
Noruji Muto am 12 Dez. 2021
アドバイスありがとうございます。
欲を言えば、ハイスピードカメラや遠距離顕微鏡レンズを使用したいのですが、なかなか難しい所です。
ちなみに粒子のサイズは直径として言うなら40~45μmで、この質問で挙げた動画自体、切り抜きや動画エリアを絞ったものです。
さらに範囲を絞ることは可能ですが、そのためには動画を部分的に塗りつぶすといった事が必要になります。
ただしその方法は不明で調査中です。

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!