- Be careful: Here is the corect doc for current versions of OpenCV. This doc applies to an older version (2.0) of OpenCV.
- Highly recommended book (library has limited number of licenses to online version): Learning OpenCV by Bradsky and Kaehler. (Some errata.)
- API Ref
- Drawing Functions
- The current OpenCV documentation covers C, C++, and Python versions of many APIs. JavaCV bindings usually correpsond to the C version. JavaCV documentation “is lacking”, but you can read the source. This can be helpful when trying to understand how C and C++ constructs like pointers were mapped to Java. Also, the JavaCV code usually has comments indicating default parameter values, which are not available in Java, and which are sometimes not correctly shown in the OpenCV documentation.
- Some particular APIs of interest:
- cvCvtColor — Note: There are undocumented conversion codes like
CV_BGR2HSV_FULL, which is similar to
CV_BGR2HSV, but use the mapping
for hue instead of
when the output image is 8-bit. This effectively makes the output hue range [0,255] instead of [0,180]; both are compressed down from [0,360] to fit in a byte. Another option is to use 32 bit floating point output, in which case you will get the whole [0,360] hue range.
- cvThreshold, cvAbsDiffS, cvInRangeS, cvOr, cvAnd, cvNot
- cvFindContours — Also see how this is called in JavaCV near the bottom of the JavaCV demo program.
- cvHoughCircles (example)
- cvCreateMemStorage, cvClearMemStorage, cvReleaseMemStorage — Note: The documentation for these may be confusing. When using a
CvMemStorage s to collect the outputs of a function like
cvHoughCircles(), you normally do
CvMemStorage s = cvCreateMemStorage(0) once at the beginning of the program. You then pass
s (implicitly by reference in Java, or using a pointer in C) to
cvHoughCircles() as you process each frame. You look through the results stored in
s (the detected circles) for that frame as you desire. When you are finished processing each frame, you call
cvClearMemStorage() to release any memory that had been allocated in
s during the call to
cvHoughCircles() for the frame. Finally, when you are done processing all frames (e.g. at program exit), call
cvReleaseMemStorage() to release the storage object