1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Fill detection final, final, final improvements

This commit is contained in:
Paweł Jastrzębski
2013-09-25 11:47:40 +02:00
parent f781b6785c
commit 43638813d7

View File

@@ -407,7 +407,9 @@ class ComicPage:
def getImageHistogram(self, image):
histogram = image.histogram()
RBGW = []
pixelCount = 0
for i in range(256):
pixelCount += histogram[i] + histogram[256 + i] + histogram[512 + i]
RBGW.append(histogram[i] + histogram[256 + i] + histogram[512 + i])
white = 0
black = 0
@@ -415,10 +417,10 @@ class ComicPage:
white += RBGW[i]
for i in range(11):
black += RBGW[i]
if white > black:
return False
else:
if black > white and black > pixelCount*0.5:
return True
else:
return False
def getImageFill(self, isWebToon):
fill = 0