public Mat ComputeDescriptor(KeyPointModel keyPoints) { Mat result = new Mat(); Mat image = new Mat(keyPoints.InputFile.fileInfo.FullName); _freak.Compute(image, keyPoints.DetectedKeyPoints, result); return(result); }
public static UMat Run(Mat img) { var modelKeyPoints = new VectorOfKeyPoint(); var result = new UMat(); using (UMat uModelImage = img.ToUMat(AccessType.Read)) { FastDetector fastCPU = new FastDetector(10, true); Freak freakCPU = new Freak(); UMat modelDescriptors = new UMat(); fastCPU.DetectRaw(uModelImage, modelKeyPoints); freakCPU.Compute(uModelImage, modelKeyPoints, modelDescriptors); Features2DToolbox.DrawKeypoints(img, modelKeyPoints, result, new Bgr(Color.Red), Features2DToolbox.KeypointDrawType.NotDrawSinglePoints); } return(result); }