Cut image with EMGU CV

0

I'm working with EMGU specifically in the detection of rectangles. The question is that I already detect the rectangle I get the X and Y coordinates and the Width and Height sizes, what I want to do afterwards is to cut the rectangle detected but I can not do it the clipping because when it makes the detection the parameters that it throws, throws them with decimal point for example:

X = 213,0006 Y = 192.4260

When I want to cut it, I do it with the following:

var rect = new Rectangle(x, y, ImgWidth, ImgHeight);
Image fotoOrig = Image.FromFile(path);
Bitmap fotoBit = (Bitmap)fotoOrig;
Bitmap newBm = fotoBit.Clone(rect, fotoBit.PixelFormat);
triangleRectangleImageBox.Image = newBm;

When I want to enter the ranges of X and Y in:

var rect = new Rectangle(x, y, ImgWidth, ImgHeight);

The type of data requested is int and the data I have is float so I do not manage to cut out any idea of how to perform the task ??

    
asked by Alejandro Reyes 16.04.2018 в 05:35
source

0 answers