Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
783 views
in Technique[技术] by (71.8m points)

feature extraction - How to calculate Local Binary Pattern Histograms with OpenCV?

I have already seen that OpenCV provides a classifier based on LBP histograms:

But I want to have access to the LBP histogram itself. For instance:

histogram = calculate_LBP_Histogram( image )

Is there any function that performs this in OpenCV?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can get the C++ code for computing LBP using OpenCV's Mat data structure here:

http://www.bytefish.de/blog/local_binary_patterns

You should be able to find the Python version as well on the same site.

The code is written by Philipp Wagner, who I believe contributed the face recognition code you mentioned to OpenCV, so it should be the same thing.

The LBP code is found in the file: OpenCV-2.4.2/modules/contrib/src/facerec.cpp as a static function. Unfortunately, it does not appear to be exposed for public use (at least for OpenCV 2.4.2).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...