dajuric / dot-imaging

Minimalistic .NET imaging portable platform
313 stars 37 forks source link

DotImaging logo

NuGet packages version

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

//get the modified blue channel var modifiedImage = image.AsEnumerable() .Select(x => x.B / 2) .ToArray2D(image.Size());


+ <a href="https://www.nuget.org/packages/DotImaging.Primitives2D"> 
    <img src="https://img.shields.io/badge/DotImaging-Primitives2D-red.svg?style=flat-square" alt="DotImaging.Primitives2D"/>  
  </a> 
  Portable 2D drawing primitives (Extensions for Point, Size, Rectangle and additional primitives)

###### IO

+ <a href="https://www.nuget.org/packages/DotImaging.IO"> 
    <img src="https://img.shields.io/badge/DotImaging-IO-red.svg?style=flat-square" alt="DotImaging.IO"/>  
  </a>
  A unified API for IO image access (camera, file, image directory). Portable image loading/saving.

  > **Tutorial:** <a href="http://www.codeproject.com/Articles/828012/Introducing-Portable-Video-IO-Library-for-Csharp" target="_blank">Portable Imaging IO</a>

 ``` csharp
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();

//------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

+ <a href="https://www.nuget.org/packages/DotImaging.BitmapInterop"> 
    <img src="https://img.shields.io/badge/DotImaging-BitmapInterop-red.svg?style=flat-square" alt="DotImaging.BitmapInterop"/>  
  </a>
  Interoperability extensions between .NET array and System.Drawing.Bitmap.

 ``` csharp
var image = new Gray<byte>[240, 320];
var bmp = image.ToBitmap(); //to Bitmap

var imageFromBmp = bmp.ToArray() as Bgr<byte>[,]; //from Bitmap
Extensions

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



## Getting started
+ Just pick what you need. An appropriate readme file will be shown upon selected NuGet package installation. 
+ Samples

## 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.