Ask Your Question

OpenCV Tutorial 1 - Add OpenCV on API 8

asked 2012-09-24 02:37:40 -0500

Droidkie gravatar image

i'd like to run OpenCV Tutorial 1 - Add OpenCV (VIEW_MODE_RGBA, VIEW_MODE_GRAY, VIEW_MODE_CANNY) on API 8 and not API 11 but has an import problem (import;) because SurfaceTexture did not exist yet on API 8.

is there an object on API 8 that can replace SurfaceTexture so that the code will work? a sample code will help a lot.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-09-25 03:41:39 -0500

Rui Marques gravatar image

Yes, if i remember correctly SurfaceTexture is used in this method, you can comment it like this, comment the import, and it works with API 8 (but will have problems with API >= honeycomb, of course).

    public void setPreview() throws IOException {
        //    mCamera.setPreviewTexture( new SurfaceTexture(10) );
edit flag offensive delete link more


thank you for the reply! why will API >= HONEYCOMB have a problem? i thought the later APIs support the older APIs? there's also an error in the codes below. what do these codes do? if(FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)){params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);}

Droidkie gravatar imageDroidkie ( 2012-09-26 10:05:24 -0500 )edit

You can also delete/comment that code if you are targeting an API8 device. That code is to set a camera parameter, that in my guess, did not exist before HONEYCOMB API. Like its name says, it makes the video camera to continuously auto focus, or something :P

Rui Marques gravatar imageRui Marques ( 2012-09-26 10:17:10 -0500 )edit

thank you! ^_^

Droidkie gravatar imageDroidkie ( 2012-09-26 12:22:53 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2012-09-24 02:37:40 -0500

Seen: 815 times

Last updated: Sep 25 '12