{"id":13419396,"url":"https://github.com/Dovyski/cvui","last_synced_at":"2025-03-15T05:31:07.883Z","repository":{"id":9215972,"uuid":"61278506","full_name":"Dovyski/cvui","owner":"Dovyski","description":"A (very) simple UI lib built on top of OpenCV drawing primitives","archived":false,"fork":false,"pushed_at":"2022-09-04T19:53:57.000Z","size":1664,"stargazers_count":841,"open_issues_count":56,"forks_count":214,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-03-08T20:50:18.031Z","etag":null,"topics":["computer-vision","cpp","gui","imgui","opencv","opencv-drawing-primitives","python","ui"],"latest_commit_sha":null,"homepage":"https://dovyski.github.io/cvui/","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/Dovyski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["dovyski"]}},"created_at":"2016-06-16T09:07:21.000Z","updated_at":"2025-02-28T18:04:30.000Z","dependencies_parsed_at":"2022-07-18T05:21:32.120Z","dependency_job_id":null,"html_url":"https://github.com/Dovyski/cvui","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dovyski%2Fcvui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dovyski%2Fcvui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dovyski%2Fcvui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dovyski%2Fcvui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dovyski","download_url":"https://codeload.github.com/Dovyski/cvui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690113,"owners_count":20331726,"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","cpp","gui","imgui","opencv","opencv-drawing-primitives","python","ui"],"created_at":"2024-07-30T22:01:15.418Z","updated_at":"2025-03-15T05:31:07.516Z","avatar_url":"https://github.com/Dovyski.png","language":"C++","readme":"cvui\n=====\nA (very) simple UI lib built on top of OpenCV drawing primitives. Other UI libs, such as [imgui](https://github.com/ocornut/imgui), require a graphical backend (e.g. OpenGL) to work, so if you want to use imgui in a OpenCV app, you must make it OpenGL enabled, for instance. It is not the case with cvui, which uses *only* OpenCV drawing primitives to do all the rendering (no OpenGL or Qt required).\n\n![image](https://raw.githubusercontent.com/Dovyski/depository/master/cvui.png?20180627)\n\nFeatures\n--------\n- Lightweight and simple to use user interface;\n- Header-only with no external dependencies (except OpenCV);\n- Based on OpenCV drawing primitives only (OpenGL or Qt are not required);\n- Friendly and C-like API (no classes/objects, etc);\n- Easily render components without worrying about their position (using rows/columns);\n- Simple (yet powerful) mouse API;\n- Modest number of UI components (11 in total);\n- Available in C++ and Python (pure implementation, no bindings).\n\nBuild\n-----\ncvui is a header-only lib that does not require a build. Just add `cvui.h` (or `cvui.py`) to your project and you are ready to go. The only dependency is OpenCV (version `2.x` or `3.x`), which you are probably using already.\n\nUsage\n-----\nCheck the [online documentation](https://dovyski.github.io/cvui) or the [examples](https://github.com/Dovyski/cvui/tree/master/example) folder to learn how to use cvui. The general usage in C++ and Python is shown below.\n\nUsage in C++:\n```cpp\n#include \u003copencv2/opencv.hpp\u003e\n\n// One (and only one) of your C++ files must define CVUI_IMPLEMENTATION\n// before the inclusion of cvui.h to ensure its implementaiton is compiled.\n#define CVUI_IMPLEMENTATION\n#include \"cvui.h\"\n\n#define WINDOW_NAME \"CVUI Hello World!\"\n\nint main(int argc, const char *argv[])\n{\n\t// Create a frame where components will be rendered to.\n\tcv::Mat frame = cv::Mat(200, 500, CV_8UC3);\n\n\t// Init cvui and tell it to create a OpenCV window, i.e. cv::namedWindow(WINDOW_NAME).\n\tcvui::init(WINDOW_NAME);\n\n\twhile (true) {\n\t\t// Fill the frame with a nice color\n\t\tframe = cv::Scalar(49, 52, 49);\n\n\t\t// Render UI components to the frame\n\t\tcvui::text(frame, 110, 80, \"Hello, world!\");\n\t\tcvui::text(frame, 110, 120, \"cvui is awesome!\");\n\n\t\t// Update cvui stuff and show everything on the screen\n\t\tcvui::imshow(WINDOW_NAME, frame);\n\n\t\tif (cv::waitKey(20) == 27) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn 0;\n}\n```\n\nUsage in Python:\n```python\nimport numpy as np\nimport cv2\nimport cvui\n\nWINDOW_NAME = 'CVUI Hello World!'\n\n# Create a frame where components will be rendered to.\nframe = np.zeros((200, 500, 3), np.uint8)\n\n# Init cvui and tell it to create a OpenCV window, i.e. cv2.namedWindow(WINDOW_NAME).\ncvui.init(WINDOW_NAME)\n\nwhile True:\n\t# Fill the frame with a nice color\n\tframe[:] = (49, 52, 49)\n\n\t# Render UI components to the frame\n\tcvui.text(frame, 110, 80, 'Hello, world!')\n\tcvui.text(frame, 110, 120, 'cvui is awesome!')\n\n\t# Update cvui stuff and show everything on the screen\n\tcvui.imshow(WINDOW_NAME, frame)\n\n\tif cv2.waitKey(20) == 27:\n\t\tbreak\n```\n\nLicense\n-----\nCopyright (c) 2016 Fernando Bevilacqua. Licensed under the [MIT license](LICENSE.md).\n\nChange log\n-----\nSee all changes in the [CHANGELOG](CHANGELOG.md) file.\n","funding_links":["https://github.com/sponsors/dovyski"],"categories":["TODO scan for Android support in followings","C++","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDovyski%2Fcvui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDovyski%2Fcvui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDovyski%2Fcvui/lists"}