Home

Awesome

<p align="center"> <a href="https://www.nuget.org/profiles/dajuric"> <img src="Deploy/Logo/logo-big.png" alt="DotImaging logo" width="120" align="center"> </a> </p> <p align="center"> <a href="https://www.nuget.org/profiles/dajuric"> <img src="https://img.shields.io/badge/NuGet-v5.2.0-blue.svg?style=flat-square" alt="NuGet packages version"/> </a> </p>

DotImaging - .NET array as imaging object
The framework sets focus on .NET native array as primary imaging object, offers extensibility support via extensions, and provides unified platform-abstract imaging IO API.

News

So why DotImaging ?

*IO and Drawing assemlies depend on OpenCV

Libraries / NuGet packages

Core
//convert to grayscale and flip
Bgr<byte>[,] image = ImageIO.LoadColor("sample.jpg"); //IO package
Gray<byte>[,] grayIm = image.ToGray()
                            .Flip(FlipDirection.Horizontal);

//get the modified blue channel 
var modifiedImage = image.AsEnumerable()
                    .Select(x => x.B / 2)
   		 .ToArray2D(image.Size());
IO
var reader = new FileCapture("sample.mp4");
reader.Open();

Bgr<byte>[,] frame = null;
while(true)
{
      reader.ReadTo(ref frame);
      if (frame == null)
         break;

      frame.Show(scaleForm: true); //UI package
}

reader.Close();
//------get an image from the Web
new Uri("http://vignette3.wikia.nocookie.net/disney/images/5/5d/Lena_headey_.jpg")
    .GetBytes().DecodeAsColorImage().Show(); //(Show - UI package)

//------stream a video from Youtube
var pipeName = new Uri("https://www.youtube.com/watch?v=Vpg9yizPP_g").NamedPipeFromYoutubeUri(); //Youtube
var reader = new FileCapture(String.Format(@"\\.\pipe\{0}", pipeName)) //IO package

//... (regular stream reading - see IO package sample)
Interoperability
var image = new Gray<byte>[240, 320];
var bmp = image.ToBitmap(); //to Bitmap

var imageFromBmp = bmp.ToArray() as Bgr<byte>[,]; //from Bitmap
Extensions
Bgr<byte>[,] image = new Bgr<byte>[480, 640];
image.Show(); //show image (non-blocking)
image.ShowDialog(); //show image (blocking)

//draw something
image.Draw(new Rectangle(50, 50, 200, 100), Bgr<byte>.Red, -1);
image.Draw(new Circle(50, 50, 25), Bgr<byte>.Blue, 5);

Getting started

Final word

If you like the project please star it in order to help to spread the word. That way you will make the framework more significant and in the same time you will motivate me to improve it, so the benefit is mutual.