One of the common problems I have found is that most of the routines only accept 8bit single channel input data - and often the manual doesn't say anything about what is or isn't expected for the image parameters.
The above can be compiled using visual C (see the makefile but you obviously need to change the paths to match your system!) makefile
The above can be compiled using gcc on windows and presumably on Linux as well (see the makefile but you obviously need to change the paths to match your system!) makefilegcc
However, if you want to interface directly to a camera to process live video, then you've got to either have a driver from the manufacurer of the capture interface (e.g., frame grabber) and look up the various interface protocols for that card, or you're going to have to use some form of standard interface. In the Microsoft windows world, that means using either the older Video For Windows (VFW) framework or the newer DirectShow framwork. These are very complex! Some examples come in the OpenCV demo apps - but you're going to have to learn MSVC version of C++ - at least to some degree - to make sense of these.
In the linux world, there are also attempts to standardize capture device interfaces.
Another alternative is to look at the Java Media Framework (JMF)
At the moment, though I can hack the various demos to get what I want using OpenCV and either VFW or Directshow, I don't have any simple help or examples to pass on - I'll work on it! - in the meantime, I guess you'll have to fight your way through yourself.