{"action":"created","issue":{"url":"https://api.github.com/repos/ukoethe/vigra/issues/281","labels_url":"https://api.github.com/repos/ukoethe/vigra/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/ukoethe/vigra/issues/281/comments","events_url":"https://api.github.com/repos/ukoethe/vigra/issues/281/events","html_url":"https://github.com/ukoethe/vigra/issues/281","id":123345662,"number":281,"title":"slicSuperpixels() always returns '0'.","user":{"login":"RishabhMalviya","id":6564529,"avatar_url":"https://avatars.githubusercontent.com/u/6564529?v=3","gravatar_id":"","url":"https://api.github.com/users/RishabhMalviya","html_url":"https://github.com/RishabhMalviya","followers_url":"https://api.github.com/users/RishabhMalviya/followers","following_url":"https://api.github.com/users/RishabhMalviya/following{/other_user}","gists_url":"https://api.github.com/users/RishabhMalviya/gists{/gist_id}","starred_url":"https://api.github.com/users/RishabhMalviya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RishabhMalviya/subscriptions","organizations_url":"https://api.github.com/users/RishabhMalviya/orgs","repos_url":"https://api.github.com/users/RishabhMalviya/repos","events_url":"https://api.github.com/users/RishabhMalviya/events{/privacy}","received_events_url":"https://api.github.com/users/RishabhMalviya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-21T19:49:07Z","updated_at":"2015-12-21T20:40:23Z","closed_at":null,"body":"I used the library (1.10.0 release) as part of a [project](https://github.com/RishabhMalviya/Semantic_Perception) recently, and I think I may have discovered a bug with the `slicSuperpixels()` function. It states the following in the [documentation](http://ukoethe.github.io/vigra/doc-release/vigra/group__SeededRegionGrowing.html#ga5561f1ce9b3f7a95b7de67738a0d2447) on the website: \r\n\r\n*\"The function returns the number of superpixels, which equals the largest label because labeling starts at 1.\"*\r\n\r\nBut when using the function, it always returned '0'. I found a way around this by calculating the maximum value in the `labels` MultiArray that is filled up by the function (please look at how the variable `superpixelCount` is assigned in the `extractSLICSuperpixels` function at line number 59 in [this](https://github.com/RishabhMalviya/Semantic_Perception/blob/master/src/features_slic.cpp) source file). Furthermore, when going through these super-pixels, I discovered that many of them had zero pixels in them. \r\n\r\nI think this may be because internally some superpixels get merged with others. I do not know exactly what files to work on or how to proceed to fix his issue, but I felt that I should bring this to light so that it can be worked upon."},"comment":{"url":"https://api.github.com/repos/ukoethe/vigra/issues/comments/166411318","html_url":"https://github.com/ukoethe/vigra/issues/281#issuecomment-166411318","issue_url":"https://api.github.com/repos/ukoethe/vigra/issues/281","id":166411318,"user":{"login":"ukoethe","id":897680,"avatar_url":"https://avatars.githubusercontent.com/u/897680?v=3","gravatar_id":"","url":"https://api.github.com/users/ukoethe","html_url":"https://github.com/ukoethe","followers_url":"https://api.github.com/users/ukoethe/followers","following_url":"https://api.github.com/users/ukoethe/following{/other_user}","gists_url":"https://api.github.com/users/ukoethe/gists{/gist_id}","starred_url":"https://api.github.com/users/ukoethe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukoethe/subscriptions","organizations_url":"https://api.github.com/users/ukoethe/orgs","repos_url":"https://api.github.com/users/ukoethe/repos","events_url":"https://api.github.com/users/ukoethe/events{/privacy}","received_events_url":"https://api.github.com/users/ukoethe/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T20:40:22Z","updated_at":"2015-12-21T20:40:22Z","body":"Thanks for reporting this. Can you please try if the problem persists when you use the current master from github? \r\n\r\n> Furthermore, when going through these super-pixels, I discovered that many of them had zero pixels in them. I think this may be because internally some superpixels get merged with others.\r\n\r\nAccording to the original authors of the SLIC method, merging of some superpixels is desired. However, function `slicSuperpixels()` is supposed to call function `Slic::postProcessing()` which should restore consecutive superpixel labels and return the maximum. Is this function called in your installation?"}}