码迷,mamicode.com
首页 > 其他好文 > 详细

在VLFEAT中mat类型图片转换成constant float* 来进行vl_dsift_process

时间:2014-12-19 18:42:20      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

How to convert an OpenCV cv::Mat into a float* that can be fed into Vlfeat vl_dsift_process:

 

Mat mat = imread("image_name.jpg", 0); // 0 stands for grayscale

vector<float> img;
for (int i = 0; i < mat.rows; ++i)
  for (int j = 0; j < mat.cols; ++j)
    img.push_back(mat.at<unsigned char>(i, j));

vl_dsift_process(dsift, &img[0]);



参考链接:http://stackoverflow.com/questions/7927105/how-to-convert-an-opencv-cvmat-into-a-float-that-can-be-fed-into-vlfeat-vl-ds/

在VLFEAT中mat类型图片转换成constant float* 来进行vl_dsift_process

标签:

原文地址:http://www.cnblogs.com/ct1104/p/4174324.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!