Ask Your Question

GalicianOpencv's profile - activity

2014-06-21 06:17:42 -0600 received badge  Famous Question (source)
2013-09-16 03:33:47 -0600 received badge  Notable Question (source)
2013-05-27 04:24:35 -0600 received badge  Popular Question (source)
2012-12-26 05:36:00 -0600 received badge  Self-Learner (source)
2012-12-26 05:34:23 -0600 received badge  Nice Question (source)
2012-11-18 15:03:22 -0600 received badge  Critic (source)
2012-11-18 15:03:02 -0600 received badge  Scholar (source)
2012-11-18 15:03:01 -0600 received badge  Supporter (source)
2012-11-18 15:00:57 -0600 answered a question How I use front camera with new OpenCV 2.4.3 for android?

Thank you Andrey.

I resolved this issue modifying the NativeCameraView as you told me. This is a provisional solution, but it's easy and quick.

What I have done is to go to OpenCV Library - 2.4.3 eclipse project, them open org.opencv.android package. Them open file NativeCameraView and change the VIdeoCapture initialization on initializeCamera function.

mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID+1);

image description

After doing it, we can use the new OpenCV interface with NativeCameraView that inherits of CameraBridgeViewBase

NativeCameraView mOpenCvCameraView;
mOpenCvCameraView = (NativeCameraView)findViewById(R.id.activity_native_surface_view);   
mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);   
mOpenCvCameraView.setCvCameraViewListener(this);
2012-11-16 10:08:00 -0600 received badge  Student (source)
2012-11-15 13:25:02 -0600 asked a question How I use front camera with new OpenCV 2.4.3 for android?

Hello.

I'm developing OpenCV project on Android devices. I adapted my previous code android interface to this new OpenCV 2.4.3. The implementation of CameraBridgeViewBase is nice and has many facilities for beginners, but i can't use the frontal face.

I tested with the permissions and the camera configuration, but I did not succeed.

With the nextcode, it's posible set a new configuration with the frontal camera?

CameraBridgeViewBase mOpenCvCameraView;
OpenCvCameraView = (CameraBridgeViewBase)findViewById(R.id.activity_native_surface_view);    
mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);     
mOpenCvCameraView.setCvCameraViewListener(this);

I want to keep this interface, otherwise I can use the following code that used before :

mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID+1);

thank you in advance