0

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?

Community
  • 1
  • 1
Tony
  • 113
  • 2
  • 3
  • 16
  • Have you tried using the cv::VideoCapture class to get the frames from the camera capture or maybe something similar to what was suggested in [this link](http://stackoverflow.com/questions/19218844/opencv-with-android-capture-images)..? Once you have the frames, you can simply plug in your existing program to the capture sequence. HTH – scap3y Nov 12 '13 at 14:27
  • I tried use VideoCapture in my case for few day, but I'm still not try it out, and don't understand how it works, I need more help, and I'm still working on it . Thanks ! – Tony Nov 18 '13 at 06:00
  • 1
    I was try use VideoCapture , but I can't change Javacameraview to nativecameraview ,even OpenCV sample tutorial1 ,I'm working on it ... – Tony Nov 26 '13 at 06:26

1 Answers1

0

I found this tutorial which explains eye tracking using Android.. You can just follow this to use the main camera and track objects..

HTH

scap3y
  • 1,188
  • 10
  • 27