开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜