OpenCV with Android Capture Images

后端 未结 1 439
借酒劲吻你
借酒劲吻你 2021-02-02 04:37

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

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 05:24

    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()

    0 讨论(0)
提交回复
热议问题