loading

How about adding computer vision to your Internet of Things?

Intel Edison has enough processing power to run simple object or face detection, but it has no cameras.

This tutorial shows how to use a smartphone to bring vision to Edison boards

Step 1: Download the Latest Edison Firmware

Intel website has all the development tools and firmware images you need to start playing with your Edison board. Go to the following URL and download the latest firmware, under the section "Intel Edison Board Firmware Release" and get the zip file:

https://software.intel.com/en-us/iot/hardware/edis...

Step 2: Connect Edison to Your PC

Make sure the micro-switch on your Intel Edison Arduino board is set pointing to the two micro-USB ports

Connect Edison to your PC using the OTG port (Check images above). Windows shall recognize it as an external drive.

Then connect a second USB cable between your PC and the serial port on Edison

Step 3: Connect to Edison Via Serial Port

Use Putty or other terminal software to connect to Edison via serial port.

Make sure you use the same connection parameters that appear on the image (115200 baud, 8N1, no flow control)

After connecting, press ENTER some times until Edison starts responding. Log on using the user "root' and no password.

Step 4: Install the Firmware Image

Your computer shall recognize Edison as an external drive.

Open it and delete all files you found there.

Then uncompress all files inside the download zip image into the Edison drive

On the serial terminal, type the command "reboot ota" and press ENTER.

Edison will restart and update the firmware. This may take some time. Watch this process via serial port

Step 5: Configuring Edison

Once you got the firmware updated, use the following commands to configure Edison:

"configure_edison --name": To give a name to your Edison board

"configure_edison --password": To set a password

And, the most important one:
"configure_edison --wifi" to connect Edison to your WiFi network, so you can go on with this tutorial

Step 6: Check Your Connection

Use PING, on your computer, to test if Edison is really 'visible' on your network

From now on, you can disconnect the serial cable and use SSH (Also on Putty) to control your Edison board. Or you can stick with serial terminal. It's up to you.

Step 7: Adding OpenCV Packages to Edison

We're gonna use opkg to install all packages we need on Edison

Type these three command lines to add new repositories to opkg list:

echo "src/gz all http://repo.opkg.net /edison/repo/all" >> /etc/opkg/base-feeds.conf
echo "src/gz edison http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf echo "src/gz core2-32 http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf

Then type "opkg update" to update the repositories list

And type "opkg upgrade" to update the installed packages. It takes some time until it finishes this process.

Finally, install the packages we need for openCV:

opkg install python-numpy opencv python-opencv

Step 8: Transforming Your Android Smartphone Into a Webcam

Make sure your phone, Edison and your computer are connected to the same WiFi network. If your phone is connected via 3G/4G, it won't work. You need WiFi on your phone

Install the free app "IP WebCam" on your phone:

https://play.google.com/store/apps/details?id=com....

Open the app, click on "Configure video" and set video resolution to 640x480. Since Edison processing power is limited, we can't work with full camera resolution images on OpenCV. Also, smaller images will be transmitted faster via WiFi, improving the FPS on Edison.

Step 9: Testing IP WebCam

After configuring IP WebCam, click on "Start server". Check that your phone goes into "camera mode", and its IP address is shown at the bottom of the screen, as a URL

Type this URL in your computer browser and you shall be able to see the video streaming from the phone

Step 10: Capturing the Phone Video From Edison

Instead of using video on Edison, we'll work with sequences of images. This makes no difference on the final result, but makes a lot easier to grab the phone output

On Edison terminal (SSH or Serial), use wget to download the current camera image as a jpeg file:

"wget :8080/shot.jpg"

Now you have a jpg file that you can use on OpenCV

Step 11:

This simple Python script shows how to grab the image from phone and use it on OpenCV

You can get an improved code to detect an object at my blog:

http://alexporto.com/blog/computer-vision-edison-opencv

Very good instructable. <br>Could you add more details from step 7 to the end? <br>i tried to follow you install OpenCV on Edison, but not succeeded.
<p>I'm sure you have figured it out by now but if not.</p><p>nano /etc/opkg/base-feeds.conf</p><p>change the third line src/gz core2-32 <a href="http://repo.opkg.net/edison/repo/core2-32" rel="nofollow">http://repo.opkg.net/edison/repo/edison</a> to </p><p>src/gz core2-32 <a href="http://repo.opkg.net/edison/repo/core2-32/" rel="nofollow">http://repo.opkg.net/edison/repo/core2-32/</a></p><p>and save (ctrl x then y then enter)</p><p>Then type &quot;opkg update&quot; to update the repositories list</p><p>And type &quot;opkg upgrade&quot; to update the installed packages. It takes some time until it finishes this process.</p><p>Finally, install the packages we need for openCV:</p><p>opkg install python-numpy opencv python-opencv</p><p>i like to use nano over vi </p><p>if nano is not installed</p><p>wget <a href="http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz" rel="nofollow"> http://www.nano-editor.org/dist/v2.2/nano-2.2.6.t...</a> &amp;&amp; tar xvf nano-2.2.6.tar.gz &amp;&amp; cd nano-2.2.6 &amp;&amp; ./configure &amp;&amp; make &amp;&amp; make install</p>
<p>i'm getting the following error.</p><p>copy_file_chunk: write: no more space left on device</p><p>after opkg upgrade. kindly help</p>
<p>Link above for core2-32 is correct, but Text is not as it points to repo edison rather than repo core2-32. This will prevent the python and opencv packages from being available to opkg install command.</p>
<p>Amazing Instructable. Thanks for share!</p>
<p>Parabens Alex!!!!</p><p>Gostei muito do seu post.</p><p>Euclas.</p>

About This Instructable

9,540views

27favorites

License:

More by Alex Porto:Computer Vision on Intel Edison using your smartphone camera 
Add instructable to: