-
Notifications
You must be signed in to change notification settings - Fork 54
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
WIP: Region Growing Algorithm: unseeded and seeded #228
base: source
Are you sure you want to change the base?
Conversation
# points. If more than one point has the same label then they will be contribute | ||
# to the same segment. | ||
|
||
img = load("assets/worm.jpg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we should not expect users have an "assets" folder at hand. We should either add it to TestImages or using some explicit download
tricks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll add worm.png to imgur then
# Now, let's segment this image using unseeded_region_growing | ||
|
||
seg_small = unseeded_region_growing(img_small, 0.05) # here 0.05 is the threshold | ||
result = map(i->get_random_color(i), labels_map(seg_small)) .* (1 .-Gray.(img_small)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use IndirectArray
instead.
juliaimages.github.io/docs/examples/image_segmentation/watershed.jl
Lines 80 to 86 in a064150
labels = labels_map(segments) | |
colored_labels = IndirectArray(labels, distinguishable_colors(maximum(labels))) | |
masked_colored_labels = colored_labels .* (1 .- bw) | |
mosaic(img, colored_labels, masked_colored_labels; nrow=1) | |
# Here we use `IndirectArray` to store the indexed image, for more explaination on it please | |
# check the tutorial [Indexed image in 5 minutes](@ref demo_indexed_image). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really we should decide about JuliaImages/ImageSegmentation.jl#76 first
Status:
Initial