Open tf1991-06 opened 4 years ago
it is not difficult and I did not referent any paper here is the main step: 1 get skeleton image 2 do a 3x3 conv sum, and masked by the skeleton image. (how many neighbors) then: in the conv image 1 means endpoint 2 means pathpoint 3 or more means junction 3 trace from endpoint to junction through pathpoint one by one.
With the help of your information, I think I can read the source code. Thank you!
bu I use ravel index to treat different dim. eg. in 2d we have r,c. and in 3d we use r, c, z. but in topology space, we can use a 1d ravel index. and neighbors means with the specific difference idx.
eg. a 5x7 array, we use 0-34 to index, and pix[i] ,s neighbors is i-1, i+1, i-7, i+7, i-7-1, i-7+1, i+7-1, i+7+1. then all the process is based on neighbors idx. so we can treat any dim.
idx2rc, rc2idx, neighbors these three function is to get neighbors idx and transform between rc and ravel idx.
Thanks again!
But I think, the most hard point is about parse_struct() function. I think, but just an idea, fill() and trace() functions will be easier to see by recursive function.
not hard, just use list to iterate a graph structure. the fill should be called flood fill.
I've never heard of "flood fill algorithm". Thanks for the further information!
Dear yxdragon, thank you for your great work. This library helped me a lot in my work! By the way, I want to know what algorithm is used in this library. Could you please tell me or write in readme.md about reference paper?