{"id":950,"date":"2011-01-04T12:56:19","date_gmt":"2011-01-04T19:56:19","guid":{"rendered":"http:\/\/mcclanahoochie.com\/blog\/?post_type=portfolio&#038;p=950"},"modified":"2023-06-10T10:32:20","modified_gmt":"2023-06-10T17:32:20","slug":"computer-vision-on-android","status":"publish","type":"post","link":"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/","title":{"rendered":"Computer Vision on Android in Java"},"content":{"rendered":"<h3>January 2010<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-2-small.png\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1259\" data-permalink=\"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/device-sobel-2-small\/#main\" data-orig-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-2-small.png?fit=221%2C124&amp;ssl=1\" data-orig-size=\"221,124\" 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;}\" data-image-title=\"device-sobel-2-small\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-2-small.png?fit=221%2C124&amp;ssl=1\" class=\"alignnone size-full wp-image-1259\" title=\"device-sobel-2-small\" src=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-2-small.png?resize=221%2C124\" alt=\"\" width=\"221\" height=\"124\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Over the holiday break, I finally created an Android\u00a0app that allows image processing on the camera&#8217;s raw data, and displays it back on the screen. It only uses\u00a0Java on the CPU for now, but in my free time I&#8217;ll be porting the code to <a href=\"http:\/\/www.khronos.org\/opengles\/\" target=\"_blank\" rel=\"noopener\">OpenGL ES<\/a> to run on the GPU, and also exploring the <a href=\"http:\/\/code.google.com\/p\/android-opencv\/\" target=\"_blank\" rel=\"noopener\">OpenCV port<\/a> for Android.\u00a0\u00a0The hard part so far was getting access to the raw pixel data and being able to display it back to the screen after modifying it. Now that this is done, any image processing effects I can think of will be easy to add to this app.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1260\" data-permalink=\"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/device-sobel-1\/#main\" data-orig-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png?fit=854%2C480&amp;ssl=1\" data-orig-size=\"854,480\" 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;}\" data-image-title=\"device-sobel-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png?fit=854%2C480&amp;ssl=1\" class=\"alignnone size-thumbnail wp-image-1260\" title=\"device-sobel-1\" src=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1-150x150.png?resize=150%2C150\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png?zoom=2&amp;resize=150%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-sobel-1.png?zoom=3&amp;resize=150%2C150&amp;ssl=1 450w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a><a href=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1261\" data-permalink=\"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/device-hist\/#main\" data-orig-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png?fit=854%2C480&amp;ssl=1\" data-orig-size=\"854,480\" 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;}\" data-image-title=\"device-hist\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png?fit=854%2C480&amp;ssl=1\" class=\"alignnone size-thumbnail wp-image-1261\" title=\"device-hist\" src=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist-150x150.png?resize=150%2C150\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png?zoom=2&amp;resize=150%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-hist.png?zoom=3&amp;resize=150%2C150&amp;ssl=1 450w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a><a href=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"1262\" data-permalink=\"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/device-histeq\/#main\" data-orig-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png?fit=854%2C480&amp;ssl=1\" data-orig-size=\"854,480\" 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;}\" data-image-title=\"device-histeq\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png?fit=854%2C480&amp;ssl=1\" class=\"alignnone size-thumbnail wp-image-1262\" title=\"device-histeq\" src=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq-150x150.png?resize=150%2C150\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png?zoom=2&amp;resize=150%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/01\/device-histeq.png?zoom=3&amp;resize=150%2C150&amp;ssl=1 450w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a><\/p>\n<p><strong>Download:<\/strong><br \/>\nI provide the\u00a0<a href=\"https:\/\/code.google.com\/p\/viewercv\/\" target=\"_blank\" rel=\"noopener\">Source<\/a> code as an example of\u00a0Computer Vision on Android in Java.<\/p>\n<p>&nbsp;<\/p>\n<p>Update 1 (Jan 7, 2011):<br \/>\nWhy didn&#8217;t I know about <a href=\"http:\/\/developer.motorola.com\/docstools\/motodevstudio\/\" target=\"_blank\" rel=\"noopener\">MOTODEV Studio<\/a> earlier!?! Through this Eclipse plug-in, getting JNI working was much less painful; I&#8217;m now processing vision code on the phone\u00a0in C instead of Java now!<\/p>\n<p>Update 2 (Jan 9, 2011):<br \/>\nSobel filter on the phone in Java: 1-2 FPS&#8230; Sobel filter in C\/jni: 15-20+ FPS!<\/p>\n<p>Update 3 (Jan 11, 2011):<br \/>\nImplemented in native C:<br \/>\n-YUV420sp -&gt; ARGB<br \/>\n-ARGB -&gt; Grayscale<br \/>\n-Histogram generation\/overlay<br \/>\n-Sobel Filtering<br \/>\n-Histogram normalization of the image<\/p>\n<p><strong>Update 4 (April 2011):<\/strong><br \/>\n<em>New<\/em><strong>: <\/strong>Android computer vision project with OpenCV &#8211; <strong><a href=\"http:\/\/mcclanahoochie.com\/blog\/portfolio\/computer-vision-on-android-opencv\/\" target=\"_blank\" rel=\"noopener\">ViewerCV<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>January 2010 &nbsp; Over the holiday break, I finally created an Android\u00a0app that allows image processing on the camera&#8217;s raw data, and displays it back on the screen. It only uses\u00a0Java on the CPU for now, but in my free time I&#8217;ll be porting the code to OpenGL ES to run on the GPU, and &#8230; <a title=\"Computer Vision on Android in Java\" class=\"read-more\" href=\"https:\/\/mcclanahoochie.com\/blog\/2011\/01\/computer-vision-on-android\/\" aria-label=\"Read more about Computer Vision on Android in Java\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[123,113,54,101,29],"class_list":["post-950","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-android","tag-computer-vision","tag-image-processing","tag-programming","tag-projects"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pZdXI-fk","jetpack-related-posts":[{"id":1177,"url":"https:\/\/mcclanahoochie.com\/blog\/2011\/04\/real-time-hdr-tonemapping\/","url_meta":{"origin":950,"position":0},"title":"Single Camera Real Time HDR Tonemapping","author":"mcclanahoochie","date":"April 26, 2011","format":false,"excerpt":"April 2011 \u00a0 Abstract As a final project for my Computational Photography class at Georgia Tech, I created an application that uses a single video camera to create tonemapped HDR images in real time. This project's inspiration comes from Soviet Montage Production's DSLR HDR video. The app runs on Linux\u2026","rel":"","context":"In \"computational photography\"","block_context":{"text":"computational photography","link":"https:\/\/mcclanahoochie.com\/blog\/tag\/computational-photography\/"},"img":{"alt_text":"contrast mapping","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/04\/map-1024x640.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/04\/map-1024x640.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/04\/map-1024x640.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1153,"url":"https:\/\/mcclanahoochie.com\/blog\/2011\/04\/computer-vision-on-android-opencv\/","url_meta":{"origin":950,"position":1},"title":"Computer Vision on Android with OpenCV","author":"mcclanahoochie","date":"April 8, 2011","format":false,"excerpt":"March 2011 With the help of Motodev Studio for Android, I've\u00a0extracted\u00a0the\u00a0android-opencv JNI\u00a0camera example and spawned a fork of my original computer vision app,\u00a0Viewer, to an OpenCV version: ViewerCV. Both are\u00a0available on Git Hub\u00a0as open source software example of doing Computer Vision on Android with OpenCV. Viewer Features: *FAST Features (default\u2026","rel":"","context":"In \"android\"","block_context":{"text":"android","link":"https:\/\/mcclanahoochie.com\/blog\/tag\/android\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/04\/viewercv1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3491,"url":"https:\/\/mcclanahoochie.com\/blog\/2015\/12\/google-cardboard-camera-vr-photos\/","url_meta":{"origin":950,"position":2},"title":"Google&#8217;s Cardboard Camera for 3D Virtual Reality Photos","author":"mcclanahoochie","date":"December 3, 2015","format":false,"excerpt":"Today Google released an app \"Cardboard Camera\" for Android in\u00a0the Play Store: https:\/\/play.google.com\/store\/apps\/details?id=com.google.vr.cyclops A free app to create 3D virtual reality photos (stereoscopic 3D 360\u00b0 panoramas). VR Photography The app\u00a0takes a three-dimensional panorama you can view in the Google Cardboard app. The result is a 360\u00b0 image where near things\u2026","rel":"","context":"In \"android\"","block_context":{"text":"android","link":"https:\/\/mcclanahoochie.com\/blog\/tag\/android\/"},"img":{"alt_text":"Screen Shot 2015-12-03 at 2.19.33 PM","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2015\/12\/Screen-Shot-2015-12-03-at-2.19.33-PM-280x300.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3454,"url":"https:\/\/mcclanahoochie.com\/blog\/2015\/06\/play-youtube-in-background-android-app\/","url_meta":{"origin":950,"position":3},"title":"Play YouTube in Background on Android","author":"mcclanahoochie","date":"June 19, 2015","format":false,"excerpt":"YT Mobile Android App Are you tired of YouTube stop playing when turning off your screen or minimizing the app? Don't want to pay for YouTube or Google Music? \u00a0 Try: Summary This app provides a convenient place to browse the mobile web version of YouTube, and allows you to\u2026","rel":"","context":"With 71 comments","block_context":{"text":"With 71 comments","link":"https:\/\/mcclanahoochie.com\/blog\/2015\/06\/play-youtube-in-background-android-app\/#comments"},"img":{"alt_text":"ytmobile.tk","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2015\/06\/logo-icon-114.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1783,"url":"https:\/\/mcclanahoochie.com\/blog\/2011\/09\/modified-build-prop-lcd-density-fi\/","url_meta":{"origin":950,"position":4},"title":"Fix Android Market Update Issues [build.prop]","author":"mcclanahoochie","date":"September 19, 2011","format":false,"excerpt":"I have been using a custom build.prop file for a while now on my Droid X. There are several benefits [example] for doing so; the main one for me is a higher virtual screen resolution,\u00a0also known as \"LCD density\". This can be done via various methods, including programs such as\u2026","rel":"","context":"In \"android\"","block_context":{"text":"android","link":"https:\/\/mcclanahoochie.com\/blog\/tag\/android\/"},"img":{"alt_text":"Lock Screen: density 240","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/09\/d240b-168x300.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1762,"url":"https:\/\/mcclanahoochie.com\/blog\/2011\/09\/music-visualization-with-processing\/","url_meta":{"origin":950,"position":5},"title":"Music Visualization with Processing","author":"mcclanahoochie","date":"September 5, 2011","format":false,"excerpt":"Live Spectrogram Re-Inspired by the awesome artistic works in\u00a0Resonance the Film, a TED talk on generative music videos,\u00a0and then remembering the good ol' days of MilkDrop\u00a0magic, I found myself captivated and wanting to learn more about music visualization\u00a0and how I could create my own. Since I will be using Processing\u2026","rel":"","context":"In \"music\"","block_context":{"text":"music","link":"https:\/\/mcclanahoochie.com\/blog\/tag\/music\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mcclanahoochie.com\/blog\/wp-content\/uploads\/2011\/09\/spect-bmsr-milkskates.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/posts\/950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/comments?post=950"}],"version-history":[{"count":0,"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/posts\/950\/revisions"}],"wp:attachment":[{"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/media?parent=950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/categories?post=950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mcclanahoochie.com\/blog\/wp-json\/wp\/v2\/tags?post=950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}