-
Notifications
You must be signed in to change notification settings - Fork 21
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
strel: more shape generators #75
Milestone
Comments
Sounds great Few remarks:
|
An update for this issue. Now that we have function strel_octagon(m, n)
diamonds = [strel_diamond((3, 3)) for _ in 1:m]
boxes = [strel_box((3, 3)) for _ in 1:m-n]
return strel_chain([diamonds..., boxes...])
end
julia> strel_octagon(3, 2)
7×7 ImageMorphology.StructuringElements.SEChainArray{2, OffsetArrays.OffsetMatrix{Bool, BitMatrix}} with indices -3:3×-3:3:
0 0 1 1 1 0 0
0 1 1 1 1 1 0
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 0 1 1 1 0 0 What we need in the future are:
#90 (comment) seems to be a good candidate for arbitrary SE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now we have
strel_box
andstrel_window
added in #65, the next step is to add a few more basic generators and (perhaps) a high-order generator. Just list a few ideas here:Basic generators
strel_ball
/strel_disk
: generate a ball-shaped SE. There was a WIP in add connectivity generator helpers #63 for a generic ellipse shapestrel_line(sz, degree)
: generates a line segment along a certain degreestrel_octagon
strel_star
Unless we know there's room for optimization; we don't need to create new array types like
strel_box
orstrel_diamond
does. A plain function that generates plainOffsetArray{Bool}
should be sufficient (don't forget that mask SE is centered to zero)High-order compositor
If we have
se1
of dimension N1 andse2
of dimension N2, it would be great to have a functionstrel_compose(se1, se2, ...)
to build aN1+N2
dimension SE.For instance, I would expect
strel_compose(strel_line((3,)), strel_line((3,)))
get us astrel_diamond((3, 3))
. This might not need to be specific to strel, it can be generalized to a kernel composor since it can also useful for ImageFiltering.This has two advantages:
extreme_filter
for diamond SE is implemented this way.To do the second, we need to build a new array type that is composed of two low-dimensional arrays. This tells Julia enough information to do dispatch.
@ThomasRetornaz I'm unsure which functions I listed above are useful in practice, and I'm not sure if I missed anything. It would be great if you can comment.
The text was updated successfully, but these errors were encountered: