diff --git a/src/OpenCvSharp/Modules/core/Mat/Mat.cs b/src/OpenCvSharp/Modules/core/Mat/Mat.cs index 544acc363..86ccb9435 100644 --- a/src/OpenCvSharp/Modules/core/Mat/Mat.cs +++ b/src/OpenCvSharp/Modules/core/Mat/Mat.cs @@ -4161,8 +4161,8 @@ public void ForEachAsVec6d(MatForeachFunctionVec6d operation) /// /// /// - public unsafe Span AsSpan() where T : unmanaged - => IsContinuous() ? new Span(DataPointer, (int)Total()) : []; + public unsafe Span AsSpan() where T : unmanaged + => IsContinuous() ? new Span(DataPointer, (int)Total() * ElemSize() / sizeof(T)) : []; #endregion }