flood-fill

Different Methods of Performing FloodFill

為{幸葍}努か 提交于 2019-12-06 03:23:37
问题 OK everyone I have several different methods of performing a FloodFill. All of them cause problems. I will list the 3 methods and explain what happens with each one. If anyone could give me some pointers that would be great. I have seen some similar posts but none of them have been for C#, java, or VB.net (the only languages I know). The givens for this are that I have a class called PixelData which stores a Color in a CellColor member variable. I have an array that is 50x50 of PixelData

OpenCV FloodFill with multiple seeds

冷暖自知 提交于 2019-12-05 21:01:04
Is there a floodFill function for python/openCV that takes a list of seeds and starts changing the color of its neighbours? I know that simplecv as a function like that SimpleCV floodFill . OpenCV says it has two floodFill functions when that uses a mask and another one that doesn't, documentation , I'm not being able to use the opencv floodfill function without a mask and with a list of seeds. Any help? This is what I'm trying to do so far: A=array([[0,1,1,0],[0,0,0,0],[1,1,1,1],[1,1,1,1]],np.uint8) mask = np.ones((A.shape[0]+2,A.shape[0]+2),np.uint8) mask[1:-1,1:-1] = np.zeros((A.shape)) cv

Canvas - floodfill leaves white pixels at edges

耗尽温柔 提交于 2019-12-01 19:36:56
I am creating a drawing app. I have succeeded to do everything. When I paint the image with a dark color, some white pixels appear at the edges. I tried to change the value of r + g + b and also alpha but no use. Can any one help me out? You can check the live site from here . Anyone who will help me, I shall grant 50 bounty to him/her. Thanks. This is my code. <script type="text/javascript"> var initial = screen.width - 50; if (initial < 1000) { initial = 1000; } var firsttime = null; var colorYellow = { r: 255, g: 207, b: 51 }; var context; var canvasWidth = initial; var canvasHeight =

Multidimensional array fill

∥☆過路亽.° 提交于 2019-12-01 14:01:29
I'm trying to fill an area in a multidimensional array and not sure on the approach. For example I have the following array: var map = [ [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 2, 2, 2, 0, 0], [0, 2, 0, 0, 0, 0, 2, 0, 0], [0, 2, 0, 2, 0, 0, 2, 0, 0], [0, 2, 0, 0, 2, 0, 2, 0, 0], [0, 0, 2, 0, 0, 0, 2, 0, 0], [0, 0, 0, 2, 2, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0] ]; And then I am trying to get the number from X and Y position and fill all those numbers (which is 0) with a number given such as 1, which will result in the following array: var map = [ [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 2

Flood fill for the game Go in Visual Basic

╄→гoц情女王★ 提交于 2019-12-01 11:13:29
I am an amateur in Visual Basic. I am attempting to recreate the game of Go , and I have created the board and am able to place stones on the intersections of the grid. I now want to start capturing stones which are surrounded. I have looked online and found that flood fill is the best way to go about this. However, I have looked online for days, and I can't find anything that I can use, or manipulate to create this. I do not understand any other programming language, so I cannot use bits of code from Java, etc. And the bits of information for Visual Basic I have found do not make much sense

Flood fill for the game Go in Visual Basic

放肆的年华 提交于 2019-12-01 09:18:22
问题 I am an amateur in Visual Basic. I am attempting to recreate the game of Go, and I have created the board and am able to place stones on the intersections of the grid. I now want to start capturing stones which are surrounded. I have looked online and found that flood fill is the best way to go about this. However, I have looked online for days, and I can't find anything that I can use, or manipulate to create this. I do not understand any other programming language, so I cannot use bits of

iOS Swift Flood fill algorithm

本小妞迷上赌 提交于 2019-11-30 21:43:31
I created this extension for "bucket fill" (flood fill) of touch point: extension UIImageView { func bucketFill(startPoint: CGPoint, newColor: UIColor) { var newRed, newGreen, newBlue, newAlpha: CUnsignedChar let pixelsWide = CGImageGetWidth(self.image!.CGImage) let pixelsHigh = CGImageGetHeight(self.image!.CGImage) let rect = CGRect(x:0, y:0, width:Int(pixelsWide), height:Int(pixelsHigh)) let bitmapBytesPerRow = Int(pixelsWide) * 4 var context = self.image!.createARGBBitmapContext() //Clear the context CGContextClearRect(context, rect) // Draw the image to the bitmap context. Once we draw,

FloodFill in iPhone

ⅰ亾dé卋堺 提交于 2019-11-30 21:25:33
I'm very new to iPhone development. I want to create a application using FloodFill algorithm in iPhone. I'm have no idea about FloodFill. Please Explain me the purpose of FloodFill algorithm.If you give a sample application for FloodFill(iPhone)means I'm really, really happy..Because I'm exploring about FloodFill since morning but, nothing I'm found. My task is, I want to fill the image with color as part by part. Which means, if I'm choosing one color and click on the particular area of the image means it gets colored with the selected color. Please help me to do this. Edit: I am not able to

iOS Swift Flood fill algorithm

╄→гoц情女王★ 提交于 2019-11-30 17:04:33
问题 I created this extension for "bucket fill" (flood fill) of touch point: extension UIImageView { func bucketFill(startPoint: CGPoint, newColor: UIColor) { var newRed, newGreen, newBlue, newAlpha: CUnsignedChar let pixelsWide = CGImageGetWidth(self.image!.CGImage) let pixelsHigh = CGImageGetHeight(self.image!.CGImage) let rect = CGRect(x:0, y:0, width:Int(pixelsWide), height:Int(pixelsHigh)) let bitmapBytesPerRow = Int(pixelsWide) * 4 var context = self.image!.createARGBBitmapContext() //Clear

Vector graphics flood fill algorithms?

萝らか妹 提交于 2019-11-30 08:39:35
I am working on a simple drawing application, and i need an algorithm to make flood fills. The user workflow will look like this (similar to Flash CS, just more simpler): the user draws straight lines on the workspace. These are treated as vectors, and can be selected and moved after they are drawn. user selects the fill tool, and clicks on the drawing area. If the area is surrounded by lines in every direction a fill is applied to the area. if the lines are moved after the fill is applied, the area of fill is changed accordingly. Anyone has a nice idea, how to implement such algorithm? The