{"id":2030,"date":"2018-08-20T14:37:48","date_gmt":"2018-08-20T06:37:48","guid":{"rendered":"http:\/\/www.magicandlove.com\/blog\/?p=2030"},"modified":"2018-08-20T14:52:15","modified_gmt":"2018-08-20T06:52:15","slug":"face-landmark-convex-hull-detection-in-opencv-with-processing","status":"publish","type":"post","link":"http:\/\/www.magicandlove.com\/blog\/2018\/08\/20\/face-landmark-convex-hull-detection-in-opencv-with-processing\/","title":{"rendered":"Face landmark convex hull detection in OpenCV with Processing"},"content":{"rendered":"<p>The 3rd exercise is the demonstration of obtaining the <a href=\"https:\/\/docs.opencv.org\/3.4.2\/d7\/d1d\/tutorial_hull.html\" target=\"_blank\" rel=\"noopener\">convex hull<\/a> of the face landmark points in the OpenCV Face module. The program based on the face landmark information collected from the <a href=\"http:\/\/www.magicandlove.com\/blog\/2018\/08\/19\/face-landmark-detection-in-opencv-face-module-with-processing\/\">last post<\/a> to find out the convex hull of the face detected.<\/p>\n<p>The function is provided by the <strong>Imgproc<\/strong> (image processing) module of OpenCV. In the sample program, the following command will obtain the each point information of those points on the convex hull of the polygon.<\/p>\n<pre lang=\"java\">Imgproc.convexHull(new MatOfPoint(p), index, false);\r\n<\/pre>\n<p>The first parameter, variable <strong>p<\/strong> is an array of type <strong>Point<\/strong> in OpenCV. The second parameter, <strong>index<\/strong>, is the returned value of type <strong>MatOfInt<\/strong> indicating all the points along the convex hull boundary. The integer value is the index in the original array <strong>p<\/strong>. The third parameter, <strong>false<\/strong>, indicates the clockwise orientation is false. By traversing the array <strong>index<\/strong>, we can obtain all the points along the convex hull.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2031\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2018\/08\/FaceConvexHull.png\" alt=\"\" width=\"600\" height=\"300\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2018\/08\/FaceConvexHull.png 600w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2018\/08\/FaceConvexHull-300x150.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>The complete source code is now in my GitHub repository <a href=\"https:\/\/github.com\/chungbwc\/Magicandlove\/tree\/master\/ml20180819a\" target=\"_blank\" rel=\"noopener\">ml20180819a<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The 3rd exercise is the demonstration of obtaining the convex hull of the face landmark points in the OpenCV Face module. The program based on the face landmark information collected from the last post to find out the convex hull of the face detected. The function is provided by the Imgproc (image processing) module of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89,79],"tags":[166,165,3,62],"class_list":["post-2030","post","type-post","status-publish","format-standard","hentry","category-research","category-software-2","tag-convex-hull","tag-face-landmark","tag-opencv","tag-processing-org"],"_links":{"self":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/2030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/comments?post=2030"}],"version-history":[{"count":5,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/2030\/revisions"}],"predecessor-version":[{"id":2036,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/2030\/revisions\/2036"}],"wp:attachment":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/media?parent=2030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/categories?post=2030"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/tags?post=2030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}