how to use properley floodFill method in android [closed]

asked 2015-06-17 08:41:37 -0600

nagesh.telivo gravatar image

updated 2020-08-16 12:19:54 -0600

i am beginer in opencv how to use flood fill method.thanks for help

i am using following code it will throws exception

Note:hear source is mat object

CODE:

            Imgproc.floodFill(source, source, new Point(source.cols()-10,10), new Scalar(255.0, 255.0, 255));
    Imgproc.floodFill(source, source, new Point(10,10), new Scalar(255.0, 255.0, 255.0));
    Imgproc.floodFill(source, source, new Point(10,source.rows()-10), new Scalar(255.0, 255.0, 255.0));
    Imgproc.floodFill(source, source, new Point(source.cols()-10,source.rows()-10), new Scalar(255.0, 255.0, 255.0));

Exception:

OpenCV Error: Assertion failed (mask.rows == size.height+2 && mask.cols == size.width+2) in int cv::floodFill(cv::InputOutputArray, cv::InputOutputArray, cv::Point, cv::Scalar, cv::Rect, cv::Scalar, cv::Scalar, int), file /builds/master_pack-android/opencv/modules/imgproc/src/floodfill.cpp, line 549 06-17 18:58:54.988: E/org.opencv.imgproc(16031): imgproc::floodFill_11() caught cv::Exception: /builds/master_pack-android/opencv/modules/imgproc/src/floodfill.cpp:549: error: (-215) mask.rows == size.height+2 && mask.cols == size.width+2 in function int cv::floodFill(cv::InputOutputArray, cv::InputOutputArray, cv::Point, cv::Scalar, cv::Rect, cv::Scalar, cv::Scalar, int)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-08-16 12:20:04.768847