nihui / opencv-mobile

The minimal opencv for Android, iOS, ARM Linux, Windows, Linux, MacOS, HarmonyOS, WebAssembly, watchOS, tvOS, visionOS
Apache License 2.0
2.53k stars 346 forks source link

自己编译提供opencv-mobile-4.9.0的源码增加其他模块如objdetect和calib3d报错, #108

Open sajdlkasj opened 7 months ago

sajdlkasj commented 7 months ago

error: ‘const class cv::_InputArray’ has no member named ‘isUMatVector’; did you mean ‘isMatVector’? 1061 | if( _descriptors.isUMatVector() ) | ^~~~ | isMatVector /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1063:21: error: ‘UMat’ was not declared in this scope; did you mean ‘Mat’? 1063 | std::vector descriptors; | ^~~~ | Mat /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1063:25: error: template argument 1 is invalid 1063 | std::vector descriptors; | ^ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1063:25: error: template argument 2 is invalid /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1064:22: error: ‘const class cv::_InputArray’ has no member named ‘getUMatVector’; did you mean ‘getMatVector’? 1064 | _descriptors.getUMatVector( descriptors ); | ^~~~~ | getMatVector /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1066:44: error: request for member ‘size’ in ‘descriptors’, which is of non-class type ‘int’ 1066 | for( size_t i = 0; i < descriptors.size(); i++ ) | ^~~~ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1068:44: error: invalid types ‘int[size_t {aka long unsigned int}]’ for array subscript 1068 | addedDescCount += descriptors[i].rows; | ^ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1071:27: error: ‘const class cv::_InputArray’ has no member named ‘isUMat’; did you mean ‘isMat’? 1071 | else if( _descriptors.isUMat() ) | ^~ | isMat /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1073:40: error: ‘const class cv::_InputArray’ has no member named ‘getUMat’; did you mean ‘getMat’? 1073 | addedDescCount += _descriptors.getUMat().rows; | ^~~ | getMat In file included from /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/core/include/opencv2/core.hpp:53, from /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/include/opencv2/features2d.hpp:47, from /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/precomp.hpp:46, from /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:42: /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1090:33: error: ‘const class cv::_InputArray’ has no member named ‘isUMat’; did you mean ‘isMat’? 1090 | CV_Assert( _descriptors.isUMat() || _descriptors.isUMatVector() || _descriptors.isMat() || _descriptors.isMatVector() ); | ^~ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’ 342 | #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, FILE, LINE ); } while(0) | ^~~~ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/features2d/src/matchers.cpp:1090:58: error: ‘const class cv::_InputArray’ has no member named ‘isUMatVector’; did you mean ‘isMatVector’? 1090 | CV_Assert( _descriptors.isUMat() || _descriptors.isUMatVector() || _descriptors.isMat() || _descriptors.isMatVector() ); | ^~~~ /home/lubancat/Desktop/opencv-mobile-4.9.0/opencv-mobile-4.9.0 (1)/opencv-mobile-4.9.0/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’ 342 | #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, FILE, LINE ); } while(0) | ^~~~ make[2]: [modules/features2d/CMakeFiles/opencv_features2d.dir/build.make:370:modules/features2d/CMakeFiles/opencv_features2d.dir/src/matchers.cpp.o] 错误 1 make[2]: 正在等待未完成的任务.... make[1]: [CMakeFiles/Makefile2:807:modules/features2d/CMakeFiles/opencv_features2d.dir/all] 错误 2 make: [Makefile:166:all] 错误 2 希望能够解决

yyds-zy commented 6 months ago

这个问题你是否解决了呢?

ilya-sha commented 5 months ago

Same problem here when use Flann and calib3d

futz12 commented 2 months ago

见我PR

futz12 commented 2 months ago

https://github.com/nihui/opencv-mobile/pull/141

laverne01 commented 1 month ago

见我PR

I’m also facing an issue with excessive UMAT codes; there are too many of them in the enabled module. How can I resolve this problem? I would appreciate your advice.