梯度角度的Sobel算子 [英] Sobel operator for gradient angle

查看:200
本文介绍了梯度角度的Sobel算子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本中查找笔触的方向.如何为此目的使用Sobel运算符?

I want to find the direction of stroke in text.How to used Sobel operator for this purpose?

此图显示了dp,它是渐变方向.我想知道如何应用Sobel算子来查找沿路径选择像素(从p到q)的像素,以找到边缘像素的另一端q.

This image show dp .which is gradient direction.I wanted to know how I can apply Sobel operator for finding pixel to chose (from p to q)along path to find other end q of pixel in edge.

推荐答案

您可以找到图像的x导数,然后是y导数.

You can find x derivative of image, then y derivative.

Sobel(Img,gxx,CV_32FC1,1,0); //  x derivative
Sobel(Img,gyy,CV_32FC1,0,1); //  y derivative

在那之后找到阶段 http://docs.opencv.org/modules/core/doc/Operations_on_arrays.html#phase

phase(gxx,gyy,angles,inDegrees);

这篇关于梯度角度的Sobel算子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆