📄 stdafx.h
字号:
#include <iostream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
/* plot points */
//color = CV_RGB(255,255,255)
#define draw_cross( center, color, d ) \
cvLine( img, cvPoint( center.x - d, center.y - d ), \
cvPoint( center.x + d, center.y + d ), color, 1, 0 ); \
cvLine( img, cvPoint( center.x + d, center.y - d ), \
cvPoint( center.x - d, center.y + d ), color, 1, 0 )
#define draw_plus( img, center, color, d ) \
cvLine( img, cvPoint( center.x - d, center.y ), \
cvPoint( center.x + d, center.y ), color, 1, 0 ); \
cvLine( img, cvPoint( center.x , center.y - d ), \
cvPoint( center.x , center.y + d ), color, 1, 0 )
#define calc_point(angle) \
cvPoint( cvRound(img->width/2 + img->width/3*cos(angle)), \
cvRound(img->height/2 - img->width/3*sin(angle)))
//int ShelteredFrameNum = 0;
//int UnshelteredFrameNum = 0;
//给定位置point和大小area,在特定图像*pimage中画矩形
IplImage* rectangle_drawing(IplImage* pimage, CvPoint point, CvSize area);
//计算8位灰度图像的颜色直方图
CvHistogram* hist_calculation(IplImage* pimage, CvHistogram* hist, int histnum, float* histranges);
//画颜色直方图
IplImage* histogram_drawing(CvHistogram* hist, IplImage* histimage, int histnum);
//从灰度图像中得到目标小图像
IplImage* patchimage_getting(IplImage* pimage, IplImage* dstimage, CvPoint point, CvSize area);
//从彩色图像中得到目标小图像
IplImage* color_patchimage_getting( IplImage* pFrame, IplImage* dstimage, CvPoint point, CvSize area);
//得到彩色直方图向量
CvMat* CalcColorHist(IplImage* pImage, CvMat* ColorHistMat);
//计算Bhattacharyya距离
float bhattacharyya(CvHistogram* hist1, CvHistogram* hist2, int histnum);
//计算彩色图像三通道颜色直方图的bhattacharyya距离
float bhattacharyya_color(CvMat* ModelColorHistMat, CvMat* ColorHistMat);
//权值计算,未进行归一化
void CondProbDens(CvConDensation* CD, float* Measurement, float exptect_dist);
void ConDensWeightsCalculation(CvConDensation* CD, float bt, float exrtect_dist);
//粒子滤波主过程,输出估计结果
CvPoint PF_result(IplImage* pGrey, CvConDensation* CD, CvPoint state_prediction, \
float vx, float vy, CvMat* ModelColorHistMat, CvSize area, \
int steps, CvRandState rng, int* shelter);
//颜色模板更新
void ColorModelUpdate(CvMat* ModelColorHistMat, CvMat* PredictionstateColorHistMat);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -