Exemple #1
0
import sys
from image import Image
import argparse

#parsing arguments
parser = argparse.ArgumentParser()
parser.add_argument("--filename")
parser.add_argument("--parameter1", default=5)  #todo:
arguments = parser.parse_args()

image = Image(arguments.filename)
image.load()
image.detect_axis()
image.ocr_labels()
image.analyze_legend()
image.crop()
image.find_pixels()
image.remove_border_lines()
image.remove_labels_lines()
image.draw()
image.group_pixels()
image.detect_lines()
image.change_axis()
image.scale_pixels()
image.write_data_to_file()
image.create_ps()
Exemple #2
0
__author__ = 'grzegorz'

from image import Image
import sys

if __name__ == "__main__":  #main function
    if (len(sys.argv) < 2):  #todo 1
        print "Filename not specified!"
        sys.exit(1)

    path = sys.argv[1]

    im = Image(path)
    im.import_image()
    im.axis_detection()
    im.ocr_labels()  #todo: labels function in class
    im.crop_image()
    im.find_points()
    im.remove_lines()
    im.remove_labels_lines()
    im.change_axis()
    im.scale_points()
    im.round_points()

    im.split_plots()

    im.write_data_to_file()
    im.create_ps()

    sys.exit(0)