Vision
OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.
tldr; It helps your computer “see” and “infer”
The Robotic Arm
For the Robotic Arm Project, OpenCV will be used to detect the shape and color of the object, position of the object relative to the claw and that data will then be used to pick and/or place said object.
OpenCV on RB3
The entire 96Boards DragonBoard line up have very straightforward and a generic userspace experience, with Open-source graphics based on Mesa and running close-to mainline linux kernel on Debian Buster, there aren’t (m)any kinks to be worked out.
OpenCV installation is very straight-forward, any instructions form the inter-webs just works without any modification, so let’s take a look at a few of them.
Don Harbin’s M&M Counting Demo:
This demo was originally created for the DragonBoard 820c but in reality can run on any device with a webcam.
The original purpose of this demo was to count M&M rolling down a shoot, but this demo also serves very well just to test opencv and color+object detection and counting. Definitely an excellent starting point.
Source: https://github.com/96boards/opencv-color-tracking-demo
Demo Video:
Running On the RB3:
pyimagesearch’s Ball Tracking with OpenCV
This is a generic demo for OpenCV beginners and also has been used a lot to show the capabilities of the DragonBoard410c on many occasions.
This demo tracks a green colored ball across the screen and draws a red trace line as it moves.
Source: https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/
Demo:
Running on the RB3:
Object Tracking + Color Detection + Shape Detection
This is the frankenstein code that, in a much more sophisticated form, will drive the robotic arm. So you could just say “Pick up the red ball” and this is how the arm knows what to pick up.
Source: https://github.com/ric96/RB3-RoboticArm/blob/master/shape.py
Running on the RB3:
RB3 doesn’t break a sweat ;)
This article is Part 2 in a 10-Part Series.
- Part 1 - qualcomm RB3 Robotic Arm Project | Introduction
- Part 2 - OpenCV on RB3 Pt. 1 | qualcomm RB3 Robotic Arm Project
- Part 3 - Threads got complicated | OpenCV on RB3 Pt. 2 | qualcomm RB3 Robotic Arm Project
- Part 4 - Gimme Code | OpenCV on RB3 Pt. 3 | qualcomm RB3 Robotic Arm Project
- Part 5 - My experiments with 1080p | OpenCV on RB3 Pt. 4 | qualcomm RB3 Robotic Arm Project
- Part 6 - Setup RB3 for the Robotic Arm Project | OpenCV on RB3 Pt. 0 | qualcomm RB3 Robotic Arm Project
- Part 7 - Speech Recognition and Combining Voice with Vision | OpenCV on RB3 Pt. 5 | qualcomm RB3 Robotic Arm Project
- Part 8 - It's ALIVE | OpenCV on RB3 Pt. 6 | qualcomm RB3 Robotic Arm Project
- Part 9 - Out with Arduino, In with i2c and PCA9685 | OpenCV on RB3 Pt. 7 | qualcomm RB3 Robotic Arm Project
- Part 10 - The RB3 Robotic Arm