cv::Mat img = cv::imread("../赤月/lena.jpg");
if(img.empty()) std::cout<<"empty image"<<std::endl;
Or
QString const image_name = "../赤月/lena.jpg";
cv::Mat img = cv::imread(image_name_.toAscii().constData());
if(img.empty()) std::cout<<"empty image"<<std::endl;
The api of imread accept std::string, what if I need unicode support?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…