cv.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Physical-Image-Manipulation-Program 作者: philipptrenz 项目源码 文件源码
def circles_per_radius(hough_radii, hough_res, number_circles_per_radius=16):
    """
    Rates found circles by intensity of peaks inside the Hough matrix. 
    Chooses the best circles for each radius
    Returns: Selected circle centers with their quality and radius      
    """
    centers = []
    accums = []
    radii = []

    # for each radius and hough peak image
    # zip([32,33,34,35,36],[(32, hough_peaks_img),(33, hough_peaks_img),(34, hough_peaks_img), ... ])
    for radius, h in zip(hough_radii, hough_res): # iterieren durch circles (h)

        # sort peaks, which represent the quality of circles by intensity
        peaks = peak_local_max(h, num_peaks=number_circles_per_radius)
        centers.extend(peaks)
        accums.extend(h[peaks[:, 0], peaks[:, 1]])
        # iterate through every (y,x) in peaks and get corresponding color value from h, which represents quality value of circle (?)
        # so acuums represents quality
        radii.extend([radius] * number_circles_per_radius)
        #

    return (centers, accums, radii)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号