110,538
社区成员
发帖
与我相关
我的任务
分享
PointF center=new PointF();
center = rect.center;//矩形中心点
Matrix<double> mymat = new Matrix<double>(2, 3);//2X3矩阵
IntPtr M2 = CvInvoke.cv2DRotationMatrix(center, angle,1,mymat);//计算旋转加缩放的变换矩阵
//这之后应该就有问题了
IntPtr inputimg = CvInvoke.cvCreateImage(CvInvoke.cvGetSize(imagesource), Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F, 3);
MIplImage inputimg1 = (MIplImage)Marshal.PtrToStructure(inputimg, typeof(MIplImage));
Image<Bgr, Byte> inputimage = new Image<Bgr, Byte>(inputimg1.width, inputimg1.height, inputimg1.widthStep, inputimg1.imageData);
IntPtr dstimg = CvInvoke.cvCreateImage(CvInvoke.cvGetSize(threshold_ptr), Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F, 3);
MIplImage dstimage1 = (MIplImage)Marshal.PtrToStructure(dstimg, typeof(MIplImage));
Image<Bgr, Byte> dstimage = new Image<Bgr, Byte>(dstimage1.width, dstimage1.height, dstimage1.widthStep, dstimage1.imageData);
//Image<Bgr, byte> dst = imagesource.CopyBlank();
CvInvoke.cvWarpPerspective(inputimage,dstimage, mymat,1, new MCvScalar(0));//这一步报了错