'**DESCRIPTION**
This method uses the snakes / active contour approach in an attempt to
fit a series of points to a line that may or may not be exactly linear.
**PARAMETERS**
* *guesses* - A set of lines that we wish to fit to. The lines are specified
as a list of tuples of (x,y) tuples. E.g. [((x0,y0),(x1,y1))....]
* *window* - The search window in pixels for the active contours approach.
* *samples* - The number of points to sample along the input line,
these are the initial conditions for active contours method.
* *params* - the alpha, beta, and gamma values for the active contours routine.
**RETURNS**
A list of fitted contour points. Each contour is a list of (x,y) tuples.
**EXAMPLE**
>>> img = Image("lsq.png")
>>> guesses = [((313,150),(312,332)),((62,172),(252,52)),((102,372),(182,182)),((372,62),(572,162)),((542,362),(462,182)),((232,412),(462,423))]
>>> r = img.fitLinePoints(guesses)
>>> for rr in r:
>>>    img.drawLine(rr[0],rr[1],color=Color.RED,width=3)
>>> for g in guesses:
>>>    img.drawLine(g[0],g[1],color=Color.YELLOW)
>>> img.show()'

def fitLinePoints(self, guesses, window=(11, 11), samples=20, params=(0.1, 0.1, 0.1)):

    pts = []
    for g in guesses:
        bestGuess = []
        dx = float((g[1][0] - g[0][0]))
        dy = float((g[1][1] - g[0][1]))
        l = np.sqrt(((dx * dx) + (dy * dy)))
        if (l <= 0):
            logger.warning("Can't    Do    snakeFitPoints    without    OpenCV    >=    2.3.0")
            return
        dx = (dx / l)
        dy = (dy / l)
        for i in range((-1), (samples + 1)):
            t = (i * (l / samples))
            bestGuess.append((int((g[0][0] + (t * dx))), int((g[0][1] + (t * dy)))))
        appx = self.fitContour(bestGuess, window=window, params=params, doAppx=False)
        pts.append(appx)
    return pts
