Questions tagged [flood-fill]

Flood fill is an algorithm to determine node adjacency in graphics or multidimensional data sets.

Flood Fill (sometimes known as Seed Fill) is an algorithm to determine node adjacency in graphics or multidimensional data sets, commonly used for "paint bucket"-style operations.

See also

475 questions
0
votes
1 answer

Why is my flood fill only filling in the positive x and z direction?

Below is a JavaScript from a interface in the Customs NPC mod which runs with minecraft. It is suppose to be running a flood fill routine. It only fill correctly to the positive x and positive z of the starting position. In minecraft x & z are in…
TAP
  • 25
  • 9
0
votes
2 answers

Number of Groups/Islands of 1's in a Matrix: Definition clarification

I am studying various solutions for Number of Groups (or "islands") of 1's in a Matrix, and while the following clear & concise Java solution looks in the right direction, it also looks incomplete to me: /* * Given a matrix of 0's and 1's, * find…
Jay Souper
  • 2,576
  • 2
  • 14
  • 17
0
votes
1 answer

MySQL 3D "Flood Fill" Implementation

I have a MySQL table with the following structure: CREATE TABLE IF NOT EXISTS `np_voxels` ( `world` VARCHAR(16) NOT NULL, `x` INT NOT NULL, `y` INT NOT NULL, `z` INT NOT NULL, `value` DOUBLE NOT NULL DEFAULT 0, `property_id` INT NULL, …
Ruby
  • 533
  • 3
  • 6
  • 16
0
votes
1 answer

Flood filling without using function (Matlab)

Im working on my project where one of the operations that i needed to do first is flood filling before achieving the outcome. I am aware that there are available function such as bwmorph or imfill to flood fill the black pixels of my image but im…
0
votes
1 answer

one touch fill color in image without border

In Application,I used jpg image having white background and plain picture border in black color.When touch without border part it fill the color but touch on border the border is also filled thats issue.I used this link
0
votes
2 answers

Refining custom flood fill algorithm (Java)

I have no experience with any type of flood fill algorithms at all. But I gave it my best shot. At first, I would fill one pixel wherever the user clicked with magenta, and then went through a loop which drew a pixel on top, left, bottom, and right…
user3376587
  • 134
  • 2
  • 12
0
votes
1 answer

Flood Fill Recursive algorithm

Hello I made use of flood fill recursive algorithm to find the connected cells to each other in an 2D array (Here I am using vectors). But this fails for one boundary test case #include #include using namespace std; int count =…
Suraj Palwe
  • 2,080
  • 3
  • 26
  • 42
0
votes
2 answers

Java Floodfill really slow

I am making a paint application and the flood fill tool works, but it takes about two minutes for it to fill a 400x180. What can I do to speed up this process? Here is the code I am currently using for this. public void gradientSize(int x, int y,…
Jaboyc
  • 567
  • 1
  • 8
  • 16
0
votes
2 answers

Linked-list representation of disjoint sets - omission in Intro to Algorithms text?

Having had success with my last CLRS question, here's another: In Introduction to Algorithms, Second Edition, p. 501-502, a linked-list representation of disjoint sets is described, wherein each list member the following three fields are…
kostmo
  • 6,222
  • 4
  • 40
  • 51
0
votes
1 answer

When line is draw after filling color using flood fill algorithm then filling color is gone

I have canvas drawing app. I successfully done integrating floodfill algorithm for filling color for finger drawing circle and rectangle area by finger drawing shapes. My problem is after filling color for created shapes by finger, filled color is…
jack
  • 338
  • 1
  • 3
  • 29
0
votes
1 answer

CvConnectedComp.contour is NULL with cvFloodFill

I am trying to use CvConnectedComp which is an output from cvFloodFill. CvConnectedComp comp; cvFloodFill(imgInput,seedPoint, cvScalarAll(0),cvScalarAll(.1),cvScalarAll(1.), &comp,CV_FLOODFILL_MASK_ONLY,imgMask); I am able to use…
sonu thomas
  • 2,161
  • 4
  • 24
  • 38
0
votes
1 answer

Flood fill difficulty in C graphics

(Note: My college is making me study graphics in ancient Turbo C) Anyway I am using the inbuilt algorithm for floodfill to color a well and a bucket. The problem I am facing is that the compiler fills the region upto a boundary color. However I…
user3041058
  • 1,520
  • 2
  • 12
  • 16
0
votes
0 answers

How to dynamically fill color in a polygon in OpenGL

I'm creating a program in OpenGL using glut in which the user can draw lines or circles on the screen by selecting the appropriate option and dragging the left mouse button on the screen. Also, I want the user to be able to fill color in the polygon…
0
votes
1 answer

An array that represents a panel with filled and blank spaces

I am making a program that would read the input (the coordinates of horizontal and vertical lines) like this: struct Data { // the beginning and ending coordinate of a line int xStart; int xEnd; int yStart; int yEnd; }; // the…
lol
  • 231
  • 1
  • 10
0
votes
2 answers

FloodFill algorithm producing StackOvlerflowError

I have a Java program containing an image, and I'm trying to have a flood fill agorithm to repleace each black pixel with a white one within the enclosed area, using the following function(canvas is a BufferedImage): public void floodFill(Point2i…
user2649681
  • 750
  • 1
  • 6
  • 23