{"id":15690775,"url":"https://github.com/tobybreckon/dog-saliency","last_synced_at":"2025-10-24T07:37:27.720Z","repository":{"id":37201316,"uuid":"274374578","full_name":"tobybreckon/DoG-saliency","owner":"tobybreckon","description":"reference implementation of Real-time Salient Object Detection based on Division of Gaussians [Katramados/Breckon, 2011]","archived":false,"fork":false,"pushed_at":"2023-10-02T22:37:32.000Z","size":36217,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-08T00:06:59.320Z","etag":null,"topics":["computer-vision","computer-vision-algorithms","feature-extraction","gaussian-filter","image-processing","image-processing-python","object-detection","opencv","saliency","saliency-analysis","saliency-detection","saliency-map","saliency-maps","saliency-model","saliency-prediction","visual-salience","visual-saliency"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobybreckon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T10:16:49.000Z","updated_at":"2023-01-26T05:13:03.000Z","dependencies_parsed_at":"2024-10-24T00:14:23.813Z","dependency_job_id":null,"html_url":"https://github.com/tobybreckon/DoG-saliency","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tobybreckon/DoG-saliency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobybreckon%2FDoG-saliency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobybreckon%2FDoG-saliency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobybreckon%2FDoG-saliency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobybreckon%2FDoG-saliency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobybreckon","download_url":"https://codeload.github.com/tobybreckon/DoG-saliency/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobybreckon%2FDoG-saliency/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280761433,"owners_count":26386240,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","computer-vision-algorithms","feature-extraction","gaussian-filter","image-processing","image-processing-python","object-detection","opencv","saliency","saliency-analysis","saliency-detection","saliency-map","saliency-maps","saliency-model","saliency-prediction","visual-salience","visual-saliency"],"created_at":"2024-10-03T18:16:00.424Z","updated_at":"2025-10-24T07:37:27.685Z","avatar_url":"https://github.com/tobybreckon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-time Visual Saliency by Division of Gaussians - Reference Implementation\n\n![Python - PEP8](https://github.com/tobybreckon/DoG-saliency/workflows/Python%20-%20PEP8/badge.svg)\n![Saliency Test](https://github.com/tobybreckon/DoG-saliency/workflows/Saliency%20Test/badge.svg)\n\nTested using Python 3.8.2 and [OpenCV 4.8.0](http://www.opencv.org)\n\n![DOG-Saliency](https://github.com/tobybreckon/DoG-saliency/blob/master/test/true_saliency_maps/fig_2_saliency.png)|![DOG-Saliency](https://github.com/tobybreckon/DoG-saliency/blob/master/test/samples/fig_2.png)\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Exemplar Real-time Salient Object Detection Using DOG Saliency\n\n## Abstract:\n\n_\"This paper introduces a novel method for deriving visual saliency maps in real-time without compromising the quality of\nthe output. This is achieved by replacing the computationally\nexpensive centre-surround filters with a simpler mathematical\nmodel named Division of Gaussians (DIVoG). The results are\ncompared to five other approaches, demonstrating at least six\ntimes faster execution than the current state-of-the-art whilst\nmaintaining high detection accuracy. Given the multitude of\ncomputer vision applications that make use of visual saliency\nalgorithms such a reduction in computational complexity is\nessential for improving their real-time performance.\"_\n\n[[Katramados, Breckon, In Proc. International Conference on Image Processing, IEEE, 2011](https://breckon.org/toby/publications/papers/katramados11salient.pdf)]\n\n---\n\n## Reference implementation:\n\nThis Saliency Map generator uses the Division of Gaussians (DIVoG / DoG) approach to produce real-time saliency maps. Put simply this algorithm performs the following three steps (as set out in the original DIVoG research paper):\n- Bottom-up construction of Gaussian pyramid\n- Top-down construction of Gaussian pyramid based on the output of Step 1\n- Element-by element division of the input image with the output of Step 2\n\nThis repository contains `saliencyDoG.py` which corresponds to the Division of Gaussians algortihm as defined in [Katramados / Breckon, 2011]. `demo.py` is simply an example of usage of the SaliencyDoG library (supported by `camera_stream.py`, providing an unbuffered video feed from a live camera input), which demonstrates saliencyDoG using either live or input video, and a live result. Each frame is processed sequentially, producing the real-time saliency map. `test.py` should be used to verify correct versions of libraries are installed, before using the library.\n\n`saliencyDoG.py` contains class `SaliencyDoG`. An object for a salience mapper can be created (with specific options), and used on various images, e.g.\n```python\nfrom saliencyDoG import SaliencyDoG\nimport cv2\n\nimg = cv2.imread('dog.png')\nsaliency_mapper = SaliencyDoG(pyramid_height=5, shift=5, ch_3=False,\n                              low_pass_filter=False, multi_layer_map=False)\nimg_saliency_map = saliency_mapper.generate_saliency(img)\n```\nwhere parameters:\n- `pyramid_height` - n as defined in [Katramados / Breckon 2011] - default = 5\n- `shift` - k as defined in [Katramados / Breckon 2011] - default = 5\n- `ch_3` - process colour image on every channel (approximetly 3x slower) - default = False\n- `low_pass_filter` - toggle low pass filter - default = False\n- `multi_layer_map` - the second version of the algortihm as defined in [Katramados / Breckon 2011] (significantly slower, with simmilar results) - default = False\n\nThe SaliencyDoG class makes use of the [Transparent API (T-API)](https://www.learnopencv.com/opencv-transparent-api/), to make use of any possible hardware acceleration\n\n---\n\n## Instructions to use:\n\nTo download and test the supplied code do:\n\n```\n$ git clone https://github.com/tobybreckon/DoG-saliency.git\n$ cd DoG-saliency\n$ python3.x -m pip install -r requirements.txt\n$ pytest test.py\n```\nEnsure that all tests are passed before proceeding. If any tests fail, ensure you have installed the modules from `requirements.txt` and are using at least python 3.7.5 and OpenCv 4.2.0.\n\nSubsequently run the following command to obtain real-time saliency output from a connected camera or video file specified on the command line:\n\n```\n$ python3.x demo.py [-h] [-c CAMERA_TO_USE] [-r RESCALE] [-fs] [-g] [-l] [-m] [video_file]\n```\n\npositional arguments:\n-   `video_file`\u0026nbsp;\u0026nbsp;specify optional video file\n\noptional arguments:\n-   `-h`\u0026nbsp;\u0026nbsp;show help message and exit\n-   `-c CAMERA_TO_USE`\u0026nbsp;\u0026nbsp;specify camera to use (int) - default = 0\n-   `-r RESCALE`\u0026nbsp;\u0026nbsp;rescale image by this factor (float) - default = 1.0\n-   `-fs`\u0026nbsp;\u0026nbsp; optionally run in full screen mode\n-   `-g`\u0026nbsp;\u0026nbsp; optionally process frames as grayscale\n-   `-l`\u0026nbsp;\u0026nbsp; optionally apply a low_pass_filter to saliency map\n-   `-m`\u0026nbsp;\u0026nbsp; optionally use every pyramid layer in the production of the saliency map\n\nDuring run-time, keyboard commands `x` will quit the program, `f` will toggle fullscreen, `s` will toggle between saliency mapping and the original input image frames and `t` will toggle the speed/fps info display.\n\n---\n\n## Example video:\n\n[![Examples](https://img.youtube.com/vi/3oeuWO7SlvQ/0.jpg)](https://www.youtube.com/watch?v=3oeuWO7SlvQ)\n\n\nVideo Example - click image above to [play](https://www.youtube.com/watch?v=3oeuWO7SlvQ).\n\n---\n\n## References:\n\nIf you are making use of this work in any way please reference the following articles in any report, publication, presentation, software release or any other associated materials:\n\n[Real-time Visual Saliency by Division of Gaussians](https://breckon.org/toby/publications/papers/katramados11salient.pdf)\n(Katramados, Breckon), In Proc. International Conference on Image Processing, IEEE, 2011.\n```\n@InProceedings{katramados11salient,\n  author    =    {Katramados, I. and Breckon, T.P.},\n  title     = \t {Real-time Visual Saliency by Division of Gaussians},\n  booktitle = \t {Proc. Int. Conf. on Image Processing},\n  pages     = \t {1741-1744},\n  year      = \t {2011},\n  month     = \t {September},\n  publisher =    {IEEE},\n  url       = \t {https://breckon.org/toby/publications/papers/katramados11salient.pdf},\n  doi       = \t {10.1109/ICIP.2011.6115785},\n}\n```\n\nFree for commercial use and non-commercial use (i.e. academic, non-for-profit and research) under the (very permissive) terms of the MIT free software [LICENSE](LICENSE) that must be adhered to.\n\nThe Division of Gaussians (DIVoG / DoG) saliency detection algorithm was filed as a patent (WIPO reference: [WO2013034878A2](https://patents.google.com/patent/WO2013034878A2/) by [Cranfield University](https://www.cranfield.ac.uk/), 2013/14) but this patent application has now lasped.\n\n### Acknowledgements:\n\nRyan Lail, this reference implementation of [Katramados / Breckon, 2011], Durham University, July 2020.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobybreckon%2Fdog-saliency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobybreckon%2Fdog-saliency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobybreckon%2Fdog-saliency/lists"}