我正在从事图像处理工作,并找到图像中的连接组件。在 MATLAB 中,我正在使用 bwconncomp 函数,但任何人都可以帮助我如何在 java 中执行此操作,或者 OpenCv 中是否有任何直接函数。
最佳答案
您可以在 Android 中使用它:
Imgproc.findContours(Mat image,
java.util.List<MatOfPoint> contours,
Mat hierarchy,
int mode,
int method)
层次结构参数涉及图像拓扑和嵌套轮廓,因此,
对于简单的轮廓,您可以分别传递 new Mat()
和 Imgproc.RETR_LIST
和 Imgproc.CHAIN_APPROX_NONE
分别作为模式和方法。
关于java - OpenCV Java : how to find connected components of image in OpenCv JAVA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23080968/