[PYTHON] Cv2.imshow now works properly with Homebrew's OpenCV3

Introduction

--I wanted to perform image processing with Python3 and OpenCV3 environment, but when I executed cv2.imshow, I was troubled with the following error.

The function is not implemented. Rebuild the library with Windows,
GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian,
install libgtk2.0-dev and pkg-config,
then re-run cmake or configure script in function cvShowImage

――However, it seems that it has been solved recently by updating Homebrew's OpenCV. ――It seems that there were repositories for OpenCV 2 and 3 respectively, but the package name is OpenCV, but it seems that the contents are only OpenCV3. Along with that, it seems that Python is also only 3 series.

Re-install Python and OpenCV

――I don't have to do anything special, but I will leave it as a memo.

Homebrew update

brew update && upgrade

Uninstall OpenCV and OpenCV3

brew uninstall --force opencv
brew uninstall --force opencv3

Uninstall Python and Python 3

brew uninstall --ignore-dependencies python
brew uninstall --force python
brew uninstall --ignore-dependencies python3
brew uninstall --force python3

Install Python3 and OpenCV3

brew install opencv

update of pip3

pip3 install --upgrade pip setuptools wheel 

Confirmation after installation

Python 3.6.2 (default, Jul 17 2017, 16:44:47) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.3.0'

Finally

――This update has returned my motivation, so I would like to play around with it.

Recommended Posts

Cv2.imshow now works properly with Homebrew's OpenCV3
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
Visualize the appreciation status of art works with OpenCV
Detect stoop with OpenCV
Binarization with OpenCV / Python
Rotate sprites with OpenCV
Data Augmentation with openCV
Easy TopView with OpenCV
Stumble with homebrew opencv3