# Checking for Numbers of Blood Vessels Junctions Detected

Hello all, this is a follow up question from this post https://answers.opencv.org/question/2...

I have the blood junctions detected from Hit or Miss Kernels. However, i want to know how many junctions detected and mark the location of the major junctions. something like this below (Pardon me for my drawing, I drew using mouse pad) :

Any Idea how can i do that?

edit retag close merge delete

1

My answer for the previous question contained half of the answer. Do a thinning (skeletonization) to get 1 pixel wide structure. Then check the number of active (8-connectivity) neighbors for every active pixel.

If you have 1 neighbor, then you are at the end of a vessel. If it's 2, then the pixel is part of a vessel. If it's 3, then you have a Y junction, if it's 4, then it's an X junction.

Using the algorithm you can create a "map" of the vessels, length from the last junction (which can also be used to eliminate false detections (e.g. 2-3 pixel long vessels)

( 2020-04-06 05:46:20 -0500 )edit

@kbarni, when i did the thinning of the matrix, more blood vessels disappear. I think skeletonization is a good idea. But I cwill try the active 8-connectivity neighbors of every pixel

( 2020-04-08 02:05:31 -0500 )edit