<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by bilgeckers on Medium]]></title>
        <description><![CDATA[Stories by bilgeckers on Medium]]></description>
        <link>https://medium.com/@gil.beckers?source=rss-57002c2cc89e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*5AwNbSfFNCyzuDk515G6Aw.jpeg</url>
            <title>Stories by bilgeckers on Medium</title>
            <link>https://medium.com/@gil.beckers?source=rss-57002c2cc89e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 10:25:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gil.beckers/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Urban Scene Matching & Interaction with a Human — Part 1]]></title>
            <link>https://medium.com/@gil.beckers/urban-scene-matching-interaction-with-a-human-part-1-80b4b85b6c22?source=rss-57002c2cc89e------2</link>
            <guid isPermaLink="false">https://medium.com/p/80b4b85b6c22</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[bilgeckers]]></dc:creator>
            <pubDate>Thu, 01 Mar 2018 13:17:46 GMT</pubDate>
            <atom:updated>2018-03-01T13:27:26.837Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In succession of two previous blogs both concerning Human Pose Estimation, this episode will now use the human pose in a broader context.</em></p><h3>The Goal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*qbjj5MOhGSxaPr8N." /><figcaption>Photoshop Battles for the win (bless reddit)</figcaption></figure><p>This is where we’re heading for; in front of a famous building, a person tries to mimic a corresponding pose. The person on the left hand side obviously sucks in illustrating the well-know iconic Eiffel tower pose where you need to touch the tip of the antenna with your index finger. Anyone could see this, from the Queen of England to the hounds of hell. But how would a dumb computer make this decision?</p><p>Well, as you most probably already guessed, that’s what this blog is about …</p><p>Thus, two questions to answer:</p><ol><li>Given two images with both a certain urban scene in the background, how do we decide if they match? -Part 1</li><li>And on top of that, how do we describe the interaction of a human posing in front of this urban scene? -Part 2</li></ol><h3>Setting the scene — a model &amp; an input</h3><p>So, suppose there is a model image. This is the <strong>template</strong> representing a posing human in the foreground and a (iconic) urban scene in the background. The input image can be any possible image which needs to be tested on how well it matches with this model image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*E9EPdOM65gEz_7V-A4Bheg.jpeg" /><figcaption>The model image</figcaption></figure><p>As input image we will use the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*1QjRIQlk4k5wP-dMSRlIgA.jpeg" /><figcaption>The input image</figcaption></figure><p><em>Note: Assume this algorithm is deployed on a smartphone, meaning we can use all the privileges a nowadays smartphone offers. This includes the smartphone camera and information about the current geolocation of the user and the taken picture.</em> <br>Knowing this, it’s now time to introduce the pipeline which the model and image picture will go through:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*jRzq57LU_eUHIh2XxA0O3Q.png" /><figcaption>Pipeline: urban scene matching and interaction</figcaption></figure><h3>Geolocation</h3><p>As already stressed, the smartphone GPS can be used to determinate the geographic coordinates of particular picture. Given the coordinates of the model image and a max radius, a mass of initial wrong inputs can be filtered out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*Hp6Gk_1UFzPIXljhONrc0w.png" /><figcaption>Only pictures taken in the green zone are allowed</figcaption></figure><h3>Human Pose Matching</h3><p>A second preprocessing step is checking if the person in the input image is performing the same pose as the person in the model image. This question of matching human poses is answered in my <a href="https://becominghuman.ai/single-pose-comparison-a-fun-application-using-human-pose-estimation-part-2-4fd16a8bf0d3">previous blog</a>. <br>Small recap: the human pose is described by 18 features (2D), each representing a body part. Treating this case of ‘matching of two pointsets’ as a point registration problem, the affine transformation is found between the input pose and the model pose. After thresholding, is then decided if the input pose matches the model pose. (for more info, check referenced blog post)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bWvUbNewCbz_sI8w." /></figure><h3>Background Matching — featuresssssss</h3><h4>1. Feature detection and description</h4><p>Next, we need to investigate if the background in the input image matches the background scene of the model image. For this we will use <a href="https://en.wikipedia.org/wiki/Feature_detection_(computer_vision)">feature matching</a>. <br>First, let’s find SIFT features in both images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KeCaL0M1EkX1-sIRd5rU8A.png" /><figcaption>plot1: detected features plotted in green</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12b7fa1260bd492e0dccbdc1829b4a9d/href">https://medium.com/media/12b7fa1260bd492e0dccbdc1829b4a9d/href</a></iframe><p>As you can see these are many features. And we don’t need all of them. <br>We only want the features that also appear in the input image. Therefore we need <strong>feature matching</strong> …</p><h4>2. Feature Matching — FLANN based</h4><p>Next, the detected features of the model image are compared with the detected features of the input image. Only the best matching features are preserved. If enough matches are found, we extract the locations of matched features in both the images. They are passed to find the <strong>perpective transformation</strong>. Once we get this 3x3 transformation matrix, we use it to transform the corners of model image to corresponding points in input image. This represents the homography (white rectangle).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l4zvt2DIbD1B_8ps0bjFOQ.png" /><figcaption>plot2: 50 good matching features (green) and the homography (white square)</figcaption></figure><p>The found homography is build up from around 50 good matching features.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d4ecaedc2c0cb5d6e0a45fe71a8228c/href">https://medium.com/media/3d4ecaedc2c0cb5d6e0a45fe71a8228c/href</a></iframe><p>In case when the background of the input image isn&#39;t related to the background of the model image, we expect that none or almost none good matches are found. Suppose we take an image of the chapel near the tower of Pisa as input. Because this chapel is just next to the tower, this is a good example where the prefiltering on geolocation would fail short.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*FcBEk1TQ4aPtOobDJPqoCg.png" /><figcaption>plot3: 5 “good” matching features (green) and the very bad homograph (white triangle left)</figcaption></figure><p>Still <strong>5 good matches</strong> are found. This is almost unavoidable, there will always be some random features that match somehow. <br>However, the found homography doesn’t lie! (Note the white triangle in the left image, this is the resulting homography). This weird looking shape isn’t what we expect for a good homography, which is normally sort of rectangular.</p><p>A simple test for checking if the homography is valid, is the determinant of the top-left 2x2 matrix of the perspective matrix. When the determinant is greater than 0, the transformation is <strong>orientation-preserving</strong>. Otherwise, the transformation is <strong>orientation-reversing</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/becd27cc9faa44f7603bbefed085d411/href">https://medium.com/media/becd27cc9faa44f7603bbefed085d411/href</a></iframe><h4>Second example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al1H1O2ZzHNn-UFu_tuC8g.png" /><figcaption>an other example of matched background scene</figcaption></figure><h3>3. Interaction between posing human and background</h3><p>The final step in the pipeline is still work in progress. Currently I’m researching a couple of possible solutions. I hope to report back to you later with some solid results.</p><p>Ciao!</p><p><strong>Remark:</strong> the discussed work in this blog is in the context of my thesis I’m currently working on. This particular issue of background scene matching is part of bigger problem. If you have any remarks or thoughts, please don’t hesitate to get in touch with me.</p><p><strong>Disclaimer</strong>: I do not own any of the used images</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80b4b85b6c22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Single Pose Comparison — a fun application using Human Pose Estimation (Part 2)]]></title>
            <link>https://becominghuman.ai/single-pose-comparison-a-fun-application-using-human-pose-estimation-part-2-4fd16a8bf0d3?source=rss-57002c2cc89e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fd16a8bf0d3</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[openpose]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[bilgeckers]]></dc:creator>
            <pubDate>Tue, 12 Dec 2017 21:20:27 GMT</pubDate>
            <atom:updated>2017-12-14T14:54:14.962Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the second part of a series. </em><a href="https://becominghuman.ai/human-pose-matching-on-mobile-a-fun-application-using-human-pose-estimation-part-1-intro-93c5cbe3a096"><em>Part 1 (Intro</em></a><em>)</em></p><p>Welcome back! In the previous blog we introduced a possible application of <a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose">OpenPose</a> (Human Pose Estimation). Because this algorithm doesn’t require any special cameras, it works with a simple digital camera. WAIT! Before going any further, first try to realize this is a GREAT relaxation. This means you don’t need some kind of Kinect or other depth camera, thus opens doors for mobile development. This just asks for a fun application …</p><p>Basic idea: a person is instructed a model pose which ze must try to mimic. After taking a picture, it’s decided if the input pose matches the model pose. <br>That’s what this blog article is about: <strong>matching human poses</strong><br><em>(An update on the mobile progress will follow shortly -hopefully-)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*8rFmGj6I8Sgw2Z4MURmkxA.jpeg" /><figcaption>Smoooth posing</figcaption></figure><h3>The Human Posture Description</h3><p>The first step in this pipeline is extracting the body parts of every person appearing in the two images. The OpenPose library will do this for us. Using a neural network and some other cool functions, it returns a collection of sets. Each set represents a human skeleton and consists out of 18 2D points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*oVTetBH6worv5grwvSFkxw.png" /></figure><h3>Human Pose Comparison</h3><p><em>We will consider the simple case with </em><strong><em>only one person</em></strong></p><p>So, we have 2 sets of corresponding points<br>1. The model (which needs to be mimicked) <br>2. The input (needs to be checked on matching grade)</p><p>Now, concluding if the input pose matches the model pose essentially comes down to checking if the two poses have the same shape. This can be treated as a <a href="https://en.wikipedia.org/wiki/Procrustes_analysis">Procrustes Problem</a>:</p><blockquote>To compare the shapes of two objects, the objects must be first optimally “superimposed”. <strong>Procrustes superimposition</strong> (PS) is performed by optimally <a href="https://en.wikipedia.org/wiki/Translation_(geometry)">translating</a>, <a href="https://en.wikipedia.org/wiki/Rotation_(mathematics)">rotating</a> and <a href="https://en.wikipedia.org/wiki/Scaling_(geometry)">uniformly scaling</a> the objects. In other words, both the <a href="https://en.wikipedia.org/wiki/Orientation_(geometry)">placement in space</a> and the size of the objects are freely adjusted. The aim is to obtain a similar placement and size, by minimizing a measure of shape difference called the Procrustes distance between the objects.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QwPx67x6rdcDi-oMAOPcaA.png" /><figcaption>WIkipedia ftw</figcaption></figure><p>The difference between the shape of two objects can be evaluated only after “superimposing” the two objects by translating, scaling and optimally rotating them as explained above. Consider the perfect case (identical shapes), after PS, the objects will perfectly coincide. Of course, e.g. due to different body proportions, there is noway a person will succeed in perfectly copying the model pose. There is a need for some <em>thresholding;</em> If all corresponding points are approximately adjacent, we can conclude the two poses match. From the moment a distance exceeds a certain threshold, they’re different.</p><h4>The Transformation — Affine</h4><p>We’re looking for the combination of a translation, scaling and rotation that best transforms the input pose onto the model pose. From Linear Algebra, we know this combination of operations is wrapped in a linear transformation, more precisely an <a href="https://en.wikipedia.org/wiki/Affine_transformation"><strong>affine transformation</strong></a><strong> (composition of linear map and a translation)</strong>. <br>The properties:<br>- Lines maps to lines<br>- Parallel lines remain parallel<br>- Origin does not necessarily map to origin<br>- Ratios are preserved</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*f49iFLorRk6Bf1CkNvVrLQ.jpeg" /><figcaption>Source: ‘Accelerating nonlinear image transformations with OpenGL’ -Vegard Øye</figcaption></figure><p>The linear map is represented as a multiplication by a matrix <strong>A </strong>and the translation as the addition of a vector <strong>b</strong>. An affine map <strong>f()</strong> acting on a vector <strong>x</strong> is represented as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*nAs6lJGPsNMuktcB0zllwA.jpeg" /></figure><p>Using an augmented matrix, it is possible to represent both the linear map and the translation using a single matrix multiplication. We need this augment matrix to solve our linear system in the next step.</p><p>This augmented matrix is created as follows:<br>1. Pad all vectors with a “1” at the end.<br>2. Augment the matrix with an one extra row of zeros at the bottom <br>3. Augment the matrix with an extra column (the translation vector) to the right and a “1” in the lower right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*y2g6XKFEnw4CkT2jS9aAmQ.jpeg" /></figure><p>In this particular case <strong>x</strong> -the input pose-<strong> </strong>and <strong>y</strong> -the model pose- are know and we want to find the augmented matrix. Using <strong>least-squares algorithm</strong> (which minimizes the sum of the squares), we can approximate the solution of this linear system and find the <strong>affine</strong> <strong>transformation matrix</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d279895c64e648602ec003b5ab38496e/href">https://medium.com/media/d279895c64e648602ec003b5ab38496e/href</a></iframe><p>Using the transformation matrix, we find <strong>x’</strong>; the input pose displayed onto the model pose. This is the <strong>best-fit</strong> resulting from the least-squares algorithm, that tries to transform the input pose onto the model pose.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ddb2b224cfafaa16c4b8f321d3da91c/href">https://medium.com/media/7ddb2b224cfafaa16c4b8f321d3da91c/href</a></iframe><h4>The Thresholds</h4><p>Now that we have the transformed input <strong>X’ , </strong>we can compare it with the proposed model pose. We will base our decision (different or similar shape) on two parameters: the distance between two corresponding points and the rotation introduced by the affine transformation.</p><p><strong>1. Rotation<br></strong>Consider a person performing handstand. This is not the same pose as another person just standing straight. Although, in some cases, it’s perfectly possible a descent affine transformation is found. When you examine the transformation matrix a bit closer, you will find rotation angle around 180°.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzvuFO5Q9gCegarO4Vgk8Q.png" /><figcaption>Rotation illustration [using split()]</figcaption></figure><p>The above example illustrates the case a decent transformation is found even though this is not what we humans understand under “the same pose”. <br>Fortunately the rotation angle of the torso (arms) is around 175°, so well above the accepted value.</p><p><strong>2. Distance<br></strong>As distance metric the <strong>Euclidean distance</strong> is used (there are other options, as there are many <a href="https://numerics.mathdotnet.com/distance.html">distance metrics</a>). We limit the maximum Euclidean distance between two corresponding points by a determined threshold. This means, from the moment one distance exceeds a certain threshold, the whole pose does not match. Note we don’t take the sum of all euclidean distances. This is because we want to focus on <strong>outliers (maximum values)</strong>. From the moment one body-part is not well transformed, we can conclude the global pose doesn’t match.</p><h4>The Split() — Torso Legs and Face separately</h4><p>Our distance thresholding starts to look quite good, but there is still room for some improvement. Our gut instinct tells us we need to make a distinction between different body regions when evaluating the distances. As it is more easy to control your arms than your legs, you can feel we need to treat those two different. Same applies to the eyes, ears and nose. We’re looking for a way to evaluate these distinct regions with their <strong>own threshold</strong>.</p><p>In addition we want to introduce more freedom in the search for the optimal transformation. In particular, we want to ensure that <strong>difference in individual body proportions</strong> don’t influence the matching result. For example; a person who has very small legs in comparison with his chest (distance between two shoulders) will result in unpleasant contradictions.</p><p>These findings are confirmed by the following illustration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l0hCSJuV1azHJtm7-hzPQQ.png" /><figcaption>Transformation of all 18 points together, as one system</figcaption></figure><p>The result is not that good. Due to difference in body ratio, the transformed arms are to long and the transformed legs to small. It’s trying to find a middle ground, but it’s not acceptable.</p><p>Instead of calculating the affine transformation for the whole body, we split it in three parts: <br>1. Face (eyes + ears + nose)<br>2. Torso (arms + neck)<br>3. Legs + Hips</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56mDY5ASRffEIYgCE59QRQ.png" /><figcaption>Split()</figcaption></figure><p>This results in three transformation matrices and in turn three partially transformed inputs; a transformed torso, transformed face and a transformed legs. Again, comparison is done based on the euclidean distance and rotation. But now with their own specific thresholds.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e691b812a62ea35f4b58d3a3ace25136/href">https://medium.com/media/e691b812a62ea35f4b58d3a3ace25136/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBH8UFf_yfJAvpYftkIrTg.png" /><figcaption>This is <strong>eye candy</strong> — result of a split()</figcaption></figure><p>Looks good! We’re almost there, only one step left. If we want to reuse our precious thresholds, we better <strong>standardize</strong> everything before comparing. In that way different image resolutions are no issue. We will rescale the features to the range in [0, 1].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*PORwZciFvVYUFI9J3VSYjA.jpeg" /><figcaption>Feature scaling, x’ is our new normalized value</figcaption></figure><h3>Results</h3><p>Voilà, concerning <strong>single pose</strong> matching, that’s about it. Hope you liked it. However, to convince the skeptics among us I realize a more challenging example needs to be considered than the ones shown above.</p><p>— Behold ;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAUsn_cbn-BAW8RlquFszQ.png" /><figcaption>Sick freaking pose</figcaption></figure><p>The input pose is almost the same as the model, except the left elbow, left hand and left knee differ a bit. Ergo, as we would expect, the biggest deviations are located in the left elbow and the left knee.</p><p>What happens in the other case? When the person fails at copying the proposed model pose. Well, no surprise I guess; the quest for the best transformation fails as well. This is reflected in the greater distance between some corresponding points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s2ScF-LOhhrP1Oncri-2XA.png" /><figcaption>Epic fail epic fail epic fail</figcaption></figure><p>Legs and face are OK, but torso is completely lost. Hence, a fail is the only right outcome.</p><h4>Thanks for reading.</h4><p><a href="https://www.youtube.com/watch?v=4CI3lhyNKfo">Ciao, bella</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F8f5f8b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F8f5f8b&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href">https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href</a></iframe><figure><a href="https://becominghuman.ai/artificial-intelligence-communities-c305f28e674c"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*2f7OqE2AJK1KSrhkmD9ZMw.png" /></a></figure><figure><a href="https://upscri.be/8f5f8b"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*v-PpfkSWHbvlWWamSVHHWg.png" /></a></figure><figure><a href="https://becominghuman.ai/write-for-us-48270209de63"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*Wt2auqISiEAOZxJ-I7brDQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fd16a8bf0d3" width="1" height="1" alt=""><hr><p><a href="https://becominghuman.ai/single-pose-comparison-a-fun-application-using-human-pose-estimation-part-2-4fd16a8bf0d3">Single Pose Comparison — a fun application using Human Pose Estimation (Part 2)</a> was originally published in <a href="https://becominghuman.ai/">Becoming Human: Artificial Intelligence Magazine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Human Pose Matching on mobile — a fun application using Human Pose Estimation (Part 1 Intro)]]></title>
            <link>https://becominghuman.ai/human-pose-matching-on-mobile-a-fun-application-using-human-pose-estimation-part-1-intro-93c5cbe3a096?source=rss-57002c2cc89e------2</link>
            <guid isPermaLink="false">https://medium.com/p/93c5cbe3a096</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[openpose]]></category>
            <dc:creator><![CDATA[bilgeckers]]></dc:creator>
            <pubDate>Sun, 12 Nov 2017 22:04:42 GMT</pubDate>
            <atom:updated>2018-01-30T20:14:30.244Z</atom:updated>
            <content:encoded><![CDATA[<p>Human pose estimation -computationally detecting human body posture- is rising. These technologies capable of detection the human body joints are becoming effective and accessible. And they look astonishing, have a look:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpW6nZXeWlGM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpW6nZXeWlGM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FpW6nZXeWlGM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b6285f434fdacd7fe067c4d4e6fdebf/href">https://medium.com/media/8b6285f434fdacd7fe067c4d4e6fdebf/href</a></iframe><p>This video is made using <a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose">OpenPose</a> and it’s impressing</p><blockquote>OpenPose represents the first <strong>real-time system</strong> to jointly detect human body, hand and facial keypoints (in total 130 keypoints) on single images. In addition, the system computational performance on body keypoint estimation is <strong>invariant to the number of detected people</strong> in the image</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*YW6rCpcaW1wqcdeBpC04IQ.gif" /><figcaption>Result using OpenPose</figcaption></figure><p>This OpenPose library is a wonderful example of *buzzword incoming* <strong>Deep Learning</strong>. This library is built upon a <strong>neural network</strong> and has been developed by Carnegie Mellon University. OpenPose uses an interesting pipeline to achieve it’s <strong>robust performance</strong>. If you want to dig into this topic, the paper “<a href="https://arxiv.org/abs/1611.08050">Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields</a>” gives an overview of the inner workings of the system.</p><p>If you are looking for alternative algorithms, take a look at <a href="https://arxiv.org/abs/1605.03170">DeeperCut</a>. Here is an <a href="https://github.com/eldar/pose-tensorflow">implementation</a> in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*4OAVRUx3tuKnXEo8tl9xtQ.png" /><figcaption>Result using DeeperCut</figcaption></figure><h3>Mobile Development — The Opportunities</h3><p>So, the magic of Deep Learning gives us 18 human body joints. WHAT CAN WE DO WITH IT? A lot actually. Samin does a good job listing the possibilities in his <a href="https://medium.com/@samim/human-pose-detection-51268e95ddc2">blog</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*oVTetBH6worv5grwvSFkxw.png" /><figcaption>Pose Output Format OpenPose</figcaption></figure><p>The fact that these pose estimators work with just a normal camera, opens doors for <strong>mobile development</strong>. Imagine using these technology with your <strong>shitty smartphone camera</strong>. OK, I admit; I want to develop for smartphone, so (ideally?) everything runs embedded on the smartphone itself. This means, the implementation is capable of running on CPU or smartphone GPU. BUT, as these Estimator Algorithms currently run on some <strong>pretty decent GPUs</strong> , this is surely a point of discussion. Most of the new smartphones these days have a GPU on board, but are they capable of running these frameworks? <em>To nuance for this case, </em><strong><em>the (multi-person) keypoint detection doesn’t need to be real-time</em></strong><em>, as there is only 1 picture (no real-time video) and a </em><strong><em>delay time</em></strong><em> of 1 to 1,5 seconds is </em><strong><em>acceptable</em></strong><em>.</em></p><p>However, working embedded is not a must, it’s also possible to outsource the estimation/matching algorithm to a <strong>central server</strong> containing a decent GPU. <em>This particular choice</em>, embedded or out-sourcing, is an issue that involves a lot of parameters (performance/computation power, server cost, accuracy, mobile battery usage, delay server communication, multi platform, scalability, mobile data usage -less important- , …).</p><h3>Similarity of different poses — The Application</h3><p>I’m working on a project where a person must mimic a predefined pose (call it the model). A picture is made from the person that mimics this predefined pose. Then, with the help of OpenPose the human pose of the person is extracted from this image and compared with the predefined pose. Finally a scoring mechanism decides how well the two poses match or if they match at all.</p><p>This desired project raises two big problems tough:</p><h4>1. Porting OpenPose to Mobile Platform</h4><p>I didn’t tell you yet, but OpenPose is build with <strong>Caffe</strong>, a Deep Learning framework. Caffe is OK, but it doesn’t support <strong>Android</strong>, not mentioning <strong>iOS</strong>. There are plenty of other Deep Learning libraries, yet the mainstream library is <a href="https://www.tensorflow.org/"><strong>TensorFlow</strong></a>, a Machine Learning framework developed by Google. And surprise surprise, TensorFlow supports Android (of course, it’s made by Google) and iOS! Great! <br>So, TensorFlow it is then? I don’t know for sure yet. Still considering/researching the options … Hope to get back on this in the near future.</p><p>The community working on this topic is quite small, but it is growing. Actually <a href="https://arvrjourney.com/@asolanopf?source=post_header_lockup">Ale Solano</a> is working on this currently, he is trying to port the OpenPose-Caffe library to TensorFlow and he is also <a href="https://arvrjourney.com/human-pose-estimation-using-openpose-with-tensorflow-part-1-7dd4ca5c8027">blogging</a> about it! He’s making good progress.<br>UPDATE: <a href="https://arvrjourney.com/human-pose-estimation-using-openpose-with-tensorflow-part-2-e78ab9104fc8">Part 2</a> (it works!)</p><h4>2. How to determine similarity between 2 sets of matching 2D points</h4><p><em>Let’s say the previous succeeded, and we have the 2D joint points of two poses:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CNVomSVLOy8RCwAVi0-fmw.png" /><figcaption>left: model || right: input pose</figcaption></figure><p>So we have 2 <strong>sets of matching points</strong> (each consisting of 18 2D coordinates);<br>1. The model X (which needs to be mimicked) -left hand side <br>2. The input Y (needs to be checked on matching grade) -right hand side</p><p>Essentially this comes down to checking if the two poses (described by their 18 2D coordinates) are <strong>similar.</strong></p><blockquote><em>“Two geometrical objects are called </em><strong><em>similar</em></strong><em> if they both have the </em><strong><em>same shape</em></strong><em>, or one has the same shape as the mirror image of the other. More precisely, one can be obtained from the other by uniformly </em><strong><em>scaling</em></strong><em> (enlarging or reducing), possibly with additional </em><strong><em>translation</em></strong><em>, </em><strong><em>rotation </em></strong><em>and reflection. This means that either object can be rescaled, repositioned, and reflected, so as to coincide precisely with the other object.” — </em><a href="https://en.wikipedia.org/wiki/Similarity_(geometry)"><em>Wikipedia</em></a></blockquote><p>This means, two poses have the same shape if you can transform one pose to the other one using only a <strong>combination of translation, scaling and rotation</strong>. From Linear Algebra, we know this combination of operations is wrapped in a linear transformation, more precisely an <a href="https://en.wikipedia.org/wiki/Affine_transformation"><strong>affine transformation</strong></a><strong> (composition of linear map and a translation)</strong>. <br>This linear transformation is described by it’s transformation matrix [2x3]. So this is the <strong>first step</strong>: find the transformation matrix. You want this matrix? Solve the linear system et voilà! <br>You wish. There is noway two different poses are exactly described by an affine transformation on each other -ie are similar-, what’s the chance? One way or an other there will be some <strong>noise</strong> introduced, these are people in the wild you know. Hence, we want something that gives us an approximate. Luckily, there exists something like <a href="https://en.wikipedia.org/wiki/Least_squares">least-squares algorithm</a>, which will do the job for us. Math to the rescue again!</p><p>Assuming we have the transformation matrix, the <strong>next step</strong> is to transform the second pose onto the model. Now we can compare the <strong>image of the second</strong> <strong>pose</strong> and the model with each other. If all their <strong>corresponding points are adjacent</strong>, we can conclude the two poses match. From the moment a distance exceeds a certain threshold, they’re different.</p><p><em>I’ve been quite vague in the last two steps. I know. </em><br>That’s because I’m not sure yet about the ‘how’ precisely. I can list you all possible options I figured out, but that’s not useful I guess. I need to make some choices and try to find the best combination. <br>There are many ways to determine if the image of the second pose matches with the model (first pose). An option is, as suggested above, to limit the max (Euclidean) distance between two matching points by a determined threshold. But as there are many other <a href="https://numerics.mathdotnet.com/distance.html">distance metrics</a>, there are some other ways to compute this <strong>transformation error</strong>. <br>The same applies for finding the transformation matrix. You can split the problem in multiple smaller problems ( ie face , torso and legs) or keep the body as whole or something else. What’s the way to go? <br>As always, some approaches are more effectively then others</p><p>In the weeks to come, I will try to setup a test case and test on all these different parameters.</p><p>Hope to report back to you with some progress then. Maybe I include some example code also. <br><a href="https://medium.com/@gil.beckers/single-pose-comparison-a-fun-application-using-human-pose-estimation-part-2-4fd16a8bf0d3"><em>Update; part 2</em></a></p><p>If you are working on something similar, please do not hesitate to get in touch with me. Ciao!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F8f5f8b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F8f5f8b&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href">https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href</a></iframe><figure><a href="https://becominghuman.ai/artificial-intelligence-communities-c305f28e674c"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*2f7OqE2AJK1KSrhkmD9ZMw.png" /></a></figure><figure><a href="https://upscri.be/8f5f8b"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*v-PpfkSWHbvlWWamSVHHWg.png" /></a></figure><figure><a href="https://becominghuman.ai/write-for-us-48270209de63"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*Wt2auqISiEAOZxJ-I7brDQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93c5cbe3a096" width="1" height="1" alt=""><hr><p><a href="https://becominghuman.ai/human-pose-matching-on-mobile-a-fun-application-using-human-pose-estimation-part-1-intro-93c5cbe3a096">Human Pose Matching on mobile — a fun application using Human Pose Estimation (Part 1 Intro)</a> was originally published in <a href="https://becominghuman.ai/">Becoming Human: Artificial Intelligence Magazine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>