def compute_join_score(im, px, py, thick=2):
    tt = linspace(0, 1, 50)
    dpx = polyder(px)
    dpy = polyder(py)
    dL2 = (polymul(dpx, dpx) + polymul(dpy, dpy))
    ux = polyval(px, tt)
    uy = polyval(py, tt)
    dx = diff(ux)
    dy = diff(uy)
    dx = r_[(dx[0], dx)]
    dy = r_[(dy[0], dy)]
    dL = sqrt(((dx ** 2) + (dy ** 2)))
    a = _compute_intensity(im, ux, uy)
    b = _compute_intensity(im, (ux + ((thick * dy) / dL)), (uy - ((thick * dx) / dL)))
    c = _compute_intensity(im, (ux - ((thick * dy) / dL)), (uy + ((thick * dx) / dL)))
    return ((((2 * a) - b) - c) / 4.0)
def compute_join_score(im, px, py, thick=2):
    tt = linspace(0, 1, 50)
    dpx = polyder(px)
    dpy = polyder(py)
    dL2 = (polymul(dpx, dpx) + polymul(dpy, dpy))
    ux = polyval(px, tt)
    uy = polyval(py, tt)
    dx = diff(ux)
    dy = diff(uy)
    dx = r_[(dx[0], dx)]
    dy = r_[(dy[0], dy)]
    dL = sqrt(((dx ** 2) + (dy ** 2)))
    a = _compute_intensity(im, ux, uy)
    b = _compute_intensity(im, (ux + ((thick * dy) / dL)), (uy - ((thick * dx) / dL)))
    c = _compute_intensity(im, (ux - ((thick * dy) / dL)), (uy + ((thick * dx) / dL)))
    return ((((2 * a) - b) - c) / 4.0)