public Image ToImage(OpenRTM.Core.CameraImage cameraImage)
 {
     if (cameraImage == null)
     {
         return Image.Empty;
     }
     var image = new Image(cameraImage.Bpp, cameraImage.Width, cameraImage.Height,
         cameraImage.Pixels.AsReadOnly().ToArray(), cameraImage.Format);
     cameraImage.Pixels = new List<byte>();
     return image;
 }
 public OpenRTM.Core.CameraImage Convert(Image image)
 {
     var cameraImage = new OpenRTM.Core.CameraImage
     {
         Bpp = (ushort) image.Bpp,
         Pixels = new List<byte>(image.Pixels.ToList().AsReadOnly()),
         Width = (ushort) image.Width,
         Height = (ushort) image.Height,
         Format = image.Format
     };
     image.Pixels = new byte[1];
     return cameraImage;
 }