Myro and OpenCV

Preview:

Citation preview

OpenCV for Image Processing with Myro

Bob RobertsKutztown University

rrobe064@live.kutztown.edu

What is Myro? Work of Georgia Tech and Bryn Mawr College

with assistance and a grant from Microsoft Collection of Python libraries for easy robotics

programming Used in conjunction with Scribbler and Fluke

What is the Scribbler...

A small robot made by Paralax Built in BASIC stamp Two motors and a number of input sensors Serial port on top for programming

...and the Fluke

Expansion board made by Georgia Tech Adds Bluetooth, a camera and a few more

sensors Plugs into the Scribbler's serial port

The Scribbler and the Fluke

The problem

Initial test to seek out a ball The robot succeeded but gave no

information about the shape The function simply determined the number

of pixels in the “blob”

Goals

Provide advanced image processing Discover working calibration Abstract into easy to use functions

Proposed solution

OpenCV, a powerful image processing tool Native to C but has Python bindings Can provide edge, circle and corner

detection among other things

Setup

A netbook running Windows XP Myro uses Python 2.4, OpenCV uses 2.6

− OpenCV and Pyhton 2.4 didn't work together

− Myro and Python 2.6 worked well enough

From Myro to OpenCV

Convert from Myro's image format to OpenCV's image format

Information got scrambled in conversion Work around was to convert to gray scale

Bad result

Detecting circles

Initial attempt produced unexpected results Prompted a controlled test that would vary

the detection variables Attempt to find the common values that

work for circle detection

Pseudo code

Increment X from 0 to 500

Increment Y from 0 to 500HoughCircle with X & Y

Detecting circles (result)

An accidental discovery

Previous test was run once more Caused the script (and Python) to fail Only notable difference between working

and non working was the dimensions Resizing worked

Wrap up for circle detection

Modified the Original ball detecting code to use the OpenCV

Variables from test did not carry into real world

Resulted in the scribbler missing the real ball and chasing ghosts

Corner detection

Initial run (with default values) went rather smoothly

Algorithm was a bit overzealous

Refinement

If the horizon could be found, superfluous results could be removed

Found the lowest, center bisecting horizontal line

Process

Looking ahead

Revisit color Implement and calibrate for the real world Create alternative to finding the horizon Add shape detection Devise a visual mapping

Thank you!

For a copy of these slides go tohttp://www.slideshare.net/2xrobert

Recommended