顯示具有 技術-OpenCV 標籤的文章。 顯示所有文章
顯示具有 技術-OpenCV 標籤的文章。 顯示所有文章

2016年2月17日 星期三

[Openalpr] How to compile openalpr for Mac?


I try to compile openalpr on my MacBook Pro. Below is the note.


0. Test environment
  • OS X EI Capitan (v10.11.2)
  • tesseract v3.0.4
  • openalpr v2.2.0
  • opencv v3.0.0

1. Download source
$ git clone https://github.com/openalpr/openalpr.git$ cd openalpr/src
$ mkdir build
$ cd build

$ wget http://www.leptonica.com/source/leptonica-1.73.tar.gz
$ tar xvf leptonica-1.73.tar.gz
$ cd leptonica-1.73
$ ./configure CC=/usr/bin/clang
$ make
$ sudo make install 
$ cd ~/openalpr
$ git clone https://github.com/tesseract-ocr/tesseract.git tesseract-ocr
$ cd tesseract-ocr/
$ git tag -l $ git checkout tags/3.04.00
$ ./autogen.sh
$ ./configure CXX=/usr/bin/clang++ --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
$ make
$ sudo make install

3. Install OpenCV, I used OpenCV v3.0.0 that I already installed.
http://albert-oma.blogspot.tw/2015/08/how-to-install-opencv-in-mac-os.html

4. Install openalpr
$ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_MACOSX_RPATH=true
$ make
$ sudo make install

5. Test
$ wget http://i.imgur.com/pjukRD0.jpg -O lp.jpg
$ alpr lp.jpg

FAQ:
1. Compile error about "undeclared identifier 'ENTER_KEY_ONE' and 'ENTER_KEY_TWO'"Referece
 https://github.com/openalpr/openalpr/blob/master/src/misc_utilities/classifychars.cpp, you will find these 2 definitions are missing for __APPLE__ platform. So you need just add below 2 lines, and it will pass the compilation.
const int ENTER_KEY_ONE = 13;
const int ENTER_KEY_TWO = 10;
2. How to generate test license plate images?
method1. download from here.
method2. use openalpr deamon to capture from a real camera or streaming server.

2016年2月4日 星期四

[Openalpr] How to cross compilation openalpr for ARM?

Recently, I survey the open source of license plate recognition. The project "openalpr" seems a good option. I reference the Compilation-instructions-(Ubuntu-Linux),  and try to run the program on arm based linux. Below is my memo.

2015年9月24日 星期四

[OpenCV] Cross compilation for ARM based Linux systems (static)

本篇記錄編譯 OpenCV (static) 的過程。

2015年8月31日 星期一

[OpenCV] 鏡頭校正 Calibration

OpenCV 已經內建鏡頭校正的範例程式,並且提供了許多範例圖片,3.0版本更針對魚眼鏡頭提供了新的函數。這些功能還挺好玩的,以下作一記錄

2015年8月25日 星期二

[OpenCV] OpenCV for iOS

對於 iOS 上如何使用 OpenCV,docs.opencv.org 提供了很多參考文件。
以下對自己的測試過程,作一記錄

1. 可以直接取得 OpenCV framework,或是自行編譯 OpenCV
可至此處 http://sourceforge.net/projects/opencvlibrary/files/opencv-ios/ 直接下載。
本次測試,我選擇自行編譯,步驟如下

[OpenCV]  FAQ

此處收集自己使用 OpenCV時遇到的問題與解決方法


1. 沒有 link zlib,錯誤訊息如下
persistence.cpp:(.text.cvOpenFileStorage+0x4a8): undefined reference to `gzrewind'
persistence.cpp:(.text.cvOpenFileStorage+0x844): undefined reference to `gzopen'
persistence.cpp:(.text.cvOpenFileStorage+0xa98): undefined reference to `gzclose'
persistence.cpp:(.text.cvOpenFileStorage+0xcee): undefined reference to `gzgets' 
解法: 自行編譯compile zlib 或是找到可用的 zlib,之後加上 -lzlib 再次編譯即可

2015年8月5日 星期三

[OpenCV] How to install OpenCV in Mac OS

安裝過程摘要

1. download latest opencv package from  http://opencv.org/
$ wget https://github.com/Itseez/opencv/archive/3.0.0.zip