I building an APK that receive the image from my android device camera and process with OpenCV library. Just want to convert the image to Gray scale, apply Gaussian Blur filter and run Canny Edge Detector.
My APK runs properly on android device, with no error instead. But it's don't return processed image, just the original.
Here's my onCameraFrame class with image processing code:
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
Mat mRgba = new Mat();
Mat imgGray = new Mat();
Imgproc.cvtColor(inputFrame.rgba(), imgGray, Imgproc.COLOR_RGBA2GRAY);
Imgproc.GaussianBlur(imgGray, imgGray, new Size(5, 5), 2, 2);
Imgproc.Canny(imgGray, imgGray, 35, 75);
return imgGray;
I think my code isn't wrong, but i don't know how to return the edge detection image.
Someone knows how to help me?
Thanks!