0xfaded / pislam

Real-time feature extraction on the Raspberry Pi 3
GNU General Public License v3.0
116 stars 34 forks source link

Convert pislam Descriptors to ORB Slam2 Descriptors? #10

Open Fredrum opened 4 years ago

Fredrum commented 4 years ago

Hi again!

I am trying to take the pislam descriptors and convert them into the cv::Mat based descriptors that are used in the ORB SLAM code. So basically this, std::vector<uint32_t> descriptors;

needs to map onto this:

_descriptors.create(keypoints.size(), 32, CV_8U); // _descriptors is OutputArray/Mat

I'm having a hard time understanding how that should work. Do you have any advice?

EDIT: Will this need to involve bit shifting somehow?

Cheers Fred

Fredrum commented 4 years ago

I got something that builds and runs but something is not correct as I get wild green markers, or no markers, in the ORB test.

This is what I have now,

    _descriptors.create(keypoints.size(), 32, CV_8U);  // The cv::OutputArray
    Mat DMat = _descriptors.getMat(); // Then fill DMat for output
    for(int i=0; i < descriptors.size(); i++)
    {
        cv::Mat row = cv::Mat(1, 32, CV_8U, descriptors[i]); // taking the Pislam descriptor
        DMat.push_back(row);
    }