OpenCV的 - 停留在解决一个锻炼; Tibial [英] OpenCV - stuck in solving an excercise

查看:126
本文介绍了OpenCV的 - 停留在解决一个锻炼; Tibial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人能告诉我如何创建一个过滤器检测具有60度角的线条,如在学习OpenCV的书的练习提到(点击这里在线书籍 - 见190页)。我只是想知道的过滤器会如何?还是有检测线在60度任何其他方式?或如何在60度旋转的过滤器(未图)来检测行?我想preFER使用大型过滤器就像9 * 9或11 * 11或15 * 15等。

Can anybody tell me how to create a filter to detect lines having 60 degrees angle, as mentioned in the exercise of Learning OpenCV book (Click here for online book - see page 190). I just want to know how the filter will be ? Or is there any other way of detection lines at 60 degrees ? Or how to rotate a filter (not image) at 60 degree to detect lines? I would prefer to use large filters like 9*9 or 11*11 or 15*15, etc.

P.S。我知道如何在标准的角度检测线,如0,90等,但困惑等角度 - 我如何在OpenCV的旋转过滤器,以不同角度

P.S. I know how to detect lines at standard angles like 0, 90, etc. but confused about other angles - how can I rotate the filters to different angels in OpenCV?

我发现GetRotationMatrix2D在OpenCV的旋转矩阵,但我想它旋转矩阵,形成一个2×3矩阵,还旋转图像本身。我想知道我是否可以使用GetRotationMatrix2D在任何方向得到一个9 * 9的矩阵旋转一个9 * 9的矩阵?同样,这可能没有图像本身旋转?

I found GetRotationMatrix2D in openCV to rotate matrix but I guess it rotates the matrix to form a 2*3 matrix and also rotates the image itself. I want to know whether I can use GetRotationMatrix2D to rotate a 9*9 matrix in any direction to get a 9*9 matrix? Also, is this possible without rotating the image itself?

推荐答案

如果你想手动创建过滤器和内部cvFilter2d使用,看一看的角过滤器。刚刚尝试申请一个60度的过滤器,通过增加内核的大小(高度应接近root3倍宽度),并写上2S对角线。

If you want to create filter by hand and use inside cvFilter2d, take a look at angular filters. Just try to apply a 60 degrees filter, by increasing size of the kernel (the height should be nearly root3 times width) and write "2"s diagonally.

检查<一href=\"http://docs.opencv.org/modules/imgproc/doc/feature_detection.html?highlight=houghlinesp#houghlines\"相对=nofollow> Hough变换 和教程。它输出所有的线的角度(根据x轴)。

Check Hough transform and its tutorial. It outputs all of the line angles (according to the x axis).

看看 SimpleCV 了。

这篇关于OpenCV的 - 停留在解决一个锻炼; Tibial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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