I want to write an Android App that can track object with OpenCV features matching in real time. For now, I can features matching with two pictures, I want it can work in real time, even the camera frames will be pretty low, I still want to try it. Any help、suggestion or references for me?
Edit: I found this question and I try it like this
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
mRgba = inputFrame.rgba();
mGray = inputFrame.gray();
VideoCapture mcapture = new VideoCapture(0);
mcapture.open(Highgui.CV_CAP_ANDROID_COLOR_FRAME);
if(!mcapture.isOpened()){
Core.putText(mRgba, "Capture Fail", new Point(50, 50), BIND_AUTO_CREATE, BIND_AUTO_CREATE, Color_Green);
}else{
Mat frame = new Mat();
Imgproc.cvtColor(mRgba, frame, Imgproc.COLOR_RGB2GRAY);
mcapture.retrieve(frame, 3);
mRgba = frame;
}
return mRgba;
}
VideoCapture is not open . any help?