Je capture les images continues et en extrayant les fonctionnalités rapides et en faisant correspondre ces fonctionnalités pour obtenir la matrice de traduction Rotation et . cela m'aidera dans la reconstruction de scène en 3D mais en obtenant une erreur lorsque j'utilise la commande Calib3d.findFundamentalMat et que je ne suis pas capable de la résoudre.obtenir l'erreur tout en utilisant findFundamentalMat dans android opencv et pas en mesure de le résoudre
MatOfDMatch matches = new MatOfDMatch();
descriptorM.match(firstImgDescriptors, secondImgDescriptors, matches);
Calib3d calib = new Calib3d();
MatOfPoint2f imgpts1 = getMatOfPoint2fFromDMatches(matches, keyPoints1, 0);
MatOfPoint2f imgpts2 = getMatOfPoint2fFromDMatches(matches, keyPoints2, 1);
Mat F = Calib3d.findFundamentalMat(imgpts1, imgpts2, Calib3d.FM_RANSAC,3, 0.99);
private static MatOfPoint2f getMatOfPoint2fFromDMatches(MatOfDMatch matches,
MatOfKeyPoint keyP, int tipo) {
/* 0 para query, 1 para train*/
DMatch dm[] = matches.toArray();
List<Point> lp = new ArrayList<Point>(dm.length);
KeyPoint tkp[] = keyP.toArray();
if(tipo == 0){
for (int i = 0; i < dm.length; i++) {
DMatch dmm = dm[i];
//if (dmm.queryIdx < tkp.length)
lp.add(tkp[dmm.queryIdx].pt);
}
}
if (tipo == 1) {
for (int i = 0; i < dm.length; i++) {
DMatch dmm = dm[i];
// if (dmm.trainIdx < tkp.length)
lp.add(tkp[dmm.trainIdx].pt);
}
}
return new MatOfPoint2f(lp.toArray(new Point[0]));
}
the Logcat window show the following error
E/cv::error(): OpenCV Error: Bad argument (The input arrays should be 2D or 3D point sets) in cv::Mat cv::findFundamentalMat(cv::InputArray, cv::InputArray, int, double, double, cv::OutputArray), file /Volumes/Linux/builds/master_pack-android/opencv/modules/calib3d/src/fundam.cpp, line 724
09-11 15:29:04.578 13625-13625/io.rpng.calibration E/org.opencv.calib3d: calib3d::findFundamentalMat_11() caught cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/calib3d/src/fundam.cpp:724: error: (-5) The input arrays should be 2D or 3D point sets in function cv::Mat cv::findFundamentalMat(cv::InputArray, cv::InputArray, int, double, double, cv::OutputArray)
09-11 15:29:04.579 13625-13625/io.rpng.calibration D/AndroidRuntime: Shutting down VM
09-11 15:29:04.588 13625-13625/io.rpng.calibration E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.rpng.calibration, PID: 13625
CvException [org.opencv.core.CvException: cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/calib3d/src/fundam.cpp:724: error: (-5) The input arrays should be 2D or 3D point sets in function cv::Mat cv::findFundamentalMat(cv::InputArray, cv::InputArray, int, double, double, cv::OutputArray)
]
at org.opencv.calib3d.Calib3d.findFundamentalMat_1(Native Method)
at org.opencv.calib3d.Calib3d.findFundamentalMat(Calib3d.java:153)
at com.pradeep.calibration.activities.MainActivity$5.onImageAvailable(MainActivity.java:529)
at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:648)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5769)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
problème grâce résolu. c'était dû à une valeur nulle –