OpenCV中的Java:如何找到在OpenCV中JAVA图像的连接组件 [英] OpenCv Java : how to find connected components of image in OpenCv JAVA
问题描述
我在图像处理工作,并找到图像中的连接组件。在MATLAB中我使用bwconncomp功能,但任何人都可以帮助我,我怎么能做到这一点在Java中还是有在OpenCV中任何直接的作用。
i am working in image processing and find the connected components in a image. in MATLAB i am using bwconncomp function but can anyone help me how can i do it in java or is there any direct function in OpenCv.
推荐答案
在看看<一个href=\"http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html\"相对=nofollow> FindContours
您可以在Android中使用使用它:
You can use it in Android with:
Imgproc.findContours(Mat image,
java.util.List<MatOfPoint> contours,
Mat hierarchy,
int mode,
int method)
层级参数的关注图像拓扑和嵌套轮廓,因此,
简单的轮廓就可以只通过新垫()
和 Imgproc.RETR_LIST
和 Imgproc。 CHAIN_APPROX_NONE
分别为模式和方法。
The hierarchy parameter concerns image topology and nested contours, therefore,
for simple contours you can just pass new Mat()
and Imgproc.RETR_LIST
and Imgproc.CHAIN_APPROX_NONE
for mode and method respectively.
这篇关于OpenCV中的Java:如何找到在OpenCV中JAVA图像的连接组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!