本文介绍了连通域标记在C ++中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个C ++应用程序使用的图像上。我可以实现我自己,但我试图使用Boost的 wiki文章中提到的/不相交的集合实施。

I need to use the connected component labeling algorithm on an image in a C++ application. I can implement that myself, but I was trying to use Boost's union-find/disjoint sets implementation since it was mentioned in the union-find wiki article.

我无法弄清楚如何创建disjoint_sets对象,以便它会和我有(无符号短)的图像数据。我在想什么? Boost的文档中的例子并不作任何意义,我。我需要所有的额外图表中那些例子天书时,我有一个形象?或者,有没有已经是OpenCV的连接成分标签的实现。目前,我们正在使用的OpenCV 1.1 pre1和Boost 1.37。

I can't figure out how to create the disjoint_sets object so that it'll work with the image data I have (unsigned shorts). What am I missing? The examples in the Boost documentation aren't making any sense to me. Do I need all the extra Graph mumbo-jumbo in those examples when I have an image? OR, is there already an OpenCV connected component labeling implementation. Currently we're using OpenCV 1.1pre1 and Boost 1.37.

推荐答案

奇怪的是,在OpenCV中没有CCL。但是,是在参考手册中描述的解决方法。见为cvDrawContours 的例子。当我试图使用它,我对第一个和最后一个行和图像列一些奇怪的行为,但我可能做错了什么。

Surprisingly, there is no CCL in OpenCV. However, there is a workaround that is described in the reference manual. See the example for cvDrawContours. When I tried to use it, I had some strange behaviour on first and last rows and columns of an image, but I probably did something wrong.

的另一种方法是使用的库

An alternative way is to use cvBlobs library.

这篇关于连通域标记在C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 04:12