Ask Your Question

eatcosmos's profile - activity

2018-08-27 02:24:46 -0600 answered a question Where is OpenMP used in OpenCV?

Learned it!

2018-08-27 01:41:07 -0600 received badge  Enthusiast
2018-08-26 22:23:05 -0600 answered a question Is findContours fast enough ?

Thank you, I am also meet this problem. Does UMat can do it?

2018-07-01 08:37:01 -0600 commented answer How to Prevent drawContours() to draw strange wrong line?

My solution for this requirement is firstly do findContours() for these points and than do drawContours() again, maybe

2018-07-01 08:36:34 -0600 commented answer How to Prevent drawContours() to draw strange wrong line?

My solution for this requirement is firstly do findContours() for these points and than do drawContours() again, maybe

2018-07-01 08:34:18 -0600 marked best answer How to Prevent drawContours() to draw strange wrong line?

image description

I have found some rule about this problem, this wrong line connects two point and do not cross any others contour points.

It seams that drawContours prefer convex shape, but I am not very sure about it.

std::vector<std::vector<Point>> collision_for_mask2_contours;

test for this variable, I have put it in bmp image in accessory file , you can get points from it for drawContours. Thank you very much!

G:\test.bmp

int  main(int argc, char* argv[]){

// test code for drawContours

std::vector<std::vector<Point>> collision_for_mask2_contours;
std::vector<Point> constours;
Mat_<uchar> testbmp = imread("G:/test.bmp", WINDOW_AUTOSIZE);
namedWindow("testbmp");
imshow("testbmp", testbmp);
waitKey(0); // need to press any key to continue
for (int y = 0; y < testbmp.rows; ++y) {
    for (int x = 0; x < testbmp.cols; ++x) {
        if (testbmp(y, x)) {
            constours.push_back(Point(x, y));
        }
    }
}
collision_for_mask2_contours.push_back(constours);
Mat_<uchar> testForDrawContours = Mat_<uchar>::zeros(testbmp.size());
// one case, can not get concave shape
drawContours(testForDrawContours, collision_for_mask2_contours, -1, Scalar(255));
namedWindow("testForDrawContours", WINDOW_AUTOSIZE);
imshow("testForDrawContours", testForDrawContours);
waitKey(0);
// one another case, also can not get concave shape
drawContours(testForDrawContours, collision_for_mask2_contours, -1, Scalar(255), -1, 8);
namedWindow("testForDrawContours2", WINDOW_AUTOSIZE);
imshow("testForDrawContours2", testForDrawContours);
waitKey(0);}
2018-07-01 08:34:18 -0600 received badge  Scholar (source)
2018-07-01 08:33:22 -0600 commented answer How to Prevent drawContours() to draw strange wrong line?

There is no magic, No more than doc and tutorial.

2018-07-01 08:32:56 -0600 commented question How to Prevent drawContours() to draw strange wrong line?

yes, you are right, I find Image file reading and writing

2018-07-01 06:08:19 -0600 commented answer How to Prevent drawContours() to draw strange wrong line?

I understand, Thank you. Can I konw How do you know opencv contours's data structure, I find many things I do not unders

2018-07-01 05:55:03 -0600 commented question How to Prevent drawContours() to draw strange wrong line?

imread("G:/test.bmp", 1); yes, 1 is right to get gray image. I find drawContours must be used along with findContours,

2018-07-01 05:54:26 -0600 commented question How to Prevent drawContours() to draw strange wrong line?

imread("G:/test.bmp", 1); yes, 1 is right to get gray image. I find must use drawContours with findContours, maybe I hav

2018-07-01 03:41:19 -0600 commented question How to Prevent drawContours() to draw strange wrong line?

HI @LBerger, I have add test code for test.bmp, and showed the problem, you can test it, thank you. drawContours(tes

2018-07-01 03:38:49 -0600 edited question How to Prevent drawContours() to draw strange wrong line?

How to Prevent drawContours() to draw strange wrong line? I have found some rule about this problem, this wrong line c

2018-07-01 03:36:53 -0600 commented question How to Prevent drawContours() to draw strange wrong line?

HI @LBerger, I have add test code for test.bmp, and showed the problem, you can test it, thank you.

2018-07-01 03:35:34 -0600 edited question How to Prevent drawContours() to draw strange wrong line?

How to Prevent drawContours() to draw strange wrong line? I have found some rule about this problem, this wrong line c

2018-07-01 02:41:58 -0600 received badge  Editor (source)
2018-07-01 02:41:58 -0600 edited question How to Prevent drawContours() to draw strange wrong line?

How can I Prevent drawContours to draw extra wrong line I have found some rule about this problem, this wrong line con

2018-07-01 02:15:12 -0600 asked a question How to Prevent drawContours() to draw strange wrong line?

How can I Prevent drawContours to draw extra wrong line I have found some rule about this problem, this wrong line con