Exemplo n.º 1
0
        public static Image<Gray, float> Compute(OpticalFlowModel model)
        {
            var flowX = new Image<Gray, float>(model.Image1.Size);
            var flowY = new Image<Gray, float>(model.Image1.Size);

            Emgu.CV.OpticalFlow.Farneback(
                model.Image1,
                model.Image2,
                flowX,
                flowY,
                model.PyramidScale,
                model.Levels,
                model.WindowSize,
                model.Iterations,
                model.PolyN,
                model.PolySigma,
                model.Flag);

            flowY = flowY.Mul(flowY);
            flowX = flowX.Mul(flowX);
            Image<Gray, float> flowResult = flowX.Mul(flowX) + flowY.Mul(flowY);
            CvInvoke.cvSqrt(flowResult, flowResult);

            return flowResult;
        }
Exemplo n.º 2
0
        public static Image <Gray, float> Compute(OpticalFlowModel model)
        {
            var flowX = new Image <Gray, float>(model.Image1.Size);
            var flowY = new Image <Gray, float>(model.Image1.Size);

            Emgu.CV.OpticalFlow.Farneback(
                model.Image1,
                model.Image2,
                flowX,
                flowY,
                model.PyramidScale,
                model.Levels,
                model.WindowSize,
                model.Iterations,
                model.PolyN,
                model.PolySigma,
                model.Flag);

            flowY = flowY.Mul(flowY);
            flowX = flowX.Mul(flowX);
            Image <Gray, float> flowResult = flowX.Mul(flowX) + flowY.Mul(flowY);

            CvInvoke.cvSqrt(flowResult, flowResult);

            return(flowResult);
        }
Exemplo n.º 3
0
 public MainViewModel()
 {
     SgbmModel = new StereoSgbmModel();
     FlowModel = new OpticalFlowModel();
     Images = new List<StereoImage<Bgr, byte>>();
 }