⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 color_histogram.h

📁 人头跟踪算法
💻 H
字号:
#ifndef _COLOR_HISTOGRAM_H_#define _COLOR_HISTOGRAM_H_#include "Image.h"		// Image8#include "outline.h"		// OUTLINE#include "search.h"			// PixelList#define N_BINS_COLOR1		8		// 256 must be divisible by these numbers!!!!#define N_BINS_COLOR2		8		// 256 must be divisible by these numbers!!!!#define N_BINS_COLOR3		4		// 256 must be divisible by these numbers!!!!#define N_BINS_TOT			(N_BINS_COLOR1*N_BINS_COLOR2*N_BINS_COLOR3)#define BINWIDTH_COLOR1		(256/N_BINS_COLOR1)#define BINWIDTH_COLOR2		(256/N_BINS_COLOR2)#define BINWIDTH_COLOR3		(256/N_BINS_COLOR3)#define CH_MODEL_SZ		MAX_OUTLINE_SZ-1typedef struct {	int val[N_BINS_TOT];} ColorHistogram;void ComputeColorHistogramOfWholeImage(Image8 *color1,									   Image8 *color2,									   Image8 *color3,									   ColorHistogram *ch);void ComputeColorHistogram(Image8 *color1,						   Image8 *color2,						   Image8 *color3,						   int xcen,						   int ycen,						   OUTLINE *outline,						   ColorHistogram *ch);void UpdateColorHistogram(Image8 *color1,						  Image8 *color2,						  Image8 *color3,						  int xcen,						  int ycen,						  PixelList *addlist,						  PixelList *sublist,						  ColorHistogram *ch);void UpdateColorHistogramAndIntersection(Image8 *color1,										 Image8 *color2,										 Image8 *color3,										 int xcen,										 int ycen,										 PixelList *addlist,										 PixelList *sublist,										 ColorHistogram *ch_model,										 ColorHistogram *ch_img,										 int *score);int ColorHistogramIntersection(ColorHistogram *ch1,							   ColorHistogram *ch2);void AddColorHistograms(ColorHistogram *ch1, 						ColorHistogram *ch2);void ExtractColorSpace(ImageBGR24 *img, 					   Image8 *img_color1, 					   Image8 *img_color2,					   Image8 *img_color3);void BGRToColorBins(unsigned char b,					unsigned char g,					unsigned char r,					int *col1, 					int *col2, 					int *col3);void QuantizeColorSpace(Image8 *img_color_in1, 						Image8 *img_color_in2,						Image8 *img_color_in3,						Image8 *img_color_out1,						Image8 *img_color_out2,						Image8 *img_color_out3);void NormalizeColorHistogram(ColorHistogram *ch_in, 							 int numerator,							 int denominator,							 ColorHistogram *ch_out);void WriteColorHistogram(char *fname,						 ColorHistogram *ch); void ReadColorHistogram(char *fname,						ColorHistogram *ch);int SizeOfColorHistogram(ColorHistogram *ch);BOOL AreColorHistogramsEqual(ColorHistogram *ch1,							 ColorHistogram *ch2);#endif  // _COLOR_HISTOGRAM_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -