python Shi-Tomasi角点检测源代码

import cv2 as cv
import matplotlib.pyplot as plt

# 1读取图像
img = cv.imread('./image/tv.jpg')
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
# 2角点检测
corners = cv.goodFeaturesToTrack(gray, 1000, 0.01, 10)
# 3绘制角点
for i in corners:
    x, y = i.ravel()
    cv.circle(img, (x, y), 2, (0, 0, 255), -1)
# 4图像展示
plt.rc("font", family='Microsoft YaHei')
plt.figure(figsize=(10, 8), dpi=100)
plt.imshow(img[:, :, ::-1]), plt.title('shi-tomasi角点检测')
plt.xticks(), plt.yticks()
plt.show()
图片[1]-python Shi-Tomasi角点检测源代码-给我网盘资源
THE END
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码

    暂无评论内容