I am using the C# wrapper but maybe you could have some tracks to follow to help me.
Imread is not working anymore with “.tif” file (48bits) after updating the OpenCvSharp wrapper version from OpenCvSharp3Any-Cpu (wrapper 4.X) to OpenCvSharp4.Windows and .Extensions. The file is 450Mo weight.
My environment :
- .Net 4.8
- Windows 10
- Visual Studio 2019 Profesionnal
- Nugget Package for OpenCvSharp4.Windows and all dependencies for
OpenCvSharp4.Extensions (include OpenCvSharp4 and .runtime.win
(redundancy ?)
For information, the path of my file in the string variable is :
C:\Users\mgauquelin\Downloads\ReferencePiezoVerification_SN404108.tif
The warning message I get:
imread_('C:\Users\mgauquelin\Downloads\ReferencePiezoVerification_SN404108.tif'): can't read data: unknown exception
Here is a sample code of my reading, with a check of the permission to read (always true) after the check the file exists (always true also) :
bool result;
string file = "myPath";
using (FileStream fs = new FileStream(file, FileMode.Open))
{
if (fs.CanRead)
{
result= true;
}
else
{
result= false;
}
}
mat = OpenCvSharp.Cv2.ImRead(file, ImreadModes.Unchanged);
I tried to open other format of file : ok.
I tried to come back to OpenCvSharp3 : ok.
I read a lot of forums which deal with the file permission, the path of the file. Already check this.
Format of my matrix after imread:
Thank you in advance for any help.