{"id":17189099,"url":"https://github.com/esimov/colidr","last_synced_at":"2025-04-13T19:23:02.214Z","repository":{"id":91223548,"uuid":"144253599","full_name":"esimov/colidr","owner":"esimov","description":"Coherent Line Drawing implementation in Go.","archived":false,"fork":false,"pushed_at":"2021-04-13T09:13:26.000Z","size":192,"stargazers_count":55,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T10:02:54.217Z","etag":null,"topics":["coherent-line-drawing","computer-graphics","computer-vision","gocv","golang","non-photorealistic-rendering","opencv","rendering"],"latest_commit_sha":null,"homepage":"","language":"Go","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/esimov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"esimov"}},"created_at":"2018-08-10T07:38:32.000Z","updated_at":"2024-04-30T05:24:53.000Z","dependencies_parsed_at":"2023-03-20T18:16:31.782Z","dependency_job_id":null,"html_url":"https://github.com/esimov/colidr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcolidr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcolidr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcolidr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcolidr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esimov","download_url":"https://codeload.github.com/esimov/colidr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766687,"owners_count":21158302,"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":["coherent-line-drawing","computer-graphics","computer-vision","gocv","golang","non-photorealistic-rendering","opencv","rendering"],"created_at":"2024-10-15T01:10:44.710Z","updated_at":"2025-04-13T19:23:02.158Z","avatar_url":"https://github.com/esimov.png","language":"Go","funding_links":["https://github.com/sponsors/esimov"],"categories":[],"sub_categories":[],"readme":"# colidr - Coherent Line Drawing\n\n[![build](https://github.com/esimov/colidr/workflows/build/badge.svg)](https://github.com/esimov/colidr/actions)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat)](./LICENSE)\n[![release](https://img.shields.io/badge/release-v1.0.1-blue.svg)](https://github.com/esimov/colidr/releases/tag/v1.0.1)\n\nImplementation in Go of the [Coherent Line Drawing](http://umsl.edu/mathcs/about/People/Faculty/HenryKang/coon.pdf) algorithm developed by Kang et al, NPAR 2007.\n\n![sample](https://user-images.githubusercontent.com/883386/60726045-40c83a80-9f43-11e9-9d53-7f190889e4bc.jpg)\n\n## Requirements\n- Go 1.10 or higher, but it should work even with a lower version\n- OpenCV 3 (tested with 3.4.2)\n- [gocv](https://github.com/hybridgroup/gocv) (bundled into the project, since it was extended with missing OpenCV functions needed for the implementation)\n- [potrace](http://potrace.sourceforge.net/) - for transforming the bitmap into smooth, scalable image (however this is optional)\n\n## Installation\n```bash\n$ go get -u github.com/esimov/colidr/\n$ go install\n```\nAnother option is cloning the repository and running the `make` file.\n```bash\n$ git clone https://github.com/esimov/colidr\n$ cd colidr\n$ make\n```\nThis will generate the binary file.\n\n## Usage\n```bash\n$ colidr -h\n\n┌─┐┌─┐┬  ┬┌┬┐┬─┐\n│  │ ││  │ ││├┬┘\n└─┘└─┘┴─┘┴─┴┘┴└─\n\nCoherent Line Drawing CLI\n    Version: 1.0.1\n\n  -aa\n    \tAnti aliasing\n  -bl int\n    \tBlur size (default 3)\n  -di int\n    \tNumber of FDoG iteration\n  -ei int\n    \tNumber of Etf iteration (default 1)\n  -in string\n    \tSource image\n  -k int\n    \tEtf kernel (default 3)\n  -out string\n    \tDestination image\n  -pt\n    \tUse potrace to smooth edges (default true)\n  -rho float\n    \tRho (default 0.98)\n  -sc float\n    \tSigmaC (default 1)\n  -sm float\n    \tSigmaM (default 3)\n  -sr float\n    \tSigmaR (default 2.6)\n  -tau float\n    \tTau (default 0.98)\n  -ve\n    \tVisualize Etf\n  -vr\n    \tVisualize end result\n\n```\nFeel free to play with the values in order to modify the visual output of the generated (non-photorealistically rendered) image. To obtain higher fidelity results you need to increase the `kernel` value and also the ETF iteration number. Different combinations produces completely different output. The `-di`, `-ei`, `-k` flags are mostly used for fine tuning, on the other hand `-rho` and `-tau` flags could change dramatically the rendered output.\n\nYou can also visualize the edge tangent flow if you enable the `-ve` flag. Below is the process illustrated:\n\n| Original image | Edge tangent flow | Coherent line drawing (final output)\n|:--:|:--:|:--:|\n| ![original](https://user-images.githubusercontent.com/883386/60724812-0f9a3b00-9f40-11e9-86c2-906bc652b3f6.jpg) | ![flowfield](https://user-images.githubusercontent.com/883386/60726316-ea0f3080-9f43-11e9-9b6c-c9bac05b32f0.png) | ![output](https://user-images.githubusercontent.com/883386/60725818-b1228c00-9f42-11e9-9019-6280d31aa09f.png) | \n\nUsing the `-pt` flag you can trace the generated bitmap into a smooth scalabe image. You need to have [potrace](http://potrace.sourceforge.net/) installed on your machine for this scope.\n\nBelow is an example whith and without the potrace flag activated.\n\n| Normal output | Potrace activated\n|:--:|:--:|\n| ![normal](https://user-images.githubusercontent.com/883386/60726045-40c83a80-9f43-11e9-9d53-7f190889e4bc.jpg) | ![smooth](https://user-images.githubusercontent.com/883386/60726046-40c83a80-9f43-11e9-81b8-d98bfea90991.jpg) |\n\nThe above [image](http://hof.povray.org/images/patio.jpg) was ganareted with the following command:\n\n```bash\ncolidr -in ~/Desktop/patio.jpg -out ~/Desktop/patio_scene.png -k=1 -sr=2.5 -sm=3.2 -tau=0.9975 -di=1 -aa=1 -ve=1 -vr=0 -pt=1 -ei=1\n```\n\n## Sample images\n| Rasterized bitmap | Vectorized image\n|:--:|:--:|\n| ![great_wave_of_kanagawa](https://user-images.githubusercontent.com/883386/60795446-5cfeee00-a174-11e9-8f55-08a3695eca56.png) | ![great_wave_of_kanagawa](https://user-images.githubusercontent.com/883386/60795445-5cfeee00-a174-11e9-9c7a-492fb72b3f69.png) |\n| ![starry_night](https://user-images.githubusercontent.com/883386/60795440-5c665780-a174-11e9-9804-d5e56d0c49e7.png) | ![starry_night](https://user-images.githubusercontent.com/883386/60795439-5c665780-a174-11e9-9d01-2c05373b465e.png) |\n| ![people](https://user-images.githubusercontent.com/883386/60795438-5c665780-a174-11e9-8c8a-365bd8eda329.png) | ![people](https://user-images.githubusercontent.com/883386/60795436-5bcdc100-a174-11e9-8fe2-00e6a0f13f06.png) |\n| ![tiger](https://user-images.githubusercontent.com/883386/60795443-5cfeee00-a174-11e9-9fd4-6ceb9a02ca21.png) | ![tiger](https://user-images.githubusercontent.com/883386/60795442-5c665780-a174-11e9-922b-fd5517622157.png) |\n\n## Todo\n- [ ] GUI support\n\n## Author\n\n* Endre Simo ([@simo_endre](https://twitter.com/simo_endre))\n\n## License\nCopyright © 2019 Endre Simo\n\nThis project is under the MIT License. See the [LICENSE](https://github.com/esimov/colidr/blob/master/LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fcolidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesimov%2Fcolidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fcolidr/lists"}