开发者

Given a coordinate and color, how to programatically determined a contiguous region of that color?

I'm using Ruby and RMagick to process an image, but the question is language agnostic...

I'm basically processing an image of tabular data and figured one of the easiest ways to determine a cell is to detect a contiguous area of white (or whatever the background color is) and then get the bounding box of the content.

But what's the most efficient way of determining a contiguous area of a color at any given spo开发者_C百科t?


Well, I'll assume you meant flood fill:

http://en.wikipedia.org/wiki/Flood_fill

http://rosettacode.org/wiki/Bitmap/Flood_fill#Ruby

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜