分支点(OpenCV,C ++) [英] Branching points(OpenCV,C++)
问题描述
我想在此图片中找出闪电的分支点:
I want to identify the branching points of the lightning in this image:
http://i.stack.imgur.com/PXujf.jpg
我先做的是阈值图像使得我得到图像的lighning部分
并丢弃背景。这是结果
What I did first was threshold the image such that I get the lighning part of the image and discard the backround. This is the result
http:// i.stack.imgur.com/IYNTi.jpg
我在openCV中使用了阈值函数,结果图像非常糟糕
as质量丢失,树枝不再可见。
I used the threshold function in openCV and the resulting image is pretty much bad as the quality is lost, the branches are no longer visible.
好的,基本上我有2个问题:
Ok, basically I have 2 problems:
- 如何正确分割图像,以便正确捕捉图像的闪电部分。
- 我如何确定分支点?对于每个分支点我想要
在它上面画一个红色圆圈。
提前感谢你
推荐答案
细分/阈值处理
我会给这个一试。
他们还有一份关于图像分割的NIPS2012研讨会(DISCML)论文,似乎可以处理相当优雅的细长物体(如图中的闪电)。
Segmentation / thresholding:
I would give this a try.
They also had a NIPS2012 workshop (DISCML) paper on image segmentation that seems to handle quite elegantly thin elongated objects (like the lightnings in the picture).
分支点:
一旦你有一个好的面具,你可以使用形态操作来提取分支点(Matlab代码):
Branching points:
Once you have a good mask you can use morphological operations to extract the branching points (Matlab code):
bw = myGoodSegmentation( img ); % replace with whatever segmentation/thresholding that works best for you.
tbw = bwmorph( bw, 'skel', inf );
[y x] = find( bwmorph( tbw, 'branchpoints' ) ); % get x,y coordinates of branch points
这篇关于分支点(OpenCV,C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!