CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - void Canny(LPBYTE Gray
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - void Canny(LPBYTE Gray - List
[
Windows Develop
]
reply_1_855734
DL : 0
// Canny算子 void Canny(LPBYTE pGray, SIZE sz, double sigma, double dRatLow, double dRatHigh, LPBYTE pResult) { //经过高斯滤波后的图像 LPBYTE pGaussSmooth pGaussSmooth = new unsigned char[sz.cx*sz.cy] //x方向导数的指针 int *pGradX pGradX = new int[sz.cx*sz.cy] //y方向 int *pGradY pGradY = new int[sz.cx*sz.cy] //梯度的幅度 int *pGradMag pGradMag = new int[sz.cx*sz.cy] //对原图高斯滤波 GaussianSmooth(sz,pGray,pGaussSmooth,sigma) //计算方向导数和梯度的幅度 Grad(sz,pGaussSmooth,pGradX,pGradY,pGradMag) //应用非最大抑制 NonmaxSuppress(pGradMag,pGradX,pGradY,sz,pResult) //应用Hysteresis,找到所有边界 Hysteresis(pGradMag,sz,dRatLow,dRatHigh,pResult) delete[] pGradX pGradX = NULL delete[] pGradY pGradY = NULL -//Canny operator void Canny (LPBYTE pGray. SIZE sz, double sigma, double dRatLow. double dRatHigh. LPBYTE pResult) (//after Gaussian filtering of images LPBYTE pGaussS mooth unsigned pGaussSmooth = new char [sz.cx* sz.cy]// x direction derivative indicators pGradX pGradX int* = new int [ sz.cx* sz.cy]// int* y direction pGradY pGradY = new int [sz.cx* sz.cy]// gradient magnitude int* pGradMag pGradMag = new int [sz.cx* sz.cy]// maximum Gaussian filter to GaussianSmo oth (sz, pGray, pGaussSmooth. sigma)// calculate derivative and the gradient range Grad (sz. pGaussSmooth, pGradX, pGradY. pGradMag)// non-application of the biggest inhibition NonmaxSuppress (pGradMa g, pGradX, pGradY, sz, pResult)// Application Hysteresis, find all border Hysteresis (pGradMag, sz, dRa
Date
: 2025-07-01
Size
: 53kb
User
:
王学金
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.