def calculatehistogram(self, image, eps=1e-7):
lbp = feature.local_binary_pattern(image, self.numberOfPoints, self.radius, method="uniform")
(histogram, _) = np.histogram(lbp.ravel(),
bins=np.arange(0, self.numberOfPoints + 3),
range=(0, self.numberOfPoints + 2))
#now we need to normalise the histogram so that the total sum=1
histogram = histogram.astype("float")
histogram /= (histogram.sum() + eps)
return histogram
training.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录