Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Update, if anyone ever needs it, I chose to encode the descriptors as a picture using PIL, here it what it looks like on the python saving part:

from PIL import Image
im = Image.fromarray(featuresDB)
im.save("features.png")

featuresDB being the numpy array of ORB descriptors. On the java side, using android studio, put this picture in src/main/res/drawable/features.png, and load it as such:

Mat features = Utils.loadResource(MainActivity.this, R.drawable.features, Imgcodecs.IMREAD_GRAYSCALE);

Which requires those imports:

import org.opencv.core.Mat;
import org.opencv.android.Utils;
import org.opencv.imgcodecs.Imgcodecs;