{"id":17301926,"url":"https://github.com/egecetin/libkaleidoscope","last_synced_at":"2025-04-14T12:42:53.225Z","repository":{"id":61546926,"uuid":"391347906","full_name":"egecetin/libKaleidoscope","owner":"egecetin","description":"A library to create kaleidoscope effect on images with CUDA. You can build on all platforms using CMake","archived":false,"fork":false,"pushed_at":"2024-03-15T10:52:53.000Z","size":12425,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-15T12:06:05.993Z","etag":null,"topics":["c","cpp","cuda","image-filter","image-filtering","image-manipulation","image-processing","kaleidoscope","python","real-time","real-time-processing","video-filter","video-filtering","video-processing"],"latest_commit_sha":null,"homepage":"https://egecetin.github.io/libKaleidoscope/","language":"C","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/egecetin.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},"funding":{"github":"egecetin"}},"created_at":"2021-07-31T12:18:08.000Z","updated_at":"2024-04-15T12:57:03.725Z","dependencies_parsed_at":"2024-04-15T12:56:59.224Z","dependency_job_id":"ed650e4e-ee40-473b-8f53-832bd8406dd5","html_url":"https://github.com/egecetin/libKaleidoscope","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egecetin%2FlibKaleidoscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egecetin%2FlibKaleidoscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egecetin%2FlibKaleidoscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egecetin%2FlibKaleidoscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egecetin","download_url":"https://codeload.github.com/egecetin/libKaleidoscope/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248883225,"owners_count":21177180,"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":["c","cpp","cuda","image-filter","image-filtering","image-manipulation","image-processing","kaleidoscope","python","real-time","real-time-processing","video-filter","video-filtering","video-processing"],"created_at":"2024-10-15T11:45:59.745Z","updated_at":"2025-04-14T12:42:53.188Z","avatar_url":"https://github.com/egecetin.png","language":"C","funding_links":["https://github.com/sponsors/egecetin"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"doc/images/logo-white.png\"/\u003e\n\u003cimg src=\"doc/images/logo-black.png\" alt=\"\" width=\"850\"/\u003e\n\u003c/picture\u003e\n\u003cbr\u003e\n\nA library to create kaleidoscope effect on images. You can build on all platforms using CMake.\n\n![GitHub](https://img.shields.io/github/license/egecetin/libKaleidoscope?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/egecetin/libKaleidoscope/pre-commit.yml?branch=master\u0026label=pre-commit\u0026logo=precommit\u0026logoColor=white\u0026style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/egecetin/libKaleidoscope/codeql-analysis.yml?branch=master\u0026label=CodeQL\u0026logo=github\u0026style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/egecetin/libKaleidoscope/os-builds.yml?branch=master\u0026label=Build\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge)\n![Codecov](https://img.shields.io/codecov/c/github/egecetin/libkaleidoscope?logo=codecov\u0026logoColor=white\u0026style=for-the-badge\u0026token=70EJQJRRBH)\n![Codacy grade](https://img.shields.io/codacy/grade/b6c3a6abeeb34c2e8aa67aaeb8bd2982?logo=codacy\u0026style=for-the-badge)\n\n\n![C Badge](https://img.shields.io/badge/C-%23555555?style=for-the-badge\u0026logo=c\u0026logoColor=white)\n![C++ Badge](https://img.shields.io/badge/C%2B%2B-%23f34b7d?style=for-the-badge\u0026logo=cplusplus\u0026logoColor=white)\n![Python Badge](https://img.shields.io/badge/Python-%233572A5?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![CUDA Badge](https://img.shields.io/badge/CUDA-%233A4E3A?style=for-the-badge\u0026logo=nvidia\u0026logoColor=white)\n\u003c/div\u003e\n\nThe library is written in C language so you can use Foreign Function Interface (FFI) to call functions from your favorite programming language. You can download from python package from PyPI. It also has C++ header only library to provide easier interface for C++ users and CUDA support for people who have doubts about performance. Check for mathematical explanation of the kaleidoscope effect from my [webpage](https://egecetin.github.io/Projects/kaleidoscope)\n\n## Supported Languages\n\n- C : Main programming language\n- C++ : Header only binding for easier usage\n- Python : Bindings using Cython\n- CUDA : For GPU computing\n\n## Install for Python\n\n```\npip install LibKaleidoscope\n```\n\nPython users check python/python-test.py in GitHub for basic usage\n\n## Building\n\nUse the following commands,\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --parallel\n```\n\nIf you want to enable CUDA backend,\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release -DKALEIDOSCOPE_ENABLE_CUDA=ON ..\ncmake --build . --parallel\n```\n\nThere is no direct dependency for libjpeg-turbo inside from the library. It is just for test and demonstration purposes. If you don't want to install/compile just disable command line tool compilation with ``-DKALEIDOSCOPE_ENABLE_CMD_TOOL=OFF``\n\n## Usage\n\nThe library has a simple usage and you need only three functions to use it. Check the sample usage at ``src/kaleidoscope-cmd.c``\n\n- Initialization of the transformation matrix: ``int initKaleidoscope(KaleidoscopeHandle *handler, int n, int width, int height, double scaleDown)``\n- Processing image (Can be used multiple times if the input images have same dimensions): ``void processKaleidoscope(KaleidoscopeHandle *handler, double k, unsigned char *imgIn, unsigned char *imgOut)``\n- Deinitialization of the transformation matrix: ``void deInitKaleidoscope(KaleidoscopeHandle *handler)``\n\nAlternatively you can directly use the command line program to create kaleidoscope effect with ``./kaleidoscope-cmd \u003cInput Image Path\u003e \u003cOutput Image Path\u003e \u003cN\u003e``. You can see an example below for ``N=8``\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"doc/images/ac-synin.jpg\" width=\"425\"/\u003e \u003cimg src=\"doc/images/ac-synin-out.jpg\" width=\"425\"/\u003e\n    \u003cbr\u003e\n    \u003csmall\u003eImage source: AC Valhalla\u003c/small\u003e\n\u003c/div\u003e\n\nFor C++ and CUDA usage check the unit tests at ``tests/processingTest.cpp`` and ``tests/processingTest.cu``. It is very easy! Just include the header and construct the ``Kaleidoscope`` class from ``kalos`` namespace.\n\n- For C++ header only binding,\n\n```\n#include \u003ckaleidoscope.hpp\u003e\n\nint main()\n{\n    kalos::Kaleidoscope handler(n, width, height, nComponents, scaleDown, k);\n\n    /* ... */\n\n    handler.processImage(inData, outData, nPixel);\n\n    /* ... */\n\n    return 0;\n}\n```\n\n- For CUDA backend,\n\n```\n#include \u003ccuda/kaleidoscope.cuh\u003e\n\nint main()\n{\n    kalos::cuda::Kaleidoscope handler(n, width, height, nComponents, scaleDown, k);\n\n    /* ... */\n\n    // Make sure inData and outData is device allocated!\n    handler.processImage(inData, outData, nPixel);\n\n    /* ... */\n\n    return 0;\n}\n```\n\n## Benchmark\n\nIt is really fast! On a Intel i7-11800H CPU it achieves,\n\n- ~65 FPS for 4K UHD (3840 x 2160)\n- ~265 FPS for Full HD (1920 x 1080)\n- ~640 FPS for 720p (1280 x 720)\n- ~1350 FPS for 576p (720 x 576)\n\nresolution images. The performance estimation can be seen at the below\n\n\u003cdiv align=\"center\"\u003e\n    \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"doc/images/performance-white.png\"/\u003e\n    \u003cimg src=\"doc/images/performance-black.png\" alt=\"\" width=\"850\"/\u003e\n    \u003c/picture\u003e\n\u003c/div\u003e\n\n$$ FPS = a\\text{ }e^{b\\text{ }nPixels}+c\\text{ }e^{d\\text{ }nPixels} $$\n\n$$ a = 2492 \\text{, } b = -2.165\\text{ }10^{-6} \\text{, } c = 364.9 \\text{, } d = -2.08\\text{ }10^{-7} $$\n\nIf you want to benchmark code on your system make sure you configured with ```-DCMAKE_BUILD_TYPE=Release``` and use this command,\n\n```./kaleidoscope-cmd \u003cInput Image Path\u003e \u003cOutput Image Path\u003e \u003cN\u003e \u003cNumber of loop\u003e```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegecetin%2Flibkaleidoscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegecetin%2Flibkaleidoscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegecetin%2Flibkaleidoscope/lists"}