Foreground detector is passing a black screen

3 次查看(过去 30 天)
I am currently trying to work on a Smart Traffic System where I want to first detect and track cars in a given video. After doing some research and working I used the vision.ForegroundDetector and the vision.BlobAnalysis libraries. In the given snippet I seem to be having a weird issue. After the first line the image passed in becomes a black screen. As in the image is all black. I tried multiple different methods to change it but cannot seem to find a solution. This is similar to an algorithm that MathWorks implemented themselves and I do not understand why it does not work.
Here is the snippet:
filteredFrame = step(videoObject.detector, singleFrame); <- PROBLEM LIES HERE
% Remove noise and clean the image
filteredFrame = imopen(filteredFrame, strel('rectangle', [3,3]));
filteredFrame = imclose(filteredFrame, strel('rectangle', [15, 15]));
filteredFrame = imfill(filteredFrame, 'holes');
  1 个评论
Madhav Thakker
Madhav Thakker 2020-8-20
How did you create videoObject.detector? You may want to add some details about what different are you doing from the example. Did you refer https://in.mathworks.com/help/vision/examples/detecting-cars-using-gaussian-mixture-models.html example?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Computer Vision Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by