dajuric / dot-imaging Goto Github PK
View Code? Open in Web Editor NEWMinimalistic .NET imaging portable platform
Minimalistic .NET imaging portable platform
I don't understand this comment in the readme file.
lightweight (no 3rd party dependencies), but powerful
Dot-Imaging has OpenCV dependencies in the Source/IO/UnmanagedLibraries folder. Please help me understand. Thanks.
After updating to version 2.5.6 the VideoWriter doesn't work. Reverting back to 2.5.4 works fine.
DotImaging.ImageStreamReader reader = new DotImaging.ImageDirectoryCapture(recordFolder, "*.png");
float fps = Convert.ToSingle(1 / secondsPerFrame);
DotImaging.ImageStreamWriter writer = new DotImaging.VideoWriter(fileName, viewSize, fps);
writer.Open();
foreach (var image in reader)
{
writer.Write(image);
}
writer.Close();
Hello,
Could we have libraries as .net standard? It would make them usable in both .net framework and core etc.
Please is possible to set FPS, Resolution and Pixel format for cameras or capture devices?
Installing only the appropriate packages as per https://github.com/dajuric/dot-imaging via NuGet. When trying to build, I get:
NuGet Error: Unable to find version 2.4.8 of package OpenCV.ffmpeg.overlay-Win32_v110
Target .NET = 4.5
Files exist. Copying them to Debug/Release makes no difference. Referencing explicit references makes no difference.
OpenCV.Net package version is 3.3.1 (does DotImaging work with 3.3.1? Guessing not?).
Is this a documentation issue more than anything? :) NuGet installation steps below.
PM> install-package opencv.net
Attempting to gather dependency information for package 'opencv.net.3.3.1' with respect to project 'Probe.Video', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 48.17 ms
Attempting to resolve dependencies for package 'opencv.net.3.3.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'opencv.net.3.3.1'
Resolved actions to install package 'opencv.net.3.3.1'
Found package 'OpenCV.Net 3.3.1' in '[dir]\packages'.
Package 'OpenCV.Net.3.3.1' already exists in folder '[dir]\packages'
Added package 'OpenCV.Net.3.3.1' to 'packages.config'
Successfully installed 'OpenCV.Net 3.3.1' to Probe.Video
Executing nuget actions took 939.6 ms
Time Elapsed: 00:00:05.2241218
PM> install-package DotImaging.IO
Attempting to gather dependency information for package 'DotImaging.IO.4.8.3' with respect to project 'Probe.Video', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 931.97 ms
Attempting to resolve dependencies for package 'DotImaging.IO.4.8.3' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'DotImaging.IO.4.8.3'
Resolved actions to install package 'DotImaging.IO.4.8.3'
Found package 'DotImaging.Primitives2D 4.8.3' in '[dir]\packages'.
Found package 'DotImaging.GenericImage 4.8.3' in '[dir]\packages'.
Found package 'DotImaging.IO 4.8.3' in '[dir]\packages'.
Package 'DotImaging.Primitives2D.4.8.3' already exists in folder '[dir]\packages'
Added package 'DotImaging.Primitives2D.4.8.3' to 'packages.config'
Successfully installed 'DotImaging.Primitives2D 4.8.3' to Probe.Video
Package 'DotImaging.GenericImage.4.8.3' already exists in folder '[dir]\packages'
Added package 'DotImaging.GenericImage.4.8.3' to 'packages.config'
Successfully installed 'DotImaging.GenericImage 4.8.3' to Probe.Video
Package 'DotImaging.IO.4.8.3' already exists in folder '[dir]\packages'
Added package 'DotImaging.IO.4.8.3' to 'packages.config'
Successfully installed 'DotImaging.IO 4.8.3' to Probe.Video
Executing nuget actions took 1.98 sec
Time Elapsed: 00:00:03.7888188
PM> install-package Accord
Attempting to gather dependency information for package 'Accord.3.6.0' with respect to project 'Probe.Video', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 111.71 ms
Attempting to resolve dependencies for package 'Accord.3.6.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Accord.3.6.0'
Resolved actions to install package 'Accord.3.6.0'
Retrieving package 'Accord 3.6.0' from 'nuget.org'.
GET https://api.nuget.org/packages/accord.3.6.0.nupkg
OK https://api.nuget.org/packages/accord.3.6.0.nupkg 41ms
Installing Accord 3.6.0.
Adding package 'Accord.3.6.0' to folder '[dir]\packages'
Added package 'Accord.3.6.0' to folder '[dir]\packages'
Added package 'Accord.3.6.0' to 'packages.config'
Successfully installed 'Accord 3.6.0' to Probe.Video
Executing nuget actions took 2.82 sec
Time Elapsed: 00:00:03.4612951
PM> install-package DotImaging.Primitives2D
Package 'DotImaging.Primitives2D.4.8.3' already exists in project 'Probe.Video'
Time Elapsed: 00:00:01.0765887
PM> install-package DotImaging.IO
Package 'DotImaging.IO.4.8.3' already exists in project 'Probe.Video'
Time Elapsed: 00:00:00.5238896
PM> install-package DotImaging.BitmapInterop
Attempting to gather dependency information for package 'DotImaging.BitmapInterop.4.8.3' with respect to project 'Probe.Video', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 714.63 ms
Attempting to resolve dependencies for package 'DotImaging.BitmapInterop.4.8.3' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'DotImaging.BitmapInterop.4.8.3'
Resolved actions to install package 'DotImaging.BitmapInterop.4.8.3'
Retrieving package 'DotImaging.BitmapInterop 4.8.3' from 'nuget.org'.
Adding package 'DotImaging.BitmapInterop.4.8.3' to folder '[dir]\packages'
Added package 'DotImaging.BitmapInterop.4.8.3' to folder '[dir]\packages'
Added package 'DotImaging.BitmapInterop.4.8.3' to 'packages.config'
Successfully installed 'DotImaging.BitmapInterop 4.8.3' to Probe.Video
Executing nuget actions took 1.05 sec
Time Elapsed: 00:00:02.3796397
PM>
When I add the package DotImaging.IO in my .NET Core 2.0 project under windows in Visual Studio the ImageIO class is not visible. The nuget also tells me:
xxx.csproj : warning NU1701: Package 'DotImaging.GenericImage 4.8.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
xxx.csproj : warning NU1701: Package 'DotImaging.Primitives2D 4.8.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
Hey.
Great projects. I am in love with them. Just starting to figure them all out, but I do have one request. That you sign the assemblies with a key file. We run our code with other libraries and we require our libraries to be signed.
I can compile and sign your code my self, but for the nuget packages, they cannot unless you do it. Can you make sure that you sign the assemblies please?
Many thanks!
If I don't care about OpenCv Interoperability or Drawing on images, is there a way to compile this library so there are no need for the opencv unmanaged dlls?
I'd like to use these assemblies, just not the opencv stuff.
Thanks,
Darren
Hi
I'm using FileCapture. all things worked corrcetly but when i use video file with Unicode name i get this error:
"Cannot open FileStream!"
Is there any chance to get this working as portable class library PCL?
hello
can anyone show me an example of how to streaming a video in vb.net please?
thanks in advance.
Video files are generated with broken or missing index (VLC message), independently by the video codec.
To isolate the problem the very basic sequence of calls is:
cameraCapture = new CameraCapture(1);
String name = @"C:\Users\fidanken\Documents\dotImaging.avi";
VideoCodec videoCodec = new VideoCodec("UserSelection");
cameraCapture.Open();
go = true;
await GoAsync();
private async Task GoAsync()
{
while (go)
{
frameIImage = await cameraCapture.ReadAsync(); //reads stream asynchronously
await videoWriter.WriteAsync(frameIImage);
}
}
go = false;
videoWriter.Close();
videoWriter.Dispose();
It seems to me that somehow, when calling Close() and/or Dispose() (I tried multiple combinations), the files are not correctly closed.
Thank You for any help
When i run the sample for youtube video streaming, i can't get sound.
Any way to solve this?
Thanks in advance.
Can we have licence info on master page ?
similar like ImageSharp ?
That awesome library has support for Xamarin.Android and Xamarin IOS??
Hi
I have this code writen:
using DotImaging;
using System;
using System.Windows.Forms;
namespace youtube_new_c
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
var sourceName = String.Empty;
var pipeName = new Uri("https://www.youtube.com/watch?v=Vpg9yizPP_g").NamedPipeFromYoutubeUri(); //Youtube
sourceName = String.Format(@"\\.\pipe\{0}", pipeName);
ImageStreamReader reader = new FileCapture(sourceName);
reader.Open();
//seek if you can
if (reader.CanSeek)
reader.Seek((int)(reader.Length * 0.25), System.IO.SeekOrigin.Begin);
//read video frames
Bgr<byte>[,] frame = null;
do
{
reader.ReadTo(ref frame);
if (frame == null)
break;
frame.Show(scaleForm: true);
((double)reader.Position / reader.Length).Progress();
}
while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape));
}
}
}
and when run i got a black window, one empty form and another form with a progressbar but nothing happens. Any idea of what i need to do?
Thanks
The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2
Why is that a requirement in order to run the samples, when 2.2 reached end of life last year?
Do you already have plans to support .NET Core in the (near) future?
What's the secret sauce to getting multiple levels of the pyramid? I changed this line by adding the neighborhoodPerLevel parameter.
linPyr = LinearizedMapPyramid.CreatePyramid(grayIm, neigborhoodPerLevel: new int[] { 5, 5 }); //prepare linear-pyramid maps
And this line by adding the maxNumberOfFeaturesPerLevel parameter.
var tp = TemplatePyramid.CreatePyramidFromPreparedBWImage(preparedBWImage, new FileInfo(file).Name /*"OpenHand"*/, maxNumberOfFeaturesPerLevel: new int[] { 100, 100 });
And what I get is Debug.Assert thrown from from the second iteration of matchTemplate->calculateSimilarityMap->neighbourMap.AddTo()->AddTo() method because src.Width does not equal dst.Width nor does src.Height equal dst.Height.
I also think I found a bug. Shouldn't sourceImage be image after the var t = new T();
Before:
public static ImageTemplatePyramid<T> CreatePyramidFromPreparedBWImage(Gray<byte>[,] sourceImage, string classLabel, int minFeatureStrength = 40, int minNumberOfFeatures = 30, int[] maxNumberOfFeaturesPerLevel = null)
{
return CreatePyramid<Gray<byte>>(sourceImage, classLabel,
(image, minFeatures, maxFeatures, label) =>
{
var t = new T();
t.Initialize(sourceImage, minFeatureStrength, maxFeatures, label);
return t;
},
minNumberOfFeatures, maxNumberOfFeaturesPerLevel);
}
After:
public static ImageTemplatePyramid<T> CreatePyramidFromPreparedBWImage(Gray<byte>[,] sourceImage, string classLabel, int minFeatureStrength = 40, int minNumberOfFeatures = 30, int[] maxNumberOfFeaturesPerLevel = null)
{
return CreatePyramid<Gray<byte>>(sourceImage, classLabel,
(image, minFeatures, maxFeatures, label) =>
{
var t = new T();
t.Initialize(image, minFeatureStrength, maxFeatures, label);
return t;
},
minNumberOfFeatures, maxNumberOfFeaturesPerLevel);
}
Hi,
Thanks for this awesome lib :) I just ave problem with 12bit tiff. The first one throw an exception (External component has thrown an exception.) while the second one crash the app with a System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
Any advice ?
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
This code doesn't work. any solution for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.