Appending local binary pattern of image (having 200 channels) taken over 3 channels at a time
I am unable to append the local binary patterns of image having 200 channels taking 3 channels at a time. hsi_data is my image,img_lbp is local binary pattern of my image hsi_data taking 3 channels at a time. I want to append all the local binary patterns taken over 3 channels to img_lbp_appended. Please refer to my code attached. Can anyone tell me my mistake. ..
for k in range(0,199,3):
if k==198:
break
else:
image_file = hsi_data[:,:,k:k+3]
img_bgr = image_file
height, width, channel = img_bgr.shape
img_gray = cv2.cvtColor(img_bgr,cv2.COLOR_BGR2GRAY)
img_lbp = np.zeros((height, width,3), np.uint8)
for i in range(0, height):
for j in range(0, width):
img_lbp[i, j] = lbp_calculated_pixel(img_gray, i, j)
img_lbp_appended=np.zeros((height, width,200),np.uint8)
img_lbp_appended=np.append(img_lbp_appended,img_lbp,axis=2)
..
where's the problem ? error msg ?
I am getting the img_lbp_appended as numpy array with zero values.
what is the intent behind:
? why 200 channels (your lbp image only has 1 ?) ? why is it repeated for each image triplet ?. (it probably should go before anything else)
I have used a code which is available in github which works for image of 3 channels. My intention is to append all the LBPs to get the LBP of my image that is having 200 channels.