flood-fill

Android: How to do this framing paint?

时间秒杀一切 提交于 2019-11-26 16:03:47
问题 I Have Some static images like below: Now, I want is, when i touch on the face or hand, then the selected color should be fill on that skin portion. See below image of result: So how to get the result like above ?? Redo and Undo Functionality Should be also there. I have try with the FloodFill color but doing that i can only able to do color in to the perticular portion. as FloodFill only fill the color till the same pixwl color comes. If the touch place pixel color get change the it will not

Flood Fill Algorithms

强颜欢笑 提交于 2019-11-26 11:15:24
问题 Its the weekend again, and that means I get to play with my hobby project. I\'ve gotten tired of creating test levels by hand, so I thought I\'d take a break from engine development and work on a level editor: Level Editor http://gfilter.net/junk/Editor.JPG I\'d like to implement a flood fill algorithm in the editor, which would work just like in a paint program. Does anyone have any pointers on what technique would work good for me here? The level is just a 2d array, so it could be

Android flood-fill algorithm

最后都变了- 提交于 2019-11-26 10:28:39
问题 Does anyone know a iterative and efficient algorithm for flood-fill? Or is there any way to implement recursive floodfill algorithm without stack overflow error? Tried the one @ Flood fill using a stack but i cant find a way to work on white and black image. 回答1: Somebody ported J. Dunlap's Queue-Linear Flood Fill Algorithm to android here. I've tried it and it's pretty fast. I've modified the copyImage() method which originally makes use of a class called Utilities which the author hasn't

How can I perform flood fill with HTML Canvas?

天涯浪子 提交于 2019-11-26 07:45:02
问题 Has anyone implemented a flood fill algorithm in javascript for use with HTML Canvas? My requirements are simple: flood with a single color starting from a single point, where the boundary color is any color greater than a certain delta of the color at the specified point. var r1, r2; // red values var g1, g2; // green values var b1, b2; // blue values var actualColorDelta = Math.sqrt((r1 - r2)*(r1 - r2) + (g1 - g2)*(g1 - g2) + (b1 - b2)*(b1 - b2)) function floodFill(canvas, x, y, fillColor,

Flood fill using a stack

帅比萌擦擦* 提交于 2019-11-26 07:43:46
问题 I am using the recursive Flood fill algorithm in Java to fill some areas of a image. With very small images it works fine, but when de image becomes larger the JVM gives me a Stack Over Flow Error. That\'s the reason why I have to reimplement the method using a Flood Fill with my own stack. (I read that\'s the best way to do it in these kind of cases) Can anyone explain me how to code it? (if you don\'t have the code at hand, with the pseudo-code of the algorithm will be fine) I\'ve read a

Fill the holes in OpenCV [duplicate]

匆匆过客 提交于 2019-11-26 06:28:33
问题 This question already has answers here : Filling holes inside a binary object (7 answers) Closed 5 years ago . I have an edge map extracted from edge detection module in OpenCV (canny edge detection). What I want to do is to fill the holes in the edge map. I am using C++ , and OpenCV libraries. In OpenCV there is a cvFloodFill() function, and it will fill the holes with a seed (with one of the location to start flooding). However, I am trying to fill all the interior holes without knowing the