Closed CalumMurray closed 4 years ago
Actually, having done this, it seems to corrupt the cluster indexing, locations etc. Any ideas?
There is indeed something not right in that function. I've got that part not from the paper, but from the corresponding source code: http://ivrg.epfl.ch/research/superpixels
Maybe something is done wrong here what has been done right in their code. It's been a while since I've seen that code, but it might also not be a vital part of the process.
On 24-03-14 20:47, Calum Murray wrote:
Actually, having done this, it seems to corrupt the cluster indexing, locations etc. Any ideas?
— Reply to this email directly or view it on GitHub https://github.com/PSMM/SLIC-Superpixels/pull/1#issuecomment-38491711.
I've had a look through the original source code, and I can't see anything wrong really. But I guess, as well as reassigning clusters = new_clusters, you'll also need to reassign the centers, distances and center_counts? I've also updated this to work with the newer OpenCV 2 API by the way (e.g. cv::Mat and friends).
What I've done is append "create_connectivity()" to the end of "generatesuperpixels()", then re run the code commented /* Clear the center values. / / Compute the new cluster centers. / /_ Normalize the clusters. */
Which looks like it's working so far, although there will almost certainly be a more efficient way to do it inline while create_connectivity is running or something.
When create_connectivity() was called, it only updated the local clusters copy.