Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

FAST detection OpenCV for Android gives blue/red screen

I want to detect all the FAST corner with my application, and use the following code:

public Mat onCameraFrame(Mat inputFrame) { MatOfKeyPoint points = new MatOfKeyPoint();

  FeatureDetector fast = FeatureDetector.create(FeatureDetector.FAST);
  fast.detect(inputFrame, points);

  Scalar redcolor = new Scalar(255,0,0);
  Imgproc.cvtColor(inputFrame, mRgba, Imgproc.COLOR_RGBA2BGRA,4);
  Features2d.drawKeypoints(mRgba, points, mRgba, redcolor, 3);


    return mRgba;


}

It doesn't return errors, but it also doesn't show the FAST points. Instead I get a blue/red screen. I have no idea what is wrong in the code that this happend. C:\fakepath\OpenCV_2013-39-22_01-39-55[1].png

FAST detection OpenCV for Android gives blue/red screen

I want to detect all the FAST corner with my application, and use the following code:

public Mat onCameraFrame(Mat inputFrame) { MatOfKeyPoint points = new MatOfKeyPoint();

  FeatureDetector fast = FeatureDetector.create(FeatureDetector.FAST);
  fast.detect(inputFrame, points);

  Scalar redcolor = new Scalar(255,0,0);
  Imgproc.cvtColor(inputFrame, mRgba, Imgproc.COLOR_RGBA2BGRA,4);
  Features2d.drawKeypoints(mRgba, points, mRgba, redcolor, 3);


    return mRgba;


}

It doesn't return errors, but it also doesn't show the FAST points. Instead I get a blue/red screen. I have no idea what is wrong in the code that this happend. C:\fakepath\OpenCV_2013-39-22_01-39-55[1].pngimage description

UPDATE: I got the points visible on the screen, but the colors are still messed up. A new problem is that i get like 200+ FAST points, can i put a limit on this? At higher resolution images (the one below is 320*240) there are so much points that is causes lag in my FPS. How do I limit this?

image description