Samuel Schmidt commited on
Commit
6fd7226
·
1 Parent(s): 42232fd

more logging

Browse files
Files changed (1) hide show
  1. src/LBP.py +5 -0
src/LBP.py CHANGED
@@ -19,6 +19,11 @@ class LBPImageEncoder:
19
  img_arr = np.array(image)
20
  print(img_arr.shape)
21
  gray_img = image.convert('L')
 
 
 
 
 
22
  print(gray_img)
23
  lbp = feature.local_binary_pattern(gray_img, self.numPoints, self.radius, method="uniform")
24
  (hist, _) = np.histogram(lbp.ravel(), bins=np.arange(0, self.numPoints + 3), range=(0, self.numPoints + 2))
 
19
  img_arr = np.array(image)
20
  print(img_arr.shape)
21
  gray_img = image.convert('L')
22
+ if gray_img.size == 0:
23
+ print("Error: Input image is empty.")
24
+ gray_img_arr = np.array(gray_img)
25
+ print(gray_img_arr.shape)
26
+ print(gray_img)
27
  print(gray_img)
28
  lbp = feature.local_binary_pattern(gray_img, self.numPoints, self.radius, method="uniform")
29
  (hist, _) = np.histogram(lbp.ravel(), bins=np.arange(0, self.numPoints + 3), range=(0, self.numPoints + 2))