概述
1.烧录系统
Operating system images – Raspberry Pi
https://shumeipai.nxez.com/2013/09/07/raspberry-pi-under-windows-system-installation-to-sd-card.h
2.远程连接(默认密码raspberry)
Preference--->Raspberry Pi Configuration--->Interface
打开SSH和VNC
3.安装OpenCV
Install OpenCV 4 on Raspberry Pi 4 and Raspbian Buster - PyImageSearch
(1)sudo raspi-config
Advanced Options
Expand filesystem
sudo reboot
(2)
# 无需科学上网
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential cmake unzip pkg-config
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libcanberra-gtk*
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3-dev
------
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
sudo pip install virtualenv virtualenvwrapper
nano ~/.bashrc
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
source ~/.bashrc
mkvirtualenv cv -p python3
workon cv
pip install numpy
sudo nano /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
------
https://github.com/opencv/opencv/archive/4.5.3.zip
https://github.com/opencv/opencv_contrib/archive/4.5.3.zip
mv opencv-4.5.3.zip opencv.zip
mv opencv_contrib-4.5.3.zip opencv_contrib.zip
unzip opencv.zip
unzip opencv_contrib.zip
mv opencv-4.5.3 opencv
mv opencv_contrib-4.5.3 opencv_contrib
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=~/Software/OpenCV_453/opencv/build/install
-D OPENCV_EXTRA_MODULES_PATH=/home/pi/Software/OpenCV_453/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 ..
-D OPENCV_GENERATE_PKGCONFIG=ON // g++ -o test_code test_code.cpp -L. -lisp_bm3d `pkg-config opencv4 --cflags --libs`
make -j4
make install
注:
(1)cv环境安装pip install opencv-contrib-python
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.--->unset all_proxy
(2)virtualenv奇葩问题--->创建红框文件即可(不知原因,只有一次装机中遇到,懂得小伙伴评论留言下)
4.VSCode远程树莓派
前端部署MNN+树莓派从0到1_环境配置_sinat_29634715的博客-CSDN博客
(1)安装C/C++
最后
以上就是洁净面包为你收集整理的树莓派环境搭建的全部内容,希望文章能够帮你解决树莓派环境搭建所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复