OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 17 Apr 2018 07:37:32 -0500Find minimum distance between two convex hullshttp://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/ Hi guys, i have already created convex hulls using cv::Hull. Now, i want to find the minimum distance between two adjacent convex hulls. Is there any method in the opencv to calculate this ? or should i implement myself ? because all i thought, if i want to calculate the minimum distance, i have to measure the distance between each points in convex hull number one and convex hull number 2. is it valid ? or may be there is an algorithm ? because i can't find any... Thanks.Mon, 16 Apr 2018 05:04:17 -0500http://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/Comment by StevenPuttemans for <p>Hi guys, i have already created convex hulls using cv::Hull. Now, i want to find the minimum distance between two adjacent convex hulls. Is there any method in the opencv to calculate this ? or should i implement myself ? because all i thought, if i want to calculate the minimum distance, i have to measure the distance between each points in convex hull number one and convex hull number 2. is it valid ? or may be there is an algorithm ? because i can't find any... Thanks.</p>
http://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/?comment=189521#post-id-189521It kind of depends what you mean with distance between shapes. If it is physical distance, then yes that will do it, but if you want to look at how similar 2 shapes are, then use the [computeDistance function](https://docs.opencv.org/master/dc/dbf/classcv_1_1ShapeDistanceExtractor.html) of the shape module.Tue, 17 Apr 2018 07:37:32 -0500http://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/?comment=189521#post-id-189521Comment by Grillteller for <p>Hi guys, i have already created convex hulls using cv::Hull. Now, i want to find the minimum distance between two adjacent convex hulls. Is there any method in the opencv to calculate this ? or should i implement myself ? because all i thought, if i want to calculate the minimum distance, i have to measure the distance between each points in convex hull number one and convex hull number 2. is it valid ? or may be there is an algorithm ? because i can't find any... Thanks.</p>
http://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/?comment=189503#post-id-189503As far as I know your approach is right. The convex hull is a vector of points and you have to loop through every point in both contours/hulls and calculate the distance. Then you take the minimum distance.Tue, 17 Apr 2018 02:57:20 -0500http://answers.opencv.org/question/189433/find-minimum-distance-between-two-convex-hulls/?comment=189503#post-id-189503