Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The following code works:

cv::Mat B = cv::Mat::ones(300,300,CV_32FC1);

for (int i = 0; i < 100; i++)
{
    B.at<int>(50, i) = 0;
    B.at<int>(51, i) = 0;
}

cv::Mat res_B;

resize(B, res_B, Size(423, 330));

namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", B );
imshow( "Display Resized Image", res_B );

waitKey(0);

The following code works:

cv::Mat B = cv::Mat::ones(300,300,CV_32FC1);

for (int i = 0; i < 100; i++)
{
    B.at<int>(50, i) = 0;
    B.at<int>(51, i) = 0;
}

cv::Mat res_B;

resize(B, res_B, Size(423, 330));
Size(640, 480));

namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", B );
imshow( "Display Resized Image", res_B );

waitKey(0);

The following code works:

cv::Mat B = cv::Mat::ones(300,300,CV_32FC1);

for (int i = 0; i < 100; i++)
{
    B.at<int>(50, i) = 0;
    B.at<int>(51, i) = 0;
}

cv::Mat res_B;

resize(B, res_B, Size(640, 480));

namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", B );
imshow( "Display Resized Image", res_B );

waitKey(0);

I hope it will help.