import cv2
import numpy as np
import matplotlib.pyplot as plt
frame = cv2.imread('inference_results/001.png')
height, weigth = frame.shape[0], frame.shape[1]
print(height,weigth)
last_mes = current_mes = np.array((0,height//2),np.float32) # 保存当前中心点,可替换为船舶检测出来的中心点坐标格式为[[x][y]]
last_pre = current_pre = np.array((0,height//2),np.float32) # 保存预测[[x][y][x误差][y误差]]
def mousemove(event, x,y,s,p):
# x和y需要自己抛出来,中心点左边的x,y
global frame, current_mes, last_mes<
卡尔曼滤波追踪——鼠标轨迹预测
鼠标追踪与卡尔曼滤波:实时船舶位置估计
最新推荐文章于 2025-11-07 07:30:00 发布
该博客介绍了如何使用OpenCV实现鼠标交互,结合卡尔曼滤波算法对图像中船舶位置进行连续预测和跟踪。通过鼠标点击获取实时位置,然后应用滤波器处理误差,展示预测轨迹与实际轨迹。

最低0.47元/天 解锁文章
878

被折叠的 条评论
为什么被折叠?



