{"id":21469910,"url":"https://github.com/dobin/xtarget","last_synced_at":"2025-09-13T05:40:53.185Z","repository":{"id":70330246,"uuid":"367496012","full_name":"dobin/xtarget","owner":"dobin","description":"Python OpenCL project to use with Laser bullets including augmented reality","archived":false,"fork":false,"pushed_at":"2023-08-04T14:01:39.000Z","size":2723,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-05T08:54:01.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dobin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-05-14T22:51:53.000Z","updated_at":"2024-12-10T10:34:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"92b43df7-ccc8-4bcf-84fb-dd3947d60ca2","html_url":"https://github.com/dobin/xtarget","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dobin/xtarget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fxtarget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fxtarget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fxtarget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fxtarget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobin","download_url":"https://codeload.github.com/dobin/xtarget/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fxtarget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274921118,"owners_count":25374198,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-23T09:19:27.800Z","updated_at":"2025-09-13T05:40:53.160Z","avatar_url":"https://github.com/dobin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xTarget\n\nIdentifying laser points on targets. [Video](https://youtu.be/DLHdM5cnhHU)\n\n\n## Install \n\n```\npip install -r requirements.txt\n```\n\n\n## Basic usage\n\nTo use webcam with id `0`:\n```\npython .\\xtarget.py --cam 0\n```\n\nThe webcam resolution will be set to 1920x1080 by default. Everything else is untested. \n\n\nIt starts into the mode `intro` which detects glare. If there is glare, it will be \ndisplayed in red on the screen. If you have glare either: \n* Make glare go away by using curtains, move target or camera position etc. \n* if glare is in target area\n  * Press `j`/`k` to increase/decrease threshold\n    * The less threshold you have, the less glare, but also the less likely that the laser will be detected\n  * use the software tool coming with your webcam to adjust exposure and gain\n* if glare is outside target area\n  * press `c` to select an area you wanna crop to. press `c` again to apply it\n\nOnce there is no glare, press `[space]` to go into `main` mode, where hits are detected. \nIf you have glare, they will count as hits.\n\nOptional:\n* When in `intro` mode, press `t` to create a target circle (center first. Pts 0-100 based on radius)\n\n\n## Troubleshooting\n\n* hits do not get detected\n  * change lightning\n  * adjust threshold\n  * change target material (use bright, reflective paper)\n  * change distance and angle of the camera, or you\n  * change exposure/gain of your webcam\n\n\n## Other notes\n\n* Hero4 gopro \n  * videos make opencv crash because of audio track. Remove audio with: \n    * `.\\ffmpeg.exe -i .\\test.mp4 -vcodec copy -an test_out.mp4`\n  * mine cannot do livestreams :-(\n* Logitech C920 works much better with the [old drivers](https://www.techspot.com/drivers/driver/file/information/17895/) (Logitech Webcam Software 2.80.853.0a)\n  * And has a great tool to adjust exposure, gain and autolightning while OpenCV is running\n\n## Keyboard Shortcuts\n\n* c: crop (c to quit)\n* t: draw target circle (t to quit)\n* q: quit\n* p: pause\n* j: increase thresh\n* k: decrease thresh\n* g: show glare\n* space: change mode\n* video playback:\n  * s: save current frame\n    * d: go one frame back\n    * f: go one frame forward\n    * e: go 10 frames back\n    * p: pause\n\n\n## Other modes\n\n### Display a frame of a video, for research purposes\n\n```\npython xtarget.py --showframe test.mp4 --framenr 123\n```\n\n### Tests\n\n```\npython xtarget.py --tests\n```\n\n### Tests quick\n\n```\npython xtarget.py --testsQuick\n```\n\n## Write video data for tests\n\n```\npython xtarget.py --write test.mp4\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fxtarget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobin%2Fxtarget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fxtarget/lists"}