SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.34k stars 188 forks source link

Bitmap.ToArray() does not handle images with odd width #457

Closed AmbachtIT closed 7 months ago

AmbachtIT commented 2 years ago

Reproduction

  1. Have an image with an odd width (for instance: 475x554x3)
  2. Load it into an NDArrayusing Bitmap.ToNDArray();

Expected result

Actual result

Root cause

Fix

Image used for reproduction

odd-width