-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mat.AsSpan() doesn't get correct length #1698
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary of your issue
I'm currently working on converting Mat to Microsoft.ML.OnnxRuntime.Tensors.Tensor<T>. To be efficient, I used mat.AsSpan() to manually access the data in a CV_8UC3 image. However, it always comes OutOfRange. Referring to the source code below:
opencvsharp/src/OpenCvSharp/Modules/core/Mat/Mat.cs
Lines 4159 to 4165 in ca1f608
Maybe it should consider the size of T and gets the length like
Environment
What did you do when you faced the problem?
Accessing from mat.DataPointer directly just works.
Example code:
Output:
What did you intend to be?
The text was updated successfully, but these errors were encountered: