MATLAB: How to find the starting point of the flows in optical flow

convergencedetectionoptical flowvector

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

Best Answer

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