You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code works fine with SharpCV 0.7.0 but cannot compile with the newer versions:
Cannot implicitly convert type 'Tensorflow.NumPy.NDArray' to 'NumSharp.NDArray'
This is a 10 times slower alternative for the ones who have to use SharpCV > 0.7.0
publicstaticNumSharp.NDArrayAsNDArray_slow(thisOpenCvSharp.Matmat){varmatType=mat.Type();varchannels=mat.Channels();varsize=mat.Rows*mat.Cols*channels;varshape=channels==1?newShape(mat.Rows,mat.Cols):newShape(mat.Rows,mat.Cols,channels);if(matType==MatType.CV_32SC1||matType==MatType.CV_32SC2){varmanagedArray=newint[size];Marshal.Copy(mat.Data,managedArray,0,size);varaslice=ArraySlice.FromArray(managedArray);returnnewNumSharp.NDArray(aslice,shape);}if(matType==MatType.CV_32FC1){varmanagedArray=newfloat[size];Marshal.Copy(mat.Data,managedArray,0,size);varaslice=ArraySlice.FromArray(managedArray);returnnewNumSharp.NDArray(aslice,shape);}if(matType==MatType.CV_64FC1){varmanagedArray=newdouble[size];Marshal.Copy(mat.Data,managedArray,0,size);varaslice=ArraySlice.FromArray(managedArray);returnnewNumSharp.NDArray(aslice,shape);}if(matType==MatType.CV_8UC1||matType==MatType.CV_8UC3||matType==MatType.CV_8UC4){varmanagedArray=newbyte[size];Marshal.Copy(mat.Data,managedArray,0,size);varaslice=ArraySlice.FromArray(managedArray);returnnewNumSharp.NDArray(aslice,shape);}thrownewException($"mat data type = {matType} is not supported");}
The text was updated successfully, but these errors were encountered:
This code works fine with SharpCV 0.7.0 but cannot compile with the newer versions:
Cannot implicitly convert type 'Tensorflow.NumPy.NDArray' to 'NumSharp.NDArray'
This is a 10 times slower alternative for the ones who have to use SharpCV > 0.7.0
The text was updated successfully, but these errors were encountered: