void resize(InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )

dsize与fx和fy必须不能同时为零,也就是说要么dsize不为零而fx与fy同时可以为0,要么dsize为0而fx与fy不同时为0;resize函数的目标大小可以是任意的大小,可以不保持长宽比率,删除的像素或者新增的像素值通过interpolation(内插)控制

Mat Image;
Image = imread("5.png");
Size dsize = Size(Image.cols * 0.1, Image.rows * 0.1);
Mat dst(dsize, Image.type());
resize(Image,dst,dst.size());

转换成功~

相关文章:

  • 2022-12-23
  • 2021-10-01
  • 2021-10-16
  • 2021-08-17
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2022-03-02
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案