How can i use onCameraFrame inputframe to image

asked 2018-02-25 09:15:30 -0500

sandwraith8 gravatar image

updated 2018-02-25 09:32:33 -0500

Hello everybody. I'm new in OpenCv4Android and i have a question. I'm using MSER algorithm to draw contour around text. It works perfectly fine when i'm using real time camera frame. But i want to take a picture with camera and then draw contour around the text. So how can i do it with input is a bitmap/picture, not an inputframe taken by onCameraFrame. Here is the code i'm using in my onCameraFrame:

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    CONTOUR_COLOR = new Scalar(255);
    mGrey = inputFrame.gray();
    mRgba = inputFrame.rgba();

    return mRgba;

I tried to convert taken image to mat but the detection was very poor compare to real time detection

edit retag flag offensive close merge delete