Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 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;
     }
 }