opencv - OrbFeaturesFinder giving different result when implemented on Android platform -
i using orbfeaturesfinder detect keypoints in images.
ptr<featuresfinder> finder; finder = makeptr<orbfeaturesfinder>(); vector<imagefeatures> features(num_images); (*finder)(img, features[i]);
i used code on linux , implemented same on android, results different sometimes, in given link http://imgur.com/a/wqxzx
what can reason behind nature of output.
method of accessing images in android image saved in jpeg form, read[edit] -
for(int = 0; < imgnames.size(); i++){ bitmap bitmap = getthumbnail(imgnames.get(i)); int imagew = bitmap.getwidth(); int imageh = bitmap.getheight(); byte[] rgb = getbytearray(imagew, imageh, bitmap, "rgb"); bitmap.recycle(); mat mrgb = new mat(imageh, imagew, cvtype.cv_8uc3); mrgb.put(0, 0, rgb); imgproc.cvtcolor(mrgb, mrgb, imgproc.color_bgr2rgb, 3); panoimgs.add(mrgb); }
and sent jni -
jclass matclass = env->findclass("org/opencv/core/mat"); jmethodid getnativeaddr = env->getmethodid(matclass, "getnativeobjaddr", "()j"); int numimgs = env->getarraylength(jinputarray); vector<mat> natimgs; for(int i=0; < numimgs; ++i) { natimgs.push_back( *(mat*)env->calllongmethod( env->getobjectarrayelement(jinputarray, i), getnativeaddr ) ); }
for linux - saving same image in jpeg format , using imread access files.
Comments
Post a Comment