Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use FindHomography (parameters) in opencv android studio?

Hi folks, I am getting this error while using FindHomography in opencv android studio environment. The error in below,

E/cv::error(): OpenCV(3.4.10) Error: Bad argument (The input arrays should be 2D or 3D point sets) in cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double), file /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp, line 372 E/org.opencv.calib3d: calib3d::findHomography_13() caught cv::Exception: OpenCV(3.4.10) /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp:372: error: (-5:Bad argument) The input arrays should be 2D or 3D point sets in function 'cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double)' E/AndroidRuntime: FATAL EXCEPTION: Thread-3 Process: com.example.opencvrecognition, PID: 17738 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.10) /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp:372: error: (-5:Bad argument) The input arrays should be 2D or 3D point sets in function 'cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double)' ] at org.opencv.calib3d.Calib3d.findHomography_3(Native Method) at org.opencv.calib3d.Calib3d.findHomography(Calib3d.java:1917) at com.example.opencvrecognition.MainActivity.recognize(MainActivity.java:170) at com.example.opencvrecognition.MainActivity.onCameraFrame(MainActivity.java:209) at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392) at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:390) at java.lang.Thread.run(Thread.java:764)

Can you please suggest to sort out the issues.

click to hide/show revision 2
None

updated 2020-05-26 01:17:05 -0600

berak gravatar image

How to use FindHomography (parameters) in opencv android studio?

Hi folks, I am getting this error while using FindHomography in opencv android studio environment. The error in below,

E/cv::error(): OpenCV(3.4.10) Error: Bad argument (The input arrays should be 2D or 3D point sets) in cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double), file /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp, line 372
E/org.opencv.calib3d: calib3d::findHomography_13() caught cv::Exception: OpenCV(3.4.10) /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp:372: error: (-5:Bad argument) The input arrays should be 2D or 3D point sets in function 'cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double)'
E/AndroidRuntime: FATAL EXCEPTION: Thread-3
    Process: com.example.opencvrecognition, PID: 17738
    CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.10) /build/3_4_pack-android/opencv/modules/calib3d/src/fundam.cpp:372: error: (-5:Bad argument) The input arrays should be 2D or 3D point sets in function 'cv::Mat cv::findHomography(cv::InputArray, cv::InputArray, int, double, cv::OutputArray, int, double)'
    ]
        at org.opencv.calib3d.Calib3d.findHomography_3(Native Method)
        at org.opencv.calib3d.Calib3d.findHomography(Calib3d.java:1917)
        at com.example.opencvrecognition.MainActivity.recognize(MainActivity.java:170)
        at com.example.opencvrecognition.MainActivity.onCameraFrame(MainActivity.java:209)
        at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
        at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:390)
        at java.lang.Thread.run(Thread.java:764)

java.lang.Thread.run(Thread.java:764)

Can you please suggest to sort out the issues.