0
I’m trying to write a code that detects lines and calculates an angle within a binary image (not necessarily this one, but always a similar spray). I read a few things about Hough Transform and even Scalar Product, but I can’t apply them.
For now I have this code only:
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
img_grey = cv2.imread('sprayang.jpg', cv2.IMREAD_GRAYSCALE)
img = cv2.GaussianBlur (img_grey, (5,5), 0)
th = 0
max_val = 255
ret, o1 = cv2.threshold(img, th, max_val, cv2.THRESH_BINARY + cv2.THRESH_OTSU )
Using the Imagej angle tool, in this image, I read 90°.
what is the doubt?
– Flavio Moraes
Precise, in python, to detect an opening angle in an image (a spray, like the one in the example) and calculate it.
– Vinicius Carreira
Imagej angle tool does not serve?
– Flavio Moraes
Yes, Flavio. But I would like to create something to detect and calculate the angle without the need to create the manual stitches to identify the lines. Basically open the file, run and result in °.
– Vinicius Carreira