c - opencvResize() problem -
i trying use opencv2, built on ubuntu 10.04 simple program going reads exisitng image, creates image , resize original image 2(both width , height). below code. upon execution, don't see resized image window.
# include "stdio.h" #include "opencv2/highgui/highgui_c.h" #include <opencv2/imgproc/types_c.h> int main( int argc, char** argv ) { iplimage* img = 0; iplimage* dst_img = 0; if( argc < 2 ) { printf( "usage: accepts 1 image argument\n" ); exit( exit_success ); } img = cvloadimage( argv[1],1); if( !img ) { printf( "error loading image file %s\n", argv[1]); exit( exit_success ); } dst_img = cvcreateimage(cvsize(img->width*2,img->height*2),img->depth,img->nchannels); if( !dst_img ) { printf( "error loading output image file \n"); exit( exit_success ); } cvresize(img,dst_img,cv_inter_linear); cvnamedwindow( "original image", cv_window_autosize ); cvnamedwindow( "rescaledimage", cv_window_autosize ); cvmovewindow( "original image", 720, 515 ); cvmovewindow( "rescaledimage", 1500,1200 ); cvshowimage( "original image", img ); cvshowimage( "rescaledimage", dst_img ); cvwaitkey( 0 ); cvreleaseimage( &img ); cvreleaseimage( &dst_img ); cvdestroywindow( "original image" ); cvdestroywindow( "rescaledimage" ); return exit_success; }
i using cvcreateimage(), & cvresize() correctly above?
how can resize input image 2 in both directions?
any pointers on web(blogs,tutorials) , books opencv has lot of sample code 1 can use study opencv hands-on?
cvmovewindow( "rescaledimage", 1500,1200 );
my mistake. thought dimension of window/image. position of window on screen. changed -
cvmovewindow( "rescaledimage", 100,100 );
both windows fine now!
Comments
Post a Comment