What is the best way to capture images in android and process them with opencv ? should i use the surface view As here or i should use the opencv camera as in o
In the OpenCV samples there is a CameraBridgeViewBase that helps in capturing, processing and showing the results of the camera preview (continuous stream of lower resolution images).
If you want to process a single capture with more resolution, you should use something similar to onPictureTaken(). Then you can read the image using Highgui.imread() and process it.
You could also avoid writing and reading to a file by creating a Bitmap from the data array with BitmapFactory.decodeByteArray() and then converting the Bitmap to a Mat using Utils.bitmapToMat()