Not getting current frame in Opencv

asked 2017-11-18 07:59:11 -0500

I am using OpenCV

CameraBridgeViewBase.CvCameraViewListener2

and I get frames through

onCameraFrame

function , I store it into an ArrayList by cloning

inputFrame.clone()

current frame and convert it into jpg when ArrayList has at least 10 objects But many times I get previous frames not the current frame.

    public static ArrayList<Mat> frames = new ArrayList<>();
    private static int indexNo = 0;
    @Override
        public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
                mRgba = inputFrame.rgba();
                frames.add(indexNo,mRgba.clone());
                indexNo++;

            return inputFrame.rgba();

        }
edit retag flag offensive close merge delete