Can't access MCvRect
I want to translate in c# but can't access MCvRect (public struct MCvRect)
cvSetImageROI(img1, cvRect(10, 15, 150, 250)); // Opencv
in c#
CvInvoke.cvSetImageROI(img1, new MCvRect(...));// how to do in c#
CvInvoke.cvSetImageROI(img1, .....开发者_JAVA百科.)// why i can't see MCvRect
I am using Emgu , VS2010. regards,
Based on the new code you have posted, this should do what you want:
Rectangle yourRect = new Rectangle(20,20,200,200);
img_scene_.ROI = yourRect;
Image<Bgr,Byte> myimage = new Image<Bgr, Byte>(yourRect.Width, yourRect.Height);
img_scene.Copy(myimage, null);
img_scene.ROI = Rectangle.Empty;
You can use the ROI property of Image class
img.ROI = new Rectangle(...);
....
....
img.ROI = Rectangle.Empty; //in case you need to clear your ROI
精彩评论