opencv convexHull returns same point twice

I am try to use convexHull to set the sequence of my points. But the result is just wrong.

//image_points_queue.push_back(original_image_points);
vector<cv::Point2f> image_points = {
    { 585, 543 },
    { 643, 749 },
    { 767, 501 },
};

convexHull(image_points, image_points, false);

image_points comes to be "767, 501", "643, 749", "767, 501". I don't have any idea about it . Please help.

Answers


I use another vector for the result and the code works just fine.

vector<cv::Point2f> result_points;
vector<cv::Point2f> image_points = {
    { 585, 543 },
    { 643, 749 },
    { 767, 501 },
};

convexHull(image_points, result_points, false);

I am using Windows 10. Not sure whether it is platform dependent.


It basically gives a closed hull so the starting point and ending point would be same. so you need to ignore the last point of the hull.


Need Your Help

How to setup a proper Eclipse Project structure?

java eclipse

I am just starting a new semester and am currently preparing my Eclipse workspace.

extract all email addresses from some .txt documents using ruby

ruby regex

I have to extract all email addresses from some .txt documents. These emails may have these formats: