Why do we care about the minimum here?

1 次查看(过去 30 天)
We have an example in class where are to detect a walking human through a series of continuous pictures/frames. The idea is that we compute the difference for each pixel in subsequent frames.
diff1 = abs(frame61 - frame62);
diff2 = abs(frame63 - frame62);
My understanding is that any pixel that is not equal to zero is where motion has been detected and where the human was walking. Pixel differences that equate to zero are places in the frames where nothing happened.
But then the next step says for each pixel, to find the smallest value from diff1 and diff2.
motion = min(diff1, diff2);
First of all, would this equate to a single value for each diff?
But also, when subtracting subsequent frames, wouldn't it just be any of the pixels that are not equal to zero?
Why do we care about the minimum?
  1 个评论
Rik
Rik 2021-9-4
I suspect this is done to suppress noise. By taking the minimum, you take the least amount of change of the two differences, so a high value indicates movement between 3 frames, instead of just 2.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2021-9-4
No because there will be video noise so there might be no person moving there but due to noise there are non-zero values. You have to set a threshold, like 5 gray levels or something. See attached demo where I take differences.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by