Ejemplo n.º 1
0
        public override void ProcessData(Mat sourceImage, Mat destImage)
        {
            Size size = sourceImage.Size;

            Mat i0 = GetBufferGray(size, 0);
            Mat i1 = GetBufferGray(size, 1);
            Mat i2 = GetBufferGray(size, 2);
            Mat i3 = GetBufferGray(size, 3);

            CvInvoke.ExtractChannel(sourceImage, i0, 0);
            CvInvoke.Canny(i0, i1, _thresh, _threshLinking, _apertureSize);
            CvInvoke.ExtractChannel(sourceImage, i0, 1);
            CvInvoke.Canny(i0, i2, _thresh, _threshLinking, _apertureSize);
            CvInvoke.ExtractChannel(sourceImage, i0, 2);
            CvInvoke.Canny(i0, i3, _thresh, _threshLinking, _apertureSize);
            using (VectorOfMat vm = new VectorOfMat(i1, i2, i3))
            {
                CvInvoke.Merge(vm, destImage);
            }
        }