Ask Your Question
0

Could I access android camera by c++ api(opencv4)?

asked 2019-02-27 00:32:37 -0600

tham gravatar image

updated 2019-02-27 00:33:47 -0600

As the title mentioned, try to google by the keywords "OpenCV4 android camera" or "OpenCV4 android camera c++" but cannot find the answers like "yes" or "no", I remember opencv3 do not support this feature. 

I found the examples written by java, but I am not sure under the hood, it is using the android api or c++ api(cv::VideoCapture) to capture the frame with JNI binding.
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-05-11 14:37:55 -0600

Afflospark gravatar image

Yes its possible. you have to use these classes to use camera

import org.opencv.android.JavaCameraView;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;

You can try to search "opencv 4 android studio use camera" on google.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-02-27 00:32:37 -0600

Seen: 733 times

Last updated: May 11 '19