Ask Your Question

Visionmop's profile - activity

2020-07-06 04:30:56 -0600 commented answer Merge contour from vector<Points>

Thank you, I think i can deal with this

2020-07-06 04:30:19 -0600 marked best answer Merge contour from vector<Points>

I would like to form an external contour from different vector points. The individual contours are continuous and contain curved lines (1 pixel wide). The merged contour should connect the lines like as marked in red in the image below

image description => image description

I would transfer the single points into a total vector. How can i determine the order I have to follow? I suppose every single contour must be ordered clockwise?

//xPts = vector<vector<int>> containing all x-Values of contour

int cntContours = xPts.size();
std::vector<cv::Point> contourMerged;
for (int cn = 0; cn < cntContours; cn++)
{
    vector<double> xTmp =  xPts[cn];
    vector<double> yTmp =  yPts[cn];

    for (int pn = 0; pn < xTmp.size(); pn++)
    {
        cv::Point tmp;
        int xt = (int)xTmp[pn];
        int yt = (int)yTmp[pn];
        tmp.x = xt;
        tmp.y = yt;

        contourMerged.push_back(tmp);
    }

}
// close contour
contourMerged.push_back(contourMerged[0]);

Thank you!

2020-07-06 04:30:19 -0600 received badge  Scholar (source)
2020-07-06 04:30:16 -0600 received badge  Supporter (source)
2020-06-26 10:14:01 -0600 commented question Image segmentation, where to start?

"However, I'm stuck into defining triangles" Instead of searching for intersections perhaps you could also rotate the im

2020-06-26 09:58:24 -0600 edited question Merge contour from vector<Points>

Merge contour from vector<points> I would like to form an external contour from different vector points. The indiv

2020-06-26 09:56:11 -0600 received badge  Student (source)
2020-06-26 09:47:11 -0600 asked a question Merge contour from vector<Points>

Merge contour from vector<points> I would like to form an external contour from different vector points. The indiv

2020-06-12 02:48:34 -0600 received badge  Enthusiast
2020-06-03 04:00:14 -0600 received badge  Editor (source)
2020-06-03 04:00:14 -0600 edited question matchShapes for Contour Defects

matchShapes for Contour Defects Hello everyone, I have little experience with OpenCV and hoped that someone here can he

2020-06-02 15:48:57 -0600 commented question Finding rectangle contours in an image

The width and height of the rectangle correspond to the width and height of the bounding rect of the contour. Here's wha

2020-06-02 15:48:56 -0600 asked a question matchShapes for Contour Defects

matchShapes for Contour Defects Hello everyone, I have little experience with OpenCV and hoped that someone here can he