In an image, one can detect the lines using HoughLinesP method in open-cv using the following code:
HoughLinesP
import numpy as np import cv2 import scipy.nd