当前位置:网站首页>Raspberry pie + opencv + opencv -- face detection ------- environment construction
Raspberry pie + opencv + opencv -- face detection ------- environment construction
2022-04-23 04:43:00 【Vivid_ Mm】
Make it clear in advance , The environment version I built is 2.4.9( Very old version , They all have basic functions ) Source code installation .
1. Install dependent files
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config
sudo apt-get install python-dev python-numpy
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev
2. Download the source file
1. Create a new one in your home directory opencv( It's just a name , What name do you like to call , No effect , Here we use opencv Instead of ) Folder
2. Then download opencv Source code
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download opencv-2.4.9.zip ( This is the source code URL)
You can download raspberry tour directly , Download and move to opencv In the folder
3. decompression upzip opencv-2.4.9.zip
3. compile
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo ldconfig
stay cmake There will be problems in the process , But there will be solutions !
The first error message :
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:969:30: error: the compiler can assume that the address of ‘annotate_img’ will never be NULL [-Werror=address]
if (&annotate_img!=NULL) {
^
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:1016:34: error: the compiler can assume that the address of ‘annotate_img’ will never be NULL [-Werror=address]
if (&annotate_img!=NULL) {
^
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp: In member function ‘cv::ChamferMatcher::Match* cv::ChamferMatcher::Matching::localChamferDistance(cv::Point, cv::Mat&, cv::Mat&, cv::ChamferMatcher::Template*, float)’:
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:1111:25: error: the compiler can assume that the address of ‘orientation_img’ will never be NULL [-Werror=address]
AM_CFLAGS = -Wall -g $(MATCHBOX_PANEL_CFLAGS) \
-I$(top_srcdir) -I$(top_builddir) -Werror
It means -Werror Get rid of
however opencv It's dependence cmake Compilation of , So according to the error information, you enter the corresponding directory , stay flags.make Found in the file -Werror=address, Remove it , Then save , Recompile is successful .
flags.make Files can be found directly in file management .
The second error message :
usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: There is no file or directory
cmake -D CMAKE_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local.. -DENABLE_PRECOMPILED_HEADERS=OFF
This is the problem I encountered in compiling , If there is anything wrong , Welcome to point out !
I'll post the code I use later , For your reference .
If you are downloading installation files or The download speed is very slow when installing dependency , It is suggested that you can replace apt Source ( That is, the software source ), Here is my software source For your reference :
1 deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib
2 deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ jessie main non-free contrib
This path is in :/etc/apt modify sources.list file ( Need to add root Permission or direct sudo )
Finished saving , Remember to update it :
sudo apt-get update
sudo apt-get -y uograde
The first one above Alibaba cloud platform , The second is the mirror station of Tsinghua University , Download speed bar .
Use python Words , If you use pip If you want to manage your files , It is suggested that pip Source , Here is also my pip Source , For your reference :
1 [global]
2 index-url = https://pypi.tuna.tsinghua.edu.cn/simple
3 [install]
4 trusted-host=mirrors.aliyun.com
This path is in :/home/pi/.pip(.pip Folder ) modify pip.conf file ( If you don't have one, just create one )
It's the same here , The first one is from Tsinghua University , The second is Ali's
May you , Don't innovate just because “ Speed ” And embarrassed !!!
版权声明
本文为[Vivid_ Mm]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220558084732.html
边栏推荐
- Innovative practice of short video content understanding and generation technology in meituan
- What is a blocking queue? What is the implementation principle of blocking queue? How to use blocking queue to implement producer consumer model?
- leetcode002--将有符号整数的数字部分反转
- zynq平臺交叉編譯器的安裝
- What is the thirty-six plan
- 第四章 --- 了解标准设备文件、过滤器和管道
- getprop 属性
- A heavy sword without a blade is a great skill
- Mysql50 basic exercises
- [paper reading] [3D target detection] point transformer
猜你喜欢
IDE Idea 自动编译 与 On Upate Action 、 On Frame Deactivation 的配置
IDE idea automatic compilation and configuration of on update action and on frame deactivation
Recommended scheme for national production of electronic components of wireless keyboard
Gut liver axis: host microbiota interaction affects hepatocarcinogenesis
Mysql50 basic exercises
RC低通滤波器的逆系统
Innovative practice of short video content understanding and generation technology in meituan
Spark optimization
229. Find mode II
数据孤岛是什么?为什么2022年仍然存在数据孤岛?
随机推荐
Recursive call -- Enumeration of permutations
C language: Advanced pointer
Error occurs when thymeleaf th: value is null
协程与多进程的完美结合
Leetcode008 -- implement strstr() function
Phishing for NFT
重剑无锋,大巧不工
What's the difference between error and exception
Inverse system of RC low pass filter
Record the blind injection script
Detailed explanation of life cycle component of jetpack
Go reflection - go language Bible learning notes
Recommended scheme for national production of electronic components of wireless keyboard
leetcode009--用二分查找在数组中搜索目标值
Microbial neuroimmune axis -- the hope of prevention and treatment of cardiovascular diseases
Mysql, binlog log query
leetcode003--判断一个整数是否为回文数
Leetcode004 -- Roman numeral to integer
IDE Idea 自动编译 与 On Upate Action 、 On Frame Deactivation 的配置
Recommended scheme of national manufactured electronic components for intelligent electronic scales