Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv assertion fail

image description I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully. image description Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3 image description It costs me 2 days and I still can not find out why.

opencv assertion failfailed (ssize.width >0 && ......) and assertion failed (mv && n >0)

image descriptionexception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully. image description Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3 image description It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: error: (-215:Assertion failed) (cn == 1 && (_mask. && (_mask. empty() || _mask.type() == == CV_8U)) || (cn > 1 && _mask.empty() && && !minIdx && !ma !ma xIdx) in function function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed failed (!ssize.empty()) in cv::resize, file file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully. image description Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3 image description It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully. image description O

penCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3 image description It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully. Osuccessfully.

penCV(3.4.3) OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3 image description 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

discreteImg = imread("lldis.bmp"); if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey(); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

Blockquote

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

discreteImg = imread("lldis.bmp"); if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey(); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

Blockquote

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

discreteImg = imread("lldis.bmp"); if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey(); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

discreteImg = imread("lldis.bmp"); if (!discreteImg.empty())
{ std::cout << "can load picture" << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey(); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

  • discreteImg = imread("lldis.bmp"); if (!discreteImg.empty())
    { std::cout << "can load picture" << "\n"; << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey(); waitKey(); } minMaxLoc(discreteImg, minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

click to hide/show revision 11
None

updated 2018-11-01 02:07:56 -0600

berak gravatar image

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

  • discreteImg = imread("lldis.bmp"); if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; << "\n"; namedWindow("lldis", 1); imshow("lldis", discreteImg); waitKey();
    } minMaxLoc(discreteImg, minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

discreteImg = imread("lldis.bmp"); imread("lldis.bmp");

if (!discreteImg.empty())        {
     std::cout << "can load picture" <<  "\n";
 "\n";   
            namedWindow("lldis", 1);
        1);  

    imshow("lldis", discreteImg);
        discreteImg);  

    waitKey(); 
} minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

click to hide/show revision 13
None

updated 2018-11-01 02:08:36 -0600

berak gravatar image

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

 discreteImg = imread("lldis.bmp");  

imread("lldis.bmp");
    if (!discreteImg.empty())        {
     std::cout << "can load picture" <<   "\n";   
    "\n";
        namedWindow("lldis", 1);  

1);
        imshow("lldis", discreteImg);  

discreteImg);
        waitKey();    }
 minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal,  NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

    discreteImg = imread("lldis.bmp");
    if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
        namedWindow("lldis", 1);
        imshow("lldis", discreteImg);
        waitKey();  
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

    discreteImg = imread("lldis.bmp");
    if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
        namedWindow("lldis", 1);
        imshow("lldis", discreteImg);
        waitKey();  
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg);
discreteImg>0);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

    discreteImg = imread("lldis.bmp");
    if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
        namedWindow("lldis", 1);
        imshow("lldis", discreteImg);
        waitKey();  
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

    if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
        namedWindow("lldis", 1);
        imshow("lldis", discreteImg);
        waitKey();      printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); 
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

    if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
            printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); 
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);
  1. result: discreteImg.tpye()=5 discreteImg.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

discreteImg.convertTo(discreteImg, CV_32S); 
discreteImg.convertTo(discreteImg, CV_32F);
discreteImg = discreteImg*0.25;

double minDiscreteVal, maxDiscreteVal; if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0); discreteImg>0);

  1. result: discreteImg.tpye()=5 discreteImg.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

discreteImg.convertTo(discreteImg, CV_32S); 
discreteImg.convertTo(discreteImg, CV_32F);
discreteImg = discreteImg*0.25;

discreteImg*0.25; double minDiscreteVal, maxDiscreteVal; if (!discreteImg.empty()) { std::cout << "can load picture" << "\n"; printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); } minMaxLoc(discreteImg, &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);

discreteImg>0);
  1. result: discreteImg.tpye()=5 discreteImg.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

discreteImg.convertTo(discreteImg, CV_32S); 
discreteImg.convertTo(discreteImg, CV_32F);
discreteImg = discreteImg*0.25; double minDiscreteVal, maxDiscreteVal;
if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
            printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); 
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);
  1. result: discreteImg.tpye()=5 discreteImg.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

code:

minDiscreteVal = 15.5;
maxDiscreteVal = 21.5;

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

discreteImg.convertTo(discreteImg, CV_32S); 
discreteImg.convertTo(discreteImg, CV_32F);
discreteImg = discreteImg*0.25; double minDiscreteVal, maxDiscreteVal;
if (!discreteImg.empty())       {
        std::cout << "can load picture" <<  "\n";
            printf("discreteImg.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); 
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);
  1. result: discreteImg.tpye()=5 discreteImg.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

code:

//minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, NULL, NULL, discreteImg>0);
minDiscreteVal = 15.5;
maxDiscreteVal = 21.5;

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

discreteImg.convertTo(discreteImg, CV_32S); 
discreteImg.convertTo(discreteImg, CV_32F);
discreteImg = discreteImg*0.25; double minDiscreteVal, maxDiscreteVal;
if (!discreteImg.empty()) (!Img.empty())       {
        std::cout << "can load picture" <<  "\n";
            printf("discreteImg.tpye()= printf("Img.tpye()= %d discreteImg.channels()=%d", discreteImg.type(), discreteImg.channels()); Img.channels()=%d", dImg.type(), Img.channels());    
    }
    minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, minMaxLoc(Img,    &minVal, &maxVal, NULL, NULL, discreteImg>0);
Img>0);
  1. result: discreteImg.tpye()=5 discreteImg.channels()=1Img.tpye()=5 Img.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

OpenCV(3.4.3) Error: Assertion failed (!ssize.empty()) in cv::resize, file c:\bu ild\3_4_winpack-build-win64-vc15\opencv\modules\imgproc\src\resize.cpp, line 404 4 exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

code:

//minMaxLoc(discreteImg,    &minDiscreteVal, &maxDiscreteVal, //minMaxLoc(Img,    &minVal, &maxVal, NULL, NULL, discreteImg>0);
minDiscreteVal Img>0);
minVal = 15.5;
maxDiscreteVal maxVal = 21.5;

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

It costs me 2 days and I still can not find out why.I finally solve this because I use wrong vc lib. My vs version is 2015 but I use vc15 lib library .After changing to vc14 , it works.

opencv assertion failed (ssize.width >0 && ......) and assertion failed (mv && n >0)

code:

if (!Img.empty())       {
        std::cout << "can load picture" <<  "\n";
            printf("Img.tpye()= %d Img.channels()=%d", dImg.type(), Img.channels());    
    }
    minMaxLoc(Img,    &minVal, &maxVal, NULL, NULL, Img>0);
  1. result: Img.tpye()=5 Img.channels()=1

exception caught: OpenCV(3.4.3) c:\build\3_4_winpack-build-win64-vc15\opencv\mod ules\core\src\minmax.cpp:753: error: (-215:Assertion failed) (cn == 1 && (_mask. empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !ma xIdx) in function 'cv::minMaxIdx'

I first met the assertion fail in the function minMaxLoc , I am sure that there is nothing wrong with my input because I imwrite and check it successfully.

code:

//minMaxLoc(Img,    &minVal, &maxVal, NULL, NULL, Img>0);
minVal = 15.5;
maxVal = 21.5;

OpenCV(3.4.3) Error: Assertion failed (mv && n > 0) in cv::merge, file c:\build \3_4_winpack-build-win64-vc15\opencv\modules\core\src\merge.cpp, line 284

Then I just guess the max and min values of instead of using this function , but another assertion fail happens. I get this project from my classmate, but it works normally in his computer with the same VS2015 and OPENCV 3.4.3

I finally solve this because I use wrong vc lib. My vs version is 2015 but I use vc15 lib library .After changing to vc14 , it works.