输出图像的高和宽为原图像的一半
//
// main.cpp
// Study05
//
// Created by Sean on 16/2/18.
// Copyright © 2016年 Sean. All rights reserved.
//
#include <iostream>
#include "highgui.h"
using namespace std;
IplImage* doPyrdown(IplImage* in,int filter = CV_GAUSSIAN_5x5)
{
//assert(in->width%2==0 && in->height%2==0);
IplImage* out=cvCreateImage
(
cvSize(in->width/2,in->height/2),
in->depth,
in->nChannels
);
cvPyrDown(in, out);
return out;
}
int main(int argc, const char * argv[]) {
// insert code here...
cout << "Hello, World!\n";
IplImage* in = cvLoadImage("/Users/sean/Pictures/11.png");
cvNamedWindow("Example05_re");
cvNamedWindow("Example05_af");
cvShowImage("Example05_re", in);
cvShowImage("Example05_af", doPyrdown(in));
while(cvWaitKey(0)!=27);
cvReleaseImage(&in);
cvDestroyAllWindows();
return 0;
}