数字图像梯度概念及计算(the gradient of the image)
来源:互联网 发布:手机淘宝号怎么登录 编辑:程序博客网 时间:2024/05/22 19:27
梯度的概念
函数 z = f(x,y)在平面区域D内具有一阶连续偏导数,则对于每一个属于D点P(x,y),都可定出一个向量
这个向量称为函数 z = f(x,y)在点P出的梯度,记为如下:
图像梯度的定义
图像函数f(x,y)在点(x,y)的梯度是一个具有大小和方向的矢量,设为Gx 和 Gy 分别表示x方向和y方向的梯度,这个梯度的矢量可以表示为:
由此可见,梯度指出了在(x,y)处f的最大变化率的方向。
这个矢量的幅度为
图像处理中一阶微分是用梯度幅值来实现的。
方向角为:
对于数字图像而言,图像可看成二维离散函数,图像梯度其实就是这个二维离散函数的求导,如下:
G(x,y) = dx(i,j) + dy(i,j);
dx(i,j) = I(i+1,j) - I(i,j);
dy(i,j) = I(i,j+1) - I(i,j);
图像梯度一般也可以用中值差分:
dx(i,j) = [I(i+1,j) - I(i-1,j)]/2;
dy(i,j) = [I(i,j+1) - I(i,j-1)]/2;
dy(i,j) = [I(i,j+1) - I(i,j-1)]/2;
图像边缘一般都是对图像进行梯度运算来实现的。
梯度的正负反映其边缘的走势,相当于方向。
由于图像在计算机中以数字图像的形式进行存储,即图像是离散的数字信号,对数字图像的梯度使用差分来代替连续信号中的微分。
数字图像中,更多的使用差分来近似导数,最简单的梯度近似表达式如下:
梯度的方向是函数f(x,y)变化最快的方向,当图像中存在边缘时,一定有较大的梯度值,相反,当图像中有比较平滑的部分时,灰度值变化较小,则相应的梯度也较小,图像处理中把梯度的模简称为梯度,由图像梯度构成的图像成为梯度图像(we can get the gradient image through computing the gradient of each pixel in the image)
经典的图像梯度算法是考虑图像的每个像素的某个邻域内的灰度变化,利用边缘临近的一阶或二阶导数变化规律,对原始图像中像素某个邻域设置梯度算子,通常我们用小区域模板进行卷积来计算,有Sobel算子、Robinson算子、Laplace算子等。
//--------------------------------------------------------------------
利用X方向与Y方向分别实现一阶微分,求取振幅,实现图像梯度效果,微分算子Prewitt与Sobel。
其中Sobel的表示:
梯度幅值:
在X, Y两个方向算子分别为:Prewitt在X, Y方向上梯度算子分别为:
参考来自:http://blog.csdn.net/buaalei/article/details/45690953
http://blog.csdn.net/computer_liuyun/article/details/21328753
阅读全文
0 0
- 数字图像梯度概念及计算(the gradient of the image)
- 数字图像的梯度概念(the gradient of the image)
- 数字图像的梯度概念以及计算(the gradient of the image)
- 图像的梯度(The Gradient of Image)
- 共轭梯度法学习 The Conjugate Gradient method
- Night of the Image Map
- The Basics Of Image Filtering
- 数字图像处理实验(2):PROJECT 02-02, Reducing the Number of Gray Levels in an Image
- 计算几何 The Circumference of the Circle
- The Circumference of the Circle(计算几何)
- The source of image UBB codes creator
- Resolving the updating problem of image-generic.
- The first image of strawberry perl
- Changing The Size Of An Image
- ads 1.2 memory map of the image
- 各种图像处理类库的比较及选择(The Comparison of Image Processing Libraries)
- 各种图像处理类库的比较及选择(The Comparison of Image Processing Libraries)
- 各種圖像處理類庫的比較及選擇(The Comparison of Image Processing Libraries)
- JS函数作用域及作用域
- svn Unable to connect to a repository at URL 'https://pc-201706292566/svn/YiBaiJia'
- itextSharp研究心得
- socket.io入门
- java里重载时的自动装箱与拆箱机制
- 数字图像梯度概念及计算(the gradient of the image)
- SOA 治理简介
- [RK3288][Android6.0] WiFi之开机自动连接过程
- ElasticSearch 5.0.0 安装部署常见错误或问题
- 【BZOJ2330】【SCOI2011】糖果——差分约束系统+tarjan
- org.apache.hadoop.security.AccessControlException: Permission denied: user异常解决方法
- React-router路由实践
- c++ auto变量学习
- tensorflow命令行传参