I calculate the LBP via this exemplary code:
from skimage import feature
radius_lbp = 1
n_points_lbp = 8
temp = feature.local_binary_pattern(regions_arr_lbp[i,j,:], n_points_lbp, radius_lbp, method='uniform').ravel()
whereby regions_arr_lbp[i,j,:] is a 64x64 numpy array with float64 values.
Now for clarification:
exam_pixel= the pixel we calculate the LBP forneigh_pixel= the neighborhood pixels ofexam_pixel
As far as I understand the LBP, I look at the immediate neighborhood of exam_pixel and compare its intensity with the intensities of its neigh_pixels. When using the method 'uniform', each neigh_pixel whose intensity is greater than exam_pixel's is assigned a 1, and 0 otherwise. This would lead to a theoretical maximum encoded value of 8 for exam_pixel if each pixel in neigh_pixel has a higher intensity.
However, when I run the code above, I get a maximum encoded value of 9 in my temp array multiple times. How is that possible? Have I misunderstood the LBP and how it works?