opencv changes between Ubuntu versions ?

asked 2014-06-17 07:48:27 -0500

hvn gravatar image

Hi,

I'm trying to re-use some C++ code with opencv I wrote for Ubuntu 10.04 on Ubuntu 12.04. With imageHSV and imageThresh defined as IplImage*,

cvInRangeS(imageHSV, cvScalar(20, 100, 100), cvScalar(30, 255, 255), imageThresh);

does compile on 10.04 but not on 12.04: "cannot convert ‘IplImage {aka _IplImage}’ to ‘CvArr* {aka void*}". However, when looking around I find this should give no problems. So why this error ?

edit retag flag offensive close merge delete

Comments

if that code is using the old c-api, you might want to re-write it instead using the c++ api, cv::Mat and such.

berak gravatar imageberak ( 2014-06-17 08:48:14 -0500 )edit

Thanks, I will change to inRange but then I have to convert cvScalar into an array. I tried to use std::vector<int> but that doesnt compile. Any suggestions ?

hvn gravatar imagehvn ( 2014-06-17 10:14:55 -0500 )edit

just use cv::Scalar then

berak gravatar imageberak ( 2014-06-17 10:17:05 -0500 )edit

thanks...got confused by cvScalar and cv::Scalar

hvn gravatar imagehvn ( 2014-06-17 11:32:42 -0500 )edit