using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenCV.OpenCV
{
    internal partial class OpenCVClass : IDisposable
    {
        public IplImage CannyEdge(IplImage src)
        {
            _cvt = new IplImage(src.Size, BitDepth.U8, 1);
            Cv.Canny(src, _cvt, 100, 255, ApertureSize.Size3);

            return _cvt;
        }

        public IplImage SobelEdge(IplImage src)
        {
            _cvt = new IplImage(src.Size, BitDepth.U8, 1);
            Cv.CvtColor(src, _cvt, ColorConversion.BgrToGray);
            Cv.Sobel(_cvt, _cvt, 1, 1, ApertureSize.Size3);

            return _cvt;
        }

        public IplImage LaplaceEdge(IplImage src)
        {
            _cvt = new IplImage(src.Size, BitDepth.U8, 1);
            Cv.CvtColor(src, _cvt, ColorConversion.BgrToGray);
            Cv.Laplace(_cvt, _cvt, ApertureSize.Size3);

            return _cvt;
        }
    }
}
