{"id":33,"date":"2022-02-17T22:08:24","date_gmt":"2022-02-17T22:08:24","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/mitch\/?p=33"},"modified":"2022-02-17T22:08:24","modified_gmt":"2022-02-17T22:08:24","slug":"images-as-functions","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/mitch\/2022\/02\/17\/images-as-functions\/","title":{"rendered":"Images as Functions"},"content":{"rendered":"\n<p>This Computer Vision stuff is taking some time to get comfortable with. Most learning resources seem to expect you to have some background in image processing. Maybe that is typically a reasonable assumption to make on their part, but it&#8217;s something I am not particularly familiar with. This has meant spending some time brushing up on the basics.<\/p>\n\n\n\n<p>To this end, after some searching, I found <a href=\"https:\/\/classroom.udacity.com\/courses\/ud810\">this course<\/a> on Udacity. The lecture videos were recorded by Dr. Aaron Bobick (then at Georgia Tech). I&#8217;ve found Dr. Bobick&#8217;s enthusiasm for the subject matter infectious and I would recommend this course to anyone who might be interested in Computer Vision.<\/p>\n\n\n\n<p>In an early lesson you learn about how, for the purposes of Computer Vision, images should be thought of as functions. I didn&#8217;t understand what this meant at first, but it seems key to understanding how Computer Vision algorithms work. I&#8217;ll try to relay what I&#8217;ve learned.<\/p>\n\n\n\n<p>Here&#8217;s a simple image function:<\/p>\n\n\n\n<p><strong>f(x,y) =&gt; i<\/strong><\/p>\n\n\n\n<p>The function takes an x and y coordinate, and returns a value the describes the intensity of the light at that position in the image.<\/p>\n\n\n\n<p>So, this image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"1024\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.05-PM-833x1024.png\" alt=\"\" class=\"wp-image-34\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.05-PM-833x1024.png 833w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.05-PM-244x300.png 244w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.05-PM-768x944.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.05-PM.png 1050w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/figure>\n\n\n\n<p>&#8230; could also be described like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"948\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM-1024x948.png\" alt=\"\" class=\"wp-image-35\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM-1024x948.png 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM-300x278.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM-768x711.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM-1200x1111.png 1200w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-4.50.27-PM.png 1402w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We can see that the places in the image where the light intensity changes quickly will create large peaks and valleys. This allows us to see (and think about) the image in different ways than we typically might at a first glance. <\/p>\n\n\n\n<p>Here is a look at a blurred version of the image, and it&#8217;s associated 3D topological brightness-intensity map:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"450\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-1024x450.png\" alt=\"\" class=\"wp-image-36\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-1024x450.png 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-300x132.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-768x337.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-1536x675.png 1536w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM-1200x527.png 1200w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5241\/files\/2022\/02\/Screen-Shot-2022-02-17-at-5.01.30-PM.png 1876w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The topology map allows us to see just how much smoother the transition between peaks and valleys is. Viewing the blurred image in this way makes it more obvious what effect, mathematically, a blurring algorithm is having on the pixels&#8217; brightness values, and makes imagining the ways we might need to manipulate the image when performing feature detection more intuitive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Computer Vision stuff is taking some time to get comfortable with. Most learning resources seem to expect you to have some background in image processing. Maybe that is typically a reasonable assumption to make on their part, but it&#8217;s something I am not particularly familiar with. This has meant spending some time brushing up [&hellip;]<\/p>\n","protected":false},"author":12068,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/users\/12068"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/posts\/33\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mitch\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}