Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не могу собрать проект #3

Open
hakmovain opened this issue Dec 15, 2017 · 1 comment
Open

Не могу собрать проект #3

hakmovain opened this issue Dec 15, 2017 · 1 comment

Comments

@hakmovain
Copy link

Версия opencv 3.1.0
Версия тесеракта и лептоники

$ tesseract -v
tesseract 3.04.01
 leptonica-1.73
  libgif 5.1.2 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.1.0

Получаю следующие ошибки

$ g++ src/*.cpp  -l:libopencv_core.so.2.4.9 -l:libopencv_highgui.so.2.4.9  -l:libopencv_video.so.2.4.9  -l:libopencv_calib3d.so.2.4.9  -l:libopencv_contrib.so.2.4.9  -l:libopencv_features2d.so.2.4.9  -l:libopencv_flann.so.2.4.9  -l:libopencv_gpu.so.2.4.9  -l:libopencv_imgproc.so.2.4.9  -l:libopencv_legacy.so.2.4.9  -l:libopencv_ml.so.2.4.9  -l:libopencv_nonfree.so.2.4.9  -l:libopencv_objdetect.so.2.4.9  -l:libopencv_ocl.so.2.4.9  -l:libopencv_photo.so.2.4.9   -l:libopencv_stitching.so.2.4.9  -l:libopencv_superres.so.2.4.9  -ltesseract -llept -std=c++11 -o rusalpr
src/anpr.cpp: In member function ‘bool Anpr::recognizeLetters()’:
src/anpr.cpp:419:45: error: conversion from ‘IplImage* {aka _IplImage*}’ to non-scalar type ‘cv::Mat’ requested
             cv::Mat recimage = cvCreateImage(cv::Size(100, 100), 8, 1
                                             ^
src/anpr.cpp:430:32: error: conversion from ‘IplImage* {aka _IplImage*}’ to non-scalar type ‘cv::Mat’ requested
    cv::Mat gray = cvCreateImage(subImg.size(), 8, 1);            
                                ^
In file included from /usr/local/include/opencv2/core.hpp:59:0,
                 from /usr/local/include/opencv2/core/types_c.h:101,
                 from /usr/local/include/opencv2/core/core_c.h:48,
                 from /usr/local/include/opencv/cv.h:63,
                 from src/anpr.h:13,
                 from src/anpr.cpp:1:
/usr/local/include/opencv2/core/mat.hpp: In instantiation of ‘class cv::Mat_<unsigned int>’:
/usr/local/include/opencv2/core/mat.inl.hpp:1225:46:   required from ‘cv::MatIterator_<_Tp> cv::Mat::begin() [with _Tp = unsigned int]’
src/anpr.cpp:135:37:   required from here
/usr/local/include/opencv2/core/mat.hpp:2153:50: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
     typedef typename DataType<_Tp>::channel_type channel_type;
                                                  ^
In file included from /usr/local/include/opencv2/core/mat.hpp:3642:0,
                 from /usr/local/include/opencv2/core.hpp:59,
                 from /usr/local/include/opencv2/core/types_c.h:101,
                 from /usr/local/include/opencv2/core/core_c.h:48,
                 from /usr/local/include/opencv/cv.h:63,
                 from src/anpr.h:13,
                 from src/anpr.cpp:1:
/usr/local/include/opencv2/core/mat.inl.hpp:1582:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::Mat_(const Vec<typename DataType<_Tp>::channel_type, n>& v
 ^
/usr/local/include/opencv2/core/mat.inl.hpp:1591:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::Mat_(const Matx<typename DataType<_Tp>::channel_type, m, n
 ^
/usr/local/include/opencv2/core/mat.inl.hpp:1600:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::Mat_(const Point_<typename DataType<_Tp>::channel_type>& p
 ^
/usr/local/include/opencv2/core/mat.inl.hpp:1609:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::Mat_(const Point3_<typename DataType<_Tp>::channel_type>& 
 ^
/usr/local/include/opencv2/core/mat.inl.hpp:1938:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::operator Vec<typename DataType<_Tp>::channel_type, n>() co
 ^
/usr/local/include/opencv2/core/mat.inl.hpp:1951:1: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
 Mat_<_Tp>::operator Matx<typename DataType<_Tp>::channel_type, m, n>(
 ^

Предполагаю, что проблема с версией opencv

@RainGrid
Copy link

@hakmovain add #define OPENCV_TRAITS_ENABLE_DEPRECATED to .h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants