Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
GravityTrack.cpp
Package: Video_detection.rar [view]
Upload User: smdfuse
Upload Date: 2015-11-06
Package Size: 98k
Code Size: 1k
Category:
Graph program
Development Platform:
Visual C++
- #include "StdAfx.h"
- #include "GravityTrack.h"
- /******************************************************/
- /* 函数名称:
- /* GravityTrack
- /*
- /* 函数参数:
- /* unsigned char* sGray-输入灰度图像
- /* int sWidth-图像宽度
- /* int sHeight-图像高度
- /* int sThreshold-目标域值
- /*
- /* 说明:
- /* 形心法目标跟踪程序
- /*******************************************************/
- /*WININFO GravityTrack (unsigned char* sGray, int sWidth, int sHeight, int sThreshold)
- {
- WININFO win;
- win.w = 0;
- win.h = 0;
- win.pt.x = 0;
- win.pt.y = 0;
- win.flag = FALSE;
- int M00bh = 0;
- int M01bh = 0;
- int M10bh = 0;
- int iLine,i,j;
- for(j=EDGE_SPACE;j<sHeight-EDGE_SPACE;j++)
- {
- iLine = 0;
- for(i=EDGE_SPACE;i<sWidth-EDGE_SPACE;i++)
- {
- int k = sWidth*j+i;
- if(sGray[k]>sThreshold)
- {
- iLine++;
- M01bh+=i;
- M10bh+=j;
- }
- }
- M00bh+=iLine;
- if(win.w<iLine) win.w = iLine;
- if(iLine>0) win.h++;
- }
- //if(M00bh>10)
- //{
- win.pt.x = int(M01bh/M00bh+0.5);
- win.pt.y = int(M10bh/M00bh+0.5);
- win.w = win.w/2+EDGE_DRAW;
- win.h = win.h/2+EDGE_DRAW;
- //win.flag = TRUE;
- //}
- return win;
- }
- */