I am Charmie

メモとログ

opencv

No module named cv2.aruco

opencv-python と opencv-contrib-pythonが競合を起こすらしい. 解決策は,いったん両方をアンインストールしてから,再度 opencv-contrib-python のみをインストール. pip uninstall opencv-python pip uninstall opencv-contrib-python pip install open…

Aruco in OpenCV

OpenCVで実装されているArucoに関するメモ.あくまでもPython.Versionは4.0.0.21テスト チュートリアルに書いてある内容+α. dictionary(マーカのセット)は2種類1. predefined dictionary: あらかじめ用意されているマーカ2. custom dictionary: 自作するd…

OpenCV-Python: video properties

[code lang='python']import cv2video = cv2.VideoCapture('input.mp4')num_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))fps = video.get(cv2.CAP_PROP_FPS)width = int(video.get(cv2.CAP_PROP_FRAME_WIDTH))height = int(video.get(cv2.CAP_PROP_FR…

ArUco in OpenCV

ArUco is a fiducial marker tracking method against occlusion published in Pattern Recognition in 2014. ArUco was integrated into OpenCV modules. This blog post is to know its definition, how-to-use, etc. for my works. ArUco provides three …

Install OpenCV contrib for python

I was looking for a way to install OpenCV and OpenCV contrib for Python 3 with Anaconda. The following commands are what I found and succeeded to install but with pip not with Anaconda. pip install opencv-python pip install opencv-contrib-…

OpenCV Python calibration code

[code lang='python'] -- coding: utf-8 -- import os import numpy as np import glob import cv2 def generate_points_3d(rows, cols, square_size): """ prepare object points as ( 0, 0, 0), (1square_size, 0, 0), (2square_size, 0, 0), ... *1 img =…

OpenCV-Python GUI outputs GTK related error

This stackoverflow post gives us the answer!! OpenCV for python installed on Linux (Ubuntu) by anaconda outputs GTK+2.x related error as OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GT…

Install OpenCV-Python 3.4.1 via Anaconda

See here. conda install -c anaconda opencv

OpenCV-Pythonチュートリアル

OpenCV-Pythonチュートリアルの和訳を2.5年ぶりに更新. 和訳は以前と同じURLからアクセス可能です. ソースはgithubからgitlabに移行しました. 誤訳,変な訳があればgitlabにイシュー登録してもらえるとハッピーです.

Anaconda: OpenCV for Python 3.6 on Windows 10

OpenCV installation on Windows via Anaconda with conda -c conda-forge opencv makes import error like ImportError: DLL load failed: access denied. The solution is to use pip instead as pip install opencv-python.

enable OpenCV-Python compilation with OpenCV 3.2.0

With default CMakeLists.txt, we cannot compile OpenCV-Python with OpenCV 3.2.0 because 1. add_subdirectory() for python2 do not work appropriately 2. add_subdirectory() for python3 do not work appropriately 3. CMakeLists.txt in the root di…

OpenCV Python flags

OpenCV flags have a little bit different names when using with python. The name CV_FLAGNAME is set as cv2.FLAGNAME. For instance, CV_CALIB_CB_ADAPTIVE_THRESH is defined as cv2.CALIB_CB_ADAPTIVE_THRESH.

OpenCV 3.1.0 for Python2.7

PYTHON2_EXECUTABLE: /opt/anaconda/anaconda2/bin/python2.7 PYTHON2_INCLUDE_DIR: /opt/anaconda/anaconda2/include PYTHON2_INCLUDE_DIR2: PYTHON2_LIBRARY: /opt/anaconda/anaconda2/lib/libpython2.7.so PYTHON2_LIBRARY_DEBUG: PYTHON2_NUMPY_INCLUDE…

OpenCV 3.1.0 on Ubuntu 14.04

cmakeのバージョンを3.1.3以上にする howto With QTのチェックを外す

OpenCV 3.1.0 prebuilt binary

Please use OpenCV 3.1.0 prebuilt binary provided at github, not at sourceforge. The one provided at sourceforge has some problem. Double clicking the exe file, I got an error message saying that can not open file "***/opencv-3.1.0.exe" as …

Notes on OpenCV-Python on Ubuntu

If PYTHON2_NUMPY_INCLUDE_DIRS is not found, python bindings for python2.7 is not generated. Couldn't compile with FFMPEG=ON. Turned off the flag. BUILD_opencv_python2=ON BUILD_opencv_python3=ON OPENCV_EXTRA_MODULES_PATH="CONTRIB_DIR/module…

highgui related issues of OpenCV-Python on Ubuntu 14.04

OpenCV-Python always crashed when I used highgui related functions. With Spyder, we can see only kernel crash, so I had no idea what happened. When I ran a problem from terminal, I got an error message that This application failed to start…

OpenCV 3.1.0 for Python: installation on Windows

OpenCV 3.1.0をPython 2.7から使うためのインストール手順 OpenCVのインストールはめんどくさいのでプレビルトライブラリを使う.opencv_contribの便利機能を使いたい場合は自前でコンパイルする必要がある. 前提条件: Anacondaを使ってPython2.7がインスト…

OpenCV-Python Tutorials (ver 3.0.0)の和訳

研究室の学生のためにOpenCV-Python Tutorialsの和訳を試みる.githubでチュートリアルのソース1式が公開されているので,このファイルを翻訳→内部ネットワークに公開という手順でいこう.

python 2.7 + OpenCV 3.0.0 on Ubuntu using Anaconda

install anaconda install python packages download OpenCV 3.0.0 source compile OpenCV 3.0.0 with BUILD_opencv_python2 ON (BUILD_opencv_python3 may work with python 3 but I didn't try yet) With default settings, OpenCV package for python 2 i…

Python 2.7 + OpenCV 3.0.0: installation on Windows

English notes is below the Japanese one. OpenCV 3.0.0をPython 2.7から使うためのインストール手順 Pythonのインストール Python-OpenCVを動かすには,Python本体に加えて少なくともNumPy, MatPlotLibのインストールが必要. 1.1. Anacondaのインストール…

OpenCV VIZ module compilation with VTK in Ubuntu 14.04

OpenCV ver. 3.0 was released. I tried to compile OpenCV with VTK again and again and finally could compile it. The key was compile VTK with BUILD_SHARED_LIBS on compile OpenCV with VTK That's it!!

OpenCV 2.2 with Visual Studio 2010

Intel TBB (Threading Building Blocks)のインストールMulti coreを使うためのライブラリ?Download/Stable versionのページから最新のバージョン(tbb30_20110315oss)を選ぶ.http://threadingbuildingblocks.org/file.php?fid=77該当するOSのファイル(tbb3…

OpenCVの行列

致命的なバグを発見.mat = cvCreateMat(3, 3, CV_32F);mat =|0.0 1.0 2.0||3.0 4.0 5.0||6.0 7.0 8.0|とすると,行ベクトル,列ベクトルを取り出す関数はcvGetRowとcvGetColvec = cvCreateMat(1,3,CV_32F);として,実行すると,cvGetRow(mat, vec, 0) -> |0…