static void Main(String[] args) { Mat img = CvInvoke.Imread(@"C:UsersdellPicturesmach.jpg"); Mat resize = new Mat(); //图像缩放操作 CvInvoke.Resize(img, resize, new Size(300, 300)); //图像旋转操作 PointF center = new PointF(resize.Cols / 2, resize.Rows / 2); double angle = 30; double scale = 2; Mat rotate = new Mat(); CvInvoke.GetRotationMatrix2D(center, angle, scale,rotate); Mat rotatedImg = new Mat(); CvInvoke.WarpAffine(resize, rotatedImg, rotate, new Size(300, 300)); //转置和镜像 Mat transpose = new Mat(); Mat flip = new Mat(); CvInvoke.Flip(resize, flip, FlipType.Horizontal); CvInvoke.Transpose(resize, transpose); CvInvoke.Imshow("flip", flip); CvInvoke.Imshow("rotated", rotatedImg); CvInvoke.Imshow("src", img); CvInvoke.Imshow("resized300*300", resize); CvInvoke.Imshow("transpose", transpose); CvInvoke.WaitKey(0); }