use c++ headers

The C headers for opencv are deprecated. Replaced with c++ headers.