Code Monkey home page Code Monkey logo

nourani / lbp Goto Github PK

View Code? Open in Web Editor NEW
97.0 97.0 60.0 1.29 MB

C++ implementation of the Local Binary Pattern texture descriptors. This class integrates with OpenCV and FFTW3 to bring a complete and fast implementation of the popular descriptors: LBP u2, ri, riu2 & hf. The routines for calculating these descriptors are inspired by the Matlab code of the original authors.

License: GNU General Public License v3.0

C++ 33.85% Python 0.67% Cuda 5.65% CMake 3.44% C 56.38%

lbp's People

Contributors

fmigneault avatar nourani avatar petermoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lbp's Issues

What about the status of GPU code?

I'm testing your library and I can say that the CPU code is very good and works pretty well.
Looking at the GPU/Cuda code it seems that it is not fully implemented.

Are you planning to continue to work on this library?

python binding error

I found 2 issues ;

  1. in lbp.hpp , #include <opencv2\imgproc\imgproc.hpp> , I am using OS X and it should be #include <opencv2/imgproc/imgproc.hpp>
  2. when run lbp_test.py , the result is
    objc[40469]: Class CaptureDelegate is implemented in both /usr/local/Cellar/opencv/2.4.13/lib/libopencv_highgui.2.4.dylib and /usr/local/lib/libopencv_highgui.2.4.dylib. One of the two will be used. Which one is undefined. Traceback (most recent call last): File "lbp_test.py", line 15, in <module> l.calcLBP(img) File "/Library/Python/2.7/site-packages/lbp.py", line 250, in calcLBP return _lbp.LBP_calcLBP(self, img, radius, borderCopy) TypeError: Array of type 'unsigned byte' required. Array of type 'double' given

Do you happen to know how to fix it ? thanks .

Having trouble building in Visual Studio 2015

Hi there,

firstly, thanks for providing a lib for computing LBP features - there are not that many out there, and I'm still surprised OpenCV doesnt have its own LBP feature extractor.

Still, I'm having trouble building this in Windows via Visual Studio 2015.

After manually solving some dependency problems, I get a "expression must have a constant value" on line 315 of LBP.cpp ( double spoints[samples][2] ) when trying to build. I do know what this means and what a workaround would be (to allocate memory and deallocate after use); however, I'd like to know how you guys got this running without this change. Am I missing something (maybe a very obvious something) ?

Any help would be greatly appreciated.

Cheers!

LBPGPU does not exist

when I try to compile on mac ,

I got

Make Error at CMakeLists.txt:79 (install):
install TARGETS given target "LBPGPU" which does not exist in this
directory.

I check LBPGPU is an option in CMakeLists , Can I compile without LBPGPU ?

hf-lbp on mask image

using python2.7 and opencv 2.4.13 .

image_path ="~/237720229_2.jpg"
image1 = cv2.imread(image_path,cv2.IMREAD_GRAYSCALE)
labelMask = np.zeros(image1.shape[:2], dtype="uint8")
labelMask[0:20,0:20] = 255
l = lbp.LBP(10, lbp.LBP_MAPPING_HF)
l.calcLBP(image1)
hist = l.calcHist(labelMask).getHist()
print hist.shape

I got an error

`OpenCV Error: Assertion failed (mask.size() == imsize && mask.channels() == 1) in histPrepareImages, file /Users/deter3/downloads/opencv-2.4.13/modules/imgproc/src/histogram.cpp, line 161
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/deter3/downloads/opencv-2.4.13/modules/imgproc/src/histogram.cpp:161: error: (-215) mask.size() == imsize && mask.channels() == 1 in function histPrepareImages

Abort trap: 6`

I checked both image and mask shape are the same , both dtype are unit8 .

If i use hist = l.calcHist().getHist() , no problem . But it is histogram for the whole image .

hf-lbp for GPU ubuntu 14.04

I was trying to compile hf-lbp for amazon GPU ubuntu 14.04 opencv 2.4 .

I used "cmake -BUILD_LBPGPU=ON -BUILD_PYTHON=ON .." , and then "make" , got the error as below . I searched a lot how to fix the error "undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5'" , tried couple solution and it did not worked out . I am not c++ guy , so can you please point me to the right direction how to fix the problem .

ubuntu@ip-xx-xx-x-xx:~/LBP/build$ make
Scanning dependencies of target LBP
[ 14%] Building CXX object CMakeFiles/LBP.dir/LBP.cpp.o
Linking CXX shared library libLBP.so
[ 14%] Built target LBP
[ 28%] Building NVCC (Device) object CMakeFiles/LBPGPU.dir//./LBPGPU_generated_LBPGPU.cu.o
Scanning dependencies of target LBPGPU
Linking CXX executable LBPGPU
/usr/bin/ld: CMakeFiles/LBPGPU.dir/./LBPGPU_generated_LBPGPU.cu.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [LBPGPU] Error 1
make[1]: *** [CMakeFiles/LBPGPU.dir/all] Error 2
make: *** [all] Error 2

Unary minus operator applied to unsigned int

Under MSVC, using additional SDL checks raises an unary minus error.

This error is raised as applying -(unsigned int) results into an (unsigned int) instead of an (int).
This is expected behaviour according to MSVC Docs

lbp.hpp problematic line

I would like to confirm why the -v & v operation is done there?

This could simply be resolved by casting to int: -(int)v & v if it doesn't alter the code intended behaviour.

/usr/bin/ld: cannot find -lnppi

Even though my .bashrc has
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64/:$LD_LIBRARY_PATH

it shows
-- Found CUDA: /usr/local/cuda-10.0 (found suitable exact version "10.0") -- Found CUDA: /usr/local/cuda-10.0 (found version "10.0") -- Configuring done -- Generating done -- Build files have been written to: /home/phd/Downloads/LBP-master/build [ 25%] Built target LBP [ 50%] Built target LBPTest [ 75%] Built target LBPMain [ 87%] Linking CXX executable LBPGPU /usr/bin/ld: cannot find -lnppi collect2: error: ld returned 1 exit status CMakeFiles/LBPGPU.dir/build.make:302: recipe for target 'LBPGPU' failed make[2]: *** [LBPGPU] Error 1 CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/LBPGPU.dir/all' failed make[1]: *** [CMakeFiles/LBPGPU.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.