Branching points(OpenCV,C++)

做~自己de王妃 提交于 2020-02-08 07:55:08

问题


I want to identify the branching points of the lightning in this image:

http://i.stack.imgur.com/PXujf.jpg

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

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.

Ok, basically I have 2 problems:

  1. How can i properly segment the image such that the lightning part of the image is properly captured.
  2. How can I then, identify the branching points? For every branch point i want to draw a red circle over it.

Thanking you in advance


回答1:


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

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


来源:https://stackoverflow.com/questions/7514638/branching-pointsopencv-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!