{"id":22234608,"url":"https://github.com/teknoir/camera-cpp-opencv","last_synced_at":"2025-03-25T09:22:48.757Z","repository":{"id":204655063,"uuid":"374704173","full_name":"teknoir/camera-cpp-opencv","owner":"teknoir","description":"A small footprint c++ camera app.","archived":false,"fork":false,"pushed_at":"2023-10-31T09:09:44.000Z","size":221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-30T08:43:00.742Z","etag":null,"topics":["app","camera","edge"],"latest_commit_sha":null,"homepage":"https://teknoir.cloud","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/teknoir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-06-07T14:55:52.000Z","updated_at":"2023-10-31T09:10:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"83654b63-7428-410b-b19d-a4b4a510f28f","html_url":"https://github.com/teknoir/camera-cpp-opencv","commit_stats":null,"previous_names":["teknoir/camera-cpp-opencv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teknoir%2Fcamera-cpp-opencv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teknoir%2Fcamera-cpp-opencv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teknoir%2Fcamera-cpp-opencv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teknoir%2Fcamera-cpp-opencv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teknoir","download_url":"https://codeload.github.com/teknoir/camera-cpp-opencv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245432189,"owners_count":20614271,"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":["app","camera","edge"],"created_at":"2024-12-03T02:08:56.589Z","updated_at":"2025-03-25T09:22:48.726Z","avatar_url":"https://github.com/teknoir.png","language":"C++","readme":"# Teknoir Camera OpenCV C++\nA small footprint c++ camera app.\n\n## Build\n```bash\ngcloud builds submit . --config=cloudbuild.yaml --timeout=3600 --substitutions=SHORT_SHA=\"$(date +v%Y%m%d)-$(git describe --tags --always --dirty)-$(git diff | shasum -a256 | cut -c -6)\"\n```\n\n## Build locally\n```bash\ncd app\nmkdir build\ncd build\ncmake ..\nmake\nmake install\n```\n\n## Run interactively on device\n```bash\nsudo kubectl run camera_cppcv -ti --rm --image tekn0ir/camera_cppcv:arm64v8 --overrides='{\"spec\":{\"imagePullSecrets\":[{\"name\":\"gcr-json-key\"}],\"containers\":[{\"name\":\"camera_cppcv\",\"image\":\"tekn0ir/camera_cppcv:arm64v8\",\"command\":[\"/bin/bash\"],\"tty\":true,\"stdin\":true,\"imagePullPolicy\":\"Always\",\"securityContext\":{\"privileged\":true},\"env\":[{\"name\":\"MQTT_SERVICE_HOST\",\"value\":\"mqtt.kube-system\"},{\"name\":\"MQTT_SERVICE_PORT\",\"value\":\"1883\"},{\"name\":\"MQTT_IN_0\",\"value\":\"camera/images\"},{\"name\":\"MQTT_OUT_0\",\"value\":\"toe/events\"},{\"name\":\"NAMES_FILE\",\"value\":\"/camera_cppcv/coco.names\"},{\"name\":\"CFG_FILE\",\"value\":\"/camera_cppcv/yolov3.cfg\"},{\"name\":\"WEIGHTS_FILE\",\"value\":\"/camera_cppcv/yolov3.weights\"}]}]}}'\n\nteknoir_app\n```\n\n## Run locally\n```bash\ndocker run -it --rm -p 1883:1883 -p 9001:9001 --name mqtt-broker eclipse-mosquitto\n# and in another terminal window run:\ndocker run -it --rm -e MQTT_SERVICE_HOST=\u003cYOUR IP\u003e tekn0ir/camera_cppcv:arm64v8\n```\nTo stop the example press `ctrl-c`.\n\n\n## Legacy build and publish docker images\n```bash\ndocker build -t tekn0ir/camera_cppcv:amd64 -f amd64.Dockerfile .\ndocker push tekn0ir/camera_cppcv:amd64\ndocker build -t tekn0ir/camera_cppcv:arm64v8 -f arm64v8.Dockerfile .\ndocker push tekn0ir/camera_cppcv:arm64v8\n```\n\n\n\nstruct bbox_t {\n    unsigned int x, y, w, h;    // (x,y) - top-left corner, (w, h) - width \u0026 height of bounded box\n    float prob;                    // confidence - probability that the object was found correctly\n    unsigned int obj_id;        // class of object - from range [0, classes-1]\n    unsigned int track_id;        // tracking id for video (0 - untracked, 1 - inf - tracked object)\n    unsigned int frames_counter;// counter of frames on which the object was detected\n};\n\nclass Detector {\npublic:\n        Detector(std::string cfg_filename, std::string weight_filename, int gpu_id = 0);\n        ~Detector();\n\n        std::vector\u003cbbox_t\u003e detect(std::string image_filename, float thresh = 0.2, bool use_mean = false);\n        std::vector\u003cbbox_t\u003e detect(image_t img, float thresh = 0.2, bool use_mean = false);\n        static image_t load_image(std::string image_filename);\n        static void free_image(image_t m);\n\n#ifdef OPENCV\n        std::vector\u003cbbox_t\u003e detect(cv::Mat mat, float thresh = 0.2, bool use_mean = false);\n\tstd::shared_ptr\u003cimage_t\u003e mat_to_image_resize(cv::Mat mat) const;\n#endif\n};\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteknoir%2Fcamera-cpp-opencv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteknoir%2Fcamera-cpp-opencv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteknoir%2Fcamera-cpp-opencv/lists"}