public IPattern Crop(Region Region) { Region = new Region(0, 0, Width, Height) .Clip(Region); var rect = new Rect(Region.X, Region.Y, Region.W, Region.H); var result = new Mat(Mat, rect); return(new DroidCvPattern(result)); }
public IPattern Crop(Region Region) { var rect = new Rect(Region.X, Region.Y, Region.W, Region.H); if (rect.X + rect.Width > Width) { rect.X = Width - rect.Width; } if (rect.Y + rect.Height > Height) { rect.Y = Height - rect.Height; } var result = new Mat(Mat, rect); return(new DroidCvPattern(result)); }