Detection only occurring on the left side
古いコメントを表示
Why is detectiong only occuring on the left side? Is it because it has not finished "processing" while going through the frames? How can it git me all the results?

Here is the code:
subplot(1,3,1);
videoFrame1 = imread("videoShot.png");
imshow(videoFrame1);
vidReader = vision.VideoFileReader("shortZebraVideo.mp4");
vidReader.VideoOutputDataType = 'double';
diskElem = strel('diamond',1);
hBlobAn = vision.BlobAnalysis('MinimumBlobArea',1,... ...
'CentroidOutputPort', true);
vidPlayer = vision.VideoPlayer;
while ~isDone(vidReader)
vidFrame = step(vidReader)
% Convert RGB image to chosen color space
Ihsv = rgb2hsv(vidFrame);
% Define thresholds for channel 1 based on histogram settings
channel1Min = 0.004;
channel1Max = 0.002;
% Define thresholds for channel 2 based on histogram settings
channel2Min = 0.000;
channel2Max = 1.000;
% Define thresholds for channel 3 based on histogram settings
channel3Min = 0.000;
channel3Max = 0.312;
% Create mask based on chosen histogram thresholds
sliderBW = ( (Ihsv(:,:,1) >= channel1Min) | (Ihsv(:,:,1) <= channel1Max) ) & ...
(Ihsv(:,:,2) >= channel2Min ) & (Ihsv(:,:,2) <= channel2Max) & ...
(Ihsv(:,:,3) >= channel3Min ) & (Ihsv(:,:,3) <= channel3Max);
Ibw = sliderBW;
Ivbwopen = imopen(Ibw, diskElem);
[areaOut, centroidOut, bboxout] = step(hBlobAn,Ivbwopen);
frameMarkers = insertMarker(vidFrame, centroidOut);
vidPlayer.step(frameMarkers);
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Hamamatsu Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!