Coder Social home page Coder Social logo

imgdiff_bindings's People

Contributors

daseyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jonike

imgdiff_bindings's Issues

I see random OutOfMemory Exceptions sometimes

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

Getting System.InvalidOperationException: 'Bitmap region is already locked.' with a Basler Pylon SDK

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());
            }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.