CNTK/GeneralizedHoughTransform/generalized_ht.py
def accumulate_gradients(r_table, grayImage):
    '''
    Perform a General Hough Transform with the given image and R-table
    '''
    edges = canny(grayImage, low_threshold=MIN_CANNY_THRESHOLD,
                  high_threshold=MAX_CANNY_THRESHOLD)


    plt.matshow(edges)
    plt.show()

    gradient = gradient_orientation(edges)

    accumulator = np.zeros(grayImage.shape)
    for (i,j),value in np.ndenumerate(edges):
        if value:
            for r in r_table[gradient[i,j]]:
                accum_i, accum_j = i+r[0], j+r[1]
                if accum_i < accumulator.shape[0] and accum_j < accumulator.shape[1]:
                    accumulator[accum_i, accum_j] += 1

    return accumulator

    Perform a General Hough Transform with the given image and R-table
    
Perform a General Hough Transform with the given image and R-table
Perform a General Hough Transform with the given image and R - table
def accumulate_gradients(r_table, grayImage):
    edges = canny(grayImage, low_threshold=MIN_CANNY_THRESHOLD,
                  high_threshold=MAX_CANNY_THRESHOLD)
    plt.matshow(edges)
    plt.show()
    gradient = gradient_orientation(edges)
    accumulator = np.zeros(grayImage.shape)
    for (i,j),value in np.ndenumerate(edges):
        if value:
            for r in r_table[gradient[i,j]]:
                accum_i, accum_j = i+r[0], j+r[1]
                if accum_i < accumulator.shape[0] and accum_j < accumulator.shape[1]:
                    accumulator[accum_i, accum_j] += 1
    return accumulator
def accumulate_gradients ( r_table , grayImage ) : edges = canny ( grayImage , low_threshold = MIN_CANNY_THRESHOLD , high_threshold = MAX_CANNY_THRESHOLD ) plt . matshow ( edges ) plt . show ( ) gradient = gradient_orientation ( edges ) accumulator = np . zeros ( grayImage . shape ) for ( i , j ) , value in np . ndenumerate ( edges ) : if value : for r in r_table [ gradient [ i , j ] ] : accum_i , accum_j = i + r [ 0 ] , j + r [ 1 ] if accum_i < accumulator . shape [ 0 ] and accum_j < accumulator . shape [ 1 ] : accumulator [ accum_i , accum_j ] += 1 return accumulator
Perform a General Hough Transform with the given image and R-table
Perform a General Hough Transform with the given image and R - table
'''
    Perform a General Hough Transform with the given image and R-table
    '''
r_table
grayImage