运行环境vc6.0 OpenCV1.0 OS:win7
//用户可以通过滚动条动态调节缩放比例,缩放比例的取值为2—8之间
#include "cv.h"
#include "highgui.h"
#include <iostream.h>
int g_slider_position = 0;
int flag = 0;
int pp = 0;
IplImage* doPyrDown(IplImage* in)
{
IplImage* out = cvCreateImage(
cvSize( in->width/2, in->height/2 ),
in->depth,
in->nChannels
);
cvPyrDown( in, out, CV_GAUSSIAN_5x5);
return( out );
};
void onTrackbarSlide(int pos)
{
flag = 1;
pp = pos;
switch(pos){
case 0:
cout << "Exercise3_1中视频画面保持原始大小——1*1" << endl;
flag = 0;
break;
case 1:
cout << "Exercise3_1中视频画面缩小一半——0.5*0.5" << endl;
break;
case 2:
cout << "Exercise3_1中视频画面缩小两半——0.25*0.25" << endl;
break;
case 3:
cout << "Exercise3_1中视频画面缩小三半——0.125*0.125" <<