Using Mat::at(i,j) in opencv for a 2-D Mat object

后端 未结 3 878
说谎
说谎 2020-12-10 07:39

I am using Ubuntu 12.04 and OpenCV 2

I have written the following code :

IplImage* img =0;
img = cvLoadImage(\"nature.jpg\");
if(img != 0)
{
    Mat         


        
3条回答
  •  忘掉有多难
    2020-12-10 08:00

    Why are you loading an IplImage first? You are mixing the C and C++ interfaces. Loading a cv::Mat with imread directly would be more straight-forward.

    This way you can also specify the type and use the according type in your at call.

提交回复
热议问题