dlib-android icon indicating copy to clipboard operation
dlib-android copied to clipboard

different feature vector from the same image

Open xueliang opened this issue 6 years ago • 0 comments

Hello, I meet a very strange problem. I find that the app obtains a little poor performance than that in PC. When digging into the code, I find that for the same image, the features obtained in training and in recognition is a little different. But I can not figure out why.

In training, the feature is loaded by cv::imread. In recognition, the image is loaded by BitmapFactory.

BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bmp = BitmapFactory.decodeFile(filename,options); 

And then covert to cv::Mat by

 jniutils::ConvertBitmapToRGBAMat(env, bitmap, rgbaMat, true);
 cv::cvtColor(rgbaMat, bgrMat, cv::COLOR_RGBA2BGR);

Is there any difference between these two ways? thanks.

xueliang avatar Apr 29 '19 05:04 xueliang