I am Charmie

メモとログ

2016-01-01から1年間の記事一覧

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…

Visual Studio 2015 with CMake

right after you installed visual studio 2015, CMake cannot find C and C++ compiler of it because Visual Studio 2015 installer didn't install any compiler. Although I have no ideas this is due to default or my install setting, I found the s…

install python non-negative matrix factorization module nimfa on anaconda

conda install -c cdeepakroy nimfa

Leap Motion SDK for Anaconda on Windows

Let ANACONDA_ROOT_DIR denote the root directory of Anaconda, C:\Anaconda2 in my case. copy Leap.py to ANACONDA_ROOT_DIR\Lib copy Leap.dll, LeapPython.pyd, msvcp120.dll, msvcr120.dll to ANACONDA_ROOT_DIR\DLLs

PyQtGraph on Ubuntu

installed PyQtGraph on anaconda running on Ubuntu 14.04 conda install pyopengl conda install pyqtgraph

Leap Motion SDK on Linux

See the REAEME file. sudo dpkg --install Leap-*-x64.deb sudo cp ./LeapSDK/lib/x64/* /usr/lib/ sudo cp ./LeapSDK/include/* /usr/include/ For anaconda, sudo cp ./LeapSDK/lib/x64/* ANACONDA_ROOT_DIR/lib/python2.7/site-packages/

Python: tuple of size 1

We can make a tuple of size 1 as tuple_a = (a, )

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.

spyder crashes with pyqt

spyder installed in my Windows 10 PC failed to boot after update conda --all. The error cause is a kind of conflict between pyqt and pyside. A solution I found on the web is here and it worked on my case. The solution is re-install pyqt ve…

Anaconda: pydicom 1.0.0a on Windows 10

To install pydicom 1.0.0a to Anaconda on Windows 10, we should build the package by ourselves. git clone https://github.com/darcymason/pydicom.git cd pydicom python setup.py install Install with conda cloud installs the version 0.9.9. The …

専門用語

Cardinality: 濃度 Image: 像 Domain: 始域 Codomain: 終域 Identity function: 恒等写像 Functional composition: 写像の合成 Functional inverse: (多分)逆写像

Python: set

setsPython 2.3で追加され,2.6で撤廃された. 2.6以降は組み込み型のsetを使う. listやnumpy.arrayを使っても似たようなことができそうだけど,集合は集合ということでsetを使った方が良い. [code lang="python"] import random if name == "main": # def…

Python: コールバック関数

関数の引数として呼ぶ関数をコールバック関数と呼ぶ. C, C++と違い,Pythonのコールバック関数を使うのは非常に簡単ということが分かった. ひとまず,コールバック関数をarithmetic.pyに保存. [code lang="python"] arithmetic.py def add(a, b): return …

unable to update cuda *** on Ubuntu 14.04

You may have GPG error (NO PUBKEY) related to nvidia's cuda when you apt-get update like: GPG error: http://developer.download.nvidia.com Release: The following signatures couldn't be verified because the public key is not available: NO_PU…

AndroidでARアプリ

GPS情報を基にした簡単な可視化を行うアプリをフルスクラッチで作ろうと思っていたんだけど,SDKを使うのが楽っぽい. AR SDKの比較表を基に良さそうなのは以下のSDK DroidAR: Location-based, marker-basedの両方 (センサーベースがメイン) GPS, 磁気センサ…

奴隷区 僕と23人の奴隷 1-10巻

奴隷区 僕と23人の奴隷 1-10巻 双葉社 岡田 伸一(原作),オオイシ ヒロト(漫画) 9月ぐらいにBOOKOFFで衝動的に買ったシリーズものが完結したので,後半数冊を新品購入. 面白かったけど話が複雑でわからんかったところもある.一気読みをおすすめ. 大奴隷区…

ノンタイプテンプレートパラメータ

関数・クラステンプレートのテンプレートパラメータに型以外を使う時,そのパラメータはノンタイプテンプレートパラメータと呼ばれる. 一般的に定数の整数値(enumeratorを含む)や外部リンケージのオブジェクトへのポインタを使う. 浮動小数点数やクラス型…

templateの明示的インスタンス化 (explicit instantiation)

templateの明示的インスタンス化とは,宣言と定義が別ファイルに記述してある関数テンプレート・クラステンプレートを呼ぶ時に必要. コンパイラが関数テンプレートやクラステンプレートをインスタンス化する時,どのようなテンプレート引数でインスタンス化…

「行けたら行きます」は会社でNG! 大人のタブー常識

「行けたら行きます」は会社でNG! 大人のタブー常識 トキオ・ナレッジ 宝島社 様々シーンにおけるマナーについて,これやっちゃ駄目よと例を示しながら解説してくれる本.読んだほうが良い. 内容: ビジネス、恋愛、ご近所づき合いにも役立つ!知らぬ間に損を…

Windows Surface Pro

研究費で購入したタブレットPCのスペックメモ 機種: Windows Surface Pro OS: Windows 8 Pro CPU: Core i5-3317U RAM: 4GB ストレージ: 256GB ディスプレイ: 10.6 inch 解像度: 1920x1080 タッチ: 10点タッチ

Set in Python

集合(Set)を扱うPythonのモジュールを調べたり試したり. setモジュール/ set module len(s): 集合sの要素数を返す x in s: xがsのメンバーに含まれていればTrueを返す x not in s: xがsのメンバーに含まれていればTrueを返す s.isdisjoint(t): sとtが共通…

Python module: shapely

Shapely is a python module for manipulation and analysis of planar geometric objects. Installation Execute a command from either of the followings: conda install -c scitools shapely pip install shapely 以下,ユーザマニュアルの要約をダラダ…

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…

Eigen 3.2.9 compilation on Ubuntu 16.04

If you face a cmake error regarding GLUT_XMU_something, try the following installation and then retry the cmake compilation. sudo apt-get install libxmu-dev libxi-dev

install Python package gurobi on Ubuntu 16.04

gurobi is a commercial optimization solver for a variety of problems such as linear programming, quadratic programming, etc. With Anaconda, you can install gurobi by two lines of commands and registering your license at the license center.…

SDKs for Android Studio

Rajawali for 3D CG. Follow the 1st tutorial to play a simple program. Google VR SDK for easy access to sensors and for cardboard. Follow the getting started just to play sample programs.

Error of Android Studio: Cannot launch AVD in emulator

I got the following error when I booted an emulator on Android Studio: [code lang="bash"] Cannot launch AVD in emulator. Output: sh: 1: glxinfo: not found libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer miss…

Android Studio installation on Ubuntu 16.04

[code language="bash"] JDK sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer sudo apt-get install oracle-java8-set-default Android Studio sudo apt-get install lib32stdc++6 wget and…

pydot error on Keras

you might have an error of pydot when you use keras.utils.visualize_util.plot. The error says that "Couldn't import dot_parser, loading of dot files will not be possible." The error is caused by incompatibility between pydot and pyparsing.…

show progressive percentile on the terminal

[code lang="c"] std::cout << std::fixed << std::setprecision(2) << std::setw(6) << "\b\b\b\b\b\b\b" << 100.0*ratio << "%" << std::flush; [/code]