android - How to use OpenGL by using OpenCV Camera -
i'm using org.opencv.android.javacameraview opencv4android preview camera view , use opencv process pic.
want use opengl draw on view.
no idea so.
can directly draw on mat opengl or must draw opengl images on javacameraview?
the layout looks this:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:opencv="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_camera" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="0dp" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.croxx.op3d.cameraactivity"> <org.opencv.android.javacameraview android:id="@+id/camera_view" android:layout_width="match_parent" android:layout_height="match_parent" opencv:camera_id="any" opencv:show_fps="true" />
and activity implements camerabridgeviewbase.cvcameraviewlistener2 :
public class cameraactivity extends appcompatactivity implements camerabridgeviewbase.cvcameraviewlistener2 { ... ... }
and using camerabridgeviewbase :
private camerabridgeviewbase mcvcamera;
and using these codes in oncreate :
mcvcamera = (camerabridgeviewbase) findviewbyid(r.id.camera_view); mcvcamera.setcvcameraviewlistener(this);
Comments
Post a Comment