//****************************************************************************
// Copyright 2003, 2004, 2005, by Xin Fan
// Thanks for the acknowledgements in research publications based on the codes.
// Usage of the codes for Commercial purpose is PROHIBITED.
//
//Institute of signal and image processing
//School of information engineering
//Dalian Maritime University, China
//http://sipi.dlmu.edu.cn
//
// Author: Xin Fan
// The codes were accomplished when the author was pursuing PHD degree in
// Xi'an Jiaotong University, China
//Reference:
// [1] S. Arulampalam and S. Maskell and N. Gordon and T. Clapp,"A Tutorial on Particle Filters for On-line
// Non-linear/Non-Gaussian Bayesian Tracking",IEEE Transactions On Signal Processing, Vol. 50(2),
// pages 174-188, February 2002.
// [2] Jun S. Liu and Rong Chen, "Sequential {Monte Carlo} Methods for Dynamic Systems",
// Journal of the American Statistical Association, Vol. 93, No. 443, pp.1032--1044, 1998
// [3] Gordon, N., Salmond, D., and Smith, A. ." Novel approach to nonlinear/non-Gaussian
// Bayesian state estimation". IEE Proc. F, 140, 2, 107-113.
// [4]P. P谷rez, A. Blake, and M. Gangnet. JetStream: Probabilistic contour extraction with particles.
// Proc. Int. Conf. on Computer Vision (ICCV), II:524-531, 2001.
// The sourcecode is partly based on Intel OpenCV
//
***************************************CParticle class*******************************************************
The class "CParticle" is an ABSTRACT class for particle filter. Derived classes from "CParticle" are required
to perform particle filtering in various applications, but the filtering can be achieved by calling the SAME
function as follows:
void * cvrParticleIteration(CParticle *cvrParticle, int nStep)
{
//Predict...
cvrParticle->UpdateByTime(nStep);
//Update weights
cvrParticle->EvalWeight(nStep);
//if Estimation performed
return (cvrParticle->GetState(nStep));
}
NOTE:
1. "UpdateByTime", "EvalWeight", and "GetState" are virtual functions that make it viable for
access overloaded functions of derived classes through the pointer to the base class "CParticle".
2. The virtual functions should be overloaded based on applications, which are
illustrated in CJetStream as an example.
3. The returned pointer should be allocated when implementing the virtual function "GetState".
***********************************************************************************************************
********************************CJetstream Class **********************************************************
The class "CJetStream" is a class for implementing JetStream algorithm. The following sample gives how to
perform JetStream algorithm and draw the extracted contour in an image.
//Specify parameters
//Dimension of contour(2-D)
const int point_dim = 2;
const int sample_num = 100;
const int step_num = 20;
const int dyn_order = 2;
/////////////////////////////
//convert input to 1-channel image
IplImage *src = cvrConvertChannel(m_pOrigImg->GetImage(), CV_BGR2GRAY);
/////////////////////////////
//Initializing JetStream
CJetStream *pJet = new CJetStream(point_dim, sample_num, step_num);
CJetInit CvrJetStartPt(dyn_order);
for (int i = 0; i < dyn_order; i++)
{
CvrJetStartPt.SetPoints((long*)(m_pPoints + i), i);
}
//Prepare Image Data for Jetstream
CJetImgData CvrJetData;
cvrJetInitData(src, &CvrJetData);
cvrJetInitPara(&CvrJetPara, &CvrJetData);
pJet->Initialize(&CvrJetPara, &CvrJetData, &CvrJetStartPt);
//////////////////////////////////////////////////////////
//JetStream iteration
for (int i = 2; i < step_num; i ++)
{
cvrParticleIteration(pJet, i);
//Act as resampling, but all the previous states will be updated
//Need to discuss more...
pJet->Selection(i);
pJet->EstState(i);
cvrProbContour(src, pJet,, i);
}
cvrProbContour(src, pJet, step_num - 1);
////////////////////////////////////////////////////
//Convert to the image format which can be displayed
cvrConvertImage(src, m_pResImg->GetImage());
cvReleaseImage( &src );
NOTE:
The functions with the prefix "cvr" are defined in "ProbContour.cpp"
condensation(PF)
4星 · 超过85%的资源 需积分: 3 95 浏览量
2008-04-14
12:43:32
上传
评论 1
收藏 20KB RAR 举报
zhaoxm2007
- 粉丝: 1
- 资源: 4
最新资源
- 基于Matlab人脸肤色定理的教师人数统计+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab霍夫曼变换的表盘读数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab火灾烟雾检测源码带GUI界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的恶劣天气交通标志识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的霍夫曼变换的表盘示数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的车道线识别系统 +源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB 的霍夫曼变换答题卡识别源码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab+bp神经网络的神经网络汉字识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈