Fix crash when using OCR check of video condition

This commit is contained in:
WarmUpTill 2023-04-02 19:18:32 +02:00 committed by WarmUpTill
parent 4f02c9ec36
commit 6db26d9f7b

View File

@ -147,6 +147,10 @@ cv::Mat preprocessForOCR(const QImage &image, const QColor &color)
std::string runOCR(tesseract::TessBaseAPI *ocr, const QImage &image,
const QColor &color)
{
if (image.isNull()) {
return "";
}
#ifdef OCR_SUPPORT
auto mat = preprocessForOCR(image, color);
ocr->SetImage(mat.data, mat.cols, mat.rows, 1, mat.step);