can not run Imgproc.Findfeatures: AndroidRuntime FATAL exception: Thread
hi guys:
In the Open cv Tutorial1, i just want to use some Imgproc functions to deal with the input camera images on the callback function: public Mat onCameraFrame(CvCameraViewFrame inputFrame) . I just add this sentences at onCameraFram:
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
MatOfPoint corners = null;
mRgba = inputFrame.rgba();
mGray= inputFrame.gray();
Imgproc.goodFeaturesToTrack(mGray, corners, 10, 0.5, 0.5);
return mRgba;
}
but the when runs to Imgpro.goodFeaturesToTrack, the error jump out on my cell phone and the program stopped.
the LogCat like this:
03-21 11:08:32.519: E/Trace(8212): error opening trace file: No such file or directory (2) 03-21 11:08:32.972: E/OpenCV_for_Tegra(8212): Tegra Version detected: 0 03-21 11:08:33.534: E/AndroidRuntime(8212): FATAL EXCEPTION: Thread-405 03-21 11:08:33.534: E/AndroidRuntime(8212): java.lang.NullPointerException 03-21 11:08:33.534: E/AndroidRuntime(8212): at org.opencv.imgproc.Imgproc.goodFeaturesToTrack(Imgproc.java:6486) 03-21 11:08:33.534: E/AndroidRuntime(8212): at org.opencv.samples.tutorial1.Tutorial1Activity.onCameraFrame(Tutorial1Activity.java:161) 03-21 11:08:33.534: E/AndroidRuntime(8212): at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:376) 03-21 11:08:33.534: E/AndroidRuntime(8212): at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:294) 03-21 11:08:33.534: E/AndroidRuntime(8212): at java.lang.Thread.run(Thread.java:856)