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

WIP: Region Growing Algorithm: unseeded and seeded #228

Open
wants to merge 1 commit into
base: source
Choose a base branch
from

Conversation

ashwani-rathee
Copy link
Member

  • Adds region growing demonstration : both seeded and unseeded
    Status: Initial

# points. If more than one point has the same label then they will be contribute
# to the same segment.

img = load("assets/worm.jpg")
Copy link
Member

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.

Copy link
Member Author

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use IndirectArray instead.

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).

Copy link
Member

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

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

Successfully merging this pull request may close these issues.

3 participants