有人对网格交点的算法实现有想法吗?

问题描述 投票:0回答:1

我正在寻找检测网格打击图像中线条的交点。 关于哪种算法最有效有什么想法吗?它可能只是伪代码,但我想了解最新技术,以便最大限度地减少故障。

谢谢

GT

python algorithm opencv image-processing computer-vision
1个回答
-1
投票

请问您使用什么编程语言来处理矩阵交点? 如果您使用 Matlab,可以查看此链接 https://www.mathworks.com/matlabcentral/answers/51239-matrices-and-line-intersection 但在 Python 中我们有 Numpy 库。

致以诚挚的问候!

示例:

import numpy as np
import matplotlib.pyplot as plt

a = np.random.randint(low=0, high=2, size=(5, 5))
b = np.random.randint(low=0, high=2, size=(5, 5))

 print(a)
  [[1 0 1 1 0]
  [1 0 0 1 0]
  [1 0 1 1 0]
  [1 0 1 0 1]
  [0 1 0 0 0]]

 print(b)
  [[0 0 1 1 0]
  [0 0 0 0 0]
  [1 0 0 1 1]
  [0 0 1 1 0]
  [0 1 0 0 0]] 
© www.soinside.com 2019 - 2024. All rights reserved.