Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Myro and OpenCV


Published on

In this presentation, I detail my experience getting Myro to work with OpenCV

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Myro and OpenCV

  1. 1. OpenCV for Image Processing with Myro Bob Roberts Kutztown University [email_address]
  2. 2. What is Myro? <ul><li>Work of Georgia Tech and Bryn Mawr College with assistance and a grant from Microsoft </li></ul><ul><li>Collection of Python libraries for easy robotics programming </li></ul><ul><li>Used in conjunction with Scribbler and Fluke </li></ul>
  3. 3. What is the Scribbler... <ul><li>A small robot made by Paralax </li></ul><ul><li>Built in BASIC stamp </li></ul><ul><li>Two motors and a number of input sensors </li></ul><ul><li>Serial port on top for programming </li></ul>
  4. 4. ...and the Fluke <ul><li>Expansion board made by Georgia Tech </li></ul><ul><li>Adds Bluetooth, a camera and a few more sensors </li></ul><ul><li>Plugs into the Scribbler's serial port </li></ul>
  5. 5. The Scribbler and the Fluke
  6. 6. The problem <ul><li>Initial test to seek out a ball </li></ul><ul><li>The robot succeeded but gave no information about the shape </li></ul><ul><li>The function simply determined the number of pixels in the “blob” </li></ul>
  7. 7. Goals <ul><li>Provide advanced image processing </li></ul><ul><li>Discover working calibration </li></ul><ul><li>Abstract into easy to use functions </li></ul>
  8. 8. Proposed solution <ul><li>OpenCV, a powerful image processing tool </li></ul><ul><li>Native to C but has Python bindings </li></ul><ul><li>Can provide edge, circle and corner detection among other things </li></ul>
  9. 9. Setup <ul><li>A netbook running Windows XP </li></ul><ul><li>Myro uses Python 2.4, OpenCV uses 2.6 </li></ul><ul><ul><li>OpenCV and Pyhton 2.4 didn't work together </li></ul></ul><ul><ul><li>Myro and Python 2.6 worked well enough </li></ul></ul>
  10. 10. From Myro to OpenCV <ul><li>Convert from Myro's image format to OpenCV's image format </li></ul><ul><li>Information got scrambled in conversion </li></ul><ul><li>Work around was to convert to gray scale </li></ul>
  11. 11. Bad result
  12. 12. Detecting circles <ul><li>Initial attempt produced unexpected results </li></ul><ul><li>Prompted a controlled test that would vary the detection variables </li></ul><ul><li>Attempt to find the common values that work for circle detection </li></ul>
  13. 13. Pseudo code <ul><li>Increment X from 0 to 500 </li></ul><ul><ul><li>Increment Y from 0 to 500 </li></ul></ul><ul><ul><ul><li>HoughCircle with X & Y </li></ul></ul></ul>
  14. 14. Detecting circles (result)
  15. 15. An accidental discovery <ul><li>Previous test was run once more </li></ul><ul><li>Caused the script (and Python) to fail </li></ul><ul><li>Only notable difference between working and non working was the dimensions </li></ul><ul><li>Resizing worked </li></ul>
  16. 16. Wrap up for circle detection <ul><li>Modified the Original ball detecting code to use the OpenCV </li></ul><ul><li>Variables from test did not carry into real world </li></ul><ul><li>Resulted in the scribbler missing the real ball and chasing ghosts </li></ul>
  17. 17. Corner detection <ul><li>Initial run (with default values) went rather smoothly </li></ul><ul><li>Algorithm was a bit overzealous </li></ul>
  18. 18. Refinement <ul><li>If the horizon could be found, superfluous results could be removed </li></ul><ul><li>Found the lowest, center bisecting horizontal line </li></ul>
  19. 19. Process
  20. 20. Looking ahead <ul><li>Revisit color </li></ul><ul><li>Implement and calibrate for the real world </li></ul><ul><li>Create alternative to finding the horizon </li></ul><ul><li>Add shape detection </li></ul><ul><li>Devise a visual mapping </li></ul>
  21. 21. Thank you! For a copy of these slides go to