i have these two images :
and i should use ransak algorithm to find line parameters of them and draw the best line on them.
here is an implementation of ransak algorithm:
the algorithm's first step is to select random data from original data, how can i use image as input?
答案 0 :(得分:1)
仅需查找图像中所有非零的点即可。使用numpy.where
查找所有非零的坐标。
(y, x) = np.where(img)
img
是图像,假设它是灰度的。 y
是行位置,x
是列位置。您将使用它们来输入帖子中看到的代码。