{"id":19386182,"url":"https://github.com/davidstutz/superpixels-revisited","last_synced_at":"2025-04-13T10:52:29.193Z","repository":{"id":27339289,"uuid":"30814148","full_name":"davidstutz/superpixels-revisited","owner":"davidstutz","description":"Library containing 7 state-of-the-art superpixel algorithms with a total of 9 implementations used for evaluation purposes in [1] utilizing an extended version of the Berkeley Segmentation Benchmark.","archived":false,"fork":false,"pushed_at":"2018-11-28T14:08:56.000Z","size":416,"stargazers_count":263,"open_issues_count":4,"forks_count":71,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-27T02:11:19.265Z","etag":null,"topics":["computer-vision","image-processing","opencv","superpixel-algorithms","superpixels"],"latest_commit_sha":null,"homepage":"http://davidstutz.de/projects/superpixelsseeds/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidstutz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-15T01:16:54.000Z","updated_at":"2025-01-04T05:37:54.000Z","dependencies_parsed_at":"2022-08-31T19:41:09.880Z","dependency_job_id":null,"html_url":"https://github.com/davidstutz/superpixels-revisited","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidstutz%2Fsuperpixels-revisited","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidstutz%2Fsuperpixels-revisited/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidstutz%2Fsuperpixels-revisited/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidstutz%2Fsuperpixels-revisited/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidstutz","download_url":"https://codeload.github.com/davidstutz/superpixels-revisited/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248702999,"owners_count":21148116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","image-processing","opencv","superpixel-algorithms","superpixels"],"created_at":"2024-11-10T10:04:34.453Z","updated_at":"2025-04-13T10:52:29.157Z","avatar_url":"https://github.com/davidstutz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Superpixels Revisited\n\n[![Build Status](https://travis-ci.org/davidstutz/superpixels-revisited.svg?branch=master)](https://travis-ci.org/davidstutz/superpixels-revisited)\n\n**A more comprehensive comparison of superpixel algorithms, including the corresponding benchmark and implementations, can be found here: [davidstutz/superpixel-benchmark](https://github.com/davidstutz/superpixel-benchmark).**\n\nThis library combines several state-of-the-art superpixel algorithms in a single library. For each approach, a user-friendly command line tool is provided - these command line tools were used for evaluation in [1] and [2]. An overview over all superpixel approaches is provided below.\n\n    [1] D. Stutz, A. Hermans, B. Leibe.\n        Superpixel Segmentation using Depth Information.\n        Bachelor thesis, RWTH Aachen University, Aachen, Germany, 2014.\n\t[2] D. Stutz.\n\t\tSuperpixel Segmentation: An Evaluation.\n\t\tPattern Recognition (J. Gall, P. Gehler, B. Leibe (Eds.)), Lecture Notes in Computer Science, vol. 9358, pages 555 - 562, 2015.\n\nAn overview over all superpixel algorithms and their evaluation results can be found online at [3]:\n\n    [3] http://davidstutz.de/projects/superpixelsseeds/\n\n![Example: several superpixel segmentations.](screenshot.png?raw=true \"Example: several superpixel segmentations\")\n\n## Index\n\n* [Superpixel Algorithms](#superpixel-algorithms)\n* [Building](#building)\n* [Usage](#usage)\n    * [FH](#fh)\n    * [SLIC](#slic)\n    * [CIS/CS](#cis)\n    * [ERS](#ers)\n    * [PB](#pb)\n    * [CRS](#crs)\n    * [SEEDS](#seeds)\n* [License](#license)\n\n## Superpixel Algorithms\n\nProvided superpixels algorithms:\n\n* FH - Felzenswalb \u0026 Huttenlocher [4];\n* SLIC - Simple Linear Iterative Clustering [5];\n* CIS/CS - Constant Intensity Superpixels/Compact Superpixels [6];\n* ERS - Entropy Rate Superpixels [7];\n* PB - Pseudo Boolean Superpixels [8];\n* CRS - Contour Relaxed Superpixels [9];\n* SEEDS - Superpixels Extracted via Energy-Driven Sampling [10].\n\nNote that the library of CIS/CS is, due to license restrictions, not directly included. See `lib_cis/README.md` for details.\n\nFurther, note that for SLIC, both the original implementation as well as the implementation as part of the VLFeat library [11] is provided. Similarly, for SEEDS the original implementation and SEEDS Revised - an implementation written during the bachelor thesis [2] - is provided.\n\n    [4] P. F. Felzenswalb, D. P. Huttenlocher.\n        Efficient graph-based image segmentation.\n        International Journal of Computer Vision, 59(2), 2004.\n    [5] R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, S. Süsstrunk.\n        SLIC superpixels.\n        Technical report, École Polytechnique Fédérale de Lausanne, 2010.\n    [6] O. Veksler, Y. Boykov, P. Mehrani.\n        Superpixels and supervoxels in an energy optimization framework.\n        European Conference on Computer Vision, pages 211–224, 2010.\n    [7] M. Y. Lui, O. Tuzel, S. Ramalingam, R. Chellappa.\n        Entropy rate superpixel segmentation.\n        Conference on Computer Vision and Pattern Recognition, pages 2097–2104, 2011.\n    [8] Superpixels via pseudo-boolean optimization. \n        Y. Zhang, R. Hartley, J. Mashford, and S. Burn.\n        In International Conference on Computer Vision, 2011.\n    [9] C. Conrad, M. Mertz, R. Mester.\n        Contour-relaxed superpixels.\n        Energy Minimization Methods in Computer Vision and Pattern Recognition,\n        volume 8081 of Lecture Notes in Computer Science, pages 280–293, 2013.\n    [10] M. van den Bergh, X. Boix, G. Roig, B. de Capitani, L. van Gool.\n        SEEDS: Superpixels extracted via energy-driven sampling.\n        European Conference on Computer Vision, pages 13–26, 2012.\n\t[11] A. Vedaldi, B. Fulkerson.\n\t\tVLFeat: An Open and Portable Library of Computer Vision Algorithms.\n\t\t\\url{http://www.vlfeat.org/, 2008.\n\n## Building\n\n**Note:** The library was tested primarily on Ubuntu 14.04, Ubuntu 16.04 and OpenCV 2.4.10 as well as OpenCV 2.4.13. Comments on building instructions are welcome!\n\nThe library can be built using CMake and Boost:\n\n    sudo apt-get install build-essential\n    sudo apt-get install cmake\n    sudo apt-get install libboost-all-dev\n\nOpenCV can be installed using:\n\n    sudo apt-get install libopencv-dev\n\nOr following this guide: [http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html](http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html). Then, the library can be built using:\n    \n    git clone --recursive https://github.com/davidstutz/superpixels-revisited.git\n    cd superpixels-revisited\n    mkdir -p build\n    cd build\n    cmake ..\n    make\n\n**Note:** This repository currently includes the [VLFeat](https://github.com/vlfeat/vlfeat) library [11] for simplicity. However, VLFeat can also be installed using:\n\n    sudo apt-get install libvlfeat-dev libvlfeat0\n\nThen, the target `vlfeat` in `vlfeat_slic_cli/CMakeLists.txt` can be commented out.\n\n**Also see `.travis.yml` for building instructions.**\n\nThe executables will be created in `superpixels-revisited/bin` while the libraries will be written to `superpixels-revisited/lib`.\n\n**For building CIS/CS [6] you need to download the corresponding library first, see `lib_cis/README.md`.**\n\nPer default, all superpixel algorithms are built. By adapting `superpixels-revisited/CMakeLists.txt`, this behavior can be adapted by commenting out the corresponding subdirectories:\n\n    # SEEDS Revised\n    add_subdirectory(lib_seeds_revised)\n\n    # Constant Intensity Superpixels/Compact Superpixels\n    # Remove comments after installing the library as described in\n    # lib_cli/README.md!\n    # add_subdirectory(lib_cis)\n    # add_subdirectory(cis_cli)\n\n    # Entropy Rate Superpixels\n    add_subdirectory(lib_ers)\n    add_subdirectory(ers_cli)\n\n    # Contour Relaxed Superpixels\n    add_subdirectory(lib_crs)\n    add_subdirectory(crs_cli)\n\n    # Felzenswalb \u0026 Huttenlocher\n    add_subdirectory(lib_fh)\n    add_subdirectory(fh_cli)\n\n    # Pseudo Boolean Superpixels\n    add_subdirectory(lib_pb)\n    add_subdirectory(pb_cli)\n\n    # SEEDS\n    add_subdirectory(lib_seeds)\n    add_subdirectory(seeds_cli)\n\n    # SLIC\n    add_subdirectory(lib_slic)\n    add_subdirectory(slic_cli)\n\n    # VLFeat SLIC\n    add_subdirectory(vlfeat_slic_cli)\n\n## Usage\n\n**Note:** Usage details can also be found in the corresponding `main.cpp` files (e.g. `crs_cli/main.cpp` or `lib_seeds_revised/cli/main.cpp`).\n\nIn general, the following executables are provided:\n\n* `bin/cli`: SEEDS Revised;\n* `bin/cis_cli`: CIS/CS;\n* `bin/crs_cli`: CRS;\n* `bin/ers_cli`: ERS;\n* `bin/fh_cli`: FH;\n* `bin/pb_cli`: PB;\n* `bin/seeds_cli`: SEEDS;\n* `bin/slic_cli`: SLIC;\n* `bin/vlfeat_slic_cli`: VLFeat SLIC.\n\nEach command line tool is provided on an input directory containing a variables number of images to be oversegmented. Further, each executable is able to write the resulting segmentations to `.csv` files and create boundary images using the `--csv` and `--contour` options, respectively, see the example below. Using the `--help` option, all available options are printed, e.g.:\n\n    $ ./bin/cli --help\n    Allowed options:\n      --help                          produce help message\n      --input arg                     the folder to process, may contain several \n                                      images\n      --bins arg (=5)                 number of bins used for color histograms\n      --neighborhood arg (=1)         neighborhood size used for smoothing prior\n      --confidence arg (=0.100000001) minimum confidence used for block update\n      --iterations arg (=2)           iterations at each level\n      --spatial-weight arg (=0.25)    spatial weight\n      --superpixels arg (=400)        desired number of supüerpixels\n      --verbose                       show additional information while processing\n      --csv                           save segmentation as CSV file\n      --contour                       save contour image of segmentation\n      --labels                        save label image of segmentation\n      --mean                          save mean colored image of segmentation\n      --output arg (=output)          specify the output directory (default is \n                                      ./output)\n\nAs example, for running SEEDS Revised on the test set of the Berkeley Segmentation Dataset [12], use:\n\n    $ cd superpixels-revisited\n    $ wget http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/BSR/BSR_bsds500.tgz\n    $ tar -xvzf BSR_bsds500.tgz\n    $ mkdir output\n    $ ./bin/cli ./BSR/BSDS500/data/images/test/ ./output --contour\n    200 images total ...\n    On average, 0.118183 seconds needed ...\n\nFor details on the Berkeley Segmentation Dataset [12], see:\n\n    [12] P. Arbeláez, M. Maire, C. Fowlkes, J. Malik.\n         Contour detection and hierarchical image segmentation.\n         Transactions on Pattern Analysis and Machine Intelligence, volume 33, number 5, pages 898–916, 2011.\n\nIn the following, each executable is described in detail.\n\n### FH\n\n    $ ./bin/fh_cli --help\n    Allowed options:\n      --help                   produce help message\n      --input arg              the folder to process\n      --sigma arg (=1)         sigma used for smoothing\n      --threshold arg (=20)    constant for threshold function\n      --minimum-size arg (=10) minimum component size\n      --time arg               time the algorithm and save results to the given \n                               directory\n      --process                show additional information while processing\n      --csv                    save segmentation as CSV file\n      --contour                save contour image of segmentation\n      --mean                   save mean colored image of segmentation\n      --output arg (=output)   specify the output directory (default is ./output)\n\n### SLIC\n\nFor SLIC, two executables are provided, the original implementation and the implementation as part of the VLFeat library:\n\n    # OriginalSLIC:\n    $ ./bin/slic_cli --help\n    Allowed options:\n      --help                   produce help message\n      --input arg              the folder to process (can also be passed as \n                               positional argument)\n      --superpixels arg (=400) number of superpixles\n      --compactness arg (=40)  compactness\n      --perturb-seeds          perturb seeds\n      --iterations arg (=10)   iterations\n      --time arg               time the algorithm and save results to the given \n                               directory\n      --process                show additional information while processing\n      --csv                    save segmentation as CSV file\n      --contour                save contour image of segmentation\n      --mean                   save mean colored image of segmentation\n      --output arg (=output)   specify the output directory (default is ./output)\n    # VLFeat SLIC:\n    $ ./bin/vlfeat_slic_cli --help\n    Allowed options:\n      --help                         produce help message\n      --input arg                    the folder to process (can also be passed as \n                                     positional argument)\n      --region-size arg (=10)        region size used; defines the number of \n                                     superpixels\n      --minimum-region-size arg (=1) minimum region size allowed\n      --regularization arg (=100)    regularization trades off color for spatial \n                                     closeness\n      --time arg                     time the algorithm and save results to the \n                                     given directory\n      --process                      show additional information while processing\n      --csv                          save segmentation as CSV file\n      --contour                      save contour image of segmentation\n      --mean                         save mean colored image of segmentation\n      --process                      show additional information\n      --output arg (=output)         specify the output directory (default is \n                                     ./output)\n\n### CIS\n\n    $ ./bin/cis_cli --help\n    Allowed options:\n      --help                  produce help message\n      --input arg             folder containing the images to process\n      --region-size arg (=10) maxmimum allowed region size (that is region size x \n                              region size patches)\n      --type arg (=1)         0 for compact superpixels, 1 for constant intensity \n                              superpixels\n      --iterations arg (=2)   number of iterations\n      --lambda arg (=50)      lambda only influences constant intensity \n                              superpixels; larger lambda results in smoother \n                              boundaries\n      --process               show additional information while processing\n      --time arg              time the algorithm and save results to the given \n                              directory\n      --csv                   save segmentation as CSV file\n      --contour               save contour image of segmentation\n      --mean                  save mean colored image of segmentation\n      --time                  save timings in BSD evaluation format in the given \n                              directory\n      --output arg (=output)  specify the output directory (default is ./output)\n\n### ERS\n\n    $ ./bin/ers_cli --help\n    Allowed options:\n      --help                   produce help message\n      --input arg              the folder to process\n      --lambda arg (=0.5)      lambda\n      --sigma arg (=5)         sigma\n      --four-connected         use 4-connected\n      --superpixels arg (=400) number of superpixels\n      --time arg               time the algorithm and save results to the given \n                               directory\n      --process                show additional information while processing\n      --csv                    save segmentation as CSV file\n      --contour                save contour image of segmentation\n      --mean                   save mean colored image of segmentation\n      --output arg (=output)   specify the output directory (default is ./output)\n\n### PB\n\n    $ ./bin/pb_cli --help\n    Allowed options:\n      --help                 produce help message\n      --input arg            the folder to process (can also be passed as \n                             positional argument)\n      --height arg (=10)     height of initial vertical strips\n      --width arg (=10)      width of initial vertical strips\n      --sigma arg (=20)      balancing the weight between regular shape and \n                             accurate edge\n      --max-flow             use max flow algorithm instead of elimination\n      --time arg             time the algorithm and save results to the given \n                             directory\n      --process              show additional information while processing\n      --csv                  save segmentation as CSV file\n      --contour              save contour image of segmentation\n      --mean                 save mean colored image of segmentation\n      --output arg (=output) specify the output directory (default is ./output)\n\n### CRS\n\n    $ ./bin/crs_cli --help\n    Allowed options:\n      --help                                produce help message\n      --input arg                           the folder to process\n      --width arg (=20)                     width of blocks in initial superpixel \n                                            segmentation\n      --height arg (=20)                    height of blocks in initial superpixel \n                                            segmentation\n      --compactness arg (=0.045)            compactness weight\n      --clique-cost arg (=0.3)              direct clique cost\n      --iterations arg (=3)                 number of iterations to perform\n      --time arg                            time the algorithm and save results to \n                                            the given directory\n      --process                             show additional information while \n                                            processing\n      --csv                                 save segmentation as CSV file\n      --contour                             save contour image of segmentation\n      --mean                                save mean colored image of segmentation\n      --output arg (=output)                specify the output directory (default \n                                            is ./output)\n\n### SEEDS\n\nFor SEEDS, two implementations are provided. The first implementation, called SEEDS Revised, is published as result of the bachelor thesis [1]. The second implementation is the original implementation provided by van den Bergh et al.:\n\n    # SEEDS Revised:\n    $ ./bin/cli --help\n    Allowed options:\n      --help                          produce help message\n      --input arg                     the folder to process, may contain several \n                                      images\n      --bins arg (=5)                 number of bins used for color histograms\n      --neighborhood arg (=1)         neighborhood size used for smoothing prior\n      --confidence arg (=0.100000001) minimum confidence used for block update\n      --iterations arg (=2)           iterations at each level\n      --spatial-weight arg (=0.25)    spatial weight\n      --superpixels arg (=400)        desired number of supüerpixels\n      --verbose                       show additional information while processing\n      --csv                           save segmentation as CSV file\n      --contour                       save contour image of segmentation\n      --labels                        save label image of segmentation\n      --mean                          save mean colored image of segmentation\n      --output arg (=output)          specify the output directory (default is \n                                      ./output)\n    # Original SEEDS:\n    $ ./bin/seeds_cli --help\n    Allowed options:\n      --help                 produce help message\n      --input arg            the folder to process (can also be passed as \n                             positional argument)\n      --bins arg (=5)        number of bins\n      --iterations arg (=2)  iterations at each level\n      --bsd arg              number of superpixels for BSDS500\n      --nyucropped arg       number of superpixels for the cropped NYU Depth V2\n      --nyuhalf arg          number of superpixel for NYU Depth V2 halfed\n      --nyuhalfcropped arg   number of superpixels for the cropped NYU Depth V2 \n                             halfed\n      --time arg             time the algorithm and save results to the given \n                             directory\n      --process              show additional information while processing\n      --csv                  save segmentation as CSV file\n      --contour              save contour image of segmentation\n      --mean                 save mean colored image of segmentation\n      --output arg (=output) specify the output directory (default is ./output)\n\n## License\n\nLicenses for source code corresponding to:\n\nD. Stutz. **Superpixel Segmentation using Depth Information.** Bachelor Thesis, RWTH Aachen University, 2014.\n\nD. Stutz. **Superpixel Segmentation: An Evaluation.** Pattern Recognition (J. Gall, P. Gehler, B. Leibe (Eds.)), Lecture Notes in Computer Science, vol. 9358, pages 555 - 562, 2015.\n\nNote that for individual superpixel algorithms, separate linceses apply; see the `README.md` in the corresponding folder (e.g. `lib_crs/README.md`).\n\nCopyright (c) 2014-2018 David Stutz, RWTH Aachen University\n\n**Please read carefully the following terms and conditions and any accompanying documentation before you download and/or use this software and associated documentation files (the \"Software\").**\n\nThe authors hereby grant you a non-exclusive, non-transferable, free of charge right to copy, modify, merge, publish, distribute, and sublicense the Software for the sole purpose of performing non-commercial scientific research, non-commercial education, or non-commercial artistic projects.\n\nAny other use, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, or production of other artefacts for commercial purposes.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nYou understand and agree that the authors are under no obligation to provide either maintenance services, update services, notices of latent defects, or corrections of defects with regard to the Software. The authors nevertheless reserve the right to update, modify, or discontinue the Software at any time.\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. You agree to cite the corresponding papers (see above) in documents and papers that report on research using this Software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidstutz%2Fsuperpixels-revisited","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidstutz%2Fsuperpixels-revisited","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidstutz%2Fsuperpixels-revisited/lists"}