После обновления OpenCV 3.2 до 4.5 я получаю пару ошибок компиляции. Кажется, некоторые константы изменили имена
CV_ADAPTIVE_THRESH_GAUSSIAN_C
CV_FILLED
Ошибка
g++ -O3 -std=c++17 txtbin.cpp -o txtbin `pkg-config opencv4 --cflags --libs`
In file included from txtbin.hpp:8,
from txtbin.cpp:11:
deskew.hpp: In member function ‘cv::Mat Deskew::preprocess(const cv::Mat&)’:
deskew.hpp:85:42: error: ‘CV_ADAPTIVE_THRESH_GAUSSIAN_C’ was not declared in this scope
85 | cv::adaptiveThreshold(img, thresh, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, cv::THRESH_BINARY, 15, -2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from txtbin.cpp:11:
txtbin.hpp: In member function ‘void Txtbin::remove_boxes(cv::Mat&)’:
txtbin.hpp:217:79: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
217 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::remove_noise(cv::Mat&)’:
txtbin.hpp:262:78: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
262 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::remove_artifacts(cv::Mat&)’:
txtbin.hpp:289:77: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
289 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘Txtbin::Bbox Txtbin::detect_textblock()’:
txtbin.hpp:352:76: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
352 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::detect_background_invert()’:
txtbin.hpp:498:79: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
498 | cv::drawContours(mask, contours.contours, c, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
Подробнее здесь: https://stackoverflow.com/questions/717 ... t-declared
Обновление OpenCV 4.5 – константы не объявлены ⇐ C++
Программы на C++. Форум разработчиков
-
Anonymous
1716587106
Anonymous
После обновления OpenCV 3.2 до 4.5 я получаю пару ошибок компиляции. Кажется, некоторые константы изменили имена
CV_ADAPTIVE_THRESH_GAUSSIAN_C
CV_FILLED
Ошибка
g++ -O3 -std=c++17 txtbin.cpp -o txtbin `pkg-config opencv4 --cflags --libs`
In file included from txtbin.hpp:8,
from txtbin.cpp:11:
deskew.hpp: In member function ‘cv::Mat Deskew::preprocess(const cv::Mat&)’:
deskew.hpp:85:42: error: ‘CV_ADAPTIVE_THRESH_GAUSSIAN_C’ was not declared in this scope
85 | cv::adaptiveThreshold(img, thresh, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, cv::THRESH_BINARY, 15, -2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from txtbin.cpp:11:
txtbin.hpp: In member function ‘void Txtbin::remove_boxes(cv::Mat&)’:
txtbin.hpp:217:79: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
217 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::remove_noise(cv::Mat&)’:
txtbin.hpp:262:78: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
262 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::remove_artifacts(cv::Mat&)’:
txtbin.hpp:289:77: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
289 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘Txtbin::Bbox Txtbin::detect_textblock()’:
txtbin.hpp:352:76: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
352 | cv::drawContours(mask, contours.contours, i, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
txtbin.hpp: In member function ‘void Txtbin::detect_background_invert()’:
txtbin.hpp:498:79: error: ‘CV_FILLED’ was not declared in this scope; did you mean ‘CLD_KILLED’?
498 | cv::drawContours(mask, contours.contours, c, cv::Scalar(255, 255, 255), CV_FILLED);
| ^~~~~~~~~
| CLD_KILLED
Подробнее здесь: [url]https://stackoverflow.com/questions/71797193/upgrade-opencv-4-5-constants-not-declared[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия