获取所有轮廓图像的问题,需要帮助!! [英] problem to obtain all contours of image, need help !!

查看:74
本文介绍了获取所有轮廓图像的问题,需要帮助!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的项目是获取图像的骨架,我使用的是细化方法,即删除轮廓中的所有简单点。

我有获得所有图像轮廓的问题,我只得到第一个轮廓。



是否有一个函数可以返回图像的所有轮廓?



我使用opencv2.2 C ++进行编程。

等待你的回复。

谢谢。

Hello,
My project is to get the skeleton of image ,I used the method of thinning that is to remove all simple points of the contour.
I have a problem with obtaining all contours of image,i'm only getting the first contour.

is there a function that returns all the contours of an image???

I programe with opencv2.2 C++.
Waiting for your reply.
Thank you.

推荐答案

你试过这个代码了吗?



Did you try this code?

vector<vector<Point>> contours;
    vector<Vec4i> hierarchy;
    findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);


这篇关于获取所有轮廓图像的问题,需要帮助!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆