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
-1
votes
1 answer

Cannot Generate Texture From Bitmap

I am using floodfill algorithm to fill a black white picture with specific color with user touches. I used this Question to use floodfill algorithm : How to use flood fill algorithm in Android? the problem is sometime(whey i want to fill fast) I get…
Arash
  • 3,013
  • 10
  • 52
  • 74
-1
votes
1 answer

Fill color on bitmap in android

How i can fill color on image(i.e fuel image) in specific area as per Seek bar progress. i have tried following solution but it is not helpful much as per my requirement. please find below image for more reference.
Hasmukh
  • 4,632
  • 2
  • 30
  • 44
-1
votes
1 answer

How to optimize a generic flood fill algorithm to prevent stack overflow?

The generic implementation of flood-fill algorithm runs into stack overflow, is there any way to optimize this? I am using this algorithm to find distinct void zones within building models. I voxelize these models then parse through voxelized…
FongYu
  • 767
  • 4
  • 15
  • 24
-2
votes
1 answer

JavaScript Minesweeper - Opening whole mine-free area at once not working properly (flood-fill)

I am trying to build a simple minesweeper game in Javascript. It works propererly apart from the function to open the entire mine-free area when clicking on a mine-free tile. It starts checking the neighbouring tiles, but stops when the first…
Sebastian
  • 7
  • 1
  • 6
-2
votes
1 answer

Finding a cost for a maze path

I have this maze: ##++############## ##++++++++++++++## ########++######## ##++++++++##----## ##++########--#### The "#" symbols are walls in the maze. The "+" regions of the maze are reachable regions of the maze from the entry…
RoadRunner
  • 25,803
  • 6
  • 42
  • 75
-2
votes
2 answers

Why is my code showing Segmentation Fault?

My code is as follows. Its is giving segmentation fault. I have been debugging it but stuck! I can't find the problem. Can someone help me? #include #include using namespace std; char art[200][200]; char art2[200][200]; int…
-2
votes
1 answer

fill an ASCII Image with Floodfill

Hi I'd like to fill an ASCII Image with the Floodfill-alg. I always get error messages and I dont know why. Here is my Main method with the input Image: public static void main(String[] args){ Scanner sc = new Scanner("read…
user3025417
  • 395
  • 1
  • 5
  • 17
-3
votes
1 answer

Flood protection - FloodFill or is there a better way?

I am doing tasks for practicing and improving skills, but I'm having hard time solving this one: You have a map with size w * h. On each box of this map is wall(flood protection) or nothing. Water can flow in eight directions and flows on…
Jozef Bugoš
  • 137
  • 1
  • 2
  • 8
-4
votes
3 answers

Simple flood fill method causes StackOverFlow error

My flood fill method: public void fillNeighbours(int x, int y) { for(int i = -1; i < 2; i++) { for(int j = -1; j < 2; j++) { try { visible[x+i][y+j] = true; if(num[x+i][y+j] == 0) { …
Matrx007
  • 25
  • 7
-4
votes
1 answer

How to lable connected components in a 2D array?

I have 2d array like this: 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0…
1 2 3
31
32