mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 19:26:14 +02:00
Porting code with 2to3 with some manual changes. The pillow modules is now required https://github.com/python-imaging/Pillow/
This commit is contained in:
parent
f629773772
commit
b3a4bdaf4b
10 changed files with 54 additions and 53 deletions
|
@ -43,15 +43,15 @@ def steganalyse(img):
|
|||
colours[r] += 1
|
||||
|
||||
most_common = colours.most_common(10)
|
||||
dict_colours = OrderedDict(sorted(colours.items(), key=lambda t: t[1]))
|
||||
dict_colours = OrderedDict(sorted(list(colours.items()), key=lambda t: t[1]))
|
||||
|
||||
colours = 0
|
||||
for colour in dict_colours.keys():
|
||||
for colour in list(dict_colours.keys()):
|
||||
colours += colour
|
||||
colours = colours / len(dict_colours)
|
||||
|
||||
#return colours.most_common(10)
|
||||
return dict_colours.keys()[:30], most_common
|
||||
return list(dict_colours.keys())[:30], most_common
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Point of entry in execution mode.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue