Useful Tips
If you look at the code in the sample programs you'll almost certainly notice the ease with which you can call different processes on an image. Indeed, looking through the pages of the Wiki and Birmingham's reference manual you can quite easily find the method or methods you'll want to use.
However, OpenCV has a few quirks that you ought to know about, especially
when it comes to passing parameters to those methods.
- CvArr Pointers: CvArr is an 'interface' - it can represent just about any array type in OpenCV. As such, you can send IplImage, CvMat and other structures (representing various types of image data) to the method without having to convert back to a particular structure.
-
Pedantry: OpenCV is really, really picky about what you can pass to
different methods. At some point you're bound to accidentally pass cvCanny a
pointer to an output image with 3 channels, and you may be surprised when it
doesn't work. (If it's this simple then you tend to get a message telling you
what you've done wrong.) If, on the other hand, you try to use cvSnakeImage
straight away without looking into its source code, it will most likely end
up with a segmentation fault, but I can't tell you any more about that as I've
still not managed to figure out why myself.
If this happens then the best thing to do is search the 40,000+ posts on the Yahoo group, as there might be someone who's had the same problem. If you don't see anything there, though, then it's up to you. - Unwidgetable Windows: The HighGUI functions provided by OpenCV such as cvNamedWindow, cvShowImage and cvCreateTrackbar all involve windows. Whilst they are some of the simplest methods to understand, just remember that you won't be able to have two windows with the same name and you won't be able to change any of their settings. You can't (for instance) change the placement of daughter objects within windows, you can't hide or show them, and you can't change their appearance.
