资源简介
http://blog.csdn.net/luckydongbin/article/details/1534192

代码片段和文件信息
//colourModel.cpp - the colourModel object
//Iain Wallace 16/08/05
//Modified by xdb 2007-03-19
#include “stdafx.h“
#include “colourModel.h“
#include
#include
//using namespace cimg_library;
using namespace std;
colourModel::colourModel()
{
//model must be initialised to 0
memset( m_model ‘\0‘ sizeof(m_model) );
//Se we can tell if the memory‘s been allocated
binsInit = false;
}
colourModel::~colourModel()
{
//Free the bins memory if it‘s assigned.
if (binsInit)
{
if( bins != NULL )
{
for (unsigned int i=0; i< mX_dim; i++)
{
if( bins[i] != NULL )
delete[] bins[i];
}
delete[] bins;
}
bins = NULL;
binsInit = false;
memset( m_model ‘\0‘ sizeof(m_model) );
}
}
double colourModel::operator[](unsigned int bin)
{
//Use GTE as index is from 0
if (bin >= NUMBINS)
{
cerr << “ERROR! Tried to access a model bin that doesn‘t exit!“ << endl;
return 0;
}
return m_model[bin];
}
unsigned int colourModel::findBin(unsigned char Runsigned char Gunsigned char B)
{
//return the bin number of a pixel according to its RGB value.
//Note that the constants defined in the header file and this function
//control the only real tuning of the tracker.
//scale the colours
unsigned int rgb;
r = (unsigned int)floor( (float)(R/BINSIZE) );
g = (unsigned int)floor( (float)(G/BINSIZE) );
b = (unsigned int)floor( (float)(B/BINSIZE) );
//If for example the blue channel is not to be used then change for:
//b = 0;
return (r + BPC*g + BPC*BPC*b);
}
void colourModel::clearModel()
{
memset( m_model ‘\0‘ sizeof(m_model) );
}
//This performs the function described by eqn(2) and eqn(4) (effectively the same)
//It saves the bin that each pixel is allocated too as this prevents it being
//re-calculated when the weights are updated.
//void colourModel::updateModel(cimg_library::CImg* image //The image in question
// unsigned int centreX //X co-ord of centre
// unsigned int centreY //Y co-ord of centre
// int half_x //half the x-size of the window
// int half_y //half the y-size of the window
// double*** kArray) //the kernel
//{
// clearModel();
// //first time this is called create bins with the size of the window
// //NOTE: more cunning memory management would be required for reszizing windows!
// if (!binsInit)
// {
// cout << “Allocating a bin allocation table“ << endl;
// //allocate the memory
// mX_dim = 2*half_x+1;
// mY_dim = 2*half_y+1;
// bins = new unsigned int*[mX_dim];
// for (unsigned int i=0;i // bins[i] = new unsigned int[mY_dim];
// binsInit = true;
// }
// for (int x = -half_x;x <= half_x;++x)
// {
// for (int y = -half_y;y <= half_y;++y)
// {
// //update the bin allocation table at the same time
// int iX = centreX + x;
// int iY = centreY + y;
// bins[x+half_x][y+half_y] = findBin((*image)(iXi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1190403 2007-03-08 15:09 mean\CImg.h
文件 6409 2007-03-21 20:32 mean\colourModel.cpp
文件 2364 2007-03-20 10:17 mean\colourModel.h
文件 10516 2007-03-21 20:25 mean\MsTracker.cpp
文件 1508 2007-03-22 16:10 mean\MsTracker.h
文件 662 2008-04-06 21:27 mean\Rademe.txt
目录 0 2007-04-28 20:25 mean
----------- --------- ---------- ----- ----
1211862 7
- 上一篇:Labview 提取信号包络
- 下一篇:操作系统实验报告-动态存储管理
相关资源
- 画图程序MFC/VC/VC CRectTracker 串行化
- 红帽 OpenShift 的业务价值
- Orientation-resolved 3d5/2 energy shift of Rh
- Photoluminescence and photoabsorbance blue shi
- Coordination-resolved 4f binding energy shift
- Spectroscopic Study on Cu2+-induced Abnormally
- Tracking and Kalman Filtering Made Easy
- 基于k-means聚类的财务欺诈类型分类
- K-means算法论文
- 基于meanshift和粒子滤波的目标跟踪代
- 基于Kmean聚类的关键帧提取代码
- windows下magic mouse2和magic trackpad2的驱动
- PCA-KDKM算法及其在微博舆情中的应用
- Adaptive Back-Stepping Sliding Mode Attitude T
- 1种新的散乱点云快速去噪算法
- 改进的k_均值聚类排挤小生境遗传算法
- Kmeans算法为各国体育水平分类
-
翻译:ob
ject Tracking: A Survey,物体跟 - 基于opencv的手势识别程序,亲测可用
- 多目标假设跟踪MHt.doc
- opengl 读取与显示obj文件
- httptrack 整站抓取工具
- LBG算法K-means
- 灰度图像的中值滤波算法verilog实现
- 基于kmeans算法的图像颜色量化
- K-Means++ 算法
- VIVETrackerChanger_1.0.zip
- ISODATA及K-means聚类算法
- FFmpeg解码MP4分别播放YUV视频和PCM音频
- meanshift均值漂移目标跟踪
评论
共有 条评论