Help me convert this code in C++ to python in open CV

this is C code from the now defunkt 1.0 api.
please throw it away, it is no more useful, since the api & functionality have changed a lot

please tell us, what you are trying to achieve, maybe we can help to find something more adequate

(you probably want to look at the tutorial)