Capture.QueryFrame not working in android

Post your Android related questions here.
Post Reply
Adil
Posts: 2
Joined: Mon Mar 21, 2016 2:49 pm

Capture.QueryFrame not working in android

Post by Adil » Mon Mar 21, 2016 3:07 pm

Hi, I am trying to capture frames from android camera. But Capture.QueryFrame is returning a null matrix. I have enabled camera in required permission in Android manifest.

Thanks in Advance

Weimar
Posts: 1
Joined: Thu Apr 28, 2016 9:38 pm

Re: Capture.QueryFrame not working in android

Post by Weimar » Thu Apr 28, 2016 9:43 pm

I believe I am running into the same problem, using the Android Camera capture example. I have narrowed the line of code to this:
Function: public static void InitUndistortRectifyMap(...
.
.
using (OutputArray oaMap1 = map1.GetOutputArray())

map1 is always null when attempting to run against an emulator (even with webcam set to the rear camera) and the exception is thrown here.

Hopefully this can be further debugged by someone with additional experience?

Adil
Posts: 2
Joined: Mon Mar 21, 2016 2:49 pm

Re: Capture.QueryFrame not working in android

Post by Adil » Fri Apr 29, 2016 5:22 am

Camera capture example does not work on emulator. You have to debug it on real android device.

canming
Site Admin
Posts: 1011
Joined: Thu Feb 28, 2008 4:16 pm

Re: Capture.QueryFrame not working in android

Post by canming » Wed Jul 19, 2017 2:28 pm

Open CV's Video Capture class do not works on Android.

To access the camera stream on Android, you will need to use the native android camera interface. The Android demo project contains a Camera Preview demo that show you how to access the camera stream. Please take a look at the "CameraPreview.cs" and "CameraPreviewActivity.cs" file under the demo project.

Post Reply