Opencv 3 4 12
Author: s | 2025-04-23
Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypi Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypi
OE 4. OpenCV 4 opencv/opencv Wiki - GitHub
/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp: In function ‘int lapack_QR(fptype*, size_t, int, int, int, fptype*, size_t, fptype*, int*)’:/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:293:111: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 293 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:302:111: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 302 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:314:114: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 314 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:323:114: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 323 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/split.dispatch.cpp.o[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat.dispatch.cpp.o[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat_c.cpp.omake[2]: *** [modules/core/CMakeFiles/opencv_core.dir/build.make:509: modules/core/CMakeFiles/opencv_core.dir/src/hal_internal.cpp.o] Error 1make[2]: *** Waiting for unfinished jobs....
opencv/CMakeLists.txt at 4.x opencv/opencv - GitHub
2048. See the image below.Increase SWAP spaceOnce done, save the file (Ctrl + O, then Enter) and Exit (Ctrl + X).To apply the changes, restart the SWAP service with the commands below:sudo /etc/init.d/dphys-swapfile stopsudo /etc/init.d/dphys-swapfile startStep 6. Now, we have everything set to start compiling and installing OpenCV. Activate the virtual environment with the workon command.workon sbb_cvStep 7. Install Numpy with the pip command.pip3 install numpyInstall NumpyStep 8. With NumPy installed, we can now start configuring OpenCV. Navigate to the OpenCV directory to get started.Note: You need to be in the /opencv/build directory when executing the cmake command. You can use the pwd command to see your current working directory.cd opencvmkdir buildcd buildcmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D ENABLE_NEON=ON \ -D ENABLE_VFPV3=ON \ -D BUILD_TESTS=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D CMAKE_SHARED_LINKER_FLAGS=-latomic \ -D BUILD_EXAMPLES=OFF ..Configure OpenCVThe cmake command might take a couple of minutes to execute. Please be patient.Step 9. We have already configured OpenCV for installation. Now let’s start compiling with all the Four cores of the Pi. Execute the command below:make -j4This is one of the longest steps. It might take between 1 to 4 hours, depending on the Raspberry Pi board you are using. As of writing this post, Raspberry Pi 4 is the fastest.Compiling OpenCVStep 10. Once the compiling process completes without an ERROR, we can now install OpenCV. Execute the commands below:sudo make installsudo ldconfigInstall OpenCVStep 11. Since we are done with installing OpenCV, we can reset the SWAP size to 100MB. Edit the /etc/dphys-swapfile and set the value of CONF_SWAPSIZE to 100MB as described in Step 5 above. Remember to Restart the swap service with the commands below:sudo /etc/init.d/dphys-swapfile stop sudo /etc/init.d/dphys-swapfile startStep 12. To finalize our installation, we will create symbolic links of cv2 toopencv/cmake/OpenCVDownload.cmake at 4.x opencv/opencv
All of our prerequisites installed, so let’s grab the 3.0.0 version of OpenCV from the OpenCV repository. (Note: As future versions of OpenCV are released just replace the 3.0.0 with the most recent version number):$ cd ~$ wget -O opencv.zip unzip opencv.zipTiming: 2m 29sFor the full install of OpenCV 3 (which includes features such as SIFT and SURF), be sure to grab the opencv_contrib repo as well. (Note: Make sure your opencv and opencv_contrib versions match up, otherwise you will run into errors during compilation. For example, if I download v3.0.0 of opencv , then I’ll want to download v3.0.0 of opencv_contrib as well):$ wget -O opencv_contrib.zip unzip opencv_contrib.zipTiming: 1m 54sStep #3: Setup PythonThe first step in setting up Python for our OpenCV compile is to install pip , a Python package manager:$ wget sudo python get-pip.pyTiming: 26sI’ve discussed both virtualenv and virtualenvwrapper many times on the PyImageSearch blog before, especially within these installation tutorials. Installing these packages is certainly not a requirement to get OpenCV and Python up and running on your Raspberry Pi, but I highly recommend that you install them!Using virtualenv and virtualenvwrapper allows you to create isolated Python environments, separate from your system install of Python. This means that you can run multiple versions of Python, with different versions of packages installed into each virtual environment — this solves the “Project A depends on version 1.x, but Project B needs 4.x” problem that often arises in software engineering.Again, it’s standard practice in the Python community to use virtual environments, so I highly suggest that you start using them if you are not already:$ sudo pip install virtualenv virtualenvwrapper$ sudo rm -rf ~/.cache/pipTiming: 17sAfter virtualenv and virtualenvwrapper have been installed, we need to update our ~/.profile file and insert the following lines at the bottom of the file:# virtualenv and virtualenvwrapperexport WORKON_HOME=$HOME/.virtualenvssource /usr/local/bin/virtualenvwrapper.shYou can use your favorite editor to edit this file, such as vim , emacs , nano , or any other graphical editor included in the Raspbian Jessie distribution. Again, all you need to do is open the file located at /home/pi/.profile and insert the. Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypiopencv/LICENSE at 4.x opencv/opencv - GitHub
#5: Finishing the installWe’re almost there! Just a few more things and we’ll be 100% done.For Python 2.7:Provided you finished Step #4 without error, OpenCV should now be installed in /usr/local/lib/python2.7/site-packages :$ ls -l /usr/local/lib/python2.7/site-packages/total 1636-rw-r--r-- 1 root staff 1675144 Oct 17 15:25 cv2.soNote: In some instances OpenCV can be installed in /usr/local/lib/python2.7/dist-packages (note the dist-packages rather than site-packages ). If you do not find the cv2.so bindings in site-packages , be sure to check dist-packages as well.The last step here is to sym-link the OpenCV bindings into the cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.soFor Python 3:OpenCV should now be installed in /usr/local/lib/python3.4/site-packages :$ ls /usr/local/lib/python3.4/site-packages/cv2.cpython-34m.soFor some reason, unbeknownst to me, when compiling the Python 3 bindings the output .so file is named cv2.cpython-34m.so rather than cv2.so .Luckily, this is an easy fix. All we need to do is rename the file:$ cd /usr/local/lib/python3.4/site-packages/$ sudo mv cv2.cpython-34m.so cv2.soFollowed by sym-linking OpenCV into our cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/$ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.soStep #6: Verifying your OpenCV 3 installAt this point, OpenCV 3 should be installed on your Raspberry Pi running Raspbian Jessie!But before we wrap this tutorial up, let’s verify that your OpenCV installation is working by accessing the cv virtual environment and importing cv2 , the OpenCV + Python bindings:$ workon cv$ python>>> import cv2>>> cv2.__version__'3.0.0'You can see a screenshot of my terminal below, indicating that OpenCV 3 has been successfully installed:Figure 5: OpenCV 3 + Python 3 bindings have been successfully installed on my Raspberry Pi 2 running Rasbian Jessie.TroubleshootingQ. When I try to use the mkvirtualenv or workon commands, I get an error saying “command not found”.A. Go back to Step #3 and ensure your ~/.profile file has been updated properly. Once you have updated it, be sure to run source ~/.profile to reload it.Q. After I reboot/logout/open up a new terminal, I cannot run the mkvirtualenv or workon commands.A. Anytime you reboot your system, logout and log back in, or open up a new terminal, you should run source ~/.profile to make sure you have access to your Python virtual environments.Q. When ILearning OpenCV 4 Computer Vision with Python 3
12,141 topics in this forum Sort By Recently Updated Title Start Date Most Viewed Most Replies Custom Filter By All Solved Topics Unsolved Topics Prev 1 2 3 4 5 6 7 Next Page 2 of 486 _LevenshteinDistance By WarMan, February 14 1 reply 317 views AspirinJunkie February 15 Run binary 1 2 3 4 11 By trancexx, August 3, 2009 210 replies 155.5k views Damnatio February 11 AutoIt parser in AutoIt By genius257, February 8 parser ast 6 replies 524 views genius257 February 10 Ternary Operators in AutoIt By TreatJ, February 9 8 replies 357 views Werty February 9 QuickLaunch alternative for Windows 11 By dv8, January 13 4 replies 848 views hughmanic February 9 Installer for execute a3x-Files By Schnuffel, January 25 8 replies 636 views Schnuffel February 9 SoundTool Playback Devices Mute Status (Auto Unmute if Muted) By TreatJ, February 6 12 replies 426 views TreatJ February 9 GUIFrame UDF - Melba23 version - 19 May 14 1 2 3 4 8 By Melba23, September 10, 2010 142 replies 110.1k views WildByDesign February 8 _ArrayCopyRange By WarMan, February 4 _arraycopyrange array 0 replies 468 views WarMan February 4 OpenCV v4 UDF 1 2 3 4 9 By smbape, August 10, 2021 opencv 174 replies 48.5k views k_u_x February 2 RustDesk UDF By BinaryBrother, December 30, 2024 13 replies 1.7k views BinaryBrother January 26 Advanced Icon Displayer In Listview By Zohran, March 25, 2012 12 replies 5.4k views manpower January 25 Screen scraping 1 2 3 By Nine, August 20, 2021 47 replies 14.9k views BinaryBrother January 23 Smtp Mailer That Supports Html And Attachments. 1 2 3 4 39 By Jos, March 28, 2006 763 replies 442.6k views SenfoMix January 21 The Taquin Puzzle By Numeric1, January 20 0 replies 375 views Numeric1 January 20 _RunWaitEx() UDF By argumentum, January 18 runwait 0 replies 430 views argumentum January 18 Multi-Task (easily run and mange many processes) 1 2 By Gianni, January 28, 2018 multi-task 22 replies 11.3k views water January 16 Extended Message Box - New Version: 16 Feb 24 1 2 3 4 19 By Melba23, January 29, 2010 360 replies 221.6k views BinaryBrother January 15 Conway's Game of Life: A Fascinating Cellular Automaton By Numeric1, January 13 0 replies 326 views Numeric1 January 13 The GASP Game By Numeric1, January 9 7 replies 503 views orbs January 13 Round buttons By ioa747, March 28, 2024How to install Python 3 and Opencv 4 on Windows
Sure you are in the cv virtual environment:$ workon cvFollowed by setting up the build:$ cd ~/opencv-3.0.0/$ mkdir build$ cd build$ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \ -D BUILD_EXAMPLES=ON ..Update (3 January 2016): In order to build OpenCV 3.1.0 , you need to set -D INSTALL_C_EXAMPLES=OFF (rather than ON ) in the cmake command. There is a bug in the OpenCV v3.1.0 CMake build script that can cause errors if you leave this switch on. Once you set this switch to off, CMake should run without a problem.Before you move on to the compilation step, make sure you examine the output of CMake!Scroll down the section titled Python 2 and Python 3 .If you’re compiling OpenCV 3 for Python 2.7, then you’ll want to make sure the Python 2 section looks like this (highlighted) in red:Figure 3: Ensuring that Python 2.7 will be used for the compile.Notice how both the Interpreter and numpy variables point to the cv virtual environment.Similarly, if you’re compiling OpenCV for Python 3, then make sure the Python 3 section looks like this:Figure 4: Ensuring that Python 3 will be used for the compile.Again, both the Interpreter and numpy variables are pointing to our cv virtual environment.In either case, if you do not see the cv virtual environment for these variables MAKE SURE YOU ARE IN THE cv VIRTUAL ENVIRONMENT PRIOR TO RUNNING CMAKE!Now that our build is all setup, we can compile OpenCV:$ make -j4Timing: 1h 35mThe -j4 switch stands for the number of cores to use when compiling OpenCV. Since we are using a Raspberry Pi 2, we’ll leverage all four cores of the processor for a faster compilation.However, if your make command errors out, I would suggest starting the compilation over again and only using one core:$ make clean$ makeUsing only one core will take much longer to compile, but can help reduce any type of strange race dependency condition errors when compiling.Assuming OpenCV compiled without error, all we need to do is install it on our system:$ sudo make install$ sudo ldconfigStepopencv/include/opencv2/opencv.hpp at 4.x opencv/opencv
System information (version)OpenCV => 4.5.5:Operating System / Platform => Linux/Ubuntu 64 BitCompiler => gcc (ver 9.3.0)Detailed descriptionI am trying to build OpenCV 4.5.5 from source but it fails when compiling CVV module and throws out QString: No such file or directory[2/1368] Building CXX object modules/c...v_cvv.dir/src/gui/image_call_tab.cpp.oFAILED: modules/cvv/CMakeFiles/opencv_cvv.dir/src/gui/image_call_tab.cpp.o/usr/bin/c++ -DCVAPI_EXPORTS -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/opencv/release/modules/cvv -I/opt/opencv/opencv_contrib/modules/cvv -I/opt/opencv/release/modules/cvv/opencv_cvv_autogen/include -I/opt/opencv/release/3rdparty/ippicv/ippicv_lnx/icv/include -I/opt/opencv/release/3rdparty/ippicv/ippicv_lnx/iw/include -I/opt/opencv/release -I/opt/opencv/opencv_contrib/modules/cvv/include -I/opt/opencv/modules/core/include -I/opt/opencv/modules/flann/include -I/opt/opencv/modules/imgproc/include -I/opt/opencv/modules/features2d/include -isystem /opt/intel/oneapi/mkl/2022.0.1/include -isystem /usr/include/eigen3 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -Wno-shadow -Wno-missing-declarations -O3 -DNDEBUG -DNDEBUG -fPIC -std=c++11 -MD -MT modules/cvv/CMakeFiles/opencv_cvv.dir/src/gui/image_call_tab.cpp.o -MF modules/cvv/CMakeFiles/opencv_cvv.dir/src/gui/image_call_tab.cpp.o.d -o modules/cvv/CMakeFiles/opencv_cvv.dir/src/gui/image_call_tab.cpp.o -c /opt/opencv/opencv_contrib/modules/cvv/src/gui/image_call_tab.cpp/opt/opencv/opencv_contrib/modules/cvv/src/gui/image_call_tab.cpp:1:10: fatal error: QString: No such file or directory1 | #include | ^~~~~~~~~compilation terminated.Steps to reproducePlatform:Timestamp: 2021-12-30T12:20:27ZHost: Linux 5.11.0-43-generic x86_64CMake: 3.22.1CMake generator: NinjaCMake build tool: /usr/bin/ninja\n"Configuration: ReleaseGUI: QT6QT: YES (ver 6.2.2 )QT OpenGL support: YES (Qt6::OpenGL )GTK+: YES (ver 3.24.20)GThread : YES (ver 2.64.6)GtkGlExt: NOOpenGL support: YES (/usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libGLU.so)The problem is somewhat related with Qt version 6 since I have built it in my other computer with all the same settings but the Qt version 5.15.2Is there any way to modify OpenCVFindGUILibs.cmake file and make Qt6 compatible with OpenCV and Contrib modules?-->Issue submission checklist I report the issue, it's not a question I checked the problem with documentation, FAQ, open issues,forum.opencv.org, Stack Overflow, etc and have not found solution[ x] I updated to latest OpenCV version and the issue is still there There is reproducer code and related data files: videos, images, onnx, etc. Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypi Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypi
opencv/3rdparty/ippicv/ippicv.cmake at 4.x opencv/opencv
The name of the virtual environment. To exit the virtual environment, use the deactivate command.Once inside the virtual environment, you can now install OpenCV. Execute the command below.pip3 install opencv-pythonInstall OpenCV with pipFrom the image above, you can see we have successfully installed OpenCV version 4.5.1.48. That’s it! You are done with OpenCV installation. To test OpenCV in your project, skip to the Test section at the bottom of the article.Method 2: Install OpenCV from the sourceIf you need a full installation of OpenCV, which includes patented algorithms, then you should use this method. Unlike the pip install method, which only takes a couple of minutes, compiling OpenCV from the source can take around two (2) hours. Follow the steps below:Step 1. Activate your virtual environment with the workon command below.workon sbb_cvStep 2. Download the source code for both OpenCV and Opencv_contrib from Github. Use the wget commands below.wget -O opencv_contrib.zip -O opencv.zip you get an error like ‘wget command not found,’ then you will need to install it with the command – sudo apt install wgetStep 3. We need to unzip the contents of the two files we downloaded. Use the unzip command as shown below:unzip opencv.zipunzip opencv_contrib.zipStep 4. After extracting the zip files, we will have two folders – opencv-4.5.2 and opencv_contrib-4.5.1. Let’s rename these two to something memorable like opencv and opencv_contrib.mv opencv-4.5.2 opencvmv opencv_contrib-4.5.1 opencv_contribRename foldersStep 5. Compiling OpenCV can be quite heavy on the Raspberry Pi memory. To avoid freezing or hanging, we can increase the SWAP space and utilize all four cores of the Pi in the compiling process. To do so, we will edit the dphys-swapfile present in the /etc. directory. Execute the command below to open dphys-swapfile with the nano editor.sudo nano /etc/dphys-swapfileFind the line – CONF_SWAPSIZE and set its value topython 3.x - How to update OpenCV 3.4.2 to OpenCV 4 or latest stable
对于安装opencv有的人一次就成功,而有人安装了N多次才成功。我就是那个安装了N多次的人,每次遇到了很多安装错误,只能通过到网上搜教程资料,解决方法;通过一次次的试错,最终完成了安装。再此提醒第一次安装或则安装失败没有头绪的小伙伴,请注重官方安装教程: 18.04安装的opencv版本为3.4.1(其他版本也行,安装过程类似)opencv安装的依赖包有:Required PackagesGCC 4.4.x or laterCMake 2.8.7 or higherGitGTK+2.x or higher, including headers (libgtk2.0-dev)pkg-configPython 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev[optional] libtbb2 libtbb-dev[optional] libdc1394 2.x[optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev[optional] CUDA Toolkit 6.5 or higher1 首先更新数据1 sudo apt-get update2 sudo apt-get upgrade2 安装依赖包1 sudo apt-get install build-essential2 sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev3 sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev3 下载openc3.4.1数据包 解压sudo unzip opencv-3.4.1.zip5 使用CMAKE安装opencv安装时要注意你所在目录进入文件夹,创建BUILD文件夹,进入BUILD文件夹1 cd opencv-3.4.12 mkdir build3 cd build设置cmake编译参数,或者直接编译使用默认参数[option] sudo cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..其他安装选项请参考官网教程:编译过程可能时间较长,也可能会出现编译错误而无法进行。6 进行MAKE创建编译后面的参数-j7 表示的是使用7核进行编译,而它的服务器有10核20个线程;所有可以使用更更多的核进行编写操作,这样速度会快一些。build的指令运行也同样时间会比较长。7 成功后,进行安装在此如果你未出现错误,说明你已经安装好了opencv库,但还需要配置环境。8 配置环境在配置之前,由于修改系统配置文件需要权限,请将身份转变成root修改opencv.conf文件sudo gedit /etc/ld.so.conf.d/opencv.conf文本可能为空白,在文本里添加opencv库的安装路径保存,若无法保存请确定你的身份root;关闭后,会出现警告无需担心。更新系统共享链接库再修改bash.bashrc文件sudo gedit /etc/bash.bashrc在末尾加入1 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 2 export PKG_CONFIG_PATH 保存退出,然后执行如下命令使得配置生效在此就已经完成配置验证是否配置成功查看opencv版本pkg-config --modversion opencv9 编辑测试程序,测试是否安装成功opencv_demo.cpp 1 #include 2 #include 3 4 using namespace std; 5 using namespace cv; 6 7 int main(void) 8 { 9 Mat src_image_ = imread("test.jpg"); // 读取当前目录下的test.jpg图片,如果保存请使用绝对路径10 imshow("src_image_", src_image_); // 打开图片文件11 waitKey(5000); // 停留5秒钟12 13 return 0;14 }CMakeLists.txt文件1 cmake_minimum_required(VERSION 3.5)2 project(test1)3 set(CMAKE_CXX_STANDARD 11)4 set(CMAKE_CXX_STANDARD_REQUIRED ON)5 6 add_executable(${PROJECT_NAME} opencv_demo.cpp)7 target_link_libraries(${PROJECT_NAME} opencv_core opencv_highgui opencv_imgcodecs)运行程序1 mkdir build # 创建目录2 cd build # 进入目录3 cmake .. # cmake自动查找父目录下的CMakeLists.txt文件4 make # 编译生成test1可执行文件5 ./test1 # 运行可执行文件, 至于代码中打开的图片是相对于test1可执行文件的相对路径如果运行成功,则安装成功;若出现编译错误请到网上搜索错误原因和解决方式。. Precompiled OpenCV 4.11 binaries for Raspberry Pi 3 4 - prepkg/opencv-raspberrypiCompiling OpenCV with cudnn on Debian 12 - build - OpenCV
Here are 48 public repositories matching this topic... Code Issues Pull requests 最全的懒人视频拍摄,支持横屏拍摄效果与竖屏拍摄效果,闪光灯,切换前后摄像头,懒人视频拍摄Demo,继承预览。简书: Updated Nov 23, 2016 Java Code Issues Pull requests A simple screen capture video recorder using the AfrogeNet ffmpeg DLL and windows forms with a flat ui. Updated Jun 12, 2017 C# Code Issues Pull requests 视频录制 视频压缩(使用FFMpeg)Android Video Recorder/Video Compressor Updated Jun 19, 2017 Java Code Issues Pull requests A GPUImage based video capture with dynamic overlays Updated Nov 2, 2017 Objective-C Code Issues Pull requests pcm + h264 = mp4 Updated Jan 4, 2018 C Code Issues Pull requests IPTV player and streamer for Linux that allows to play any stream that LibVLC can play, offers an overlay based on WebKit using HTML5, JavaScript and CSS and uses XMLTV data for EPG information. It allows the playback of URLs, files and can grab URLs from shell scripts. XMLTV EPG data can be downloaded from URLs or grabbed from shell scripts. Updated Apr 4, 2018 C Code Issues Pull requests 使用OpenCV实现的视频录制。 Updated Aug 9, 2018 Code Issues Pull requests jQuery AV Recorder is a configurable plugin that renders an audio and/or video recorder using HTML5 standards. Updated Dec 5, 2018 JavaScript Code Issues Pull requests Lightweight desktop screen recorder for Windows. Updated May 30, 2020 C# Code Issues Pull requests A set of basic OpenCV programs in Python 3 Updated Jun 13, 2020 Python Code Issues Pull requests python video recorder using opencv Updated Nov 29, 2020 Python Code Issues Pull requests Simultaneous audio and video recording sample using MediaCodec/MediaMuxer Updated Mar 14, 2021 Java Code Issues Pull requests Playback video from webCam or a movie file, keeps frames of the latest 10min, and allow you to watch your desired point with several playback options/modes. Updated Jul 31, 2021 Python Code Issues Pull requests An electron.js based desktop app that helps you to record your computer’s screen. Updated Aug 3, 2021 JavaScript Code Issues Pull requests A simple Audio, Video and Screen Recorder Updated Aug 13, 2021 HTML Code Issues Pull requests Video-Recorder based on qt, ffmpeg and C++ Updated Aug 22, 2021 C Code IssuesComments
/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp: In function ‘int lapack_QR(fptype*, size_t, int, int, int, fptype*, size_t, fptype*, int*)’:/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:293:111: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 293 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:302:111: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 302 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:314:114: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 314 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~/build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:323:114: error: too few arguments to function ‘void dgels_(const char*, const int*, const int*, const int*, double*, const int*, double*, const int*, double*, const int*, int*, size_t)’ 323 | dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info); | ^In file included from /usr/include/lapack.h:11, from /usr/include/lapacke.h:36, from /build/opencv/src/build/opencv_lapack.h:12, from /build/opencv/src/opencv-4.5.2/modules/core/src/hal_internal.cpp:51:/usr/include/lapack.h:1525:6: note: declared here 1525 | void LAPACK_dgels_base( | ^~~~~~~~~~~~~~~~~[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/split.dispatch.cpp.o[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat.dispatch.cpp.o[ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat_c.cpp.omake[2]: *** [modules/core/CMakeFiles/opencv_core.dir/build.make:509: modules/core/CMakeFiles/opencv_core.dir/src/hal_internal.cpp.o] Error 1make[2]: *** Waiting for unfinished jobs....
2025-04-162048. See the image below.Increase SWAP spaceOnce done, save the file (Ctrl + O, then Enter) and Exit (Ctrl + X).To apply the changes, restart the SWAP service with the commands below:sudo /etc/init.d/dphys-swapfile stopsudo /etc/init.d/dphys-swapfile startStep 6. Now, we have everything set to start compiling and installing OpenCV. Activate the virtual environment with the workon command.workon sbb_cvStep 7. Install Numpy with the pip command.pip3 install numpyInstall NumpyStep 8. With NumPy installed, we can now start configuring OpenCV. Navigate to the OpenCV directory to get started.Note: You need to be in the /opencv/build directory when executing the cmake command. You can use the pwd command to see your current working directory.cd opencvmkdir buildcd buildcmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D ENABLE_NEON=ON \ -D ENABLE_VFPV3=ON \ -D BUILD_TESTS=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D CMAKE_SHARED_LINKER_FLAGS=-latomic \ -D BUILD_EXAMPLES=OFF ..Configure OpenCVThe cmake command might take a couple of minutes to execute. Please be patient.Step 9. We have already configured OpenCV for installation. Now let’s start compiling with all the Four cores of the Pi. Execute the command below:make -j4This is one of the longest steps. It might take between 1 to 4 hours, depending on the Raspberry Pi board you are using. As of writing this post, Raspberry Pi 4 is the fastest.Compiling OpenCVStep 10. Once the compiling process completes without an ERROR, we can now install OpenCV. Execute the commands below:sudo make installsudo ldconfigInstall OpenCVStep 11. Since we are done with installing OpenCV, we can reset the SWAP size to 100MB. Edit the /etc/dphys-swapfile and set the value of CONF_SWAPSIZE to 100MB as described in Step 5 above. Remember to Restart the swap service with the commands below:sudo /etc/init.d/dphys-swapfile stop sudo /etc/init.d/dphys-swapfile startStep 12. To finalize our installation, we will create symbolic links of cv2 to
2025-04-05#5: Finishing the installWe’re almost there! Just a few more things and we’ll be 100% done.For Python 2.7:Provided you finished Step #4 without error, OpenCV should now be installed in /usr/local/lib/python2.7/site-packages :$ ls -l /usr/local/lib/python2.7/site-packages/total 1636-rw-r--r-- 1 root staff 1675144 Oct 17 15:25 cv2.soNote: In some instances OpenCV can be installed in /usr/local/lib/python2.7/dist-packages (note the dist-packages rather than site-packages ). If you do not find the cv2.so bindings in site-packages , be sure to check dist-packages as well.The last step here is to sym-link the OpenCV bindings into the cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.soFor Python 3:OpenCV should now be installed in /usr/local/lib/python3.4/site-packages :$ ls /usr/local/lib/python3.4/site-packages/cv2.cpython-34m.soFor some reason, unbeknownst to me, when compiling the Python 3 bindings the output .so file is named cv2.cpython-34m.so rather than cv2.so .Luckily, this is an easy fix. All we need to do is rename the file:$ cd /usr/local/lib/python3.4/site-packages/$ sudo mv cv2.cpython-34m.so cv2.soFollowed by sym-linking OpenCV into our cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/$ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.soStep #6: Verifying your OpenCV 3 installAt this point, OpenCV 3 should be installed on your Raspberry Pi running Raspbian Jessie!But before we wrap this tutorial up, let’s verify that your OpenCV installation is working by accessing the cv virtual environment and importing cv2 , the OpenCV + Python bindings:$ workon cv$ python>>> import cv2>>> cv2.__version__'3.0.0'You can see a screenshot of my terminal below, indicating that OpenCV 3 has been successfully installed:Figure 5: OpenCV 3 + Python 3 bindings have been successfully installed on my Raspberry Pi 2 running Rasbian Jessie.TroubleshootingQ. When I try to use the mkvirtualenv or workon commands, I get an error saying “command not found”.A. Go back to Step #3 and ensure your ~/.profile file has been updated properly. Once you have updated it, be sure to run source ~/.profile to reload it.Q. After I reboot/logout/open up a new terminal, I cannot run the mkvirtualenv or workon commands.A. Anytime you reboot your system, logout and log back in, or open up a new terminal, you should run source ~/.profile to make sure you have access to your Python virtual environments.Q. When I
2025-04-08