SciSharp / NumSharp

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

ToBitmap() - datatype mistmatch #491

Open davidvct opened 1 year ago

davidvct commented 1 year ago

I tried to convert a numsharp array with integers to bitmap.

array_rgb_numsharp = array_rgb_numsharp.reshape(1, 300, 300, 3);
Bitmap image = array_rgb_numsharp.ToBitmap();

and encounter this error: System.InvalidCastException: 'Unable to perform CopyTo when T does not match dtype, use non-generic overload instead.'

How can I fix it?