找到旋转stripeline /角度的角 [英] Finding the angle of stripeline/ Angle of rotation

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

问题描述

所以我想找到的旋转角度的条纹线,如所附照片图像。 唯一的假设是,线是平行的,并且它们的取向为约90度左右或多或少[说5度公差。 我必须确保在结果图像中的条纹线将是100%垂直。图像质量的变化以及它们的直方图/灰度值。因此,基于非自适应阈值的方法已经失败,我的情况下,[我不感兴趣的阈值基础的方法,如果我不能让它适应。此外,还有一些随机黑色簇上的条纹线的顶端有时

So I’m trying to find the rotational angle for stripe lines in images like the attached photo. The only assumption is that the lines are parallel, and their orientation is about 90 degrees approximately more or less [say 5 degrees tolerance]. I have to make sure the stripe lines in the result image will be %100 vertical. The quality of the images varies as well as their histogram/greyscale values. So methods based on non-adaptive thresholding already failed for my cases [I’m not interested in thresholding based methods if I cannot make it adaptive]. Also, there are some random black clusters on top of the stripe lines sometimes.

我所做的,到目前为止: 1当然HoughLines中)是第一选择,但我不能让我所有的图像工作,我不得不虽然下面这篇大文章的一些部分成功: http://felix.abecassis.me/2011/09/opencv-检测扭曲角/ 。  失败对我的理解,主要的原因是,我需要微调的参数,不同的图像。参数如康力/ BW /形态边缘检测(如果需要)|参数minLinelength / maxLineGap /等。可以肯定有办法侵入这一点,并使其发挥作用,但是,对我来说这是一个脆弱的解决方案!

What I did so far: 1) Of course HoughLines is the first option, but I couldn’t make it work for all my images, I had some partial success though following this great article: http://felix.abecassis.me/2011/09/opencv-detect-skew-angle/. The main reason of failure to my understanding was that, I needed to fine tune the parameters for different images. Parameters such as Canny/BW/Morphological edge detection (If needed) | parameters for minLinelength/maxLineGap/etc. For sure there’s a way to hack into this and make it work, but, to me this is a fragile solution!

2)什么我的工作,现在,是将图像分割为顶片和底片,然后找到每个片的高峰和低谷。那么基本上找到使用图像和峰翻译的宽度的角度。我目前正在调查其顶部片峰属于哪个底层切片,自会有我的计算一定的假阳性峰因存在黑/白群上的带状线的顶部。

2) What I’m working on right now, is to divide the image to a top slice and a bottom slice, then find the peaks and valleys of each slice. Then basically find the angle using the width of the image and translation of peaks. I’m currently working on finding which peak of the top slice belongs to which of the bottom slice, since there will be some false positive peaks in my computation due to existence of black/white clusters on top of the strip lines.

例如:对于片峰的位置: 顶分层= {1,33,67,90,110} BottomSlice = {3,14,35,63,90,104}

Example: Location of peaks for slices: Top Slice = { 1, 33,67,90,110} BottomSlice = { 3, 14, 35,63,90,104}

我实际上得到类似载体提取高峰时。因此可以看出,向量的长度可能会有所不同,任何想法如何,我可以得到一组这样的:

I am actually getting similar vectors when extracting peaks. So as can be seen, the length of vector might vary, any idea how can I get a group like:

{{1,3},{33,35},{67,63},{90,90},{110104}}

{{1,3},{33,35},{67,63},{90,90},{110,104}}

我愿意接受关于提高所有这些算法还是一种全新的方法的想法。如果需要,我可以上传更多的图像。

I’m open to any idea about improving any of these algorithms or a completely new approach. If needed, I can upload more images.

推荐答案

如果你能得到点的列表为单行,一个的回归会给你最适合的点直线的公式。一个简单的触发操作将行的公式转换为角度。

If you can get a list of points for a single line, a linear regression will give you a formula for the straight line that best fits the points. A simple trig operation will convert the line formula to an angle.

您也许可以使用一些在线细化操作打开条纹变成点列表。

You can probably use some line thinning operation to turn the stripes into a list of points.

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

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