opencvsharp 特征检测

namespace 特征检测与匹配
{
    class Program
    {
        static Mat mat1 = new Mat(@"1.jpg", ImreadModes.AnyColor);
     //   static Mat mat2 = new Mat(@"2.jpg", ImreadModes.AnyColor);
        static void Main(string[] args)
        {    
            Cv2.ImShow("mat1", mat1);
         //   Cv2.ImShow("mat2", mat2);
            CvTrackbar cvTrackbar = new CvTrackbar("threshould", "mat1", 0, 255, new CvTrackbarCallback(resultBack)); 
            Cv2.WaitKey();
        }
        static void resultBack(int o)
        {
            Mat nweTemp= new Mat();
            mat1.CopyTo(nweTemp);
            #region Fast 算子 继承自XFeatures2D 需要引用      
            FastFeatureDetector fastFeatureDetector = FastFeatureDetector.Create(o);
            KeyPoint[] keyPoints = fastFeatureDetector.Detect(nweTemp);
            Cv2.DrawKeypoints(nweTemp, keyPoints, nweTemp);
            #endregion
          //  Cv2.Threshold(mat1,mat1,0,o,ThresholdTypes.Binary);
            Cv2.ImShow("mat1", nweTemp);
            nweTemp.Dispose();
        }
    } 
}

今天晚了没写完先上个FAST算子的用法
附结果:

你可能感兴趣的:(opencvsharp)