Mundarija:
2025 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2025-01-13 06:58
Bu ko'rsatmalarda kengaytirilgan reallik dasturini ishga tushirish uchun OpenCV, Python 3.5 va Python 3.5 uchun bog'liqliklar qanday o'rnatilishi tasvirlangan.
1 -qadam: talablar
Sizga quyidagi belgilar kerak bo'ladi:
Dragonboard 410c yoki 820c;
Linaro-alip/developer-ning toza o'rnatilishi;
DB410c: v431.link versiyasida sinovdan o'tgan
snapshots.linaro.org/96boards/dragonboard4..
DB820c: v228.link versiyasida sinovdan o'tgan
snapshots.linaro.org/96boards/dragonboard8..
Kamida 16 Gb sig'imli MicroSD karta (agar Dragonboard 410c ishlatilsa);
Faylni yuklab oling (bu bosqich oxirida), oching va MicroSD kartasiga nusxa oling;
Obs: Agar Dragonboard 820c dan foydalansangiz, faylni yuklab oling, oching va buyruqlardan foydalanishni osonlashtirish uchun/home/*USER*/ga o'ting;
- USB uyasi;
- USB sichqoncha va klaviatura;
- Internetga ulanish.
2 -qadam: MicroSD kartasini o'rnatish (faqat W/ Dragonboard410c)
Dragonboard -da terminalni oching;
-
Terminalda fdiskni ishga tushiring:
$ sudo fdisk -l
- MicroSD kartasini DragonBoard MicroSD karta uyasiga joylashtiring;
- Ro'yxatdagi yangi qurilmaning nomini (va bo'limini) qidirib, fdisk -ni qayta ishga tushiring:
$ sudo fdisk -l
Ildiz katalogiga o'ting:
$ CD ~
Jild yaratish:
$ mkdir sdfolder
MicroSD kartasini o'rnating:
mount /dev /sd_card_partition_name sdfolder
3 -qadam: Kerakli ramkalarni o'rnatish
Dragonboard -da terminalni oching;
Terminalda tanlangan katalogga o'ting (820c uchun "~" va 410c uchun o'rnatilgan SDCard yordamida):
(820c) $ CD
(410c) $ cd ~/sdfolder
Zram.sh skriptini ishga tushiring:
$ sudo bash augmented_reality/skriptlar/zram.sh
Tizimni yangilash:
sudo apt update && sudo apt upgrade
Ushbu paketlarni o'rnating:
sudo apt install -y debootstrap schroot git curl pkg-config zip unzip python python-pip g ++ zlib1g-dev openjdk-8-jdk libhdf5-dev libatlas-base-dev gfortran v4l-utils hdf5* libhdf5* libpng-dev build-muhim cmake libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libjpeg-dev libtiff5-dev libavcodec-dev libavformat-dev libsvscl-dev-libvxv2 libgtk2.0-dev libgtk-3-dev
Ushbu katalogga o'ting:
$ cd /usr /src
Python 3.5 -ni yuklab oling:
sudo wgetPaketni chiqarib oling:
$ sudo tar xzf Python-3.5.6.tgz
Siqilgan paketni o'chirib tashlang:
$ sudo rm Python-3.5.6.tgz
Python 3.5 katalogiga o'ting:
$ CD Python-3.5.6
Python 3.5 kompilyatsiyasi uchun optimallashtirishni yoqing:
$ sudo./configure-faollashtirish-optimallashtirish
Python 3.5 ni kompilyatsiya qiling:
$ sudo altinstall qiling
Pip va sozlash vositalarini yangilang:
$ sudo python3.5 -m pip o'rnatish -pip && python3.5 -m pip o'rnatish -setuptools -ni yangilash
Numpy -ni o'rnating:
$ python3.5 -m pip o'rnatish numpy
Tanlangan katalogga o'ting:
(820c) $ CD ~
(410c) $ cd ~/sdfolder
OpenCV va OpenCV Contrib omborlarini klonlang:
$ sudo git clone -b 3.4 https://github.com/opencv/opencv.git && sudo git clone -b 3.4
Katalogga o'ting:
$ CD ochiq
Qurilish katalogini yarating va unga o'ting:
$ sudo mkdir build && cd build
CMake -ni ishga tushiring:
$ sudo cmake -D CMAKE_BUILD_TYPE = RELEASE -D CMAKE_INSTALL_PREFIX =/usr/local -D BUILD_opencv_java = OFF -D BUILD_opencv_python = OFF -D BUILD_opencv_python3 = qaysi python3.5) -D PYTHON_INCLUDE_DIR =/usr/local/include/python3.5m/-D INSTALL_C_EXAMPLES = O'chirilgan -D INSTALL_PYTHON3_EXAMPLES = O'chirilgan -D BUILD_EXAMPLES = O'CHIRILGAN -BU -OFF = VT -BU -OFF = -DBUILD_TBB = ON -D OPENCV_ENABLE_NONFREE = ON -DBUILD_opencv_xfeatures2d = O'chirilgan -D OPENGL = ON -D OPENMP = ON -D ENABLE_NEON = ON -D BUILD_PERF_TESTS = O'chirilgan/ochilgan/ochilgan/ochilgan.
OpenCV -ni 4 yadroli kompilyatsiya qiling:
$ sudo make -j 4
OpenCV -ni o'rnating:
$ sudo make install
Tanlangan katalogga o'ting:
(820c) $ CD ~
(410c) $ cd ~/sdfolder
-
Python3.5 talablarini o'rnating:
$ sudo python3.5 -m pip install -r requirements.txt --no -cache -dir
Sinov importi:
python3.5
> cv2 import >> kolbani import qilish
4 -qadam: AR dasturini ishga tushirish
Tanlangan katalogga o'ting:
(820c) $ CD
(410c) $ cd ~/sdfolder
Kengaytirilgan haqiqat katalogiga o'ting:
$ cd augmented_reality/
Ilovani ishga tushiring:
$ python3.5 app.py