1 | initial version |
Well, OpenCV is mostly low level functions, with more complicated things built from those. So to do what you want, you do each of those in turn. Here's links to the functions that do what you described.
If you think the whole function you are trying to do would be useful to others, feel free to write it up as a module or function and contribute it to the library.