Page 1 of 1

Compiling opencv-mobile

Posted: 2024-01-31 22:38
by torchris4
I think I have followed all the instructions here, but when I go to compile, I get:

Code: Select all

Consolidate compiler generated dependencies of target opencv-mobile-test
[ 50%] Building CXX object CMakeFiles/opencv-mobile-test.dir/main.cpp.o
/root/opencv-mobile-test/main.cpp: In function 'int main()':
/root/opencv-mobile-test/main.cpp:9:9: error: 'VideoCapture' is not a member of 'cv'
     cv::VideoCapture cap;
         ^~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:10:5: error: 'cap' was not declared in this scope
     cap.set(cv::CAP_PROP_FRAME_WIDTH, 320);
     ^~~
/root/opencv-mobile-test/main.cpp:10:17: error: 'CAP_PROP_FRAME_WIDTH' is not a member of 'cv'
     cap.set(cv::CAP_PROP_FRAME_WIDTH, 320);
                 ^~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:11:17: error: 'CAP_PROP_FRAME_HEIGHT' is not a member of 'cv'
     cap.set(cv::CAP_PROP_FRAME_HEIGHT, 240);
                 ^~~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:14:31: error: 'CAP_PROP_FRAME_WIDTH' is not a member of 'cv'
     const int w = cap.get(cv::CAP_PROP_FRAME_WIDTH);
                               ^~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:15:31: error: 'CAP_PROP_FRAME_HEIGHT' is not a member of 'cv'
     const int h = cap.get(cv::CAP_PROP_FRAME_HEIGHT);
                               ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/opencv-mobile-test.dir/build.make:76: CMakeFiles/opencv-mobile-test.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/opencv-mobile-test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Re: Compiling opencv-mobile

Posted: 2024-02-01 1:27
by Eng38
Hello,

We are unable to reproduce this error message at the moment. Please try compiling with this package and see if the error persists.
Downloaded 436 times

Re: Compiling opencv-mobile

Posted: 2024-02-01 2:54
by torchris4
Cool! I was able to just run "opencv-mobile-test" directly from the build directory and it worked right away!

I'll try compiling it tomorrow.

Re: Compiling opencv-mobile

Posted: 2024-02-01 3:32
by torchris4
Trying to compile, I keep getting:

Code: Select all

CMake Error at CMakeLists.txt:9 (find_package):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" with any
  of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.
I'm not very good at all this CPP make stuff! :?

Re: Compiling opencv-mobile

Posted: 2024-02-01 6:42
by Eng38
Is there anything else to modify in CMakeLists.txt besides changing the cross-compiler path?

The normal compilation process is illustrated in the diagram below:
企业微信截图_17067683209763.png

Re: Compiling opencv-mobile

Posted: 2024-02-01 10:38
by tjhd408
我遇到了跟他一模样的问题。
我的文件夹内容见附件。
报错内容与命令行反馈也在附件中。

Re: Compiling opencv-mobile

Posted: 2024-02-01 10:50
by tjhd408
不过,我用你在这个贴子里上传的压缩包就好了。我的是luckfox-pico ,把cmakelists中的内容按我自己的系统改了改。

Re: Compiling opencv-mobile

Posted: 2024-02-01 11:15
by Eng38
尝试替换一下 opencv-mobile-4.8.1-luckfox-pico 包,再进行编译