I was able to find this link: Calculating the angle between two lines in an image in Python which I then only took the code part that allows to calculate the angle:
import numpy as np
from skimage.transform import (hough_line, hough_line_peaks, probabilistic_hough_line)
from pylab import imread, gray, mean
import matplotlib.pyplot as plt
image = imread('D:\\Pictures\\PyTestPics\\oo.tiff')
image = np.mean(image, axis=2)
h, theta, d = hough_line(image)
angle = []
dist = []
for _, a, d in zip(*hough_line_peaks(h, theta, d)):
angle.append(a)
dist.append(d)
angle = [a*180/np.pi for a in angle]
angle_reel = np.max(angle) - np.min(angle)
print(angle_reel)
can anyone please explain me the code of the for loop and the angle_reel? because I couldn't understand how are there multiple angles and those multiple angles are formed between what line and what other object inside the image? It would be really appreciated.