thorstenwagner / ij-ridgedetection

Detect ridges / lines with imagej
GNU General Public License v2.0
42 stars 27 forks source link

Extend lines does not work correctly #12

Open thorstenwagner opened 8 years ago

thorstenwagner commented 8 years ago

I recognized that the extend lines functionality in the Link class does not work correctly: https://github.com/thorstenwagner/ij-ridgedetection/blob/master/src/main/java/de/biomedical_imaging/ij/steger/Link.java#L818

Example: one_crossing_point_missed

Use the standard settings and deselect extend lines. Three lines were detected: 100, 101, 102

There are gaps between the lines 101 - 100 and 102 -100. If extend lines is selected, the algorithm detects correctly that 101 could be connected with 100 and 102 could be connected with 100. However, it does not add a junction point. The reason is, that the extend lines functionality only adds a junction points if it is not one of the other line's endpoints. But when it comes to the connection of 101 and 100 it is the endpoint of line 100. So the decision not add an junction point when extending the line 101 to 100 is correct. But then algorithm should merge the lines 101 and 100 but it does not! When it comes to the connection between 102 and 100 the algorithm does not know that the line 100 is already extended and do not add junction point again . This should be corrected.