scripts/detection_util.py
def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap):
  """
  `img` should be the output of a Canny transform.
  Note: This function has been modified to return just the raw line-segments identified while applying Hough transform.
  """
  lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap)
  filtered_lines = list(filter(lambda l: l.is_candidate, map(lambda line: Line(*line[0]), lines)))
  if filtered_lines is not None:
    return filtered_lines
  else:
    return None

  `img` should be the output of a Canny transform.
  Note: This function has been modified to return just the raw line-segments identified while applying Hough transform.
  
`img` should be the output of a Canny transform.
Note: This function has been modified to return just the raw line-segments identified while applying Hough transform.
` img ` should be the output of a Canny transform . Note : This function has been modified to return just the raw line - segments identified while applying Hough transform .
def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap):
  lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap)
  filtered_lines = list(filter(lambda l: l.is_candidate, map(lambda line: Line(*line[0]), lines)))
  if filtered_lines is not None:
    return filtered_lines
  else:
    return None
def hough_lines ( img , rho , theta , threshold , min_line_len , max_line_gap ) : lines = cv2 . HoughLinesP ( img , rho , theta , threshold , np . array ( [ ] ) , minLineLength = min_line_len , maxLineGap = max_line_gap ) filtered_lines = list ( filter ( lambda l : l . is_candidate , map ( lambda line : Line ( * line [ 0 ] ) , lines ) ) ) if filtered_lines is not None : return filtered_lines else : return None
`img` should be the output of a Canny transform.
` img ` should be the output of a Canny transform .
"""
  `img` should be the output of a Canny transform.
  Note: This function has been modified to return just the raw line-segments identified while applying Hough transform.
  """
img
rho
theta
threshold
min_line_len
max_line_gap