text: """
  HoughLinesP() is the improvement of the HoughLines
  One more flexibility of this HoughLinesP() is that it will give us the x1, y1, x2 and y2 co-ordinates, rather than calculating each one individually as HoughLines()
  """
  
  import cv2
  import numpy as np
  
  img = cv2.imread('sudoku.png')
  gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  edges = cv2.Canny(gray_img, threshold1=50, threshold2=150, apertureSize=3)
  cv2.imshow("edges of the image", edges)
  lines = cv2.HoughLinesP(edges, rho=1, theta=np.pi/180, threshold=100, minLineLength=10, maxLineGap=0.5)  # Vary the parameters an check for the correct and accurate result
  """
  @param definitions:
  All the other parameters are same, the new ones are explained below:
  minLineLength = Minimum length of the line(as a LineSegment). Line segments shorter than these are rejected
  maxLineGap = Maximum allowed gap between the lines to treat them as single line.
  """
  
  for line in lines:
  	x1, y1, x2, y2 = line[0]
  	cv2.line(img, (x1, y1), (x2, y2), (0, 0, 255), 2)
  
  cv2.imshow("Final Image", img)
  cv2.waitKey()
  cv2.destroyAllWindows()