标签:
Java 使用opencv中的sift进行计算。
<span style="white-space:pre"> </span>/** * 传入一张图片得到sift特征点 * @param mat * @return */ public MatOfKeyPoint getFeaturePoints(Mat mat){ FeatureDetector fd = FeatureDetector.create(FeatureDetector.SIFT); MatOfKeyPoint mkp =new MatOfKeyPoint(); fd.detect(mat, mkp); return mkp; } /** * 获取sift特征 * @param mat * @return */ public Mat getFeature(Mat mat){ Mat desc = new Mat(); MatOfKeyPoint mkp = getFeaturePoints(mat); DescriptorExtractor de = DescriptorExtractor.create(DescriptorExtractor.SIFT); de.compute(mat,mkp,desc );//提取sift特征 return desc; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/yuexin2/article/details/46894023