Пример #1
0
        public static void Debug1()
        {
            string debugPath = Environment.CurrentDirectory + Path.DirectorySeparatorChar + "DEBUG" + Path.DirectorySeparatorChar + "DEBUG3.jpg";
            //LbpTextureAnalysisResult textureResult = Cv.LbpTextureAnalysis(debugPath);
            Image <Rgb, Byte> rawImage = new Image <Rgb, byte>(debugPath);
            Image <Rgb, Byte> rawimage = rawImage.Resize(480, 240, Inter.Linear);

            double[] threshold1 = new double[]
            {
                200
            };
            double[] threshold2 = new double[]
            {
                200, 300, 400
            };
            CannyTextureAnalysisResult textureAnalysisResult = Cv.AutoCannyTextureAnalysis(rawimage, threshold1, threshold2, 0);
            ZedGraphForm tempZedGraphForm = new ZedGraphForm(textureAnalysisResult.Data);

            tempZedGraphForm.Show();
            MessageBox.Show(textureAnalysisResult.Info);
            //ShowImg(textureAnalysisResult.Img);
        }
Пример #2
0
        private void buttonSample_Click(object sender, EventArgs e)
        {
            /*
             * Image tempImage = videoSourcePlayer.GetCurrentVideoFrame();
             * string tempPath = _tempFileManager.AddTempFile(tempImage);
             * TextureAnalysisResult textureResult = Cv.TextureAnalysis(tempPath);
             * FindCuttingPointResult cuttingPointResult = Cv.FindCuttingPoint(textureResult, Cv.FindCuttingPointMode.MaximumMethod);
             * Bitmap resultImage = textureResult.img.Resize(pictureBox.Width, pictureBox.Height, Inter.Linear, true).Bitmap;
             *
             * Bitmap newBitmap = new Bitmap(resultImage.Width, resultImage.Height);
             * Graphics g = Graphics.FromImage(newBitmap);
             * g.DrawImage(resultImage, 0, 0);
             * for (int i = 0; i < cuttingPointResult.Edges.Count; i++)
             * {
             *      float location = (float)cuttingPointResult.Edges[i] / cuttingPointResult.Accuracy * newBitmap.Width;
             *      g.DrawLine(new Pen(Color.Red, 4), location, 0 * newBitmap.Height, location, 1 * newBitmap.Height);
             * }
             * g.Dispose();
             *
             * pictureBox.Image = newBitmap;
             */
            string            tempPath = VideoSourceDevice.GetCurrentPicturePath();
            Image <Rgb, Byte> rawImage = new Image <Rgb, byte>(tempPath);

            double[] threshold1 = new double[]
            {
                200
            };
            double[] threshold2 = new double[]
            {
                200, 300, 400
            };
            CannyTextureAnalysisResult textureAnalysisResult = Cv.AutoCannyTextureAnalysis(rawImage, threshold1, threshold2, 0);
            ZedGraphForm tempZedGraphForm = new ZedGraphForm(textureAnalysisResult.Data);

            tempZedGraphForm.Show();
            MessageBox.Show(textureAnalysisResult.Info);
        }