-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I'm using the erode function with a diamond shape structuring element, but the output doesn't look like what I expected. I'm working with 3D masks. Here is a minimal example with 3x3x3 showing the unexpected result.
Explanation:
The center voxel image[2,2,2] should be 0 after erosion (It is connected to image[2,2,3]==0).
In the output of erode, the voxel eroded[2,2,2]==1 though, which is not what I expected.
julia> image = [1 1 1; 1 1 1; 1 1 1;;; 0 1 0; 1 1 1; 1 1 1;;; 0 0 0; 0 0 0; 1 1 1]
3×3×3 Array{Int64, 3}:
[:, :, 1] =
1 1 1
1 1 1
1 1 1
[:, :, 2] =
0 1 0
1 1 1
1 1 1
[:, :, 3] =
0 0 0
0 0 0
1 1 1
julia> SE = strel_diamond(box)
3×3×3 ImageMorphology.SEDiamondArray{3, 3, UnitRange{Int64}, 0} with indices -1:1×-1:1×-1:1:
[:, :, -1] =
0 0 0
0 1 0
0 0 0
[:, :, 0] =
0 1 0
1 1 1
0 1 0
[:, :, 1] =
0 0 0
0 1 0
0 0 0
julia> eroded = erode(image, SE)
3×3×3 Array{Int64, 3}:
[:, :, 1] =
1 1 1
1 1 1
1 1 1
[:, :, 2] =
0 1 0
0 1 0
1 1 1
[:, :, 3] =
0 0 0
0 0 0
0 0 0
Metadata
Metadata
Assignees
Labels
No labels