daseyb / imgdiff_bindings Goto Github PK
View Code? Open in Web Editor NEWFast image comparison and diffing in C++ (with a C# binding)
Fast image comparison and diffing in C++ (with a C# binding)
Hello,
I used the bindings with a camera SDK to make a test application. We went through 800 iterations and see that the ImageDiff bindings often throw System Out of Memory exceptions. These iterations seem completely random and I think these are caused by memory management by this library.
In every iteration we were trying to compare two 14MP lossless images using this library. I will try to post the logs from my application if possible
Hi,
Thanks for writing this! I wrote a .NET Framework GUI with the C# bindings and it works perfectly! However, I tried to use it with the C# program with Basler Pylon SDK and I got the following error,
System.InvalidOperationException
HResult=0x80131509
Message=Bitmap region is already locked.
Source=System.Drawing
StackTrace:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I am using an earlier commit because the latest does not let me use System.Drawing Bitmap type. This error was generated by the following code,
var fpath1 = Directory.GetFiles($"..\\..\\..\\..\\re\\1")[0];
var fpath2 = Directory.GetFiles($"..\\..\\..\\..\\re\\2")[0];
DiffResult result;
var First = new Bitmap(fpath1);
var Second = new Bitmap(fpath2);
//crop
Rectangle roi = new Rectangle(1400, 450, 1100, 1900);
First = cropAtRect(First, roi);
Second = cropAtRect(Second, roi);
pictureBox.Image = First;
pictureBox1.Image = Second;
try
{
result = ImageDiff.Binding.Diff(First, Second,
new DiffOptions()
{
ErrorColor = Color.FromArgb(255, 255, 0, 255),
Tolerance = 0.26f,
OverlayTransparency = 1.0f,
OverlayType = OverlayType.Flat,
WeightByDiffPercentage = false,
IgnoreColor = false
});
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
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.