We have an OpenCV problem of opening (and writing) file paths that contain non-Ascii characters on Windows. I saw questions OpenCV imread with foreign characters and imread
Try this:
cv::Mat ReadImage(const wchar_t* filename)
{
FILE* fp = _wfopen(filename, L"rb");
if (!fp)
{
return Mat::zeros(1, 1, CV_8U);
}
fseek(fp, 0, SEEK_END);
long sz = ftell(fp);
char* buf = new char[sz];
fseek(fp, 0, SEEK_SET);
long n = fread(buf, 1, sz, fp);
_InputArray arr(buf, sz);
Mat img = imdecode(arr, CV_LOAD_IMAGE_COLOR);
delete[] buf;
fclose(fp);
return img;
}