using OpenCvSharp;
using OpenCvSharp.CPlusPlus;

namespace OpenCVSharpSandbox
{
    public class Visualisation
    {
        public static void DrawBriskPoints() {
            var brisk = new BRISK(50, 0, 3f);
            var descriptors = new Mat();
            KeyPoint[] points;
            var imgNorm = imgs.imgMTE.CopyMakeBorder(30, 30, 30, 30, BorderType.Constant, Scalar.Gray);
            points = brisk.Detect(imgNorm);
            var imgOut = new Mat();
            Cv2.DrawKeypoints(imgNorm, points, imgOut);
            Cv2.ImShow("brisk", imgOut);
            Cv2.WaitKey();
        }

        public static void DrawBriefPoints() {
            KeyPoint[] points;
            var imgPyr = new Mat();
            Cv2.PyrDown(imgs.img1, imgPyr);
            using (var fastDetector = new FastFeatureDetector(35))
            {
                points = fastDetector.Detect(imgPyr);
            }
            var imgOut = new Mat();
            Cv2.DrawKeypoints(imgPyr, points, imgOut);
            Cv2.ImShow("brief", imgOut);
            Cv2.WaitKey();
        }
        public static void DrawORBPoints()
        {
            var orb = new ORB(1200, 1.2f, 8, 50, 1, 2, ORBScore.Fast);
            var descriptors = new Mat();
            KeyPoint[] points;
            points = orb.Detect(imgs.img2);
            var imgOut = new Mat();
            Cv2.DrawKeypoints(imgs.img2, points, imgOut);
            Cv2.ImShow("orb", imgOut);
            Cv2.WaitKey();
        }
        public static void DrawBriefPoints1()
        {
            KeyPoint[] points;
            using (var fastDetector = new FastFeatureDetector(35, false))
            {
                points = fastDetector.Detect(imgs.img1);
            }
            var imgOut = new Mat();
            Cv2.DrawKeypoints(imgs.img1, points, imgOut);
            Cv2.ImShow("brief", imgOut);
            Cv2.WaitKey();
        }
    }
}