Core functions: cvpyrdown and cvpyrup
Program:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/45/D3/wKiom1PsNO6hW7IHAAWMsF7aTwY995.jpg "Title =" clipboard.png "alt =" wkiom1psno6hw7ihaawmsf7atwy995.jpg "/>
Code:
#include "cv.h"#include "cxcore.h"#include "highgui.h"#include <iostream>int pyr(int argc,char** argv){IplImage* src=cvLoadImage("e:\\picture\\xibao.jpg");IplImage* dst1=cvCreateImage(cvSize(src->width/2,src->height/2),src->depth,src->nChannels);IplImage* dst2=cvCreateImage(cvSize(src->width*2,src->height*2),src->depth,src->nChannels);cvPyrDown(src,dst1,CV_GAUSSIAN_5x5);cvPyrUp(src,dst2,CV_GAUSSIAN_5x5);cvNamedWindow("src");cvNamedWindow("PyrDown");cvNamedWindow("PyrUp");cvShowImage("src",src);cvShowImage("PyrDown",dst1);cvShowImage("PyrUp",dst2);std::cout<<src->height<<std::endl;std::cout<<src->width<<std::endl;cvWaitKey(0);return 0;}
This article is from the "flyclc" blog, please be sure to keep this source http://flyclc.blog.51cto.com/1385758/1539846