光条中心提取算法——steger算法(Hessian矩阵)的代码实现

OpenCV 专栏收录该内容
3 篇文章 0 订阅

下面三个网站是我自己找到的代码,但是都没跑过。其中最后一个好像根据steger写的代码改进的,可以重点看这个。第四个网网址是Halcon里面steger算法的介绍。

https://github.com/allen52/Hessian-steger/tree/master/Hessian-steger

https://github.com/thorstenwagner/ij-ridgedetection/tree/master/src/main/java/de/biomedical_imaging/ij/steger

https://github.com/jalmar/CurveTracing/tree/master/source/stegers

https://www.mvtec.com/doc/halcon/1905/en/lines_gauss.html

我遇到的问题,如果在对每个像素点都计算Hessian矩阵,并求中心的时候,那么在光条中心提取时,怎么保证每行只得到唯一的一个中心点?

我看到的代码是每行取遇到的第一个灰度值为255的点,计算中心点坐标,如果tnx < 0.5的话,则将它作为中心点坐标,否则继续遍历该行。但是这样显然不是很正确。。。

在看了steger的代码后发现,对符合tnx < 0.5的点再对它的特征值进行判断,阈值是根据另外一段代码计算出来的。同时在Halcon里面看到下面这段话。

Pixels which exhibit a local maximum in the second directional derivative perpendicular to the line direction are marked as line points. The line points found in this manner are then linked to contours. This is done by immediately accepting line points that have a second derivative larger than High. Points that have a second derivative smaller than Low are rejected.

For the choice of the thresholds High and Low one has to keep in mind that the second directional derivative depends on the amplitude and width of the line as well as the choice of Sigma. The value of the second derivative depends linearly on the amplitude, i.e., the larger the amplitude, the larger the response. For the width of the line there is an approximately inverse exponential dependence: The wider the line is, the smaller the response gets. This holds analogously for the dependence on Sigma: The larger Sigma is chosen, the smaller the second derivative will be. This means that for larger smoothing correspondingly smaller values for High and Low have to be chosen. Two examples help to illustrate this: If 5 pixel wide lines with an amplitude larger than 100 are to be extracted from an image with a smoothing of Sigma = 1.5, High should be chosen larger than 14. If, on the other hand, 10 pixel wide lines with an amplitude larger than 100 and a Sigma = 3 are to be detected, High should be chosen larger than 3.5. For the choice of Low values between 0.25 High and 0.5 High are appropriate.

Low (input_control)  

Lower threshold for the hysteresis threshold operation.

Default value: 3

Suggested values: 0, 0.5, 1, 2, 3, 4, 5, 8, 10

Typical range of values: 0 ≤ Low ≤ 20

Recommended increment: 0.5

Restriction: Low >= 0

 

High (input_control)  

Upper threshold for the hysteresis threshold operation.

Default value: 8

Suggested values: 0, 0.5, 1, 2, 3, 4, 5, 8, 10, 12, 15, 18, 20, 25

Typical range of values: 0 ≤ High ≤ 35

Recommended increment: 0.5

Restriction: High >= 0 && High >= Low

  • 1
    点赞
  • 2
    评论
  • 20
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值