سؤال

In my code, I don't want to read data from rout of images,such as

    cv::Mat img_1 = imread("F:\1.tif");

Instead I wanna read data from pointer:

    float* srcImage;//pointer to image data
    cv::Mat img_1(height, width, CV_32FC1, srcImage);

However, I found that, by this way, when I used the img_1 in the following ORB function, it didn't work

    cv::ORB orb;
vector<cv::KeyPoint> keyPoints_1;
cv::Mat descriptors_1;
orb(img_1, cv::Mat(), keyPoints_1, descriptors_1);

How can I pass data to Mat from pointer? Is there any difference between imread() function and pass data from pointer? Or, is there any special request in cv::ORB function ?

Thanks very much! I'm not familiar with OpenCV, I just start using it for a few weeks, I just need solve this problem and the rest part of my code depends on results of this part.

هل كانت مفيدة؟

المحلول

orb wants an 8bit grayscale image as input, not a CV_32FC1

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top