






Setting up the VIPeR Toolkit (sMunger)
The Computational Perception Lab has a VC++ "starter" project file which allows:
1) easy access to .avi and .bmp files
2) access for grabbing frames from a camera/capture card
3) Output of bmp's and (uncompressed) avi's.
This is for research/class purposes, so use at your own risk. Also, we use this under WinNT 4.0 and Win2000. You should too. Last thing: Look for newer versions, since they may have fixes or more/better examples.
Instructions:
- Get the file: /net/hi21/fx/bin/VIPeR_00.zip (or whatever the highest number is)
- Create a path to the CPL installed libraries: Go to your Unix home directory and type "ln -s /usr/local/cpl/NT cplNT". This will create a symbolic link allowing you to access CPL unix-mounted libraries through Windows.
- On your desktop, right-click My Computer to edit properties and add a user-variable "Path" with Value: "%Path%;h:\links\cplNT\ipl\bin;h:\links\cplNT\cvl\Bin;H:\links\cplNT\VisSDK\bin;h:\links\cplNT\SML\lib\"
NOTE: Make sure to set the appropriate path according to your link to cplNT e.g. If cplNT is directly in h:\ and not a sub-directory of 'links' set path value to the following:
"%Path%;h:\cplNT\ipl\bin;h:\cplNT\cvl\Bin;H:\cplNT\VisSDK\bin;h:\cplNT\SML\lib\"
- Open Visual C++ without opening a specific project file
- Add library paths to Development Environment by using the Tools Menu->Options->Directories, and assigning:
- Executables: H:\cplNT\ipl\bin (assuming you followed the instructions for symbolic links). Then do same for CVL and VisionSDK.

- Libs: H:\cplNT\ipl\lib\msvc. Same for CVL and VisionSDK.

- Include: H:\cplNT\ipl\include. Same for CVL and VisionSDK.

- Close VCPP (those path changes are now part of your roaming NT profile)
- Open the project file (sMunger.dsw)
- Build and run. You'll see that it checks for cameras and capture cards, but proceeds to process a movie and a bitmap if those aren't located. You can take the camera-activation part out if you're only processing files.
- Edit main.cpp in the callback functions. To find these, just look for "INSERT VIDEO IMAGE MANIPULATION CODE HERE"
- The callback you assign gets called for each frame of a movie, and the data within "videoImage" gets blasted to the screen. The VisIplDeleteImage is just deleting the ipl-wrapper around the data, not the pixel-values themselves.
- Elsewhere in that file you'll see commented-out examples of other callbacks, and you can find where those callbacks are associated with specific data streams. Change as you see fit, and try to experiment, though we don't expect you to ever need to change code outside of main.cpp.
Now you can modify the code to do what you want. FYI, you have IPL documentation in H:\cplNT\ipl\doc\iplman.pdf.
CVL (higher-level operations which use IPL data) documentation is at H:\links\cplNT\cvl\Docs\OpenCV.pdf and some extra explanations are in OpenCV_new.pdf. The online forum for discussing CVL (which is rapidly gaining users with its parallel Windows and Linux versions) is at: http://groups.yahoo.com/group/OpenCV
Use other avi's by changing xdim and ydim.
Notice that hitting space-bar in the log window has been given a callback at the bottom of the main.cpp: replays the movie. Try left and right-clicking in the windows. Hopefully these example hooks to keyboard and mouse-clicking can get you started if you want user-input.
Two example callbacks are in an alternate main file: example_main.cpp.
Pull it into your workspace in place of main.cpp. I've commented out the InitInstance call to activate the camera - turn it back on if you want, but the two example callbacks just process an avi and a bmp. Look for the 2 sections labeled "ADD YOUR CODE HERE!". Notice that space has been allocated implicitly for one VisSDK image, which comes into the callback as an argument, and whose contents go to the window when the callback is done. To get your results onto the screen, you'll need to dump them into the buffer that VisSDK points to (also pointed to by the iplVideoImage). Allocate other VisSDK and IPL images as you need them. You should be able to add windows widgets/menus/resources, but you'll need to change some of the relevant files from read-only to writable.
Pretty soon, all problems in life will look like they can be solved with computer vision. Have Fun.
Update History:
Ver. 01: Added code to InitInstance: CVisImageBase::SetIsAlphaWritten(false); // Makes written bmp's 24bit (not 32) and readable by Photoshop etc.
NOTE added to setting Path variable in user environment
Link to this Page
- Discussions last edited on 5 April 2001 at 3:52 pm by manatee.cc.gatech.edu