Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Slow Loading Images #975

@fdncred

Description

@fdncred

What would you like to submit? (put an 'x' inside the bracket that applies)

  • question
  • bug report
  • feature request

Issue description
Hey @cesarsouza,
I have not looked at the code yet but something strange seems to be going on with Accord.Imaging.Image.FromFile(). Both of my test images are bitonal 200 DPI about 1500W x 1600H.

Quick code

var sw = new Stopwatch();

var inFileName = @"C:\SomePath\To\Image1\07128777.tif";
var inFileName2 = @"C:\SomePath\To\Image2\07128778.tif";
sw.Start();
var inFileBmp = Accord.Imaging.Image.FromFile(inFileName);
sw.Stop();
Console.WriteLine($"Accord.Imaging.Image.FromFile Image 1 in [{sw.ElapsedMilliseconds}].");

sw.Reset();
sw.Start();
var inFileBmp2 = Accord.Imaging.Image.FromFile(inFileName2);
sw.Stop();
Console.WriteLine($"Accord.Imaging.Image.FromFile Image 2 in [{sw.ElapsedMilliseconds}].");

sw.Reset();
sw.Start();
var inFileBmp3 = System.Drawing.Image.FromFile(inFileName);
sw.Stop();
Console.WriteLine($"System.Drawing.Image.FromFile Image 1 in [{sw.ElapsedMilliseconds}].");

sw.Reset();
sw.Start();
var inFileBmp4 = System.Drawing.Image.FromFile(inFileName2);
sw.Stop();
Console.WriteLine($"System.Drawing.Image.FromFile Image 2 in [{sw.ElapsedMilliseconds}].");

Quick code results

Accord.Imaging.Image.FromFile Image 1 in [963] ms.
Accord.Imaging.Image.FromFile Image 2 in [3374] ms.
System.Drawing.Image.FromFile Image 1 in [10] ms.
System.Drawing.Image.FromFile Image 2 in [9] ms.

Any idea why Accord is taking so long to load files (in comparison to System.Drawing.Image)?

BTW - This was in debug with NuGet versions of 3.8.0.0.
I'm using VS2017.
I'm on Windows 10 1709 (Fall Creators Update)

Thanks,
Darren

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions