OpenSift源碼編譯過程記錄

本文記錄了在CentOS6.5上編譯Sift的開源實現OpenSift的編譯過程,同時記錄了編譯過程中的幾個問題.

sift的理論已經有很多了,下面會給出鏈接:


1.Requirements

a.OpenCV

All code in this package requires the OpenCV library (known working version is 2.3):http://sourceforge.net/projects/opencvlibrary/

b.GDK/GTK+2

Some functions require GDK/GTK+2 (known working version is 2.18.4): http://www.gtk.org/

opencv的安裝可以看CentOS6.5上配置Python2.7+OpenCV2.4.7  


2.Build

從github下載源碼,解壓如圖


作者給出的build和使用過程

To build everything, use make:

#make

This should produce a few executables in bin/, a static library lib/libopensift.a, and some HTML documentation in docs/.
You can use the -h argument to get help with any of the executables. libopensift.a can be compiled into your own code using the standard method:

#gcc -I/path/to/opensift/include/ -L/path/to/opensift/lib/ yourcode.c -o yourexecutable -lopensift
The documentation in docs/ describes all of the functions available in libopensift.a as well as
#defines, etc. Use the documentation to determine what header files from include/ to include in your code.

You can also individually build any of the executables or libopensift.a, e.g.

照做,很明顯,一般人make完了都會有錯,錯誤如下:


確認你已經安裝了opencv和gtk,然後出現上圖錯誤的話肯定就是編譯設置的問題了,

提示信息已經說了:

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable,

就是說pkg-config找不到opencv.pc,那就找到opencv.pc,cp到/usr/lib/pkgconfig下

#find / -name opencv.pc


安裝目錄就是/usr/lib/pkgconfig/opencv.pc了,複製到pkgconfig下

#cp /usr/local/lib/pkgconfig/*.pc /usr/lib/pkgconfig,然後再重新make,沒報錯就Ok了


3.test

# bin/match beaver.png beaver_xform.png,報錯如下:

opencv的動態庫沒找到,修改如下:

# vim /etc/ld.so.conf

添加/usr /local/lib(這裏是opencv安裝後的庫目錄)

#ldconfig

重新執行下,效果如圖:



相關鏈接:

http://robwhess.github.io/opensift/(opensift介紹)

https://github.com/robwhess/opensift(opensift源碼)

http://www.cs.ubc.ca/~lowe/keypoints/(sift)

http://www.robots.ox.ac.uk:5000/~vgg/research/affine/index.html

http://blog.csdn.net/onlyzkg/article/details/11570965(理論)

http://blog.csdn.net/abcjennifer/article/details/7639681(理論)

http://cgwxyz.blog.163.com/blog/static/262806020105307929424/(編譯錯誤)

http://blog.sina.com.cn/s/blog_54f82cc201011ve4.html(編譯錯誤)


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章