//resize//
void m_resize(Mat& src, Mat &dst, int cols, int rows)
{
// if(src.cols==cols&&src.rows==rows){
// dst.create(cols,rows);
// src.convertTo(dst);
// return;
// }
// Mat aa( rows, cols, CV_8UC3, Scalar(0,255,0) );//其实是2*6的矩阵,因为每个元素有3个通道。
double scale_x = (double)src.cols / cols;
double scale_y = (double)src.rows / rows;
// dst.create(cols,rows);
uchar* dataDst = dst.data;
int stepDst = dst.step;
uchar* dataSrc = src.data;
int stepSrc = src.step;
int iWidthSrc = src.cols;
int iHiehgtSrc = src.rows;
for (int j = 0; j < dst.rows; ++j)
{
float fy = (float)((j + 0.5) * scale_y - 0.5);
int sy = (int)(fy>=0?fy:fy-1);
fy -= sy;
sy = std::min(sy, iHiehgtSrc - 2);
sy = std::max(0, sy);
short cbufy[2];