Why does namedwindow("Original Image",CV_WINDOW_AUTOSIZE) show a debug error on running exe whilenamedwindow("Original Image",1) doesn't?

asked 2016-01-23 22:53:02 -0500

devansh20la gravatar image

double alpha; /**< Simple contrast control */

int beta; /**< Simple brightness control */

int main( int argc, char** argv )

{ Mat image = imread( argv[1] );

Mat new_image = Mat::zeros( image.size(), image.type() );

cout<<"* Enter the alpha value [1.0-3.0]: ";cin>>alpha; cout<<"* Enter the beta value [0-100]: ";cin>>beta;

/// Do the operation new_image(i,j) = alpha*image(i,j) + beta

for( int y = 0; y < image.rows; y++ )

{ for( int x = 0; x < image.cols; x++ )

{ for( int c = 0; c < 3; c++ )
     {

new_image.at<vec3b>(y,x)[c] =saturate_cast<uchar>( alpha*( image.at<vec3b>(y,x)[c] ) + beta );

}

}

}

namedWindow("Original Image", 1);

namedWindow("New Image", 1);

imshow("Original Image", image);

imshow("New Image", new_image);

waitKey();

return 0;

}

edit retag flag offensive close merge delete

Comments

and the error is ?

berak gravatar imageberak ( 2016-01-24 00:50:13 -0500 )edit