Problem related to access chain code value [closed]
I am trying to extract contour from gray label image. My interest is I want to access/show numerical value of chain code. How can I do this? Here is my code segment.
int main(..)
{
Mat src_gray;
//read src_gray;
Mat canny_output;
vector<vector<Point> > contours;
vector<Vec4i> hierarchy;
int thresh=100;
/// Detect edges using canny
Canny( src_gray, canny_output, thresh, thresh*2, 3 );
/// Find contours
findContours( canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_CODE, Point(0, 0) );
///Want to see chain code of contour here/How to access chain code value?
}
Didn't know that CV_CHAIN_CODE even exists, since it's not listed in the docu...
Thanks. May be I need to use ApproxChain class.
@Guanta is there any function in current version which can represent contour as chain code?
I think a chain-code representation doesn't exist or at least I don't know of it. Is it that important? findContours() gives you all the contours as vector of points which you can then process further.
Chain code is a kind of boundary descriptor. We can produce it from contour points. No problem if there is no function available. I need to develop code. Cheers!!
i am also have the same problem to get the chain code,if you have some solution then plaese post it