Fix crash when file path contain non ASCII chars
This commit is contained in:
@@ -9,7 +9,7 @@ CLAHE::CLAHE()
|
||||
void CLAHE::loadFile(const QString &path)
|
||||
{
|
||||
cv::Mat tmp;
|
||||
tmp = cv::imread(path.toStdString(), cv::IMREAD_COLOR | cv::IMREAD_ANYDEPTH);
|
||||
tmp = cv::imread(path.toLocal8Bit().data(), cv::IMREAD_COLOR | cv::IMREAD_ANYDEPTH);
|
||||
int type = tmp.depth();
|
||||
_scale = type==CV_8U ? 1.0/255 : 1.0/65535;
|
||||
tmp.convertTo(tmp, CV_32F, _scale);
|
||||
@@ -24,7 +24,7 @@ void CLAHE::saveFile(const QString &path)
|
||||
cv::merge(_image, 3, tmp);
|
||||
cv::cvtColor(tmp, tmp, cv::COLOR_Lab2BGR);
|
||||
tmp.convertTo(tmp, _lumImage.depth(), 1/_scale);
|
||||
cv::imwrite(path.toStdString(), tmp);
|
||||
cv::imwrite(path.toLocal8Bit().data(), tmp);
|
||||
}
|
||||
|
||||
void CLAHE::apply(float clipLimit, int kernelSize)
|
||||
|
||||
Reference in New Issue
Block a user