{"id":13574205,"url":"https://github.com/codeplaysoftware/visioncpp","last_synced_at":"2025-04-04T14:32:01.355Z","repository":{"id":40694234,"uuid":"67422992","full_name":"codeplaysoftware/visioncpp","owner":"codeplaysoftware","description":"A machine vision library written in SYCL and C++ that shows performance-portable implementation of graph algorithms","archived":true,"fork":false,"pushed_at":"2024-04-18T09:07:22.000Z","size":14961,"stargazers_count":160,"open_issues_count":1,"forks_count":54,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-12-06T22:27:51.389Z","etag":null,"topics":["sycl"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeplaysoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-09-05T13:23:40.000Z","updated_at":"2024-11-15T19:20:47.000Z","dependencies_parsed_at":"2023-01-19T23:03:44.209Z","dependency_job_id":"ca1f6a21-1253-4cb9-8a5d-3524e7e18fe8","html_url":"https://github.com/codeplaysoftware/visioncpp","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/codeplaysoftware%2Fvisioncpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplaysoftware%2Fvisioncpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplaysoftware%2Fvisioncpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplaysoftware%2Fvisioncpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeplaysoftware","download_url":"https://codeload.github.com/codeplaysoftware/visioncpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194193,"owners_count":20899440,"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":["sycl"],"created_at":"2024-08-01T15:00:48.092Z","updated_at":"2025-04-04T14:31:57.399Z","avatar_url":"https://github.com/codeplaysoftware.png","language":"C++","funding_links":[],"categories":["Table of Contents","C++"],"sub_categories":["AI - Computer Vision"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr /\u003e\u003cimg src=\"https://developer.codeplay.com/assets/img/home/tools/visioncpp.png\"\u003e\u003cbr /\u003e\n\u003c/div\u003e\n\n# Overview\n**VisionCpp** is a lightweight header-only library for computer vision and image processing.\nThe aim of the library is to provide a toolbox that enables performance portability for heterogeneous platforms using modern C++.\n\nWritten using [SYCL 1.2.1](https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf) and compiled/tested with [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) to accelerate vision code using OpenCL devices.\n\n## Table of contents\n* [Integration](#integration)\n* [Tutorials](#visioncpp-tutorials)\n* [Sample Code](#sample-code)\n* [Requirements](#requirements)\n* [Build](#build)\n* [Examples](#examples)\n* [Documentation](#documentation)\n* [Contributing](#contributing)\n* [Resources](#resources)\n* [License](#license)\n* [Known Issues](#known-issues)\n\n## Integration\nYou will need to install ComputeCpp in order to use VisionCpp, you can follow the [ComputeCpp Getting Started guide](https://developer.codeplay.com/products/computecpp/ce/guides/getting-started) that outlines the installation process.\nAll you need to do is include the VisionCpp.hpp header in your project and you are good to go! ( assuming that OpenCL and ComputeCPP is installed correctly. )\n\n~~~~~~~~~~~~~~~{.cpp}\n#include \u003cvisioncpp.hpp\u003e //all that is needed\n~~~~~~~~~~~~~~~\n\n## VisionCpp Tutorials\nThere are some tutorials explaining how to perform different operations using VisionCpp. These cover basic [Hello World](https://github.com/codeplaysoftware/visioncpp/wiki/Example:-Hello-World), [Anisotropic Diffusion](https://github.com/codeplaysoftware/visioncpp/wiki/Example:-Anisotropic-Diffusion), [Bayer Filter Demosaic](https://github.com/codeplaysoftware/visioncpp/wiki/Example:-Bayer-Filter-Demosaic), [Dense Depth Reconstruction with Block Matching Algorithm](https://github.com/codeplaysoftware/visioncpp/wiki/Example:-Dense-Depth-Reconstruction-with-Block-Matching-Algorithm) and [Harris Corner Detection](https://github.com/codeplaysoftware/visioncpp/wiki/Example:-Harris-Corner-Detection).\n\n## Sample Code\nBelow is a very simple application that will do the conversion RGB -\u003e HSV. Full source code can be found in the examples folder.\nRGB is assumed to be a three-channel unsigned char storage with a reasonable channel order.\n\n~~~~~~~~~~~~~~~{.cpp}\n  // main, args, checks and all the boring stuff\n\n  // ...\n\n  // where VisionCpp will run.\n  auto dev = visioncpp::make_device\u003cvisioncpp::backend::sycl,\n                                    visioncpp::device::cpu\u003e();\n\n  // create a host container for input data\n  std::shared_ptr\u003cunsigned char\u003e in_rgb(new unsigned char[3],\n  [](unsigned char *dataMem) { delete[] dataMem;});\n\n  in_rgb.get()[0] = atoi(argv[1]);\n  in_rgb.get()[1] = atoi(argv[2]);\n  in_rgb.get()[2] = atoi(argv[3]);\n\n  // create a host container for output data\n  std::shared_ptr\u003cunsigned char\u003e out_hsv(new unsigned char[3],\n  [](unsigned char *dataMem) { delete[] dataMem;});\n\n  // exiting this scope will sync data\n  {\n    // definition of the VisionCpp pipeline:\n\n    // create terminal nodes - a leaf node ( data node ) of the expression tree.\n    // terminal struct takes 4 arguments\n    // 1st template parameter specifies the data U8 (unsigned char) C3 (three\n    // channels)\n    // 2nd number of columns in the storage\n    // 3rd number of rows in the storage\n    // 4th underlying storage type - currently only Buffer2D supported\n    auto data =\n        visioncpp::terminal\u003cvisioncpp::pixel::U8C3, 1, 1,\n                            visioncpp::memory_type::Buffer2D\u003e(in_rgb.get());\n    auto data_out =\n        visioncpp::terminal\u003cvisioncpp::pixel::U8C3, 1, 1,\n                            visioncpp::memory_type::Buffer2D\u003e(out_hsv.get());\n\n    // unsigned char -\u003e float RGB storage conversion\n    auto node = visioncpp::point_operation\u003cvisioncpp::OP_U8C3ToF32C3\u003e(data);\n    // float RGB to float HSV conversion\n    auto node2 = visioncpp::point_operation\u003cvisioncpp::OP_RGBToHSV\u003e(node);\n    // helper node that allows display of HSV\n    // for unsigned char: V \u003c- 255*V, S \u003c- 255*S, H \u003c- H/2 ( to fit in range of 0..255 )\n    auto node3 = visioncpp::point_operation\u003cvisioncpp::OP_HSVToU8C3\u003e(node2);\n\n    // assign operation that writes output of the pipe to output terminal node\n    auto pipe = visioncpp::assign(data_out, node3);\n    // execute the pipeline\n    // 1st template parameter defines if VisionCpp back-end fuses the expression\n    // 2nd \u0026 3rd shared memory sizes ( column, row )\n    // 4th \u0026 5th local work group size ( column , row )\n    visioncpp::execute\u003cvisioncpp::policy::Fuse, 1, 1, 1, 1\u003e(pipe, dev);\n  }\n\n  printf(\"RGB: %u %u %u \\nHSV: %u %u %u \\n\", in_rgb.get()[0], in_rgb.get()[1],\n         in_rgb.get()[2], out_hsv.get()[0], out_hsv.get()[1], out_hsv.get()[2]);\n\n~~~~~~~~~~~~~~~\n\n## Requirements\nTo successfully compile VisionCpp tests, you will need:\n* ComputeCpp (https://codeplay.com/products/computesuite/computecpp)\n* OpenCV 3.2 (https://github.com/opencv/opencv) - used for camera access, window display and as a testing reference.\n* GTest (https://github.com/google/googletest) - testing framework.\n* OpenCL 1.2\n\n## Build\nAssuming you are in the root of a git repo:\n~~~~~~~~~~~~~~~{.sh}\nmkdir build\ncd  build\ncmake .. -DComputeCpp_DIR={PATH_TO_COMPUTECPP_ROOT} -DCMAKE_CXX_COMPILER={FAVORITE_CXX_COMPILER}\nmake -j8\nmake test\n~~~~~~~~~~~~~~~\n\nThe output binaries will be catalogued in bin folder.\n~~~~~~~~~~~~~~~{.sh}\n| - build\n  | - bin\n    | - example\n    | - test\n~~~~~~~~~~~~~~~\n\n## Examples\nThere is a set of example code in the /example/ folder of the repository. Most of the examples are performing image operations from the camera input.\n\n## Documentation\nOnline documentation can be found [here](https://codeplaysoftware.github.io/visioncpp/).\n\nThe documentation is created using [Doxygen](http://www.stack.nl/~dimitri/doxygen/).\n~~~~~~~~~~~~~~~{.sh}\nmake doc\n~~~~~~~~~~~~~~~\n\nThe documentation will be created in html folder in build directory.\n~~~~~~~~~~~~~~~{.sh}\n| - build\n  | - doc\n~~~~~~~~~~~~~~~\n\n## Contributing\nContributors always welcome! See \u003ca href=\"https://github.com/codeplaysoftware/visioncpp/blob/master/CONTRIBUTING.md\"\u003eCONTRIBUTING.md\u003c/a\u003e for details.\n\nThe list of \u003ca href=\"https://github.com/codeplaysoftware/visioncpp/blob/master/CONTRIBUTORS.md\"\u003econtributors\u003c/a\u003e.\n\n## Resources\n* [Kernel composition in SYCL](http://opus.bath.ac.uk/49695/)\n* [VisionCPP: A SYCL-based Computer Vision Framework](http://dl.acm.org/citation.cfm?doid=2909437.2909444)\n* [Wiki](https://github.com/codeplaysoftware/visioncpp/wiki)\n\n## License\nThe Apache License, Version 2.0 License. See [LICENSE](https://github.com/codeplaysoftware/visioncpp/blob/master/LICENSE) for more.\n\n## Known Issues\n* The Tuple class works only with clang++.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplaysoftware%2Fvisioncpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeplaysoftware%2Fvisioncpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplaysoftware%2Fvisioncpp/lists"}