简体   繁体   中英

OpenCV Android Camera Capture

I want to modify "OpenCV Tutorial 1 - Add OpenCV" from to capture images and save it at the Gallery. How do I achieve this?

My main goal is to capture a frame, apply OpenCV functions to it, and then save it in the phone.

I can do the OpenCV functions but not the capture frame part.

I found using the Native Camera quite tricky. The easiest way is to capture the images using the normal phone camera using the Camera Intent. After you have captured the image, you can send them off to OpenCV for processing and saving.

So in pseudocode:

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, 0);

// In your activity
public void onActivityResult(Intent data, int requestCode, int resultCode){
    // grab the image from the 'data' returned 

    // send the image to your opencv classes for processing and saving
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM