I am working on a piece of code in MATLAB using the Image Processing Toolbox, where I used Skel = bwmorph (BM, 'skel') to get a river skeleton. I want to use BP = bwmorph (Skel, "branch points") to get points where merges and inflows exist. I get a lot of false positives in BP when the skeleton looks like
oQo
Q
o
It marks Q pixels as branch points, as well as the actual expected branch points. There are many false positives.
I noticed that the true branch point is observed as an isolated pixel in BP, while the branch points of the halyards always form pairs.
Can someone tell me how the branch point algorithm finds points? If I know this, I can be satisfied that there is a real reason why false positives are in pairs, and true positive values are one, and not a happy coincidence.
I have a feeling that he is looking at an 8-connection around a pixel, but I think that not everything he does.
To clarify, I noted a cropped image of the output. The positive values it gives are shown in red. As you can see, only one of these pixels is actually a branch point. I want to know how the algorithm works, so I can give a logical reason why false positives fall in pairs (if they really work).
Picture
source