I have detected a lane boundary line which is not straight using hough transform and then extracted that line separately. Then blended with another image that has a straight line. Now I need to calculate the angle between those two lines, but I do not know the coordinates of those lines. So I tried with code that gives the coordinates of vertical lines, but it can not specifically identify those coordinates. Is there a way to measure the angle between those lines? Here is my coordinate calculation code and blended image with two lines
import cv2 as cv
import numpy as npsrc = cv.imread("blended2.png", cv.IMREAD_COLOR)if len(src.shape) != 2:gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
else:gray = srcgray = cv.bitwise_not(gray)
bw = cv.adaptiveThreshold(gray, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY, 15, -2)horizontal = np.copy(bw)
vertical = np.copy(bw)cols = horizontal.shape[1]
horizontal_size = int(cols / 30)horizontalStructure = cv.getStructuringElement(cv.MORPH_RECT, (horizontal_size, 1))
horizontal = cv.erode(horizontal, horizontalStructure)
horizontal = cv.dilate(horizontal, horizontalStructure)cv.imwrite("img_horizontal8.png", horizontal)h_transpose = np.transpose(np.nonzero(horizontal))
print("h_transpose")
print(h_transpose[:100])rows = vertical.shape[0]
verticalsize = int(rows / 30)
verticalStructure = cv.getStructuringElement(cv.MORPH_RECT, (1, verticalsize))
vertical = cv.erode(vertical, verticalStructure)
vertical = cv.dilate(vertical, verticalStructure)cv.imwrite("img_vertical8.png", vertical)v_transpose = np.transpose(np.nonzero(vertical))print("v_transpose")
print(v_transpose[:100])img = src.copy()# edges = cv.Canny(vertical,50,150,apertureSize = 3)
minLineLength = 100
maxLineGap = 200
lines = cv.HoughLinesP(vertical,1,np.pi/180,100,minLineLength,maxLineGap)
for line in lines:for x1,y1,x2,y2 in line:cv.line(img,(x1,y1),(x2,y2),(0,255,0),2)cv.imshow('houghlinesP_vert', img)
cv.waitKey(0)