![]() |
|||||||
| [ Home ] | [ Software ] | [ Curriculum ] | [ Hardware ] | [ Community ] | [ News ] | [ Publications ] | [ Search ] |
|
Implementing your own Vision SystemIf 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 SystemThere 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 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.
Pyro Modules Table of Contents
Modules
Additional ResourcesReference: PyroSiteNotes
|
| [ Home ] | [ Software ] | [ Curriculum ] | [ Hardware ] | [ Community ] | [ News ] | [ Publications ] | [ Search ] |
View Wiki Source | Edit Wiki Source | Mail Webmaster | |||||||