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

3 views (last 30 days)
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 Comments

Sign in to comment.

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 10 Sep 2018
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

More Answers (1)

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

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!