private void OnGrab()
 {
     if (_mat != null)
     {
         using (Image <Gray, byte> i = _mat.ToImage <Gray, byte>())
         {
             var image = new Image(i.Bytes, i.Width, i.Height, DateTime.Now);
             try
             {
                 GrabberSubject.OnNext(image);
             }
             catch (Exception ex)
             {
             }
         }
     }
 }
Example #2
0
        public void Start(CameraEntity device)
        {
            var client = new HttpClient();

            State = UnitState.Run;
            Task.Factory.StartNew(async() =>
            {
                while (State == UnitState.Run)
                {
                    var frame = await client.GetByteArrayAsync("http://192.168.100.100/-wvhttp-01-/image.cgi?v=jpg:1280x720");
                    var i     = new Image
                    {
                        JpegData = frame,
                    };
                    GrabberSubject.OnNext(i);
                }
            });
        }