UserPreferences

Implementing your own Vision System


Implementing your own Vision System

If you would like to explore vision from the lower-level, and you would like to keep it tighty integrated with Python, then this section will show you how. You might want to read the section PythonAndC at some point.

If you don't need it to be tightly integrated with Python, then you just need to make your code callable from Python. The Phission vision system (see Pyro Vision Functions using Phission) is an example of this style, although it is tied to the Video4Linux subsystem. All you need do for this method is wrap your C or C++ code using SWIG. See PythonAndC for more details.

The rest of this section describes an example template for the integrated Python vision system. It is designed to work with any camera type in Pyro, including: Video4Linux, FakeCamera (simulated camera from image files), BlobCamera (simulated camera in the Stage simulator), GazeboCamera (OpenGL camera in the Gazebo simulator), and RobocupCamera (simulated camera for the Robocup simulator).

Example Vision System

There is a simple C++ based vision system (image processing) template that comes with Pyro. To build it:

export PYROBOT=/usr/local/pyrobot
cp -r $PYROBOT/vision/example myexample
cd myexample
make

In Pyro versions prior to 3.2.1, you may need to remove the unneeded PYTHON_INCLUDE line in the Makefile in that subdirectory. It is not necessary. There is another in the $PYROBOT/Makefile. You may also want to get the latest version of myVision.cpp. You can get it here.

To make changes, edit myVision.cpp and then rerun make to rebuild. You can add any kind of image processing code here.

To use from inside Pyro, start a robot (the Test robot is useful for this---you can also start it up on the command line pyro -r Test), and simply select this device from the Load menu under Devices.... You'll need to change directories (select Home in the upper right-hand corner of the load window, then select myexample).

You'll see a window popup, and the Filters menu is filled-in with the functions from your myexample/myVision.cpp.

You'll see the functions getMenu() and applyFilter() in myVision.cpp. They are the functions that add items to the menu, and execute their selection, respectively.

TODO: We'll try to add more detail here. Please add comments or questions.

Pyro Modules Table of Contents

Modules

  1. PyroModuleIntroduction

  2. PyroModuleObjectOverview

  3. PyroModulePythonIntro

  4. PyroModuleDirectControl

  5. PyroModuleSequencingControl

  6. PyroModuleBehaviorBasedControl

  7. PyroModuleReinforcementLearning

  8. PyroModuleNeuralNetworks

  9. PyroModuleEvolutionaryAlgorithms

  10. PyroModuleComputerVision

  11. PyroModuleMapping

  12. PyroModuleMultirobot

  13. FurtherReading

Additional Resources

  1. PyroIndex

  2. PyroAdvancedTopics

  3. PyroUserManual

  4. Pyro Tutorial Movies

Reference: PyroSiteNotes
{"cc_re__cc_re__cc_by_sa_2_0": ["es</a> \n</p>\n</li>\n\n    </ol>\n\n\n<p>\nReference: <a href=\"/emergent/PyroSiteNotes\">PyroSiteNotes</a> \n</p>\n</div>\n<div class=\"include-link\"><a class=\"include-page-link\" href=\"/emergent/PyroModulesContents\">[PyroModulesContents]</a><a class=\"include-edit-link\" href=\"/emergent/PyroModulesContents?action=edit&amp;backto=Implementing+your+own+Vision+System\"><img src=\"/wiki/classic/img/moin-edit.png\" alt=\"Edit\" height=\"12\" width=\"12\"></a></div> \n</p>\n</div>\n\n\n\n<div id=\"footer\">\n<div id=\"credits\">\n\n    <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">\n           <img align=\"right\" vspace=\"10\" alt=\"CreativeCommons\" border=\"0\" src=\"/wiki/classic/img/somerights20.gif\">\n    </a>\n    <a href=\"http://moinmoin.wikiwikiweb.de/\">\n           <img align=\"right\" alt=\"MoinMoin Powered\" border=\"0\" src=\"/wiki/classic/img/moinmoin.png\">           \n    </a>\n    <a href=\"http://www.python.org/\">\n        <img src=\"/wiki/classic/img/PythonPowered.png\" width=\"55\" height=\"22\" alt=\"PythonPowered\">\n    </a>\n    \n</div>\n\n\n<a href=\"/emergent/Implementing_20your_20own"]}