当前位置: 首页 > news >正文

自学网站开发流程婺源网站建制作

自学网站开发流程,婺源网站建制作,wordpress 百度搜索,58同城东莞招聘网最新招聘欢迎关注 『youcans 的 OpenCV 例程 200 篇』 系列#xff0c;持续更新中 欢迎关注 『youcans 的 OpenCV学习课』 系列#xff0c;持续更新中 【youcans 的 OpenCV 例程200篇】150. 边缘检测梯度算子 2. 点、线和边缘检测 本节基于图像灰度的不连续性#xff0c;讨论根据灰… 欢迎关注 『youcans 的 OpenCV 例程 200 篇』 系列持续更新中 欢迎关注 『youcans 的 OpenCV学习课』 系列持续更新中 【youcans 的 OpenCV 例程200篇】150. 边缘检测梯度算子 2. 点、线和边缘检测 本节基于图像灰度的不连续性讨论根据灰度的突变检测边界以此为基础进行图像分割。 边缘像素是图像中灰度突变的像素而边缘是相连边缘像素的集合。线是一条细边缘线段其两侧的背景灰度与线段的像素灰度存在显著差异。孤立的点是一个被背景像素围绕的前景像素或一个被前景像素围绕的背景像素。 导数可以用来检测灰度的局部突变 一阶导数通常产生粗边缘二阶导数对精细细节如细线、孤立点和噪声的响应更强二阶导数在灰度斜坡和台阶过渡处会产生双边缘响应即二阶导数在进入和离开边缘时的符号相反二阶导数的符号可用于确定边缘的过渡是从亮到暗还是从暗到亮。 计算图像中每个像素位置的一阶导数和二阶导数的方法是空间卷积。对一个 3*3 模板计算模板区域内灰度值与模板系数的卷积。 2.4 边缘检测的常用梯度算子 边缘检测的基本方法通常是基于一阶导数和二阶导数的因此需要进行图像的梯度计算。图像的梯度可以用一阶导数和二阶偏导数来求解。 以矩阵形式表达的数字图像 f任意位置 (x,y) 的梯度 ∇f\nabla f∇f 定义为向量 ∇fgrad(f)[gxgy][∂f/∂x∂f/∂x]\nabla f grad(f) \begin{bmatrix} g_x \\ g_y \end{bmatrix} \begin{bmatrix} \partial f /\partial x \\ \partial f /\partial x \end{bmatrix} ∇fgrad(f)[gx​gy​​][∂f/∂x∂f/∂x​] 梯度算子的前向差分公式为 gx(x,y)∂f(x,y)∂xf(x1,y)−f(x,y)gy(x,y)∂f(x,y)∂yf(x,y1)−f(x,y)g_x(x,y) \dfrac{\partial f(x,y)}{\partial x} f(x1,y) - f(x,y) \\ g_y(x,y) \dfrac{\partial f(x,y)}{\partial y} f(x,y1) - f(x,y) \\ gx​(x,y)∂x∂f(x,y)​f(x1,y)−f(x,y)gy​(x,y)∂y∂f(x,y)​f(x,y1)−f(x,y) 梯度向量的幅度 M 和角度 α\alphaα 为 M(x,y)∣∣∇f∣∣gx2gy2α(x,y)arctan[gy/gx]M(x,y) ||\nabla f|| \sqrt {g_x^2 g_y^2} \\ \alpha (x,y) arctan[g_y / g_x] M(x,y)∣∣∇f∣∣gx2​gy2​​α(x,y)arctan[gy​/gx​] 在实际编程中为了减少计算量常用绝对值来近似梯度幅度 M(x,y)≈∣gx∣∣gy∣M(x,y) \approx |g_x| |g_y| M(x,y)≈∣gx​∣∣gy​∣ 根据梯度算子的定义和基本公式可以发展多种不同的计算算法称为梯度算子。对于图像的梯度计算通常采用模板卷积核对原图像进行卷积运算来实现。 Robert 梯度算子 简单的交叉差分算法利用局部差分算子寻找边缘采用对角线相邻两像素差作为梯度值检测边缘。形式简单计算速度快但对噪声敏感无法抑制噪声。 Prewitt 算子 利用两个方向模板与图像进行邻域卷积一个方向模板检测水平边缘另一个检测垂直边缘。能够抑制噪声但对边缘的定位较 Roberts 算子差。 Sobel 算子 是高斯平滑和微分求导的联合运算抗噪声能力强。考虑了距离对权值的影响距离越远的像素的影响越小。可以通过快速卷积实现简单有效应用广泛。 Isotropic Sobel 算子 权值反比于中心距具有各向同性沿不同方向检测边缘时梯度幅度一致。 Scharr 算子 是 Sobel 算子在 ksize3 时的优化在平滑部分中心元素占的权重更大相当于使用更瘦高的平滑模板。与 Sobel 的速度相同精度更高。 Lapacian 算子 二阶微分算子具有各向同向性与坐标轴无关无法检测方向。对噪声非常敏感可以先进行阈值处理或平滑处理。 这些基本的一阶、二阶微分算子如 Robert、Sobel、Prewitt、Laplacian 等本质上都可以用于检测边缘也被称为边缘检测算子。进一步地考虑边缘和噪声的性质可以改进边缘检测算子如 Marr-Hildreth 算子、Canny 算子。 例程 11.4边缘检测梯度算子 # 11.4 边缘检测的梯度算子 (Roberts 算子, Prewitt 算子, Sobel 算子, Laplacian 算子)img cv2.imread(../images/Fig1016a.tif, flags0) # 读取为灰度图像# 自定义卷积核# Roberts 边缘算子kernel_Roberts_x np.array([[1, 0], [0, -1]])kernel_Roberts_y np.array([[0, -1], [1, 0]])# Prewitt 边缘算子kernel_Prewitt_x np.array([[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]])kernel_Prewitt_y np.array([[1, 1, 1], [0, 0, 0], [-1, -1, -1]])# Sobel 边缘算子kernel_Sobel_x np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]])kernel_Sobel_y np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]])# Laplacian 边缘算子kernel_Laplacian_K1 np.array([[0, 1, 0], [1, -4, 1], [0, 1, 0]])kernel_Laplacian_K2 np.array([[1, 1, 1], [1, -8, 1], [1, 1, 1]])# 卷积运算imgBlur cv2.blur(img, (3,3)) # Blur 平滑后再做 Laplacian 变换imgLaplacian_K1 cv2.filter2D(imgBlur, -1, kernel_Laplacian_K1)imgLaplacian_K2 cv2.filter2D(imgBlur, -1, kernel_Laplacian_K2)imgRoberts_x cv2.filter2D(img, -1, kernel_Roberts_x)imgRoberts_y cv2.filter2D(img, -1, kernel_Roberts_y)imgRoberts np.uint8(cv2.normalize(abs(imgRoberts_x) abs(imgRoberts_y), None, 0, 255, cv2.NORM_MINMAX))imgPrewitt_x cv2.filter2D(img, -1, kernel_Prewitt_x)imgPrewitt_y cv2.filter2D(img, -1, kernel_Prewitt_y)imgPrewitt np.uint8(cv2.normalize(abs(imgPrewitt_x) abs(imgPrewitt_y), None, 0, 255, cv2.NORM_MINMAX))imgSobel_x cv2.filter2D(img, -1, kernel_Sobel_x)imgSobel_y cv2.filter2D(img, -1, kernel_Sobel_y)imgSobel np.uint8(cv2.normalize(abs(imgSobel_x) abs(imgSobel_y), None, 0, 255, cv2.NORM_MINMAX))plt.figure(figsize(12, 8))plt.subplot(341), plt.title(Origin), plt.imshow(img, cmapgray), plt.axis(off)plt.subplot(345), plt.title(Laplacian_K1), plt.imshow(imgLaplacian_K1, cmapgray), plt.axis(off)plt.subplot(349), plt.title(Laplacian_K2), plt.imshow(imgLaplacian_K2, cmapgray), plt.axis(off)plt.subplot(342), plt.title(Roberts), plt.imshow(imgRoberts, cmapgray), plt.axis(off)plt.subplot(346), plt.title(Roberts_X), plt.imshow(imgRoberts_x, cmapgray), plt.axis(off)plt.subplot(3,4,10), plt.title(Roberts_Y), plt.imshow(imgRoberts_y, cmapgray), plt.axis(off)plt.subplot(343), plt.title(Prewitt), plt.imshow(imgPrewitt, cmapgray), plt.axis(off)plt.subplot(347), plt.title(Prewitt_X), plt.imshow(imgPrewitt_x, cmapgray), plt.axis(off)plt.subplot(3,4,11), plt.title(Prewitt_Y), plt.imshow(imgPrewitt_y, cmapgray), plt.axis(off)plt.subplot(344), plt.title(Sobel), plt.imshow(imgSobel, cmapgray), plt.axis(off)plt.subplot(348), plt.title(Sobel_X), plt.imshow(imgSobel_x, cmapgray), plt.axis(off)plt.subplot(3,4,12), plt.title(Sobel_Y), plt.imshow(imgSobel_y, cmapgray), plt.axis(off)plt.tight_layout()plt.show()本节完 版权声明 youcansxupt 原创作品转载必须标注原文链接(https://blog.csdn.net/youcans/article/details/124073181) Copyright 2022 youcans, XUPT Crated2022-4-10 欢迎关注 『youcans 的 OpenCV 例程 200 篇』 系列持续更新中 欢迎关注 『youcans 的 OpenCV学习课』 系列持续更新中 【youcans 的 OpenCV 例程200篇】01. 图像的读取cv2.imread 【youcans 的 OpenCV 例程200篇】02. 图像的保存cv2.imwrite 【youcans 的 OpenCV 例程200篇】03. 图像的显示cv2.imshow 【youcans 的 OpenCV 例程200篇】04. 用 matplotlib 显示图像plt.imshow 【youcans 的 OpenCV 例程200篇】05. 图像的属性np.shape 【youcans 的 OpenCV 例程200篇】06. 像素的编辑img.itemset 【youcans 的 OpenCV 例程200篇】07. 图像的创建np.zeros 【youcans 的 OpenCV 例程200篇】08. 图像的复制np.copy 【youcans 的 OpenCV 例程200篇】09. 图像的裁剪cv2.selectROI 【youcans 的 OpenCV 例程200篇】10. 图像的拼接np.hstack 【youcans 的 OpenCV 例程200篇】11. 图像通道的拆分cv2.split 【youcans 的 OpenCV 例程200篇】12. 图像通道的合并cv2.merge 【youcans 的 OpenCV 例程200篇】13. 图像的加法运算cv2.add 【youcans 的 OpenCV 例程200篇】14. 图像与标量相加cv2.add 【youcans 的 OpenCV 例程200篇】15. 图像的加权加法cv2.addWeight 【youcans 的 OpenCV 例程200篇】16. 不同尺寸的图像加法 【youcans 的 OpenCV 例程200篇】17. 两张图像的渐变切换 【youcans 的 OpenCV 例程200篇】18. 图像的掩模加法 【youcans 的 OpenCV 例程200篇】19. 图像的圆形遮罩 【youcans 的 OpenCV 例程200篇】20. 图像的按位运算 【youcans 的 OpenCV 例程200篇】21. 图像的叠加 【youcans 的 OpenCV 例程200篇】22. 图像添加非中文文字 【youcans 的 OpenCV 例程200篇】23. 图像添加中文文字 【youcans 的 OpenCV 例程200篇】24. 图像的仿射变换 【youcans 的 OpenCV 例程200篇】25. 图像的平移 【youcans 的 OpenCV 例程200篇】26. 图像的旋转以原点为中心 【youcans 的 OpenCV 例程200篇】27. 图像的旋转以任意点为中心 【youcans 的 OpenCV 例程200篇】28. 图像的旋转直角旋转 【youcans 的 OpenCV 例程200篇】29. 图像的翻转cv2.flip 【youcans 的 OpenCV 例程200篇】30. 图像的缩放cv2.resize 【youcans 的 OpenCV 例程200篇】31. 图像金字塔cv2.pyrDown 【youcans 的 OpenCV 例程200篇】32. 图像的扭变错切 【youcans 的 OpenCV 例程200篇】33. 图像的复合变换 【youcans 的 OpenCV 例程200篇】34. 图像的投影变换 【youcans 的 OpenCV 例程200篇】35. 图像的投影变换边界填充 【youcans 的 OpenCV 例程200篇】36. 直角坐标与极坐标的转换 【youcans 的 OpenCV 例程200篇】37. 图像的灰度化处理和二值化处理 【youcans 的 OpenCV 例程200篇】38. 图像的反色变换图像反转 【youcans 的 OpenCV 例程200篇】39. 图像灰度的线性变换 【youcans 的 OpenCV 例程200篇】40. 图像分段线性灰度变换 【youcans 的 OpenCV 例程200篇】41. 图像的灰度变换灰度级分层 【youcans 的 OpenCV 例程200篇】42. 图像的灰度变换比特平面分层 【youcans 的 OpenCV 例程200篇】43. 图像的灰度变换对数变换 【youcans 的 OpenCV 例程200篇】44. 图像的灰度变换伽马变换 【youcans 的 OpenCV 例程200篇】45. 图像的灰度直方图 【youcans 的 OpenCV 例程200篇】46. 直方图均衡化 【youcans 的 OpenCV 例程200篇】47. 图像增强—直方图匹配 【youcans 的 OpenCV 例程200篇】48. 图像增强—彩色直方图匹配 【youcans 的 OpenCV 例程200篇】49. 图像增强—局部直方图处理 【youcans 的 OpenCV 例程200篇】50. 图像增强—直方图统计量图像增强 【youcans 的 OpenCV 例程200篇】51. 图像增强—直方图反向追踪 【youcans 的 OpenCV 例程200篇】52. 图像的相关与卷积运算 【youcans 的 OpenCV 例程200篇】53. Scipy 实现图像二维卷积 【youcans 的 OpenCV 例程200篇】54. OpenCV 实现图像二维卷积 【youcans 的 OpenCV 例程200篇】55. 可分离卷积核 【youcans 的 OpenCV 例程200篇】56. 低通盒式滤波器 【youcans 的 OpenCV 例程200篇】57. 低通高斯滤波器 【youcans 的 OpenCV 例程200篇】58. 非线性滤波—中值滤波 【youcans 的 OpenCV 例程200篇】59. 非线性滤波—双边滤波 【youcans 的 OpenCV 例程200篇】60. 非线性滤波—联合双边滤波 【youcans 的 OpenCV 例程200篇】61. 导向滤波Guided filter 【youcans 的 OpenCV 例程200篇】62. 图像锐化——钝化掩蔽 【youcans 的 OpenCV 例程200篇】63. 图像锐化——Laplacian 算子 【youcans 的 OpenCV 例程200篇】64. 图像锐化——Sobel 算子 【youcans 的 OpenCV 例程200篇】65. 图像锐化——Scharr 算子 【youcans 的 OpenCV 例程200篇】66. 图像滤波之低通/高通/带阻/带通 【youcans 的 OpenCV 例程200篇】67. 空间域图像增强的综合应用 【youcans 的 OpenCV 例程200篇】68. 空间域图像增强的综合应用 【youcans 的 OpenCV 例程200篇】69. 连续非周期信号的傅立叶系数 【youcans 的 OpenCV 例程200篇】70. 一维连续函数的傅里叶变换 【youcans 的 OpenCV 例程200篇】71. 连续函数的取样 【youcans 的 OpenCV 例程200篇】72. 一维离散傅里叶变换 【youcans 的 OpenCV 例程200篇】73. 二维连续傅里叶变换 【youcans 的 OpenCV 例程200篇】74. 图像的抗混叠 【youcans 的 OpenCV 例程200篇】75. Numpy 实现图像傅里叶变换 【youcans 的 OpenCV 例程200篇】76. OpenCV 实现图像傅里叶变换 【youcans 的 OpenCV 例程200篇】77. OpenCV 实现快速傅里叶变换 【youcans 的 OpenCV 例程200篇】78. 频率域图像滤波基础 【youcans 的 OpenCV 例程200篇】79. 频率域图像滤波的基本步骤 【youcans 的 OpenCV 例程200篇】80. 频率域图像滤波详细步骤 【youcans 的 OpenCV 例程200篇】81. 频率域高斯低通滤波器 【youcans 的 OpenCV 例程200篇】82. 频率域巴特沃斯低通滤波器 【youcans 的 OpenCV 例程200篇】83. 频率域低通滤波印刷文本字符修复 【youcans 的 OpenCV 例程200篇】84. 由低通滤波器得到高通滤波器 【youcans 的 OpenCV 例程200篇】85. 频率域高通滤波器的应用 【youcans 的 OpenCV 例程200篇】86. 频率域滤波应用指纹图像处理 【youcans 的 OpenCV 例程200篇】87. 频率域钝化掩蔽 【youcans 的 OpenCV 例程200篇】88. 频率域拉普拉斯高通滤波 【youcans 的 OpenCV 例程200篇】89. 带阻滤波器的传递函数 【youcans 的 OpenCV 例程200篇】90. 频率域陷波滤波器 【youcans 的 OpenCV 例程200篇】91. 高斯噪声、瑞利噪声、爱尔兰噪声 【youcans 的 OpenCV 例程200篇】92. 指数噪声、均匀噪声、椒盐噪声 【youcans 的 OpenCV 例程200篇】93. 噪声模型的直方图 【youcans 的 OpenCV 例程200篇】94. 算术平均滤波器 【youcans 的 OpenCV 例程200篇】95. 几何均值滤波器 【youcans 的 OpenCV 例程200篇】96. 谐波平均滤波器 【youcans 的 OpenCV 例程200篇】97. 反谐波平均滤波器 【youcans 的 OpenCV 例程200篇】98. 统计排序滤波器 【youcans 的 OpenCV 例程200篇】99. 修正阿尔法均值滤波器 【youcans 的 OpenCV 例程200篇】100. 自适应局部降噪滤波器 【youcans 的 OpenCV 例程200篇】101. 自适应中值滤波器 【youcans 的 OpenCV 例程200篇】102. 陷波带阻滤波器的传递函数 【youcans 的 OpenCV 例程200篇】103. 陷波带阻滤波器消除周期噪声干扰 【youcans 的 OpenCV 例程200篇】104. 运动模糊退化模型 【youcans 的 OpenCV 例程200篇】105. 湍流模糊退化模型 【youcans 的 OpenCV 例程200篇】106. 退化图像的逆滤波 【youcans 的 OpenCV 例程200篇】107. 退化图像的维纳滤波 【youcans 的 OpenCV 例程200篇】108. 约束最小二乘方滤波 【youcans 的 OpenCV 例程200篇】109. 几何均值滤波 【youcans 的 OpenCV 例程200篇】110. 投影和雷登变换 【youcans 的 OpenCV 例程200篇】111. 雷登变换反投影重建图像 【youcans 的 OpenCV 例程200篇】112. 滤波反投影重建图像 【youcans 的 OpenCV 例程200篇】113. 形态学操作之腐蚀 【youcans 的 OpenCV 例程200篇】114. 形态学操作之膨胀 【youcans 的 OpenCV 例程200篇】115. 形态学操作之开运算 【youcans 的 OpenCV 例程200篇】116. 形态学操作之闭运算 【youcans 的 OpenCV 例程200篇】117. 形态学操作之顶帽运算 【youcans 的 OpenCV 例程200篇】118. 形态学操作之底帽运算 【youcans 的 OpenCV 例程200篇】119. 图像的形态学梯度 【youcans 的 OpenCV 例程200篇】120. 击中-击不中变换 【youcans 的 OpenCV 例程200篇】121. 击中-击不中用于特征识别 【youcans 的 OpenCV 例程200篇】122. 形态算法之边界提取 【youcans 的 OpenCV 例程200篇】123. 形态算法之孔洞填充 【youcans 的 OpenCV 例程200篇】124. 孔洞填充的泛洪算法 【youcans 的 OpenCV 例程200篇】125. 形态算法之提取连通分量 【youcans 的 OpenCV 例程200篇】126. 形态算法之凸壳 【youcans 的 OpenCV 例程200篇】127. 形态算法之细化 【youcans 的 OpenCV 例程200篇】128. 形态算法之骨架 (skimage) 【youcans 的 OpenCV 例程200篇】129. 形态算法之骨架 (重建开运算) 【youcans 的 OpenCV 例程200篇】130. 形态学之提取水平和垂直线 【youcans 的 OpenCV 例程200篇】131. 形态学重建之竖线字符提取 【youcans 的 OpenCV 例程200篇】132. 形态学重建之孔洞填充算法 【youcans 的 OpenCV 例程200篇】133. 形态学重建之边界清除 【youcans 的 OpenCV 例程200篇】134. 形态学重建之细胞计数 【youcans 的 OpenCV 例程200篇】135. 形态学重建之粒度测定 【youcans 的 OpenCV 例程200篇】136. 灰度腐蚀和灰度膨胀 【youcans 的 OpenCV 例程200篇】137. 灰度开运算和灰度闭运算原理 【youcans 的 OpenCV 例程200篇】138. 灰度开运算和灰度闭运算 【youcans 的 OpenCV 例程200篇】139. 灰度顶帽变换校正阴影 【youcans 的 OpenCV 例程200篇】140. 灰度底帽变换校正光照 【youcans 的 OpenCV 例程200篇】141. 灰度底帽变换的三维地形图 【youcans 的 OpenCV 例程200篇】142. 基于灰度形态学的图像平滑 【youcans 的 OpenCV 例程200篇】143. 基于灰度形态学的粒度测定 【youcans 的 OpenCV 例程200篇】144. 基于灰度形态学的纹理分割 【youcans 的 OpenCV 例程200篇】145. 形态学之边缘和角点检测 【youcans 的 OpenCV 例程200篇】146. 基于灰度形态学的复杂背景图像重建 【youcans 的 OpenCV 例程200篇】147. 图像分割之孤立点检测 【youcans 的 OpenCV 例程200篇】148. 图像分割之线检测 【youcans 的 OpenCV 例程200篇】149. 图像分割之边缘模型 【youcans 的 OpenCV 例程200篇】150. 边缘检测梯度算子
http://www.zqtcl.cn/news/506110/

相关文章:

  • 安康网站建设技巧腾讯建设网站视频下载
  • 如何能让企业做网站的打算中企动力做网站贵吗
  • wordpress 空间常州seo
  • 网站负责人备案采集照具体要求湛江网吧
  • 长春建站模板制作php网站空间购买
  • 网站域名到期怎么办食品包装设计的介绍
  • 建设网站专栏台州cms模板建站
  • 网站建设套餐方案湛江网站如何制作
  • wordpress网站怎么打开西安企业做网站多少钱
  • 电子商务网站建设的实训报告网页美工设计夏霍
  • 在一呼百应上做网站行吗江西省住房和城乡建设厅的网站
  • 对百度网站进行分析山水人家装饰公司
  • 接网站开发广州仿站定制模板建站
  • 资源网站源码下载制作软件的app有哪些
  • 免备案空间网站电子商务网站经营特色分析的主要内容包括
  • 遨游建站网站设计的基本知识
  • 延津县建设局网站景安网站上传完还要怎么做
  • 模板做网站达州住房和城乡建设部网站
  • 高端网站定做公司企业文化模板
  • iis7.5添加网站销售订单管理系统
  • 网站开发模板代码外贸流程知识
  • 免费网站有哪些邯郸去哪做网站改版
  • 商务网站开发的工作任务湖南专业网站建设
  • 怎样搭建免费网站什么网站做网页好
  • flash工作室网站模板天津seo培训班在哪里
  • 怎么做游戏推广网站扬中商城官网
  • html5 公众号 网站开发顺德手机网站建设
  • 上海医疗网站备案表千库网是什么
  • 陕西省西安市制作网站二次元 wordpress主题
  • 十堰网站建设weitian帮人做logo网站