用canny算子提取边缘,核心:用高斯滤波器平滑图像;一阶偏导的有限差分计算梯度的幅值和方向;非极大值抑制;双阈值算法检测和连接边缘。- 下载
|
// 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 下载
|
用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象-with Canny operator to detect the edges in the image P0404 : image thresholding segmentation P0405 : water line threshold method image segmentation P0406 : matrix Quadtree P0407 : images into text and non-text of the two categories P0408 : morphological gradient detection Binary Image Edge P0409 : morphology example -- Images from the PCB to delete all current lines, retaining only chip targets 下载
|
用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象-with Canny operator to detect the edges in the image P0404 : image thresholding segmentation P0405 : water line threshold method image segmentation P0406 : matrix Quadtree P0407 : images into text and non-text of the two categories P0408 : morphological gradient detection Binary Image Edge P0409 : morphology example -- Images from the PCB to delete all current lines, retaining only chip targets 下载
|
用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象-with Canny operator to detect the edges in the image P0404 : image thresholding segmentation P0405 : water line threshold method image segmentation P0406 : matrix Quadtree P0407 : images into text and non-text of the two categories P0408 : morphological gradient detection Binary Image Edge P0409 : morphology example -- Images from the PCB to delete all current lines, retaining only chip targets 下载
|
MATLAB源码,P0401:用Prewitt算子检测图像的边缘 P0402:用不同σ值的LoG算子检测图像的边缘 P0403:用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象- 下载
|
程序代码说明 P0401:用Prewitt算子检测图像的边缘 P0402:用不同σ值的LoG算子检测图像的边缘 P0403:用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象- Procedure code explanation P0401: Examines the picture with the Prewitt operator the edge P0402: Examines the picture with the different sigma value LoG operator the edge P0403: Examines the picture with the Canny operator the edge P0404: Picture threshold value division P0405: Divides the picture with the water line threshold value law P0406: Carries on to the matrix four forks the tree decomposition P0407: Divides into the writing and the non- writing two categories the picture P0408: The morphology gradient examines two values pictures the edge P0409: The morphology example 鈻♀枴deletes all electricity streamline from the PCB picture, only retains the chip object 下载
|
程序代码说明 P0401:用Prewitt算子检测图像的边缘 P0402:用不同σ值的LoG算子检测图像的边缘 P0403:用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象 -code P0401 Note : Prewitt operator to detect the edges in the image P0402 : different values of Getting operator to detect the edges in the image P0403 : Canny operator to detect the edges in the image P0404 : image thresholding segmentation P0405 : water line threshold method image segmentation P0406 : matrix Quadtree P0407 : images into text and non-text of the two categories P0408 : morphological gradient detection Binary Image Edge P0409 : morphology example -- Images from the PCB to remove all current lines, retaining only chip targets 下载
|
程序代码说明 P0401:用Prewitt算子检测图像的边缘 P0402:用不同σ值的LoG算子检测图像的边缘 P0403:用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象 -code P0401 Note : Prewitt operator to detect the edges in the image P0402 : different values of Getting operator to detect the edges in the image P0403 : Canny operator to detect the edges in the image P0404 : image thresholding segmentation P0405 : water line threshold method image segmentation P0406 : matrix Quadtree P0407 : images into text and non-text of the two categories P0408 : morphological gradient detection Binary Image Edge P0409 : morphology example -- Images from the PCB to remove all current lines, retaining only chip targets 下载
|
程序代码说明 P0401:用Prewitt算子检测图像的边缘 P0402:用不同σ值的LoG算子检测图像的边缘 P0403:用Canny算子检测图像的边缘 P0404:图像的阈值分割 P0405:用水线阈值法分割图像 P0406:对矩阵进行四叉树分解 P0407:将图像分为文字和非文字的两个类别 P0408:形态学梯度检测二值图像的边缘 P0409:形态学实例——从PCB图像中删除所有电流线,仅保留芯片对象 - Procedure code explanation P0401: Examines the picture with the Prewitt operator the edge P0402: Examines the picture with the different sigma value LoG operator the edge P0403: Examines the picture with the Canny operator the edge P0404: Picture threshold value division P0405: Divides the picture with the water line threshold value law P0406: Carries on to the matrix four forks the tree decomposition P0407: Divides into the writing and the non- writing two categories the picture P0408: The morphology gradient examines two values pictures the edge P0409: The morphology example 鈻♀枴deletes all electricity streamline from the PCB picture, only retai 下载
|