开发者

2D bitmap neighbour grouping

Let's say I have a 2D array of 1bit pixels, for example an image bitmap. I would like to find groups/cl开发者_开发问答usters of 2x2 or larger. The groups can take any free form shape larger than that.

Any recommended algorithms for this? For the group boundaries I thinking about 'marching squares' but how about counting the area of each group?


Yes: use simple logic to find a "seed" of 4 set bits, then use flood-fill to discover the whole region and calculate its volume area.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜