-
Notifications
You must be signed in to change notification settings - Fork 34
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
Incorrect centroid location #9
Comments
I like the output of 0.4 more though, guess I will compute the centroid again in numpy for now. |
Thanks for the report. I'll have a look on the version you mentioned. (it may take time though, because of the ongoing issue in my country😭) |
Stay safe! I am in Hong Kong so 👀 |
Hello @Algy |
Hello @Algy , Thanks for this library, it is really fast and does the job very well. I think that I met an issue that could be connected to the centroid one. If I show the image obtained by coloring every pixel of original image with the color of the assigned cluster I get the colors all shuffled up. I think that the indices of the clusters do not match the indices in the assignment matrix. PS I checked the color space and it is not a problem of color conversion. |
Any progress on the problem? I encounter this problem too. |
You can bypass the problem by reassigning the index at very little cost, would still be faster if fixed in the C++ code probably. for entry in slic.slic_model.clusters:
y, x = entry['yx']
idx = assignment[int(y),int(x)]
x_centroid_map[assignment==idx] = x
y_centroid_map[assignment==idx] = y |
Thank you for this great piece of work!
I spotted an issue in the latest version (0.4.0), that the centroid information returned by
slic.slic_model.clusters
is incorrect.Minimal working example:
I would expect the (x, y) centroid map to look like this:
X:
Y:
But it gives me this for X:
and Y is fine.
Note that this works in version 0.3.5 (which I used to generate the "expected output")!
Hope this helps 😄
The text was updated successfully, but these errors were encountered: