Welcome![Sign In][Sign Up]
Location:
Search - void Canny(LPBYTE Gray

Search list

[Windows Developreply_1_855734

Description: // 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
Platform: | Size: 54272 | Author: 王学金 | Hits:

CodeBus www.codebus.net