<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11085</bug_id>
          
          <creation_ts>2017-02-20 11:11:42 +0000</creation_ts>
          <short_desc>Computer vision demo/testing setup</short_desc>
          <delta_ts>2017-05-04 08:02:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>IoT Reference OS Kit</product>
          <component>intel-iot-refkit-profile-computer-vision</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ismo Puustinen">ismo.puustinen</reporter>
          <assigned_to name="Ismo Puustinen">ismo.puustinen</assigned_to>
          <cc>brian.avery</cc>
    
    <cc>christian.da.costa</cc>
    
    <cc>matti-pekka.sivosuo</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70827</commentid>
    <comment_count>0</comment_count>
    <who name="Ismo Puustinen">ismo.puustinen</who>
    <bug_when>2017-02-20 11:11:42 +0000</bug_when>
    <thetext>Integrate various computer vision technologies into one demo / test case. Initial thinking is to use OpenCV for recognizing content in the picture. Then librealsense can be used for distance measurement to the recognized content.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71959</commentid>
    <comment_count>1</comment_count>
    <who name="Ismo Puustinen">ismo.puustinen</who>
    <bug_when>2017-03-31 10:48:53 +0000</bug_when>
    <thetext>A demo setup is created here: https://github.com/intel/intel-iot-refkit/pull/57

It allows, among other things, the use of RealSense cameras using Python 3 (for scripting) and brings example models for image recognition. The PR can&apos;t be merged though, because the final location to demo layers isn&apos;t defined yet.

One example demo which can be built using the PR with Python3 OpenCV and RealSense bindings is measuring the distance to cats using a RealSense camera:

   #!/usr/bin/python3
   
   import sys
   
   import numpy as np
   import cv2
   import pyrealsense as pyrs
   
   n_devices = pyrs.start()
   
   if n_devices == 0:
       print(&quot;No RealSense devices found!&quot;)
       sys.exit(1)
   
   cam = pyrs.Device()
   
   cat_cascade = cv2.CascadeClassifier(&quot;/usr/share/OpenCV/haarcascades/haarcascade_frontalcatface.xml&quot;)
   
   for x in range(30):
       # stabilize exposure
       cam.wait_for_frame()
   
   while True:
       # get image from web cam
       cam.wait_for_frame()
       img = cam.colour
   
       cats = cat_cascade.detectMultiScale(img)
   
       for (x,y,w,h) in cats:
           # find center
           cx = x+(w/2)
           cy = y+(h/2)
       
           depth = cam.depth[cy][cx]
    
           print(&quot;Cat found, distance &quot; + str(depth/10.0) + &quot; cm&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72788</commentid>
    <comment_count>2</comment_count>
    <who name="Ismo Puustinen">ismo.puustinen</who>
    <bug_when>2017-04-24 12:05:58 +0000</bug_when>
    <thetext>Before merging we need to finalize the layer discussion (where to put demos, testing coverage, ...).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72851</commentid>
    <comment_count>3</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-04-26 06:14:50 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Before merging we need to finalize the layer discussion (where to put demos,
&gt; testing coverage, ...).

The &apos;where&apos; part is what we&apos;ve already agreed. We can proceed with that as the first step. Please create a PR that adds meta-refkit-extra and all the recipes in it.

We can start with that layer disabled and I&apos;d propose that satisfies 2.3M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72852</commentid>
    <comment_count>4</comment_count>
    <who name="Ismo Puustinen">ismo.puustinen</who>
    <bug_when>2017-04-26 06:49:59 +0000</bug_when>
    <thetext>Ok, I&apos;ll add the layer. Should we in fact add several layers for different distro configurations? For example, we could have meta-refkit-extra-graphical for demos which require X11 DISTRO_FEATURE, and so on? If we have the layers disabled we can then just select which ones we need.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72886</commentid>
    <comment_count>5</comment_count>
    <who name="Ismo Puustinen">ismo.puustinen</who>
    <bug_when>2017-04-27 04:58:15 +0000</bug_when>
    <thetext>The meta-refkit-extra layer PR is now there with computer vision demo content and documentation. Changing status of this issue to &quot;review&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73005</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2017-05-03 15:51:09 +0000</bug_when>
    <thetext>Brian is going to create a new BZ as a follow-up to this one. Could you like or mention the bug id here now that I&apos;ve added you too the CC list? :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>