Ask Your Question
0

Uninstalling Opencv 4.0.0 to 3.4

asked 2018-06-19 15:57:00 -0600

gameon1510 gravatar image

Hello, everyone, I would like some help in uninstalling my current version of opencv to a different one. I'm fairly new to this and I would greatly appreciate a step by step tutorial on how to go about this in the quickest and least painful manner. The opencv software is running on Ubuntu 16.04 on a raspberry pi. I'm attempting to use the opencv to use facial detection via webcam. Please inform me if you need any additional information.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-19 18:58:57 -0600

updated 2018-06-19 19:45:29 -0600

I hope you have a folder which you run cmake command to OpenCV? In my case, I created a folder name release to put builds. open Terminal on that location (or go to that place using Terminal). Now run below command.

sudo make uninstall

After this, remove opencv and opencv_contrib folders. If above command doesn't work don't worry. Now we are going to remove symlinks manually(I suggest follow this and check to avoid tons of error while installing new one). Be careful when you are removing them. Always read fully before remove Run below command and it will prompt you all the files that have OpenCV name.

sudo find / -name "opencv" -exec rm -i {} \;

read carefully and type y and enter. If you don't want to remove type n and enter.

After above manual remove is complete please run

pkg-config --modversion opencv

If it's doesn't print a version number now OpenCV has completely removed.

Now we need to get OpenCV Release codes. I suggest using OpenCV 3.4.1 Download Source code (zip) using below command

now we need to move them to /opt folder. This process you have to go through a terminal as a Superuser. After Extract them open Terminal and example commands will be like below.

sudo mv opencv-3.4.1 /opt

sudo mv opencv_contrib-3.4.1 /opt

Now go to opencv-3.4.1 and create release folder

cd /opt/opencv-3.4.1

mkdir release

cd release

Now you have to build the OpenCV using below commands

sudo cmake -D BUILD_TIFF=ON -D WITH_CUDA=OFF -D ENABLE_AVX=OFF -D WITH_OPENGL=OFF -D WITH_OPENCL=OFF -D WITH_IPP=OFF -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_EIGEN=OFF -D WITH_V4L=OFF -D WITH_VTK=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-3.4.1/modules /opt/opencv-3.4.1/

Make sure you have correct versions on both OpenCV here I use 3.4.1 Please follow next commands.

sudo make -j4

sudo make install

sudo ldconfig

Now run below command to check installation is completed or not.

pkg-config --modversion opencv

Disclaimers - This answer provided with good deeds. If you won't be careful when manual OpenCV file removing step, you might damage your IDE or relevant software.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-06-19 15:57:00 -0600

Seen: 24,148 times

Last updated: Jun 19 '18