【发布时间】:2021-03-02 07:05:18
【问题描述】:
我正在尝试编写代码来查找二进制处理后的喷嘴喷射角度(图像)。我读了一些关于霍夫变换的东西来做到这一点,但我无法正确应用。 (Calculating the angle between two lines in an image in Python 和 How to find angle of hough lines detected?)
有一段时间我有这个:
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 )
使用 ImageJ 中的角度测量工具,我测量了大约 90°。
【问题讨论】: