private byte[] OutputPicture;//出力する画像

        //一定時間ごとに解析
        void Detection()
        {
            if (_pictureBuf.Count < 2)
            {
                return;
            }

            int height = _defBitmap.Height;
            int width  = _defBitmap.Width;
            int stride = _defBitmap.Stride;

            byte[] pic1 = _pictureBuf[0];

            HSV[,] picHsv = new HSV[width, height];

            //hsv作成
            for (int i = 0; i < height; i++)
            {
                int h = i * stride;
                for (int j = 0; j < width; j++)
                {
                    picHsv[j, i] = HSV.BGRtoHSV(pic1[4 * j + h], pic1[1 + 4 * j + h], pic1[2 + 4 * j + h]);
                }
            }
            _hsvs.Add(picHsv);

            //検出器の実行
            Detector1(width, height, stride, ref pic1);
            //Detector2(width, height, stride, ref pic1);

            OutputPicture = pic1;
        }
        private byte[] OutputPicture; //出力する画像

        //一定時間ごとに解析
        void Detection()
        {
            if (_pictureBuf.Count < 2)
            {
                return;
            }

            int height = _defBitmap.Height;
            int width  = _defBitmap.Width;
            int stride = _defBitmap.Stride;

            byte[] pic1 = _pictureBuf[0];


            HSV[,] picHsv    = new HSV[width, height];
            float[,] picGray = new float[width, height];

            //hsv作成
            for (int i = 0; i < height; i++)
            {
                int h = i * stride;
                for (int j = 0; j < width; j++)
                {
                    byte b = pic1[4 * j + h];
                    byte g = pic1[4 * j + h + 1];
                    byte r = pic1[4 * j + h + 2];

                    picHsv[j, i]  = HSV.BGRtoHSV(b, g, r);
                    picGray[j, i] = (b * 0.114f + g * 0.587f + r * 0.299f);
                }
            }
            _hsvs.Add(picHsv);
            _grayScales.Add(picGray);

            //時間軸検出器の実行
            //Detector1(width, height, stride, ref pic1);
            //Detector2(width, height, stride, ref pic1);
            //Detector3(width,height,stride,ref pic1);

            //エッジ抽出
            if (_grayScales.Count > 5)
            {
                pic1 = new byte[pic1.Length];
                //EdgeDetector(width, height, stride, ref pic1, _grayScales[1]);
                EdgeDetector(width, height, stride, ref pic1, _grayScales[4]);
            }
            OutputPicture = pic1;
        }