How can I find the starting point of the flows in optical flow?

2 次查看(过去 30 天)
I am performing smoke detection using optical flow. How can we find the starting point of acting?
vidReader = VideoReader('test1.avi', 'CurrentTime', 1);
% opticFlowLK = opticalFlowLK('NoiseThreshold', 0.009);
% opticFlowFarneback = opticalFlowFarneback;
opticFlow = opticalFlowHS;
opticFlowLKDoG = opticalFlowLKDoG('NumFrames', 3);
while hasFrame(vidReader)
frameRGB = readFrame(vidReader);
frameGray = rgb2gray(frameRGB);
flow = estimateFlow(opticFlow, frameGray);
m = flow.Magnitude;
figure(1);
imshow(frameRGB);
hold on
plot(flow,'DecimationFactor',[5 5],'ScaleFactor', 100);
hold off
%pause(0.1);
end
  4 个评论

请先登录,再进行评论。

采纳的回答

Bjorn Gustavsson
Bjorn Gustavsson 2018-9-10
Well, in principle you can determine sources and sinks of a flow by looking at its divergence. Regions with divergence larger than zero are sources, smaller than zero sinks. This is valid for a 3-D flow in 3-D, or a 2-D flow in 2-D - you, however, have 2-D images of 3-D flow so extra caution has to be taken. But since we're already on our way - you might get something out of trying to look at divergences of your optical flow, you most likely should do whole lot of low-pass filterings on the divergence and perhaps the flow-vectors.
If that fails you could have a look at Helmholtz decomposition and further on, if you can get some more robust estimates.
Let us know how you proceedings go. Good luck!
HTH

更多回答(1 个)

KSSV
KSSV 2018-9-10
Check this variable flow. This should be having your location coordinates, from here you can pick the initial point.
  2 个评论
Jae Min Lee
Jae Min Lee 2018-9-10
Thank you for your reply. But I don't understand. Can you give me a little detail?
KSSV
KSSV 2018-9-10
As I don't have data in hand....I don't know how the flow variable is.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by