Cannot Access Mean Values

前端 未结 1 1823
南笙
南笙 2021-01-27 08:01

I have computed mean and standart deviation values of a region in the image. The code:

Mat img=imread(\"a.jpg\");
Mat hsv1;
Mat mean, stdev;
cvtColor(img, hsv1,         


        
相关标签:
1条回答
  • 2021-01-27 08:17

    The problem here is that you're trying to access a CV_64F Mat using at<float>.

    You can solve this like:

    double Mi = mean.at<double>(0,0);
    

    Or declaring Scalar instead of Mat:

    Scalar mean, stdev;
    cv::meanStdDev(hsv1, mean, stdev, superpixel_mask);
    double Mi = mean[0]; 
    
    0 讨论(0)
提交回复
热议问题