//#include<opencv2/core/core.hpp>
//#include<opencv2/highgui/highgui.hpp>
//#include<iostream>
//using namespace cv;
//using namespace std;
//
//Mat scale(Mat SImage, double sx, double sy)
//{
// int x = (int)(SImage.rows*sx);
// int y = (int)(SImage.cols*sy);
// Mat DImage(x, y, CV_8UC3);
// for (int i = 0; i < DImage.rows; i++)
// {
// for (int j = 0; j < DImage.cols; j++)
// {
// int tempx = (int)(i / sx);
// int tempy = (int)(j / sy);
// if (tempx >= SImage.rows - 1 || tempy >= SImage.cols - 1)
// {
// DImage.ptr(i, j)[0] = SImage.ptr(SImage.rows - 1, SImage.cols - 1)[0];
// DImage.ptr(i, j)[1] = SImage.ptr(SImage.rows - 1, SImage.cols - 1)[1];
// DImage.ptr(i, j)[2] = SImage.ptr(SImage.rows - 1, SImage.cols - 1)[2];
// }
// else {
// double b = i / sx - tempx;
// double a = j / sy - tempy;
// DImage.ptr(i, j)[0] = SImage.ptr(tempx, tempy)[0] * (1 - a)*(1 - b) + SImage.ptr(tempx, tempy + 1)[0] * a*(1 - b)
// + SImage.ptr(tempx + 1, tempy)[0] * b*(1 - a) + SImage.ptr(tempx + 1, tempy + 1)[0] * a*b;
// DImage.ptr(i, j)[1] = SImage.ptr(tempx, tempy)[1] * (1 - a)*(1 - b) + SImage.ptr(tempx, tempy + 1)[1] * a*(1 - b)
// + SImage.ptr(tempx + 1, tempy)[1] * b*(1 - a) + SImage.ptr(tempx + 1, tempy + 1)[1] * a*b;
// DImage.ptr(i, j)[2] = SImage.ptr(tempx, tempy)[2] * (1 - a)*(1 - b) + SImage.ptr(tempx, tempy + 1)[2] * a*(1 - b)
// + SImage.ptr(tempx + 1, tempy)[2] * b*(1 - a) + SImage.ptr(tempx + 1, tempy + 1)[2] * a*b;
// }
// }
// }
// return DImage;
//}
//
//
//int main()
//{
// Mat SImg = imread("god.jpg");
// Mat DImg = scale(SImg, 1.5, 2.3);
// namedWindow("原图");
// imshow("原图", SImg);
// namedWindow("缩放后");
// imshow("缩放后", DImg);
// waitKey();
//
//}
//