public Mat GetBufferBgrSingle(Size size, int index) { if (_bgrSingleBuffers == null) { _bgrSingleBuffers = new ImageBufferFactory <Mat>(s => new Mat(s.Height, s.Width, DepthType.Cv8U, 3)); } return(_bgrSingleBuffers.GetBuffer(size, index)); }
public Mat GetBufferGray(Size size, int index) { if (_grayBuffers == null) { _grayBuffers = new ImageBufferFactory <Mat>(s => new Mat(s.Height, s.Width, DepthType.Cv8U, 1)); } return(_grayBuffers.GetBuffer(size, index)); }
public ProcessedCameraPreview(Activity activity, bool cameraPreviewCallbackWithBuffer) : base(activity) { _cameraPreviewCallbackWithBuffer = cameraPreviewCallbackWithBuffer; _paint = new Paint(); _paint.SetStyle(Paint.Style.Stroke); _paint.SetARGB(255, 255, 0, 0); _paint.TextSize = 25; using (Image <Bgr, Byte> img = new Image <Bgr, byte>(4, 8)) { } _watch = Stopwatch.StartNew(); _bgrBuffers = new ImageBufferFactory <Image <Bgr, byte> >(size => new Image <Bgr, Byte>(size)); }
protected override void DisposeObject() { if (_bgrBuffers != null) { _bgrBuffers.Dispose(); _bgrBuffers = null; } if (_grayBuffers != null) { _grayBuffers.Dispose(); _grayBuffers = null; } if (_bgrSingleBuffers != null) { _bgrSingleBuffers.Dispose(); _bgrSingleBuffers = null; } }