OpenCVSharp set ROI in camera streaming window

Hello,

I’d like to set Region of Interest in window with image captured from camera… How to do that? I’m using C# with OpenCVSharp and Visual C#.

Something like that:

  
using (CvCapture cap = CvCapture.FromCamera(0)) // device type + camera index  
using (CvWindow v = new CvWindow("Live Stream"))  
while (CvWindow.WaitKey(10) < 0)  
            {  
                using (IplImage src = cap.QueryFrame())  
                v.Image = src;  
              // Then set ROI and send it to picturebox  
                pictureBox.Image = BitmapConverter.ToBitmap(ROI);  
            }