Author Topic: Robotic vision: Coding issues  (Read 5453 times)

0 Members and 1 Guest are viewing this topic.

Offline jteteraTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Robotic vision: Coding issues
« on: April 04, 2014, 08:46:33 AM »
Hello.
After finishing my third minisumo robot, i decided to make a robot for playing football, navigated via CMOS vision sensors (was thinking about the one located at http://www.adafruit.com/products/397 ). However, i can't find any useful code for the processing (blob detection, will be used for detecting the ball). It will not be used for ranging (have ultrasonic sensors for that). Currently i have no idea about such systems and only used I2C once or twice.
I am using Arduino Uno. I'd also appreciate examples for other platforms and other camera chips. My goal is just to get the damn thing working.

Thanks in advance.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Robotic vision: Coding issues
« Reply #1 on: April 04, 2014, 11:23:49 AM »
Computer vision is a pretty hard area. As someone said: "Everything has been tried, and nothing works." :-)

What kind of CPU are you using for the detection? An Arduino or other small microcontroller is not going to be able to do the processing you need.

The lowest-cost system I can think of that would do a good job would be a Raspberry Pi plus the Pi camera (or a low-cost USB webcam, which will weigh slightly more.) The Pi could also do high-level IK and pathing for the servos, but would need some help (a small microcontroller or servo controller board) to drive the servos needed.

I'd probably start from some existing humanoid robot, such as the Dongbu Hovis, or the Robotis Bioloid.

Offline jteteraTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Robotic vision: Coding issues
« Reply #2 on: April 04, 2014, 11:56:38 AM »
Thanks for your advice.
The rasberry setup seems just OK given my budget and requirements, as the two robot kits you mentioned are a) expensive b) don't meet the vision requirements. The robot I designed is not even fully humanoid, it has some tank-like belts.
However, i don't have any experience with raspberries or even unix itself. And i also have no idea how to connect it to an arduino or such which would control subsystems (movement, servos etc.)
Do you know any tutorial sites?ยจ

EDIT: Is the 256 MB RAM version of raspberry enough to do the job?
« Last Edit: April 04, 2014, 12:16:15 PM by jtetera »

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Robotic vision: Coding issues
« Reply #3 on: April 04, 2014, 03:43:06 PM »
You connect a RPi to Arduino using USB, just like to any other PC/computer.
The 256 MB version of the RPi only has one USB port. If you want to use USB to connect both an Arduino and a Webcam, that won't work (without a separate hub, which increases price and weight.)
If you go with the Raspberry Pi specific camera, rather than a USB webcam, then you can use the remaining USB port for talking to the Arduino.
If you want to get started with Raspberry Pi programming, there's a good forum over on raspberrypi.org. They're quite friendly to newbies.
Also, there exists a distribution of ROS for Raspberry Pi. This will require more learning up-front to get going, but will also then give you a lot of pre-built functionality, like vision tracking, navigation control, etc. You'd probably need the 512MB version to run ROS.

Offline jteteraTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Robotic vision: Coding issues
« Reply #4 on: April 05, 2014, 05:28:23 AM »
Thank you again. I read through some ROS tutorials, and it seems i can get through it.

Offline klims

  • Robot Overlord
  • ****
  • Posts: 190
  • Helpful? 2
Re: Robotic vision: Coding issues
« Reply #5 on: April 28, 2014, 02:39:57 PM »
I think the easiest thing for a beginner would be to get something like the new CMU camera Pixy. Its relatively cheap and can easily connect to your arduino and send coordinates of colours/blobs.

It will allow you to get a taste for the task of blob/colour tracking that could be done easily. If you find that the device can't do the kind of tracking you need out of the box, then you will probably need to go down the RPi + Camera path and write your own algorithm.

Offline hobbes

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Robotic vision: Coding issues
« Reply #6 on: May 20, 2014, 02:00:47 AM »
You will need an algorithm that is not very processor intensive. Try making the ball a unique color that is not anywhere else in the scene. The field and other robots can not have that color. This trick is used to do weather forecasts on tv ( green screen ). Your code than just processes the pixels looking for that color. When you find one pixel with that color you can check the pixels around it to find the center of the ball. You can check the pixels to the left until the color is changed, than to the right, take the distance from the left to the right, the midpoint will give you the horizontal center of the ball. Do the same for the vertical center of the ball.


Offline muilenta

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Robotic vision: Coding issues
« Reply #7 on: October 24, 2014, 12:10:15 PM »
I'm using a laptop, opencv, and controlling a wheelchair.  Much easier.

 


data_list