Exemple #1
0
        void L1opticalFlowforPictures()
        {
            int i = 0;

            opticalFlow.Height   = inputImage_1.ImageHeight;
            opticalFlow.Width    = inputImage_1.ImageWidth;
            opticalFlow.Array    = new float[2][];
            opticalFlow.Array[0] = new float[opticalFlow.Width * opticalFlow.Height];
            opticalFlow.Array[1] = new float[opticalFlow.Width * opticalFlow.Height];

            sw.Start();
            opticalFlow = L1flow.TV_L1_opticalFlow(inputImage_1.Bitmap, inputImage_2.Bitmap, out i);
            sw.Stop();
            label10.Text    = String.Format("Run time: {0} [s]", Convert.ToString(sw.Elapsed.TotalSeconds));
            label10.Visible = true;
            float[] length = _CLProcessor.calcFlowLength(opticalFlow);
            label11.Text      = String.Format("Max value: {0} [pixel/frame transition]", Convert.ToString(length.Max()));
            OutputImage       = _CLProcessor.decorateFlowColor(inputImage_1.Bitmap, opticalFlow, L1flow.flowInterval, L1flow.threshold);
            pictureBox3.Image = OutputImage.Bitmap;
            sw.Reset();

            // label12.Text = String.Format(Convert.ToString(i));
            //label11.Visible = true;
            //label12.Visible = true;
            saveToolStripMenuItem.Enabled = true;
        }
        private void Button3_Click(object sender, EventArgs e)
        {
            float[] length1 = clprocessor.calcFlowLength(groundtruth);
            float[] length2 = clprocessor.calcFlowLength(eval);


            float[] error        = new float[eval.Height * eval.Width];
            float[] angularerror = new float[eval.Height * eval.Width];
            error        = clprocessor.calcFlowDist(eval, groundtruth);
            angularerror = clprocessor.calcAngularError(eval, groundtruth);
            label2.Text  = Convert.ToString(error.Average());
            label4.Text  = Convert.ToString(angularerror.Average() * (180 / Math.PI));

            label2.Visible = true;
            label4.Visible = true;
        }
Exemple #3
0
        void LGopticalFlowforPictures()
        {
            int i = 0;

            sw.Start();
            opticalFlow = LGflow.calcOpticalFlow(inputImage_1.Bitmap, inputImage_2.Bitmap, out i);
            sw.Stop();
            label9.Text    = String.Format("Run time: {0} [s]", Convert.ToString(sw.Elapsed.TotalSeconds));
            label9.Visible = true;
            float[] length = _CLProcessor.calcFlowLength(opticalFlow);
            label17.Text      = String.Format("Max value: {0} [pixel/frame transition]", Convert.ToString(length.Max()));
            OutputImage       = _CLProcessor.decorateFlowColor(inputImage_1.Bitmap, opticalFlow, LGflow.flowInterval, LGflow.threshold);
            pictureBox3.Image = OutputImage.Bitmap;
            sw.Reset();



            saveToolStripMenuItem.Enabled = true;
        }