Ask Your Question
0

opencv for android2.4.4 How to instantiate a CameraBridgeViewBase surface with out xml

asked 2013-03-15 22:19:24 -0600

alexon gravatar image

updated 2013-03-16 04:07:34 -0600

How to instantiate a CameraBridgeViewBase surface so that I can use setContentView(cvCam) with out firstly describe it in the layout xml file.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-16 04:32:58 -0600

CameraBridgeViewBase is base abstract class. You need to instantiate NativeCameraView or JavaCameraView object. Both of them uses OpenCV classes and functions and must be constructed after OpenCV initialization. I recommend you to use public JavaCameraView(Context context, AttributeSet attrs) or public NativeCameraView(Context context, AttributeSet attrs) constructor to fully initialize camera.

edit flag offensive delete link more

Comments

Ok, but how can I correctly write the constructor to initiate a JavaCameraView . I don't understand how to pass the "Context context, AttributeSet attrs" this two parameter.... since there is no examples doing this.

alexon gravatar imagealexon ( 2013-03-16 07:01:14 -0600 )edit

I create feature request on project tracker: http://code.opencv.org/issues/2893. I think such sample will be published with one of the feature releases.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-03-16 12:18:53 -0600 )edit

Question Tools

Stats

Asked: 2013-03-15 22:19:24 -0600

Seen: 232 times

Last updated: Mar 16 '13