Flamerx
Flamerx

Reputation: 1

Directionally closing an image using opencv morphology or otherwise

I'm trying to use opencv morphology to close a binary image. However I would like to close along the maximum intensity direction locally rather than the entire surrounding region. The idea is for me to use the binary image that is created after this operation to extract a skeleton.

The idea I have come up with so far is to use the hough line transform on a localised ROI of the image. then use the direction given by this transform to create a kernel that approximates the direction of this line. then use this kernel for the opencv close operation rather than the generic np.ones kernel. However this is quite computationally expensive and seems to give mixed results. I was wondering if there is an easier way to do this. I'm fairly new to opencv so your thoughts and comments are highly appreciated. Thank you!

Original image -> [1]: https://i.sstatic.net/Z46bJxfm.jpg

Binary image generated using k-means clustering -> [2]: https://i.sstatic.net/H3TNekkO.jpg

Upvotes: 0

Views: 53

Answers (0)

Related Questions