资源简介
粒子滤波使用源代码
VC++ opencv
代码片段和文件信息
/*
mex -f mexopts_intel10amd.bat -output ellipse.dll ellipse.c
mex -f mexopts_intelP4.bat ellipse.c
Author : S閎astien PARIS
m = [130 135; 260 270];
e = [20 15; 20 10; 0 3];
[x y] = ellipse(m e);
plot(x y);
*/
#include
#include “mex.h“
#define PI 3.14159265358979323846
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
void ellipse(double * double * int
double * double *
int
double * double *);
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
void mexFunction( int nlhs mxArray *plhs[] int nrhs const mxArray *prhs[] )
{
double *m *e;
int N;
double *x *y;
double *cos_angle *sin_angle;
int *dimsm *dimse;
int *dimsx;
int i d slice = 1 numdimsm numdimse numdimsx;
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/* -------------------------- Parse INPUT -------------------------------------- */
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
if(nrhs < 2)
{
mexErrMsgTxt(“At least 2 inputs argument are required for ellipse“);
}
/* ----- Input 1 ----- */
m = mxGetPr(prhs[0]);
numdimsm = mxGetNumberOfDimensions(prhs[0]);
dimsm = mxGetDimensions(prhs[0]);
if ( (dimsm[0] != 2) )
{
mexErrMsgTxt(“m must be at least(d x s1 x .... x sp) d >= 2“);
}
d = dimsm[0];
for (i = 1 ; i < numdimsm ; i++)
{
slice *= dimsm[i];
}
/* ----- Input 2 ----- */
e = mxGetPr(prhs[1]);
numdimse = mxGetNumberOfDimensions(prhs[1]);
dimse = mxGetDimensions(prhs[1]);
if ( (dimse[0] != 3) )
{
mexErrMsgTxt(“e must be (d x s1 x .... x sp)“);
}
/* ----- Input 5 ----- */
if(nrhs < 3)
{
N = 50;
}
else
{
N = (int) mxGetScalar(prhs[2]);
}
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/* -------------------------- Parse OUTPUT ------------------------------------- */
/*-----------------------------------------------------------------------------
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 15585792 2004-02-21 22:00 SECOND.AVI
文件 6567 2007-12-11 15:16 ellipse.c
文件 69632 2007-12-11 15:17 ellipse.dll
文件 1580 2009-05-18 17:03 license.txt
文件 4598 2007-12-12 12:45 part_moment.c
文件 53248 2007-12-12 12:45 part_moment.dll
文件 5277 2007-12-11 15:26 particle_resampling.c
文件 61440 2007-12-11 15:18 particle_resampling.dll
文件 13693 2007-12-11 15:22 pdfcolor_ellipserand.c
文件 77824 2007-12-11 15:15 pdfcolor_ellipserand.dll
文件 3959 2007-12-11 15:33 rgb2hsv_mex.c
文件 49152 2007-12-11 15:31 rgb2hsv_mex.dll
文件 9144 2007-12-11 15:39 test_pf_colortracker.m
评论
共有 条评论