Ask Your Question

Maxfashko's profile - activity

2015-03-26 16:08:39 -0600 asked a question resizeImage

Good evening. I'm trying to solve the following problem:

This is necessary to reduce the image when it is greater than a certain value. At the start of an error:

            newHeight = cfloat(img.rows);
    newWidth = cfloat(img.cols);

    aspectRatio = newHeight / newWidth;

    cout<< aspectRatio<<endl;

        if(img.rows > 1000){
            cout<<"yes";
        resize(img, dst, Size(200 / aspectRatio, 200), INTER_CUBIC);
        }

Error on my screen: OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file C:\b uildslave64\win64_amdocl\2_4_PackSlave-win32-vc11-shared\opencv\modules\imgproc\ src\color.cpp, line 3739

I would be grateful for any help