Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Papers of the algorithm #10

Open
tf1991-06 opened this issue Jul 4, 2020 · 6 comments
Open

Reference Papers of the algorithm #10

tf1991-06 opened this issue Jul 4, 2020 · 6 comments

Comments

@tf1991-06
Copy link

tf1991-06 commented Jul 4, 2020

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?

@yxdragon
Copy link
Member

yxdragon commented Jul 5, 2020

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.

@tf1991-06
Copy link
Author

With the help of your information, I think I can read the source code.
Thank you!

@yxdragon
Copy link
Member

yxdragon commented Jul 5, 2020

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.

@tf1991-06
Copy link
Author

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.

@yxdragon
Copy link
Member

yxdragon commented Jul 5, 2020

not hard, just use list to iterate a graph structure.
the fill should be called flood fill.

@tf1991-06
Copy link
Author

I've never heard of "flood fill algorithm".
Thanks for the further information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants