mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
Update steganalysis functions.
This commit is contained in:
parent
d3d03c2f74
commit
0d1c5cc4c1
4 changed files with 18 additions and 38 deletions
|
@ -50,19 +50,3 @@ def steganalyse(img):
|
|||
b = 255
|
||||
encoded.putpixel((col, row), (r, g , b))
|
||||
return encoded
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Point of entry in execution mode.
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser()
|
||||
parser.add_option("-i", "--input", dest="input_image_file",
|
||||
help="Image file")
|
||||
parser.add_option("-o", "--output", dest="output_image_file",
|
||||
help="Image file")
|
||||
parser.set_defaults(input_image_file = './pictures/Lenna.png',
|
||||
output_image_file = './pictures/Lenna_steganalysed.png')
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
input_image_file = Image.open(options.input_image_file)
|
||||
output_image = steganalyse(input_image_file)
|
||||
output_image.save(options.output_image_file)
|
||||
|
|
|
@ -55,16 +55,14 @@ def steganalyse(img):
|
|||
|
||||
if __name__ == '__main__':
|
||||
# Point of entry in execution mode.
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser()
|
||||
parser.add_option("-i", "--input", dest="input_image_file",
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(prog='steganalysis-statistics')
|
||||
parser.add_argument("-i", "--input", dest="input_image_file",
|
||||
help="Image file.")
|
||||
parser.add_option("-o", "--output", dest="output_image_file",
|
||||
parser.add_argument("-o", "--output", dest="output_image_file",
|
||||
help="Image file.")
|
||||
parser.set_defaults(input_image_file = './pictures/Lenna.png',
|
||||
output_image_file = './pictures/Lenna_steganalysed.png')
|
||||
(options, args) = parser.parse_args()
|
||||
arguments = parser.parse_args()
|
||||
|
||||
input_image_file = Image.open(options.input_image_file)
|
||||
input_image_file = Image.open(arguments.input_image_file)
|
||||
output_image = steganalyse(input_image_file)
|
||||
soutput_image.save(options.output_image_file)
|
||||
soutput_image.save(arguments.output_image_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue