We have an OpenCV problem of opening (and writing) file paths that contain non-ASCII characters on Windows. Affected functions are: cv::imread()
, cv::imwrite()
, ...
As far as I saw in the OpenCV source code, it uses fopen
even on Windows (instead of _wfopen
) and AFAIK fopen
does not handle non-ASCII characters on Windows.
I saw questions OpenCV imread with foreign characters and imread(openCV),QString unicodes but still didn't understand a proper way of solving the problem. From the questions above I saw that there could be some trick using QString
s, but if it works what does it exactly do? How does it transform a unicode string to a character array that will be accepted by Windows' fopen()
?
P.S. We don't use QT
FILE*
on my file withwfopen
but then I don't know how to properly useimdecode
to get acv::Mat
from that. Apart from that: does OpenCV still not support non-ASCII filenames natively, also in version 3.0? PS: is there maybe an easier but still efficient way if I do use Qt (I mean without readingQImage
s and converting afterwards)? – Balaklava