Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is it possible to switch between Front camera and Back camera at runtime?

I've created a Native camera view like this :

<org.opencv.android.NativeCameraView
            android:id="@+id/tutorial1_activity_native_surface_view"
            android:layout_width="350px"
            android:layout_height="350px"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            opencv:camera_id="front" />

Now I have 2 questions.

  1. How can I switch from front camera to back camera at run time?
  2. How can I turn off and on the camera at run time ?

Is it possible to switch between Front camera and Back camera at runtime?

I've created a Native camera view like this :

<org.opencv.android.NativeCameraView
            android:id="@+id/tutorial1_activity_native_surface_view"
            android:layout_width="350px"
            android:layout_height="350px"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            opencv:camera_id="front" />

Now I have 2 questions.

  1. How can I switch from front camera to back camera at run time?
  2. How can I turn off and on the camera at run time ?

Is it possible to switch between Front camera and Back camera at runtime?

I've created a Native camera view like this :

<org.opencv.android.NativeCameraView
            android:id="@+id/tutorial1_activity_native_surface_view"
            android:layout_width="350px"
            android:layout_height="350px"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            opencv:camera_id="front" />

Now I have 2 questions.

  1. How can I switch from front camera to back camera at run time?
  2. How can I turn off and on the camera at run time ?