开始使用免费开始使用

更少的角点

在本练习中,您将测试当将角点峰之间的最小距离设置为更大的数值时会发生什么。请记住,您可以通过 corner_peaks() 函数的 min_distance 参数来实现。threshold_rel 参数用于指定峰值的最小强度。

从下往上看的建筑物
图像已预加载为 building_image

函数 show_image()show_image_with_corners() 以及所需的包都已为您预加载。用于查找角点的先前代码也已就绪。通过 corner_harris() 得到的 Harris 响应图像已预加载为 measure_image

本练习是课程的一部分

Python 图像处理

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Find the peaks with a min distance of 10 pixels
coords_w_min_10 = ____(measure_image, min_distance=____, threshold_rel=0.02)
print("With a min_distance set to 10, we detect a total", len(coords_w_min_10), "corners in the image.")
编辑并运行代码