Freeman449s / Computer-Vision-Course

课程“计算机视觉”的代码仓库,利用OpenCV完成了直线与圆弧检测、Harris角点检测、EigenFace等工程。
GNU Lesser General Public License v2.1
4 stars 4 forks source link

圆弧检测 #4

Closed yingma111 closed 2 years ago

yingma111 commented 2 years ago
def isOnArc(p: tuple, center: tuple, tanMat: np.ndarray, T: float) -> bool:
    """
    验证给定点p是否是以center为中心的圆上的点\n
    :param p:
    :param center:
    :param tanMat:
    :param T:
    :return:
    """
    px = p[0]
    py = p[1]
    cx = center[0]
    cy = center[1]
    tan = tanMat[py][px]
    C = py - tan * px
    dist = abs(tan * cx - cy + C) / math.sqrt(1 + tan * tan)
    return dist < T

请问, dist = abs(tan cx - cy + C) / math.sqrt(1 + tan tan),能解释一下意义吗?