flood-fill

Opencv - FloodFill doesn't change mask image

让人想犯罪 __ 提交于 2019-12-11 11:47:53
问题 I try to use floodFill algorithm on my android application. I click a point to select seed.Then I run floodfill algorithm. I want to show only selected area same as seed color. To do this, I display mask mat object. But it is black everytime, it doens't change. I used FLOODFILL_FIXED_RANGE and FLOODFILL_MASK_ONLY flags. My code is here : Imgproc.cvtColor(mRgba, temp, Imgproc.COLOR_RGBA2RGB); Imgproc.cvtColor(temp, temp, Imgproc.COLOR_RGB2GRAY); mMask = Mat.zeros(mMask.size(), CvType.CV_8UC1);

Flood fill NumPy Array `numpy.ndarray`, i. e. assign new value to element and change neighboring elements of the same value, too

萝らか妹 提交于 2019-12-11 04:56:38
问题 Another, similar post called Flood Fill in Python is a very general question on flood fill and the answer only contains a broad pseudo code example. I'm look for an explicit solution with numpy or scipy . Let's take this array for example: a = np.array([ [0, 1, 1, 1, 1, 0], [0, 0, 1, 2, 1, 1], [0, 1, 1, 1, 1, 0] ]) For selecting element 0, 0 and flood fill with value 3 , I'd expect: [ [3, 1, 1, 1, 1, 0], [3, 3, 1, 2, 1, 1], [3, 1, 1, 1, 1, 0] ] For selecting element 0, 1 and flood fill with

Flood Fill algorithm causes StackOverFlowError

徘徊边缘 提交于 2019-12-10 22:08:24
问题 I am programming a simple paint application using Java. I'm trying to use a recursive implementation of the Flood Fill algorithm as my 'bucket fill' tool. However, this always gives me a StackOverFlowError . (No matter how small the area that I'm using the 'bucket fill tool' on is). EDIT: Changed the code to make it more efficient. Still same error. Here's the code: public void floodFill(int x, int y, Color targetColor, Color replacementColor) throws AWTException{ pixelColor = robot

Flood Fill Optimization: Attempting to Using a Queue

被刻印的时光 ゝ 提交于 2019-12-10 14:47:01
问题 I am trying to create a filling method which takes the initial coordinate specified by the user, checks the character and then changes it as desired. After doing so, it then checks adjacent squares and repeats the process. After some research, I came across the flood fill algorithm and after trying that (it works but cannot meet my maximum requirement of an array of 250 by 250 characters). My original flood fill algorithm was as follows: public static void fillArea (int x, int y, char

Is there a parallel flood fill implementation?

筅森魡賤 提交于 2019-12-10 13:27:59
问题 I've got openMP and MPI at my disposal, and was wondering if anyone has come across a parallel version of any flood fill algorithm (preferably in c). If not, I'd be interested in sketches of how to do parallelise it - is it even possible given its based on recursion? Wikipedia's got a pretty good article if you need to refresh your memory on flood fills. Many thanks for your help. 回答1: There's nothing "inherently" recursive about flood-fill, just that to do some work, you need some

Flood fill algorithm that takes alpha into account without leaving fringes around anti-aliased lines?

二次信任 提交于 2019-12-10 10:46:41
问题 I've implemented a typical flood fill algorithm and it works as expected when solid colors are used where I use the Euclidean distance between the ARGB components to compare colors. My problem is that if you draw something like an anti-aliased red line on a transparent background my flood fill algorithm will not fill over most semi-transparent pixels, leaving fringes around objects. Specifically for this example, the center of the line is solid red (i.e. (255, 255, 0, 0) in ARGB format) and

Flood fill algorithm on vector drawable image view

我的梦境 提交于 2019-12-08 06:05:29
问题 I want to create application like this. Flood fill algorithm I applied that code and it is working fine with JPG or PNG file. But I want to use that algorithm with Vector drawable imageview Vector drawable imageview before flood fill After flood fill of vector imageview Expected result should be like this (Flood fill work perfectly when I set JPG or PNG file) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

Flutter Flood or Bucket fill image

孤人 提交于 2019-12-06 17:52:28
I am new in Flutter. I want to select zone from below images. How can I achieve the flood or bucket fill in flutter. Can someone help me out with your Knowledge in Flutter Dart..?? You can do this by using shapes wrapped in an InkWell : import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { MyApp({Key key,}) : super(key: key); @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp>{ @override Widget build(BuildContext context) { return MaterialApp( title: 'Test App', home: MyHomePage(), ); } } class

Flood fill algorithm that takes alpha into account without leaving fringes around anti-aliased lines?

[亡魂溺海] 提交于 2019-12-06 11:52:29
I've implemented a typical flood fill algorithm and it works as expected when solid colors are used where I use the Euclidean distance between the ARGB components to compare colors. My problem is that if you draw something like an anti-aliased red line on a transparent background my flood fill algorithm will not fill over most semi-transparent pixels, leaving fringes around objects. Specifically for this example, the center of the line is solid red (i.e. (255, 255, 0, 0) in ARGB format) and the fringes of the line are also solid red but the alpha of these pixels ranges down to 1% alpha (i.e.

White spaces left in coloring using QueueLinearFloodFillAlgorithm

China☆狼群 提交于 2019-12-06 04:38:55
I am trying to implement flood fill algorithm in android. It was working very slow, so I tried queue linear flood fill algorithm according to this link How to use flood fill algorithm in Android? It is working fast but the portion is not completely colored. There are some white spaces left on the edgeslike in this picture. I used the following code: public class QueueLinearFloodFiller { protected Bitmap image = null; protected int[] tolerance = new int[] { 0, 0, 0 }; protected int width = 0; protected int height = 0; protected int[] pixels = null; protected int fillColor = 0; protected int[]