Exemplo n.º 1
0
def convert_to_pairs(image, height, width, column_factor, row_factor):
    left_column = int(width*column_factor)
    right_column = width - left_column
    bottom_row = int(height*row_factor)
    top_row = height - bottom_row
    left_column_intersections = im.fast_check_column(left_column, image, bottom_row, top_row)
    right_column_intersections = im.fast_check_column(right_column, image, bottom_row, top_row)
    bottom_row_intersections = im.fast_check_row(bottom_row, image,  left_column, right_column)
    top_row_intersections = im.fast_check_row(top_row, image,  left_column, right_column)
    return (left_column_intersections, bottom_row_intersections, right_column_intersections, top_row_intersections)
Exemplo n.º 2
0
def convert_to_pairs(image, height, width, column_factor, row_factor):
    left_column = int(width * column_factor)
    right_column = width - left_column
    bottom_row = int(height * row_factor)
    top_row = height - bottom_row
    left_column_intersections = im.fast_check_column(left_column, image,
                                                     bottom_row, top_row)
    right_column_intersections = im.fast_check_column(right_column, image,
                                                      bottom_row, top_row)
    bottom_row_intersections = im.fast_check_row(bottom_row, image,
                                                 left_column, right_column)
    top_row_intersections = im.fast_check_row(top_row, image, left_column,
                                              right_column)
    return (left_column_intersections, bottom_row_intersections,
            right_column_intersections, top_row_intersections)
Exemplo n.º 3
0
import Image_2
import time

for i in range(0,30):
    start = time.time()
    im = Image_2.load_image()
    c1 = Image_2.fast_check_column(5,im)
    c2 = Image_2.fast_check_column(10,im)
    r1 = Image_2.fast_check_row(5,im)
    r2 = Image_2.fast_check_row(10,im)
    end = time.time()
    print end-start
Exemplo n.º 4
0
import Image_2
import time

for i in range(0, 30):
    start = time.time()
    im = Image_2.load_image()
    c1 = Image_2.fast_check_column(5, im)
    c2 = Image_2.fast_check_column(10, im)
    r1 = Image_2.fast_check_row(5, im)
    r2 = Image_2.fast_check_row(10, im)
    end = time.time()
    print end - start