Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

after applying cv::xphoto::bm3dDenoising is imshow is giving insertion error

I am simply trying to apply bm3dDenoising filter, below is my code

img = imread("/home/odroid/Downloads/t2.bmp");
cvtColor(img, gray, COLOR_BGR2GRAY);

    Mat img, gray, gray1,gray2
    float h = 1;
    int templateWindowSize = 4;
    int searchWindowSize = 16;
    int blockMatchingStep1 = 2500;
    int blockMatchingStep2 = 400;
    int groupSize = 8;
    int slidingStep = 1;
    float beta = 2.0f;
    int normType = cv::NORM_L2;
    int step = cv::xphoto::BM3D_STEPALL;
    int transformType = cv::xphoto::HAAR ;

imshow("b4_gray_image", gray);              //1

cv::xphoto::bm3dDenoising (gray, gray1, gray2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType);

imshow("after_gray_image", gray);           //2
imshow("dst1", gray1);                              //3
imshow("dst2", gray2);                              //4
waitKey();

return 0;

When I am compiling it doesn't give error, but during runtime its giving the following assertion error

terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.2) /home/odroid/Desktop/is2/opencv/modules/highgui/src/window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' It would be very helpful to point out my mistake !!

TIA

after applying cv::xphoto::bm3dDenoising is imshow is giving insertion error

I am simply trying to apply bm3dDenoising filter, below is my code

img = imread("/home/odroid/Downloads/t2.bmp");
cvtColor(img, gray, COLOR_BGR2GRAY);

    Mat img, gray, gray1,gray2
    float h = 1;
    int templateWindowSize = 4;
    int searchWindowSize = 16;
    int blockMatchingStep1 = 2500;
    int blockMatchingStep2 = 400;
    int groupSize = 8;
    int slidingStep = 1;
    float beta = 2.0f;
    int normType = cv::NORM_L2;
    int step = cv::xphoto::BM3D_STEPALL;
    int transformType = cv::xphoto::HAAR ;

imshow("b4_gray_image", gray);              //1

cv::xphoto::bm3dDenoising (gray, gray1, gray2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType);

imshow("after_gray_image", gray);           //2
imshow("dst1", gray1);                              //3
imshow("dst2", gray2);                              //4
waitKey();

return 0;

When I am compiling it doesn't give error, but during runtime its giving the following assertion error

terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.2) /home/odroid/Desktop/is2/opencv/modules/highgui/src/window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' It would be very helpful to point out my mistake !!

TIA

after applying cv::xphoto::bm3dDenoising is ; imshow is giving insertion error

I am simply trying to apply bm3dDenoising filter, below is my code

img = imread("/home/odroid/Downloads/t2.bmp");
cvtColor(img, gray, COLOR_BGR2GRAY);

    Mat img, gray, gray1,gray2
    float h = 1;
    int templateWindowSize = 4;
    int searchWindowSize = 16;
    int blockMatchingStep1 = 2500;
    int blockMatchingStep2 = 400;
    int groupSize = 8;
    int slidingStep = 1;
    float beta = 2.0f;
    int normType = cv::NORM_L2;
    int step = cv::xphoto::BM3D_STEPALL;
    int transformType = cv::xphoto::HAAR ;

imshow("b4_gray_image", gray);              //1

cv::xphoto::bm3dDenoising (gray, gray1, gray2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType);

imshow("after_gray_image", gray);           //2
imshow("dst1", gray1);                              //3
imshow("dst2", gray2);                              //4
waitKey();

return 0;

When I am compiling it doesn't give error, but during runtime its giving the following assertion error

terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.2) /home/odroid/Desktop/is2/opencv/modules/highgui/src/window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' It would be very helpful to point out my mistake !!

TIA