can't run stipdet in open cv - linux

I 'm trying to run some precompiled code (source code is not available) on Ubuntu, which requires openCV to be installed. I installed the latest version of openCV (from the SVN) yesterday, and installed it according to the debian install guide on the openCV website (cmake -> make -> sudo make install) and everything seemed to go fine.
I tried to run stipdet program but this gives me following error.
bash: ./stipdet: cannot execute binary file
Please can anyone help me with this error?

What does:
file $(which stipdet)
...say? I'm guessing it was built for a CPU you don't have.

You need to run chmod 755 ./stipdet to make stipdet executable.

Related

Ubuntu WSL is listed in Clion toolchains but says "not found"

Unlike this question or this one, CLion seems to detect the WSL correctly:
You can see that Ubuntu-20.04 is listed but still not found :
Versions :
Windows 10 : 1803
WSL : 1 (since windows 1803 does not support WSL 2)
WSL Distrib : Ubuntu 20.04 from Windows store
CLion : 2021.2.3
Has anyone ever faced this issue?
The issue seem to be, that clion can't find the cmake, C compiler, or C++ compiler of the WSL. My guess is that you haven't installed those yet.
You can install gcc with:
sudo apt install build-essential
This article explains how to build cmake:
Go to — https://cmake.org/files/ That shows all the list of the versions of cmake, I use cmake-3.15.0-rc1.tar.gz.
Open your terminal or bash and download it.
wget https://cmake.org/files/v3.15/cmake-3.15.0-rc1.tar.gz
After downloading, then untar.
tar -xvzf cmake-3.15.0-rc1.tar.gz
cd cmake-3.15.0-rc1/
./bootstrap
sudo make
sudo make install
cd /bin/
sudo cp cmake /usr/bin/
Now don’t forget we are currently in cmake-3.15.0-rc1/ just go back by entering cd ... that takes you up one directory back.
Now copy the directory to /usr/bin/share
sudo cp -r cmake-3.15.0-rc1/ /usr/share/cmake-3.15
export CMAKE_ROOT=/usr/share/cmake-3.15
After you have done that, clion should be able to detect everything correctly.
I asked the CLion support and this if the answer (which fixed my problem)
Actually, the best way to solve this is to update Windows. If it's not possible, then in CLion go to Help | Find Action, type "Registry...", select it and in the opened list find and and disable the wsl.execute.with.wsl.exe option. It should help.

Can't execute .run file in Ubuntu container

there.
I'm trying to install the Microchip XC8 compiler on a Ubuntu container to make a pipeline for building the project with Gitlab CI. But there's no response after I run the "xc8-v1.45-full-install-linux-installer.run" file.
Here is the environment I have:
Official Ubuntu 18.04 LTS image on a Docker container
Docker version 19.03.13
Windows 10 as Docker host
Microchip XC8 v1.45 compiler
And the commands I used for downloading and installing are as following:
# Download XC8 from the Microchip official site
wget http://ww1.microchip.com/downloads/en/DeviceDoc/xc8-v1.45-full-install-linux-installer.run
# Change the access permission
chmod +x xc8-v1.45-full-install-linux-installer.run
# Execute the ".run" file
./xc8-v1.45-full-install-linux-installer.run
After I did them all, there's no response. Obviously, something went wrong.
I have tried the installation process above on a native Ubuntu computer, and it just works fine.
Is there any prerequisite I missed? Or there have some ways for me to achieve the same purpose?
Thanks!
I was having this problem on 64 bit Ubuntu 20.04 as well.
I had several problems, could not change execution bit because it was on an NTFS partition and the executable required 32 bit libraries to run.
First I had to move the file from an NTFS partition so that I could set the file to executable. In my case I moved it to my downloads directory and then in that folder executed:
sudo chmod +x ./xc8-v1.42-full-install-linux-installer.run
It still would not run, so I checked its type by executing:
file ./xc8-v1.42-full-install-linux-installer.run
which resulted in the response:
./xc8-v1.42-full-install-linux-installer.run: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, no section header
Eventually the main solutions was to install 32 bit libraries:
sudo apt-get install lib32z1
Finally I could install install that 32 bit library. Then running this worked:
sudo ./xc8-v1.42-full-install-linux-installer.run
Using existing MPLAB Docker repo
This GitLab.com project exists:
MPLAB X IDE/IPE podman/docker container
This may not help with your .run file problem, but maybe switching to an existing docker container might make it easier for you.
They also work with .run files, so you may find your solution over there as well.
Features:
Has a general-purpose installation of MPLAB X and the toolchain.
X11 forwarding for working in the IDE is supported.
Can use USB from inside the container.
Requires some setup. See readme for installation instructions.
MIT License
Need to test this still myself, but just wanted to share here, might just as well.
Posted in the microchip forums by the creator:
Dockerfile for MPLAB X IDE/IPE and toolchains

sdkman on cygwin can't install

I'm setting up a new machine and installing sdkman on Cygwin to install Java. I had this exact setup working on my previous machine, also Win 10.
Installed Cygwin, and required for sdkman, installed zip and unzip packages. Now I'm getting the following error:
$ sdk i java 11.0.3-zulu
Downloading: java 11.0.3-zulu
In progress...
Warning: Failed to create the file
Warning: /home/whyph/.sdkman/tmp/D2txrZkztdcZKSIltTtxclUhHkzF9yIf.bin: No such
Warning: file or directory
curl: (23) Failed writing body (0 != 14095)
mv: cannot stat '/home/whyph/.sdkman/tmp/D2txrZkztdcZKSIltTtxclUhHkzF9yIf.bin': No such file or directory
Tried disabling Windows firewall and running Cygwin as administrator, neither changed the error. Worked out of the box on my last machine, but can't figure out what might be different.
I discovered the problem - wrong curl. Turns out, Windows 10 now comes with curl and it's on your path. I assumed it was one of the base packages of Cygwin, but it is not, and the Windows version is not compatible with SDKMAN, even though it worked to install it. Fix:
Remove SDKMAN per https://sdkman.io/install Uninstallation section
Close Cygwin shells
Rerun Cygwin setup and insure the curl, zip, unzip, and tar packages
are installed (check installation instructions in case more
dependencies are added since this writing)
Install SDKMAN per instructions
Recently I had the very same problem, and the reason was very simple... I forgot to install cURL on my Cygwin. Hope it helps!
I had the same problem recently and I manage to make it work somehow.
In the sdkman source file, I modified the .sdkman/src/sdkman-install.sh line 150.
I replaced the "--output" of the line below by a classic redirection ">".
After I just restarted cygwin and the command finally worked.
__sdkman_secure_curl_download "${download_url}" --output "${binary_input}"
Hope that helps !

Install Scratch 2 under Linux Ubuntu 14.04

I tried to install Scratch 2 under Linux for Education at school. I followed these good instructions to install Adobe Air - everything works fine. But if I execute the Air-Installfile for Scratch I will be asked for the root password. In the little Pop-Up-Window it's not working so I tried to start the Air-File with these:
/opt/Adobe\ AIR/Versions/1.0/Adobe\ AIR\ Application\ Installer /{absolute path to downloadfolder}/Scratch.air
It works fine, but I get an error saying error that my Scratch-Install-File is broken... I re-loaded again but nothing changed. Does someone has an helpful idea?
Look at your file size. The download have maybe been interupted before it was complete. It happened to me so I downloaded it again with a download manager like JDownloader and installed it successfully but only with sudo
sudo /opt/Adobe\ AIR/Versions/1.0/Adobe\ AIR\ Application\ Installer /{absolute path to downloadfolder}/Scratch.air
The problem is that you can't launch it directly when you installed it with sudo rights. I'm looking for a solution but this is another problem.

OpenCV VideoWriter will not open

I'm having trouble instantiating and opening an OpenCV VideoWriter for recording video on a Raspberry Pi (Raspbian Weezy).
My project is written in C++, but I've written a minimal Python program that demonstrates the problem.
https://gist.github.com/chriscollins/11ff2f43852e1c93dae8
Both my C++ code and the Python code above run without problem on my Windows machine. Sometimes the writer does not open, but that's to be expected - I don't have all of the listed codecs installed (the list of codecs comes from the Open CV source), but a good number of them work correctly. However, on a Raspberry Pi, both the C++ code and the Python code fail with the VideoWriter never being opened. In the above Python code, writer.isOpened() returns false for every single codec, when run on a Raspberry Pi.
I've chowned the destination directory to the user I'm running the Python script as, and chmodded it to 777 so I don't believe that it is a permissions problem. I think it may be connected with how I've installed OpenCV or some of its dependencies, but I'm not sure how to rectify it.
The install process I've used is as follows:
Update firmware/packages via rpi-update, apt-get update and apt-get upgrade.
Install the following dependencies via apt-get:
libjpeg8
libjpeg8-dev
libjpeg8-dbg
libjpeg-progs
ffmpeg
libavcodec-dev
libavcodec53
libavformat53
libavformat-dev
libgstreamer0.10-0-dbg
libgstreamer0.10-0
libgstreamer0.10-dev
libxine1-ffmpeg
libxine-dev
libxine1-bin
libunicap2
libunicap2-dev
swig
libv4l-0
libv4l-dev
python-numpy
libpython2.6
python-dev
python2.6-dev
libgtk2.0-dev
Download and unzip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip to /root/opencv-2.4.9.
cd /root/opencv-2.4.9 and run cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_ocl=OFF. Output of cmake is available at https://gist.github.com/chriscollins/d8060e03a6acd6d4336c
make and make install from the same directory.
Various other OpenCV functionality works correctly on the Raspberry Pi (in C++ or in Python) - e.g. viewing a webcam via VideoCapture, but I can't get the VideoWriter to work. I'm tempted to try installing FFMPEG from source instead of via apt-get, but as make takes 5+ hours to run on a Raspberry Pi, I was hoping I'd find the answer here, rather than proceeding with a trial and error approach!
Any advice on how to solve (or debug) this is appreciated.
EDIT: Added output of cmake command (https://gist.github.com/chriscollins/d8060e03a6acd6d4336c)
Looking at the output of make, I've found that it says NO to installation of gstreamer, which is a must for multimedia handling. This is the missing link.
Try
sudo apt-get install libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev .
This should solve your problem.
I've had similar issue on Mac OS 10.9 (Mavericks). I've solved it be reinstalling Opencv with ffmpeg support (i'm not sure whether i've reinstalled it after manually installing ffmpeg or whether brew handled it). On mac installing OpenCV with ffmpeg support was just one command - brew install opencv --with-ffmpeg (description of this option -> "Build with ffmpeg support"). I'm sure apt-get should have similar option.
You may also try this solution - http://www.ozbotz.org/opencv-installation-2-3-1/ It's quite old, but after small changes should work with current OpenCV version.

Resources