资源简介
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 提取信号包络
- 下一篇:操作系统实验报告-动态存储管理
相关资源
- 自动选择跟踪窗尺度的Mean-Shift 算法
- MPPtrackIref.m
- Charles Elkan的快速k-means算法的代码
- K-均值聚类实现路标检测
- OptiTrack Motive Guide
- Face-tracking.zip
- K-medoids聚类源代码K-means改进
- 关于k-means的一篇好的总结论文
- kmeans图像聚类程序
- Kmeans++算法对图像进行分割
- opencv团块跟踪 blobtracking
-
Efficient Graph-ba
sed Image Segmentation & - 基于SIFT+Kmeans+SVM的场景识别报告
- 多种K-means聚类算法或改进算法包,
- GPStrackingGeneral1009A.slx
- PTZ目标跟踪算法程序
- KMeans GMM
- camshift+kalman+LBP特征目标跟随算法实现
- usernameANDpassword
- 论文研究-水下目标检测与跟踪:GVF
- 煤岩图像边界的K-means识别算法
- 导航猫破解补丁Navicatrack
- 用MapReduce实现KMeans算法
- BT3 各种版本地址 BackTrack_3_Final
- k-means训练
- meanshift算法实现.rar
- imagenet-vgg-m-2048
- 机器学习Kmeans实验报告
- k-means算法用到的数据集
- 自适应布谷鸟搜索的并行K-means聚类算
评论
共有 条评论