OpenCV is released under a BSD license and hence it’s free for both academic and commercial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing. Enabled with OpenCL, it can take advantage of the hardware acceleration of the underlying heterogeneous compute platform. Adopted all around the world, OpenCV has more than 47 thousand people of user community and estimated number of downloads exceeding 7 million. Usage ranges from interactive art, to mines inspection, stitching maps on the web or through advanced robotics.
import sys
import cv2
import cv2.cv as cv
from cv2.cv import *
from cv2 import *
if __name__=='__main__':
if len(sys.argv)>1:
image=cv2.imread(sys.argv[1])
cv2.imshow("UDOO-OPENCV",image )
cv2.waitKey(0)
This is a UDOO vision control touch project, which is capable of gesture recognition under complex background.
UDOO - Gesture Control Project Test Two
UDOO - Gesture Control Project Test One
With UDOO Video Capture function and its powerful computing capability, we achievereal-time image capture and gesture recognition, here we use LED to display the I/O control. The following is a description of our design:
UDOO - Gesture Control Project
The screen is divided in 9 hot point area. In each area, it will recognize the gesture as a fist or a Palm to control the LED state.
We use OpenCV under Android OS to do the image capture and gesture recognition, use Android ADK to pass the control signal to Android OS to control the Arduino I/O to implement the control platform.
Arduino CODE:
#include "variant.h"
#include "stdio.h"
#include "adk.h"
#define LED_PIN1 10
#define LED_PIN2 11
#define LED_PIN3 12
#define LED_PIN4 13
// Accessory descriptor. It's how Arduino identifies itself to Android.
char descriptionName[] = "ArduinoADK_2";
char modelName[] = "UDOO_ADK"; // your Arduino Accessory name (Need to be the same defined in the Android App)
char manufacturerName[] = "Aidilab"; // manufacturer (Need to be the same defined in the Android App)
// Make up anything you want for these
char versionNumber[] = "1.0"; // version (Need to be the same defined in the Android App)
char serialNumber[] = "1";
char url[] = "http://udoomv.blogspot.it/"; // If there isn't any compatible app installed, Android suggest to visit this url
USBHost Usb;
ADK adk(&Usb, manufacturerName, modelName, descriptionName, versionNumber, url, serialNumber);
#define RCVSIZE 128
uint8_t buf[RCVSIZE];
uint32_t bytesRead = 0;
void setup()
{
Serial.begin(115200);
pinMode(LED_PIN1, OUTPUT);
pinMode(LED_PIN2, OUTPUT);
pinMode(LED_PIN3, OUTPUT);
pinMode(LED_PIN4, OUTPUT);
delay(500);
Serial.println("UDOO ADK demo start...");
}
void loop()
{
Usb.Task();
if (adk.isReady()) {
adk.read(&bytesRead, RCVSIZE, buf);// read data into buf variable
if (bytesRead > 0) {
if (parseCommand(buf[0]) == 1) {// compare received data
// Received "1" - turn on LED
digitalWrite(LED_PIN1, HIGH);
}
else if (parseCommand(buf[0]) == 0) {
// Received "0" - turn off LED
digitalWrite(LED_PIN1, LOW);
}
if (parseCommand(buf[1]) == 1) {// compare received data
// Received "1" - turn on LED
digitalWrite(LED_PIN2, HIGH);
}
else if (parseCommand(buf[1]) == 0) {
// Received "0" - turn off LED
digitalWrite(LED_PIN2, LOW);
}
if (parseCommand(buf[2]) == 1) {// compare received data
// Received "1" - turn on LED
digitalWrite(LED_PIN3, HIGH);
}
else if (parseCommand(buf[2]) == 0) {
// Received "0" - turn off LED
digitalWrite(LED_PIN3, LOW);
}
if (parseCommand(buf[3]) == 1) {// compare received data
// Received "1" - turn on LED
digitalWrite(LED_PIN4, HIGH);
}
else if (parseCommand(buf[3]) == 0) {
// Received "0" - turn off LED
digitalWrite(LED_PIN4, LOW);
}
}
}
}
// the characters sent to Arduino are interpreted as ASCII, we decrease 48 to return to ASCII range.
uint8_t parseCommand(uint8_t received) {
return received - 48;
}
UDOO is a mini PC that could run either Android or Linux, with an Arduino-compatible board embedded.
UDOO is a powerful prototyping board for software development and design, it’s easy to use and with a few steps you can start using it and creating your projects with minimum knowledge.
UDOO board
UDOO merges different computing worlds in one; each world has its strengths and weaknesses, and all of them are useful today in education as well as Do-It-Yourself (DIY) and rapid prototyping endeavours.
UDOO is an open hardware, low-cost computer equipped with an ARM i.MX6 Freescale processor for Android and Linux, alongside Arduino DUE’s ARM SAM3X, both CPU integrated on the same board!
UDOO’s size is 4.33 inch x 3.35 inch (11 cm x 8.5 cm) and it has low power consumption.
The power of 4 Raspberry PI + Arduino DUE functionality = UDOO
UDOO goals:
Develop an innovative product for a growing market
Give a new vision to the educational framework: the idea is to train up a new generation of engineers, designers and software developers skilled in digital technology: physical computing, multi-media arts, interactive arts, IoT...
Boost up the DIY world
Offer a low cost embedded platform for interactive art with powerful tools: Processing, OpenCV, PureData, openFramework
Provide companies with a great tool for fast prototyping
This is a machine vision control system, it can identify the color and size of objects in a production line, and then produce the judgment results according to the parameters, the results is defined by human like the category of size, category of color and so on.
Structure
1、 Controller: UDOO + Camera + Touchscreen+Ardunio +LED (MAIN) 2、 Machinery: compressed-air + solenoid valve + conveyor belt (Optional)