pageauc / opencv3-setup Goto Github PK
View Code? Open in Web Editor NEWRaspberry Pi whiptail Menu driven Easy Install and Compile of opencv3 python from source files.
Raspberry Pi whiptail Menu driven Easy Install and Compile of opencv3 python from source files.
New to PI/coding and your tutorial seem to be the best written and most comprehensive for beginners.
However, I am running into this issue:
Could Not Create Dir at /home/pi/tmp_cv3 │
│ Check permissions │
│ If on a mounted Device make sure │
│ 1- Device is mounted and is NOT FAT32 │
│ 2- Device Must be writeable by Pi user. │
│ Check ownership and permissions │
│ │
│ Exit to Terminal to Investigate
Here is the code
./cv3-install-menu.sh: line 122: $LOG_FILE: ambiguous redirect
STEP 2 Install opencv 4.1.2 Build Dependencies
This step will install opencv 4.1.2 Build Dependencies
Then Download and unzip opencv source files to /home/pi/tmp_cv3 Folder
Filesystem Size Used Avail Use% Mounted on
udev 1.6G 0 1.6G 0% /dev
tmpfs 380M 1.4M 378M 1% /run
/dev/mmcblk0p2 29G 4.8G 23G 18% /
tmpfs 1.9G 26M 1.9G 2% /dev/shm
tmpfs 5.0M 20K 5.0M 1% /run/lock
/dev/mmcblk0p1 510M 73M 438M 15% /boot/firmware
tmpfs 380M 44K 380M 1% /run/user/1000
Install Dep and Source? (y/n)? y
Mon Nov 27 02:01:10 PM CST 2023 STEP 2-1 Installing Dependencies Please Wait ...
-- apt-get-install Start: Mon Nov 27 02:01:10 PM CST 2023
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.39.2-1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cmake is already the newest version (3.25.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pkg-config is already the newest version (1.8.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libjpeg-dev is already the newest version (1:2.1.5-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libtiff-dev is already the newest version (4.5.0-6+deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libjasper-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libpng-dev is already the newest version (1.6.39-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libavcodec-dev is already the newest version (8:5.1.4-0+rpt1+deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libavformat-dev is already the newest version (8:5.1.4-0+rpt1+deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libswscale-dev is already the newest version (8:5.1.4-0+rpt1+deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgtk2.0-dev is already the newest version (2.24.33-2+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libgstreamer0.10-0-dbg
E: Couldn't find any package by glob 'libgstreamer0.10-0-dbg'
E: Couldn't find any package by regex 'libgstreamer0.10-0-dbg'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libgstreamer0.10-0
E: Couldn't find any package by glob 'libgstreamer0.10-0'
E: Couldn't find any package by regex 'libgstreamer0.10-0'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libgstreamer0.10-dev
E: Couldn't find any package by glob 'libgstreamer0.10-dev'
E: Couldn't find any package by regex 'libgstreamer0.10-dev'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libv4l-0 is already the newest version (1.22.1-5+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libv4l-dev is already the newest version (1.22.1-5+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxvidcore-dev is already the newest version (2:1.3.7-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgtk-3-dev is already the newest version (1:3.24.38-2~deb12u1+rpt1+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libx264-dev is already the newest version (2:0.164.3095+gitbaee400-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libqtgui4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libqtgui4' has no installation candidate
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libqt4-test
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libcanberra-gtk3-0' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk3-dev' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk3-module' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk-dev' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk0' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk-common-dev' for glob 'libcanberra-gtk*'
Note, selecting 'libcanberra-gtk-module' for glob 'libcanberra-gtk*'
libcanberra-gtk3-0 is already the newest version (0.30-10).
libcanberra-gtk-module is already the newest version (0.30-10).
libcanberra-gtk3-module is already the newest version (0.30-10).
libcanberra-gtk3-dev is already the newest version (0.30-10).
libcanberra-gtk0 is already the newest version (0.30-10).
libcanberra-gtk-common-dev is already the newest version (0.30-10).
libcanberra-gtk-dev is already the newest version (0.30-10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libatlas-base-dev is already the newest version (3.10.3-13).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python2.7-dev
E: Couldn't find any package by glob 'python2.7-dev'
E: Couldn't find any package by regex 'python2.7-dev'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-dev is already the newest version (3.11.2-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gfortran is already the newest version (4:12.2.0-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-numpy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-numpy' has no installation candidate
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-scipy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-matplotlib
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
default-jdk is already the newest version (2:1.17-74).
ant is already the newest version (1.10.13-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgtkglext1-dev is already the newest version (1.2.0-11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
v4l-utils is already the newest version (1.22.1-5+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gphoto2 is already the newest version (2.5.28-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (23.0.1+dfsg-1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ntfs-3g is already the newest version (1:2022.10.3-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-- apt-get-install End: Mon Nov 27 02:02:35 PM CST 2023
-- apt-get-install Took: 1 min 25 sec
Perform sudo apt-get autoremove and clean
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Create dir /home/pi/tmp_cv3
mkdir: cannot create directory '/home/pi': Permission denied
Thank you for any assistance with this
Hi @pageauc ,
I've tried almost every way possible to get CV2 installed onto my rPi 0w and came across your scripts and am hoping they will get me over the hump.
I'm working my way through your menu and got to the cmake portion where the script failed after 1sec. It is saying it can't find the build folder though it clearly is there. Please see pics included. Hopefully you can help.
This release is a major revamp of the script and improves the menuing and navigation. If steps are successful you can continue to the next step automatically or exit, to correct any issues then restart menu to retry step. There is an option to continue compile where you left off or perform a make clean to force a full compile. You can also change the install_dir to another location to allow running from a mounted USB storage device location. This is useful if the system SD does not have enough free disk space. The Readme has also been updated.
I have run this setup on several fresh builds without issue. Also updated one RPI to opencv 3.4.1
Regards
Claude ....
I got the import error when trying to import cv2 with python3 (python2 worked fine),
ImportError: libQtGui.so.4: cannot open shared object file: No such file or directory
Luckily I solved it with:
sudo apt install libqtgui4
No idea why though
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.