gpt4 book ai didi

opencv - 梯度角的 Sobel 算子

转载 作者:太空宇宙 更新时间:2023-11-03 20:51:26 31 4
gpt4 key购买 nike

我想在文本中找到笔划的方向。 Sobel 算子如何用于此目的?

enter image description here

这张图显示的是dp,也就是梯度方向。我想知道如何应用 Sobel 运算符找到要选择的像素,从 pq,沿着路径 sp,到找到边缘上的结束像素 q

最佳答案

你可以找到图像的 x 导数,然后是 y 导数。

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);

关于opencv - 梯度角的 Sobel 算子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22381704/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com