{"id":21655028,"url":"https://github.com/zchrissirhcz/smallcv","last_synced_at":"2025-08-17T19:31:25.208Z","repository":{"id":40295835,"uuid":"319067564","full_name":"zchrissirhcz/smallcv","owner":"zchrissirhcz","description":"Lightweight Mat and imread()/imwrite()/imshow()","archived":false,"fork":false,"pushed_at":"2024-06-17T17:20:23.000Z","size":40568,"stargazers_count":80,"open_issues_count":1,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-09T03:24:32.586Z","etag":null,"topics":["imread","imshow","lightweight","opencv"],"latest_commit_sha":null,"homepage":"","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/zchrissirhcz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license/ncnn/LICENSE.txt","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-12-06T15:38:36.000Z","updated_at":"2024-11-28T17:54:08.000Z","dependencies_parsed_at":"2023-01-29T23:30:29.643Z","dependency_job_id":"11904117-d71d-4694-8880-d290b6632343","html_url":"https://github.com/zchrissirhcz/smallcv","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/zchrissirhcz%2Fsmallcv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchrissirhcz%2Fsmallcv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchrissirhcz%2Fsmallcv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchrissirhcz%2Fsmallcv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zchrissirhcz","download_url":"https://codeload.github.com/zchrissirhcz/smallcv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230159996,"owners_count":18182610,"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":["imread","imshow","lightweight","opencv"],"created_at":"2024-11-25T08:29:41.198Z","updated_at":"2024-12-17T18:11:43.576Z","avatar_url":"https://github.com/zchrissirhcz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmallCV\n\n[![unittest](https://github.com/zchrissirhcz/smallcv/actions/workflows/unit_test.yml/badge.svg)](https://github.com/zchrissirhcz/smallcv/actions/workflows/unit_test.yml)\n![Windows](https://img.shields.io/badge/Windows-gray?logo=windows\u0026logoColor=blue)\n![Ubuntu](https://img.shields.io/badge/Ubuntu-gray?logo=ubuntu)\n![macOS](https://img.shields.io/badge/-macOS-333333?style=flat\u0026logo=apple)\n\nSmall Computer Vision Library.\n\n## Features\n- Lightweight\n    - [x] C++11 based\n    - [x] Not including optimization\n- Conformance\n    - [x] API like OpenCV\n    - [x] Same result on PC and Android\n\n\n## APIs\nSupported:\n- `Mat`\n- `imread()`/`imwrite()`/`imshow()`/`waitKey()`\n- `cvtColor()`/`resize()`\n- `putText()`/`rectangle()`/`circle()`/`line()`\n\nNot supported:\n- `Mat::clone()`\n- `saturate_cast`\n- `parallel_for_`\n- `operator Point_\u003cTp2\u003e`\n\n\n## Getting Started\n\nTo build this project, you are assumed:\n\n- Familiar with CMake based C/C++ building\n- Install **glfw** for `imshow()`. See [deps/glfw_build](deps/glfw_build) for build hints.\n- Modify [cmake/deps.cmake](cmake/deps.cmake) to specify dependencies paths.\n\n```bash\ncd build\n./linux-x64.sh   # Linux build\n./Xcode.sh       # macOSX build\n.\\vs2019-x64.cmd # Windows build\n```\n\n## Example Usage\n```c++\n#include \u003cstring\u003e\n#include \"smallcv.hpp\"\n\nint main() {\n    std::string image_path = \"mingren.jpg\";\n    cv::Mat image = cv::imread(image_path);\n    cv::Rect rect(100, 100, 233, 233);\n    cv::rectangle(image, rect, cv::Scalar(0,0,255), 2);\n    cv::imshow(\"mingren\", image);\n    cv::waitKey(0);\n    cv::imwrite(\"mingren_swap.bmp\", image);\n\n    return 0;\n}\n```\n\n![](assets/ncnn_simplepose_result.png)\n\n```c++\n#include \u003cstring\u003e\n#include \"smallcv.hpp\"\n\nint main()\n{\n    std::string image_path = \"mingren.jpg\";\n    //std::string image_path = \"E:/projects/arccv/smallcv/build/vs2019-x64/mingren.jpg\";\n    cv::Mat image = cv::imread(image_path);\n    cv::Rect rect(100, 100, 233, 233);\n    cv::rectangle(image, rect, cv::Scalar(0,0,255), 2);\n    \n    cv::Mat bigger_image;\n    cv::Size ssize = image.size();\n    cv::Size dsize = ssize * 2;\n    cv::resize(image, bigger_image, dsize);\n\n    cv::Mat gray;\n    cv::cvtColor(image, gray, cv::COLOR_BGR2GRAY);\n    \n\n    cv::putText(image, \"image\", cv::Point(60, 60), 10, 1, cv::Scalar(255, 0, 0), 2);\n    cv::putText(bigger_image, \"bigger image\", cv::Point(60, 60), 10, 1, cv::Scalar(255, 0, 0), 2);\n    cv::putText(gray, \"gray\", cv::Point(60, 60), 10, 1, cv::Scalar(255, 0, 0), 2);\n\n    cv::imshow(\"mingren\", image);\n    cv::imshow(\"bigger image\", bigger_image);\n    cv::imshow(\"gray\", gray);\n\n    cv::waitKey(0);\n\n    cv::imwrite(\"image.png\", image);\n    cv::imwrite(\"bigger_image.png\", bigger_image);\n    cv::imwrite(\"gray.png\", gray);\n}\n```\n![](assets/smallcv_imshow_multiple_win_result.png)\n\n\n## Acknowledgement\n\nSmallCV referenced the following projects：\n\n- [OpenCV](https://github.com/opencv/opencv)\n- [ncnn](https://github.com/tencent/ncnn)\n- [shufaCV](https://github.com/scarsty/shufaCV)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchrissirhcz%2Fsmallcv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzchrissirhcz%2Fsmallcv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchrissirhcz%2Fsmallcv/lists"}