C++ Opencv程序在发布模式下不工作

C++ Opencv程序在发布模式下不工作,c++,opencv,release,C++,Opencv,Release,我有一个程序,在其中我试图查看图像是否为白色,它在调试模式下工作,但在发行版中不工作 int image_blanche(char * str, double prctage){ Mat img=imread(str); int compt=0; for(int i=0;i<img.rows;i++){ for(int j=0;j<img.cols;j++){ if (img.at

我有一个程序,在其中我试图查看图像是否为白色,它在调试模式下工作,但在发行版中不工作

   int image_blanche(char * str, double prctage){
       Mat img=imread(str);
       int compt=0;
       for(int i=0;i<img.rows;i++){
            for(int j=0;j<img.cols;j++){
                if (img.at<uchar>(i,j)==0){
                compt=compt+1;
               }
           }
        }

        if (compt< img.rows*img.cols*prctage)
        {   
            return 1;
        }
       else if (compt> img.rows*img.cols*prctage){
            return 0;
       }
    }

请显示错误消息或此代码的预期行为。什么不起作用?函数是否返回了错误的值?您确定两种模式都使用相同的映像吗?不要将发布版本链接到调试库;如果这是在windows上,请确保您使用的是正确的DLL。我指的是Visual Studio 2013的vc12。vc11适用于Visual Studio 2012,vc10适用于Visual Studio 2010,vc9适用于Visual Studio 2008。是的,这些都是正确的。调试断言失败