First be sure that gedit is already installed in your system.
If it is not installed, run this command
sudo apt install gedit # version 46.1-3
Next run :
sudo apt update
Now, run these following commands to install opencv in your ubuntu operating system.
sudo apt install libopencv-dev python3-opencv
Check opencv version:
python3 -c "import cv2; print(cv2.__version__)"
After installing, you can check wheather your program is properly running or not, you can simply write a sample code like....
To create python file : gedit p1.py
import cv2 img = cv2.imread("/home/arik/Downloads/image.jpeg", cv2.IMREAD_GRAYSCALE) cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows()
Here is the above given image:
To run : python3 p1.py
If output is,
So, your installation is successfull.