You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openCV/OpenCV/OpenCVClass.cs

24 lines
465 B

3 years ago
using OpenCvSharp;
using System;
namespace OpenCV
{
class OpenCVClass : IDisposable
{
IplImage gray;
public IplImage GrayScale(IplImage src)
{
gray = new IplImage(src.Size, BitDepth.U8, 1);
Cv.CvtColor(src, gray, ColorConversion.BgrToGray);
return gray;
}
public void Dispose()
{
if (gray != null)
Cv.ReleaseImage(gray);
}
}
}