Difference between revisions of "User:Sjoerdlegue"

From DigitalCraft_Wiki
Jump to navigation Jump to search
Line 64: Line 64:
 
----
 
----
 
====Collecting Data====
 
====Collecting Data====
 +
The first step in my process was to collect data through video. I have tried multiple other things, before settling with the Raspi Camera module. Other video recorders, like a generic webcam and the Microsoft Kinect did not work properly with the Raspberry Pi. They would require a lot of tweaking and fiddling around before being able to use them. This was the moment I stumbled upon the Raspberry Pi Camera module. I played around with the source from pyimagesearch.com that I found and did some research on the camera and it's documentation. At this point, I was still working in Node.js. But that programming language did not match my requirements and could not 'communicate' as easily with the camera module as Python would.
  
====Libraries====
+
<gallery>
 +
File:Testingcamera.jpg|Testing Raspberry Pi Camera
 +
File:Testsetup.JPG|Living Room Setup
 +
</gallery>
 +
 
 +
Before switching to Python, I have been trying to create a proper setup for collecting some datasets from within my living room.
  
 
====Writing Code====
 
====Writing Code====
 +
After having made the decision to switch to Python, I have been searching on the internet for other similar projects. I always think it is better to learn from something similar, then to try reinventing everything all over again. I stumbled upon a project from a Belgian person named Cedric Verstraeten. He has made a [https://github.com/cedricve/motion-detection motion detection system] for OpenCV in C++ (see github link). Some of his elements (like the motion blocking) is very clever and has been the inspiration for me to take on a similar approach. I combined the ideas of [https://github.com/cedricve/motion-detection Cedric] and [http://www.pyimagesearch.com/2015/05/25/basic-motion-detection-and-tracking-with-python-and-opencv/ pyimagesearch.com] into my own Python-based motion detection system.
  
 
====Testing:====
 
====Testing:====
 +
  
 
====Finetuning:====
 
====Finetuning:====
  
 
===Code===
 
===Code===
 +
----
 
'''Setup:'''<br/>
 
'''Setup:'''<br/>
 
All used code files are within this .zip file. Just extract them, navigate to the location and run motion.py as administrator.
 
All used code files are within this .zip file. Just extract them, navigate to the location and run motion.py as administrator.
Line 82: Line 91:
  
 
====Files====
 
====Files====
 +
<div style="padding: 5px 10px; font-family: Courier, monospace; background-color: #F3F3F3; border: 1px solid #C0C0C0;">
 
[[Media:Motion.zip]] (bestandgrootte: 2Mb)
 
[[Media:Motion.zip]] (bestandgrootte: 2Mb)
 +
</div><br/>
  
 
===Brainstorm===
 
===Brainstorm===

Revision as of 01:29, 21 June 2016

Project Awareness

By Sjoerd Legué (sjoerdlegue@gmail.com)

Individual Project

Rotterdam-centraal.jpeg

Change of Direction:
In the brainstorm section, I've described that I wanted to do something with Open Data. This has changed, the current project does have stuff to do with data, but more with the processing of it. In september there is "De week van de Eenzaamheid" in Rotterdam. This event addresses the fact that loneliness is a serious issue in the Netherlands and thus requires needful attention. For this event, I have been asked to come up with a digital installation that makes people aware of the fact that loneliness can be something very close to everyone.

Concept:
The concept of my project is to address people personally, through a live videofeed and animation, that people themselves can help prevent loneliness amongst elderly around them. This is addressed through asking people personal questions about (for instance) when they have called their own grandma or grandpa.

Medium:
To reach people personally for this concept I want to process a live video feed (that is positioned on the first floor of Rotterdam Station) and track traveling people that are at the station. The video feed is going to be beamed on a canvas that is visible for everyone who walks at the station, or is visiting the website of our foundation (omaspopup.nl). For the project I am going to use a small single-board computer like the Raspberry Pi and it's compatible camera. I have chosen for this method because the entire project has to be small in size, to be able to fit underneath the canvas.

Documentation

Hardware


Raspberry Pi 3B

Raspberry Pi (model 3B+):
As described above, using a small processing computer allows me to use the installation in a narrow space. I also won't prefer placing a very expensive computer like a Mac to be placed in such a public space.

RasPi Camera (rev. 1.3):
This is the native supported webcam for the Raspberry Pi. This on-board camera can be connected to the computer very easily and is broadly supported across all of it's software.

RasPi 7" Touchscreen Display:
I use this touchscreen to display and read information directly from the Raspberry Pi itself. The computing board is attached on the back of the display, which makes the format of the installation even smaller.

Software


OpenCV 3 Object Detection

Python:
The entire program that drives the camera, and the recording/generating of the images, is written in Python. This programming language is quite easy to learn and is also very readable. I do have a lot of experience with other web-based programming languages, but I have never worked in Python before. So as an unexperienced programmer in Python, the language is very much recommendable for people who are new in programming.

Dependencies


Raspbian Jessie:
Before installing any dependencies, do not forget to update and upgrade the Advance Packages Tool.

sudo apt-get update
sudo apt-get upgrade
reboot


OpenCV 3:
OpenCV is a library that allows easy access for image manipulation and processing. Installing it for the Raspberry Pi takes quite some time and can be difficult for people who are new into Linux. I used this tutorial for the complete installation. This website (pyimagesearch.com is also very helpful and has an extensive set of tutorials about OpenCV + Python on the Raspberry Pi.

PiCamera:
This is the driver of the on-board camera. No need for installing the package, it comes natively with Raspberry OS Jessie. When having your camera connected, check availability like this:

vcgencmd get_camera


Matplotlib:
For the creation of the GIF image, additional libraries were needed. Matplotlib is a plotting library that supports the animation of GIF's. Although the dependency can be quite slow, it has excellent native support for OpenCV and PiCamera. Installing it did not take very long, I used this small tutorial for installing the libraries. Do not forget to install ImageMagick library too when using this, it is not described anywhere in the tutorial. Small topic on the subject here.

sudo apt-get update
sudo apt-get install imagemagick


Python, JSON:
All installed natively, I think. If not, just give the error a Google search and browse some forums.

Process


Collecting Data

The first step in my process was to collect data through video. I have tried multiple other things, before settling with the Raspi Camera module. Other video recorders, like a generic webcam and the Microsoft Kinect did not work properly with the Raspberry Pi. They would require a lot of tweaking and fiddling around before being able to use them. This was the moment I stumbled upon the Raspberry Pi Camera module. I played around with the source from pyimagesearch.com that I found and did some research on the camera and it's documentation. At this point, I was still working in Node.js. But that programming language did not match my requirements and could not 'communicate' as easily with the camera module as Python would.

Before switching to Python, I have been trying to create a proper setup for collecting some datasets from within my living room.

Writing Code

After having made the decision to switch to Python, I have been searching on the internet for other similar projects. I always think it is better to learn from something similar, then to try reinventing everything all over again. I stumbled upon a project from a Belgian person named Cedric Verstraeten. He has made a motion detection system for OpenCV in C++ (see github link). Some of his elements (like the motion blocking) is very clever and has been the inspiration for me to take on a similar approach. I combined the ideas of Cedric and pyimagesearch.com into my own Python-based motion detection system.

Testing:

Finetuning:

Code


Setup:
All used code files are within this .zip file. Just extract them, navigate to the location and run motion.py as administrator.

cd motion/
sudo python motion.py


Files

Media:Motion.zip (bestandgrootte: 2Mb)


Brainstorm


The moment I knew what I wanted to do:
For a long time I have known that Product Design was the right decision for me to choose. This also means that there was or is not a certain kind of image that reflects this moment for me. But IKEA has always inspired me to look at products (in the literal term) in a very different way. For instance the IKEA Concept Kitchen (IKEA Concept Kitchen 2025).

What do I make?
Although I have chosen for product design, my background lays in graphic- and digital design. Together with Emmy Jaarsma, I have made several hat designs over the course of a few years. Our best work even won the International Hat Designer of the Year award in 2013. For the hat, I mainly designed the digital pattern for the laser-cutter.

Topic of Interest:
For this practice I want to explore the concept of Open Data. It fascinates me that a lot of information is freely accessible on the internet to be used and processed and that everyone can contribute to this gigantic heap of information. Almost everything is on the internet, at least when you search for it with the right parameters.

Medium:
The main component I wish to use is a microcontroller (or small computer) with access to the internet. It should be able to search for the information by itself and process that into a visual attractive element that is easily readable by human beings. A good example of a very cool project is the Magic Mirror. It's just like a regular mirror, but it displays important information for the consumer to know.

Result