Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assertion erro in log operation

My code for calculate the log of all pixels in an image:

int main(int argc, char** argv)
{


    //ABRE A IMAGEM->CINZA e MOSTRA
    Mat img = imread("img.jpg", IMREAD_GRAYSCALE);
    Mat dest;

    cv::log(img, dest);
    namedWindow("Histograma");
    imshow("Histograma", dest);
    if (waitKey(0) == 27) destroyAllWindows();
    return 0;
}

Assertion erro in log operation

My code for calculate the log of all pixels in an image:

int main(int argc, char** argv)
{


    //ABRE A IMAGEM->CINZA e MOSTRA
    Mat img = imread("img.jpg", IMREAD_GRAYSCALE);
    Mat dest;

    cv::log(img, dest);
    namedWindow("Histograma");
namedWindow("t");
 imshow("Histograma", imshow("t", dest);
    if (waitKey(0) == 27) destroyAllWindows();
    return 0;
}

Assertion erro in log operation

My code for calculate the log of all pixels in an image:

int main(int argc, char** argv)
{


    //ABRE A IMAGEM->CINZA e MOSTRA
    Mat img = imread("img.jpg", IMREAD_GRAYSCALE);
    Mat dest;

    cv::log(img, dest);
    namedWindow("t");
    imshow("t", dest);
    if (waitKey(0) == 27) destroyAllWindows();
    return 0;
}

Output:

OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(3.4.2) Error: Assertion failed (depth == 5 || depth == 6) in cv::log, file c:\build\3_4_winpack-build-win64-vc15\opencv\modules\core\src\mathfuncs.cpp, line 701