《学习opencv》kalman.c详细注释

此代码示例展示了如何应用Kalman滤波器来模拟沿圆形轨迹运动的粒子。初始化滤波器、窗口和随机数生成器,然后进行预测和校正操作,以跟踪粒子的角度和角速度。
摘要由CSDN通过智能技术生成
 

// Example 10-2. Kalman filter sample code
//
//  Use Kalman Filter to model particle in circular trajectory.

//
#include "cv.h"
#include "highgui.h"
#include "cvx_defs.h"

#define phi2xy(mat)                                                  \
  cvPoint( cvRound(img->width/2 + img->width/3*cos(mat->data.fl[0])),\
    cvRound( img->height/2 - img->width/3*sin(mat->data.fl[0])) )

int main(int argc, char** argv) {

    // Initialize, create Kalman Filter object, window, random number
    // generator etc.
    //
    cvNamedWindow( "Kalman", 1 );
    CvRandState rng;
    //typedef struct CvRandState
    //{
    //CvRNG     state;    /* RNG state (the current seed and carry)*/
    //int       disttype; /* distribution type */
    //CvScalar  param[2]; /* parameters of RNG */
    //} CvRandState;
    cvRandInit( &a
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值