{"id":491,"date":"2019-06-29T22:01:43","date_gmt":"2019-06-29T22:01:43","guid":{"rendered":"http:\/\/funfacts.104.42.120.246.xip.io\/?page_id=491"},"modified":"2019-11-20T22:04:11","modified_gmt":"2019-11-20T22:04:11","slug":"face-derivatives-and-computer-vision","status":"publish","type":"page","link":"https:\/\/math.hmc.edu\/funfacts\/face-derivatives-and-computer-vision\/","title":{"rendered":"Face Derivatives and Computer Vision"},"content":{"rendered":"\n<div class=\"wp-block-columns has-2-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>One challenge in robotics is the problem of <em>computer vision<\/em>: how do you program a computer to interpret and &#8220;understand&#8221; the data it receives from some visual sensor? For example, one aspect of this problem is object\u00a0<em>recognition<\/em>, and another is object\u00a0<em>tracking<\/em>.<\/p>\n\n\n\n<p>While recognition is a very hard problem (that won&#8217;t concern us here), if you know what an object looks like, it can be tracked using some interesting mathematical ideas.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"73\" height=\"91\" data-attachment-id=\"1430\" data-permalink=\"https:\/\/math.hmc.edu\/funfacts\/face-derivatives-and-computer-vision\/20012-3-1\/\" data-orig-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.1.jpg\" data-orig-size=\"73,91\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"20012.3.1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.1.jpg\" data-large-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.1.jpg\" src=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.1.jpg\" alt=\"\" class=\"wp-image-1430\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"318\" height=\"172\" data-attachment-id=\"1431\" data-permalink=\"https:\/\/math.hmc.edu\/funfacts\/face-derivatives-and-computer-vision\/20012-3-2\/\" data-orig-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.2.gif\" data-orig-size=\"318,172\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"20012.3.2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.2-300x162.gif\" data-large-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.2.gif\" src=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.2.gif\" alt=\"\" class=\"wp-image-1431\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"73\" height=\"91\" data-attachment-id=\"1433\" data-permalink=\"https:\/\/math.hmc.edu\/funfacts\/face-derivatives-and-computer-vision\/20012-3-3\/\" data-orig-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.3.gif\" data-orig-size=\"73,91\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"20012.3.3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.3.gif\" data-large-file=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.3.gif\" src=\"https:\/\/math.hmc.edu\/funfacts\/wp-content\/uploads\/sites\/4\/2019\/11\/20012.3.3.gif\" alt=\"\" class=\"wp-image-1433\"\/><\/figure><\/div>\n<\/div>\n<\/div>\n\n\n\n<p>Suppose you are trying to track the face in Figure 1 as it moves in a sequence of frames. The visual data in each frame is an array of numbers (pixel intensities). Naively, you might track the face by searching each frame for an pattern of numbers similar to the one in Figure 1. But this can be very computationally intensive.<\/p>\n\n\n\n<p> Here is a better method used by computer scientists. The key idea is&nbsp;<em>linearization<\/em>&#8212; while an object&#8217;s motion may not be linear, for small time steps it is approximately&nbsp;linear. So we would expect that the frames alter in approximately linear ways. <\/p>\n\n\n\n<p>And they do! In the first row of Figure 2, we see a face moving left in a sequence of frames (look at them right-to-left). We can approximate the motion by looking at the frame in the first row labeled &#8220;+1 pix&#8221; and &#8220;subtracting&#8221; the original frame. This difference is shown in Figure 3. (If you like, you can think of it as a &#8220;derivative&#8221; representing the face&#8217;s motion!) If we assume that the face&#8217;s true motion is just the motion in Figure 3 repeated over and over, we get the approximation in the second row of Figure 2! As you can see, it remains a pretty good approximation&nbsp;for small numbers of steps. So we can &#8220;track&#8221; the face using this idea, as described below.<\/p>\n\n\n\n<p><strong>The&nbsp;Math&nbsp;Behind&nbsp;the&nbsp;Fact:<\/strong><br>In practice, the array of pixel intensities is encoded as a (very long) vector of numbers. The space of all possible pictures forms a vector space, and the vector associated with Figure 2 forms a vector V. Tracking an object then correponds to finding the component of a given vector (picture) in the direction of V, and the multiple of V tells us the amount of the translation! Other motions can also be treated in this way, such as shifts up\/down, rotation, scalings, etc. These correspond to vector components in other directions. (Thanks to Zach Dodds for providing the pictures, and Ran Libeskind-Hadas for providing his face!)<\/p>\n\n\n\n<p>You can study linearity and vector spaces in a&nbsp;linear algebra&nbsp;course.<\/p>\n\n\n\n<p><strong>How to Cite this Page:<\/strong>&nbsp;<br>Su, Francis E., et al. &#8220;Face Derivatives and Computer Vision.&#8221;&nbsp;<em>Math Fun Facts<\/em>. &lt;http:\/\/www.math.hmc.edu\/funfacts&gt;.<\/p>\n\n\n\n<p><strong>Fun Fact suggested by:<\/strong>   <br>Zach Dodds <\/p>\n","protected":false},"excerpt":{"rendered":"<p>One challenge in robotics is the problem of computer vision: how do you program a computer to interpret and &#8220;understand&#8221;&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[20,7,6,101,4,12],"class_list":["post-491","page","type-page","status-publish","hentry","tag-analysis","tag-calculus","tag-hard","tag-linear-algebra","tag-medium","tag-other"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/comments?post=491"}],"version-history":[{"count":4,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/491\/revisions"}],"predecessor-version":[{"id":1435,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/491\/revisions\/1435"}],"wp:attachment":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/media?parent=491"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/tags?post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}