-
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
Mean shift algorithm #235
base: source
Are you sure you want to change the base?
Mean shift algorithm #235
Conversation
ashwani-rathee
commented
Sep 19, 2021
- covers mean shift image segmentation algorithm
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 hadn't noticed these (they arrived back when I wasn't paying attention), thanks for adding this!
# - We have specify a prior on the number of clusters(Number of K which is no of | ||
# segments). |
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.
# - We have specify a prior on the number of clusters(Number of K which is no of | |
# segments). | |
# - We have specify a prior on the number `K` of clusters (segments). |
# but has two main issues: | ||
# - We have specify a prior on the number of clusters(Number of K which is no of | ||
# segments). | ||
# - It can be sensitive to value of k-means parameter. |
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.
This seems not entirely surprising. Is it really worth making as a separate point?
It could also be stated that K-means tends to return clusters of approximately equal radius, which may not be how a human would do it.
# - Each hill represents a cluster | ||
# - Peak(mode) of hill represents "center" of the cluster | ||
# - Each pixel climbs the steepest hill within its neighborhood | ||
# - Pixel assigned to the hill(cluster) it climbs. That's the idea behind meanshift. |
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.
# - Pixel assigned to the hill(cluster) it climbs. That's the idea behind meanshift. | |
# - A pixel is assigned to the hill(cluster) it climbs. |
I think the "idea behind meanshift" encompasses all of these points.
# The Manhattan Distance is another useful choice sometimes. | ||
# - A radius. All pixels within this radius (measured according the above distance) | ||
# will be accounted for the calculation. | ||
# - A value difference. From all pixels inside radius r, we will take only those |
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.
Would "intensity" be clearer than "value"?
# - Set $m_i = f_i$ as initial mean fro each pixel idea | ||
# - Repeat the following for each mean mi: | ||
# - place window of size $w$ around $m_i$. | ||
# - compute centroid m within the window set $mi = main$ |
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.
Not sure what main
means
# Task: Find modes(clusters) of distribution. | ||
|
||
# Clustering: | ||
# - Set $m_i = f_i$ as initial mean fro each pixel idea |
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.
# - Set $m_i = f_i$ as initial mean fro each pixel idea | |
# - Set $m_i = f_i$ as initial mean for each pixel |
|
||
# Clustering: | ||
# - Set $m_i = f_i$ as initial mean fro each pixel idea | ||
# - Repeat the following for each mean mi: |
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 the same notation. Is mi
the same as $m_i$
?
# - stop if shift in mean $m_i$ is less than a threshoold $\epsilon$, $m_i$ is the mode | ||
|
||
# It's a very simple but computationally expensive method which doesn't require input of | ||
# the number of clusters. Very robust to outliers and clustering depends on window size w. |
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.
Technically, one could say that it replaces specification of # of clusters with the size of the radius.