# Revision history [back]

### How can i convert onCameraFrame inputframe to image

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();

detectText();
return mRgba;
}


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

### How can i convert onCameraFrame inputframe to image

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();

detectText();
return mRgba;
}


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