Opencv android, capture image

后端 未结 2 1954
执笔经年
执笔经年 2021-02-06 18:49

I will try to simplify my problem. Lets say i just want to see grayscale images using camera, i do it this way:

public Mat onCameraFrame(CvCameraViewFrame inputF         


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-02-06 19:32

    It is because you are modifying Mat in onCameraFrame() and writing the image data to file in onPictureTaken().

    The Mat in onCameraFrame is never written to the file.

    The byte[] in onPictureTaken() contains the picture taken by the camera when you push a button or touch on the screen whatever is triggering takePicture().

    If you want to the write picture with some effects then you will have to convert byte[] to Mat and then make effects in this Mat and then write it to file using imwrite() or convert the modified Mat back to byte[] and then write it to file using FileOutputStream as shown in your code.

    imwrite() will be slower than the FileOutputStream approach

提交回复
热议问题