示例#1
0
def kernel_size():
    """High Pass Filter Additive image fusion compatible kernel size.
    Based on a random ratio float ranging in (1.0, 10.0).
    Returns a single integer"""
    rr = random_ratio()
    ks = [k for ((lo, hi), k) in MATRIX_PROPERTIES if lo <= rr < hi]
    return ks[0]
    # 2nd pass requested?
    if ratio_random < 6 and second_pass:
        print "Second Pass Requested:", second_pass
    center_cell_level_2 = random.choice(CENTER_CELL.keys())

    # inform
    print "Center cell level 2:", center_cell_level_2


print
print "--- -- User Independent Variables - ---"
print

# Ratio ------------------------------------------------------------------
ratio_random = random_ratio()
print "Ratio (Random):", ratio_random

# Kernel size ------------------------------------------------------------
kernel_size = kernel_size()
print "Kernel Size: ", kernel_size

# idx
kernel_index = KERNEL_SIZES.index(kernel_size)
print "(Index to retrieve center cell value: ", kernel_index, ")"

print
print "--- --- - Simulate User Input - --- ---"
print

# Center Cell ------------------------------------------------------------
    # 2nd pass requested?
    if ratio_random < 6 and second_pass:
        print "Second Pass Requested:", second_pass
    center_cell_level_2 = random.choice(CENTER_CELL.keys())

    # inform
    print "Center cell level 2:", center_cell_level_2


print
print "--- -- User Independent Variables - ---"
print

# Ratio ------------------------------------------------------------------
ratio_random = random_ratio()
print "Ratio (Random):", ratio_random


# Kernel size ------------------------------------------------------------
kernel_size = kernel_size()
print "Kernel Size: ", kernel_size

# idx
kernel_index = KERNEL_SIZES.index(kernel_size)
print "(Index to retrieve center cell value: ", kernel_index, ")"

print
print "--- --- - Simulate User Input - --- ---"
print