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

3d watershed #35

Closed
mschauer opened this issue Oct 1, 2019 · 1 comment
Closed

3d watershed #35

mschauer opened this issue Oct 1, 2019 · 1 comment

Comments

@mschauer
Copy link

mschauer commented Oct 1, 2019

I am doing the watershed on a nxnx2 matrix and I am surprised that the segmentation of the first and the second layer are the same. Small example reproducing the behaviour.

A1 = [2 3 3 1 0
      1 3 3 3 2
      1 1 3 3 2
      0 1 3 3 2]


 A2 = [1 1 3 3 1
       1 2 3 3 2
       1 3 3 2 2
       1 3 3 2 2]

A = cat(A1, A2, dims=3)
seeds = zeros(Int, size(A))
is = findall(i -> i == 0, A)
seeds[is] .= 1:length(is)
seeds
S = watershed(A, seeds)
heatmap([S.image_indexmap[:,:,1]; S.image_indexmap[:, :, 2]])

Screenshot 2019-10-01 at 15 52 40

@mschauer
Copy link
Author

mschauer commented Oct 1, 2019

I think I understand now why that is the case: the metric induced by the pixel neighbourhood makes points diagonally adjacent in different layer as close as direct neighbours.

@mschauer mschauer closed this as completed Oct 2, 2019
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

1 participant