OpenCV Color Tracking Robot Arm

I finally finished this OpenCV robo arm. It follows my neon green paper. I use the Romeo All in One microcontroller with the Arduino IDE. This microcontroller cannot take camera input, so I execute the program aws Follows.

1. I use the Logitech Quickcam Pro 9000 Webcam that is attached via usb to my mac.

2. Using OpenCV on my computer I run a program on eclipse that converts the frame to HSV, filters out neon green, then draws a target over the object. I got the source code for the color filter from this video. https://www.youtube.com/watch?v=bSeFrPrqZ2A .

3. The Eclipse Program sends serial data via usb to my Romeo all in one microcontroller V1

 

4. My Arduino Code reads the Serial data that reads l for left, r for right, u for up, d for down, and f for fire.

5. The Robot Arm( https://www.robotshop.com/en/dagu-6-degrees-of-freedom-robotic-arm.html ) adjusts accordingly.

6. As a later add on I added a laser diode that only fires when the arm is locked on ( when the object is int the middle of the cameras view. ) This laser can hit the green paper from up to 10ft away, and the card is about 12'' by 8''.

Largest Challenge:

The hardest part when building this robot was getting the Serial to work. On a mac I originally thought I had to use the extremely complicates stdio.h library, but I came across a command called popen. This is very simple. To send a byte, such as u you need to do very little. popen("echo u > (your own usb serial port)", "r")

I use c++ in eclipse. Getting OPenCV on my computer was also very challenging. I wnated to attach a micro electric airsoft gun and have it shoot red balloons, but my parents won't let me get an airsoft gun.


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/opencv-color-tracking-robot-arm

Spill the Beans!

This is a great project.

I know that Nemesis and mogul; have already said it, but i can’t wait to see how you got to the end result.

Parts used, how it was built, how it was programmed, more pictures/videos etc - there are a plenty of things you can add to make this not only a detailed build log but also a great source of information for others to draw inspiration from.

Me included!

Fantastic expansion

Thanks for the extra information!