Caffe2 - C++ API
A deep learning, cross platform ML framework
optical_flow.h
1 #ifndef CAFFE2_VIDEO_OPTICAL_FLOW_H_
2 #define CAFFE2_VIDEO_OPTICAL_FLOW_H_
3 
4 #include <opencv2/core.hpp>
5 #include <opencv2/highgui.hpp>
6 #include <opencv2/opencv.hpp>
7 #include <opencv2/video.hpp>
8 
9 #include <caffe2/core/logging.h>
10 
11 namespace caffe2 {
12 
13 // Four different types of optical flow algorithms supported;
14 // BroxOpticalFlow doesn't have a CPU version;
15 // DensePyrLKOpticalFlow only has sparse CPU version;
16 enum FLowAlgType {
17  FarnebackOpticalFlow = 0,
18  DensePyrLKOpticalFlow = 1,
19  BroxOpticalFlow = 2,
20  OpticalFlowDual_TVL1 = 3,
21 };
22 
23 // Define different types of optical flow data type
24 // 0: original two channel optical flow
25 // 1: three channel optical flow with magnitude as the third channel
26 // 2: two channel optical flow + one channel gray
27 // 3: two channel optical flow + three channel rgb
28 enum FlowDataType {
29  Flow2C = 0,
30  Flow3C = 1,
31  FlowWithGray = 2,
32  FlowWithRGB = 3,
33 };
34 
35 void OpticalFlowExtractor(
36  const cv::Mat& prev_gray,
37  const cv::Mat& curr_gray,
38  const int optical_flow_alg_type,
39  cv::Mat& flow);
40 
41 void MergeOpticalFlow(cv::Mat& prev_flow, const cv::Mat& curr_flow);
42 
43 void MultiFrameOpticalFlowExtractor(
44  const std::vector<cv::Mat>& grays,
45  const int optical_flow_alg_type,
46  cv::Mat& flow);
47 
48 } // namespace caffe2
49 
50 #endif // CAFFE2_VIDEO_OPTICAL_FLOW_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13