首页 > 代码库 > cvResize 重新设定图像大小

cvResize 重新设定图像大小

核心函数:cvResize

程序:

wKiom1PsPY2ztCLbAAh_2Z9bSJY448.jpg

代码:

#include "cv.h"

#include "cxcore.h"

#include "highgui.h"

#include <iostream>

int resize(int argc,char** argv)

{

IplImage* src=http://www.mamicode.com/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;

}


本文出自 “flyclc” 博客,请务必保留此出处http://flyclc.blog.51cto.com/1385758/1539859