Android: Real Time Image Processing

前端 未结 1 1435
北恋
北恋 2021-02-14 17:44

I have an application which takes a camera preview, performs some basic image processing function on every frame (e.g. edge detection, colour change, image warp etc.) and displa

相关标签:
1条回答
  • 2021-02-14 18:01

    I have also done something like this. What I do is extend the Camera View. I don't think the camera view is updated every frame, but retrieved. And only the View that you have changed would have to be updated. OpenCv do does a better job than native camera. After importing org.opencv.highgui.VideoCapture , you can directly access the camera using:

    VideoCapture camera;
    camera.retrieve(mGrayMat, Highgui.CV_CAP_ANDROID_GREY_FRAME);
    

    to convert mGrayMat to mRgbaMat: ( org.opencv.imgproc.Imgproc)

    Imgproc.cvtColor(mGrayMat, mRgbaMat, Imgproc.COLOR_GRAY2BGRA, 4);
    
    0 讨论(0)
提交回复
热议问题