cvResize 重新设定图像大小

核心函数:cvResize

程序:

wKiom1PsPY2ztCLbAAh_2Z9bSJY448.jpg

代码:

#include "cv.h"

#include "cxcore.h"

#include "highgui.h"

#include <iostream>

int resize(int argc,char** argv)

{

IplImage* src=cvLoadImage("e:\\picture\\xibao.jpg");

IplImage* dst=cvCreateImage(cvSize(src->width/3,src->height/3),src->depth,src->nChannels);

cvResize(src,dst,1);

cvNamedWindow("src");

cvNamedWindow("dst");

cvShowImage("src",src);

cvShowImage("dst",dst);

cvWaitKey(0);

cvDestroyWindow("src");

cvDestroyWindow("dst");

cvReleaseImage(&src);

cvReleaseImage(&dst);

return 0;

}


你可能感兴趣的:(opencv,cvResize,重新设定图像大小)