How can i use opencv FloodFill with java?

asked 2016-03-24 07:18:35 -0500

nadia gravatar image

updated 2016-03-24 07:22:14 -0500

I tried to use floodfill in my source code but the application doesn't work and this is my code :

`final Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath(),options);

Mat tmp = new Mat(bitmap.getWidth(), bitmap.getHeight(), CvType.CV_8UC1);

Utils.bitmapToMat(bitmap, tmp);

Mat gray = new Mat(bitmap.getWidth(), bitmap.getHeight(), CvType.CV_8UC1);

Imgproc.cvtColor(tmp, gray, Imgproc.COLOR_RGB2GRAY);

Photo.fastNlMeansDenoising(gray, gray,5,7,21);

Mat stub = new Mat(gray.rows() + 2,gray.cols() + 2, CvType.CV_8U);

Imgproc.floodFill(gray,stub, new Point(0, 0), new Scalar(255, 255, 255));

Utils.matToBitmap(stub, bitmap);`

edit retag flag offensive close merge delete

Comments

have u reached something because i am dealing with the same issue?

Tomna gravatar imageTomna ( 2017-01-30 16:35:34 -0500 )edit