资源简介
66409758bill-recognition.rar

代码片段和文件信息
#include “stdafx.h“
#include
#include
#include
#include
#include
#include “feature.h“
#include “calHSB.h“
typedef struct
{
unsigned char red;
unsigned char green;
unsigned char blue;
} rgb_color;
typedef struct
{
int hue;
int saturat;
int bright;
} hsb_color;
int *Gauss;
#define Pi 3.1415926
#define SUM_WIDTH 10
#define DIST_DELTA 15
#define A 3
#define COUNTERR 200
void CalGauss(int *data int length)
{
int i;
double result x;
for(i=-length; i<=length; i++){
x = (double)i;
result = 1.0/(A*sqrt(2.0*3.1415926));
result *= (exp(-x*x/(2.0*A*A)));
result *= 1000;
data[i] = (int)(result);
}
}
void rgb2hsb( rgb_color *pRgb hsb_color *pHsb )
{
double x y r angle;
int max = 0;
int min = 255;
if( pRgb->red < min ) min = pRgb->red;
if( pRgb->green < min ) min = pRgb->green;
if( pRgb->blue < min ) min = pRgb->blue;
if( pRgb->red > max ) max = pRgb->red;
if( pRgb->green > max ) max = pRgb->green;
if( pRgb->blue > max ) max = pRgb->blue;
if(max == 0){
pHsb->hue = 0;
pHsb->saturat = 0;
pHsb->bright = 0;
return;
}
x = pRgb->red - 0.5000 * (pRgb->green + pRgb->blue );
y = 0.8660254037844 *( pRgb->green - pRgb->blue );
if((r = sqrt(x*x + y*y)) <= 0.01){
pHsb->hue = -1;
pHsb->saturat = ((max -min)*100/max);
pHsb->bright = (int) ((max + 1 )*100/ 256);
return;
}else{
angle = asin(fabs(y)/r);
}
if( x >= 0.0 ){
if( y >= 0.0) angle = angle;
else angle = 2*Pi - angle;
}else{
if( y >= 0.0) angle = Pi - angle;
else angle = Pi + angle;
}
pHsb->hue = (int) (angle * 180 / Pi);
pHsb->saturat = (int) ((max -min)*100/max);
pHsb->bright = (int) ((max + 1 )*100/ 256);
return;
}
void CalHSB2(unsigned char *ImagePtr[] int height int width
FeatureSetHeader *FSH)
{
unsigned char * pBuf;
hsb_color Hsb ;
rgb_color Rgb ;
int i j count row col;
int s e sum max1 max1index max2 max2index;
int HistOnHue[360];
int HistVolut[360];
int HistVolut1[360];
int SatTh = 10 tempindex;
// Init Hue Histogram of Hue
for( i = 0; i < 360; i++) HistOnHue[i] = 0;
//calculate Gauss
Gauss = (int *)malloc((2*SUM_WIDTH+1)*sizeof(int));
Gauss += SUM_WIDTH;
CalGauss(Gauss SUM_WIDTH);
// Form Saturate Threshold.
// Form Saturate Threshold.
for( row = 0; row < height; row++ ){
pBuf = ImagePtr[row];
for( col = 0; col < width; col++ ){
Rgb.blue = *pBuf++;
Rgb.green = *pBuf++;
Rgb.red = *pBuf++;
rgb2hsb( &Rgb &Hsb );
if(Hsb.saturat > SatTh && Hsb.bright > 20)
HistOnHue[Hsb.hue]++;
}
}
/* Calculate the s e sum and convolution*/
s = 360 - SUM_WIDTH; e = SUM_WIDTH;
sum = 0;
for( s = 360 - SUM_WIDTH count = 0; count<360 ;s++ count++){
sum = 0;
for( i = -SUM_WIDTH j = s ; i <=SUM_WIDTH; i++ j++){
sum += HistOnHue[j%360]*Ga
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 33199 1998-06-21 10:53 bill recognition\AA.CPP
文件 33265 1998-06-25 17:18 bill recognition\ADJUST.CPP
文件 119 1998-05-28 20:39 bill recognition\ADJUST.H
文件 26539 1998-06-21 10:52 bill recognition\ADJUST2.CPP
文件 24421 1998-06-21 10:52 bill recognition\ADJUST3.CPP
文件 4031 1998-05-15 16:32 bill recognition\calHSB.cpp
文件 93 1998-05-15 16:32 bill recognition\calHSB.h
文件 15462 1998-06-20 23:07 bill recognition\DIBAPI.CPP
文件 1726 1998-06-16 16:08 bill recognition\DIBAPI.H
文件 5019 1998-06-18 09:30 bill recognition\DIBDOC.CPP
文件 1464 1998-04-20 11:24 bill recognition\DIBDOC.H
文件 766 1998-06-08 12:15 bill recognition\DIBDOC.ICO
文件 5317 1998-05-15 16:22 bill recognition\diblook.001
文件 4257 1998-05-14 14:22 bill recognition\DIBLOOK.CPP
文件 5354 2008-07-03 21:49 bill recognition\diblook.dsp
文件 539 2008-07-03 21:38 bill recognition\DIBLOOK.DSW
文件 192584 2008-07-03 21:50 bill recognition\diblook.exe
文件 1215 1998-04-20 16:20 bill recognition\DIBLOOK.H
文件 766 1998-06-08 12:15 bill recognition\DIBLOOK.ICO
文件 28560 1998-04-20 11:24 bill recognition\DIBLOOK.MAK
文件 238592 2009-11-11 06:11 bill recognition\DIBLOOK.ncb
文件 56832 2009-11-11 06:11 bill recognition\DIBLOOK.OPT
文件 2395 2009-11-08 16:56 bill recognition\diblook.plg
文件 17586 1998-06-08 12:15 bill recognition\DibLook.rc
文件 19020 2008-07-08 16:36 bill recognition\DIBVIEW.CPP
文件 2006 1998-05-15 17:59 bill recognition\DIBVIEW.H
文件 971 1998-06-24 15:09 bill recognition\Feature.h
文件 12 1998-05-14 14:35 bill recognition\FET.CPP
文件 24697 1998-06-21 10:52 bill recognition\fetprocess.cpp
文件 2483 1998-05-15 18:29 bill recognition\InputDialog.cpp
............此处省略147个文件信息
- 上一篇:AltiumDesigner中文帮助手册.pdf
- 下一篇:恒润CCP讲解PPT
相关资源
-
开机速度优化工具Startup Dela
yer3.0中 - tomcat 8.0 32位 绿色版
- 四路抢答器
- SolidWorks-100多个
- delphi源码-检测是否运行了多个程序
- 希捷硬盘套件助系统构建商把握Vist
- 可以在XE下使用的DosCommand,捕获控制
- 如何使用VC和OD调试OCX控件
- 计算机三级-网络技术-第4大题题库-共
- 雷柏v700s机械键盘驱动 v1.0.0.1 官方版
- weui手机商城模板在线
- BMA250手册word和PDF(博文配到资源)
- Delphi时钟助手源码,定时关机、提醒
- Cisco无线AP全部配置文件(AIR-1200系列
- 安卓手机PC端一键重启工具
- ManualIciMapping_v3.1
- 集客9341固件ap
- 遍历USB设备,获取USB序列号
- delphi源码-实现软件注册机
- Microservices_Designing_Deploying
-
Design for em
bedded Image Processing on FPG - GNU/Linux系统开发者需要从桌面突破
- Concurrency in Go(EarlyRelease) 无水印p
- cfx中ccl语言使用手册
- 单元测试一条龙1.50final
- 金丰300T级进冲床电气控制原理图1
- DSP实验(10次实验有详细步骤)
- HP Compaq 8200 Elite 系列商用台式机
- 2019年软考高级下半年信息系统项目管
- Assembly Language for x86 Processors (7th Ed
评论
共有 条评论