{"id":29262382,"url":"https://github.com/bashrc2/datamatrix","last_synced_at":"2025-07-04T10:07:38.377Z","repository":{"id":301877295,"uuid":"1010180194","full_name":"bashrc2/datamatrix","owner":"bashrc2","description":"Datamatrix commandline utility","archived":false,"fork":false,"pushed_at":"2025-06-29T10:33:28.000Z","size":560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T11:29:19.369Z","etag":null,"topics":["2d-barcodes","barcode-scanner","c99","commandline","computer-vision","datamatrix","gs1-standard","reed-solomon"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bashrc2.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,"zenodo":null}},"created_at":"2025-06-28T14:20:50.000Z","updated_at":"2025-06-29T10:33:31.000Z","dependencies_parsed_at":"2025-06-29T11:39:38.476Z","dependency_job_id":null,"html_url":"https://github.com/bashrc2/datamatrix","commit_stats":null,"previous_names":["bashrc2/datamatrix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bashrc2/datamatrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashrc2%2Fdatamatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashrc2%2Fdatamatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashrc2%2Fdatamatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashrc2%2Fdatamatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bashrc2","download_url":"https://codeload.github.com/bashrc2/datamatrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashrc2%2Fdatamatrix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263489687,"owners_count":23474528,"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":["2d-barcodes","barcode-scanner","c99","commandline","computer-vision","datamatrix","gs1-standard","reed-solomon"],"created_at":"2025-07-04T10:07:35.423Z","updated_at":"2025-07-04T10:07:38.366Z","avatar_url":"https://github.com/bashrc2.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://gitlab.com/bashrc2/datamatrix/-/raw/main/img/datamatrix.png\" width=\"25%\" alt=\"Picture of a datamatrix\"/\u003e\n\n*datamatrix* is a commandline utility for reading and verifying Datamatrix direct part markings. Some image processing functions are based on [visionutils](https://codeberg.org/bashrc/visionutils).\n\n## Key features\n\n * Reads PNG files (recommended at least 800 pixels across) using *lodepng*\n * Outputs the plain text encoded by the datamatrix pattern\n * Implemented in pure C99\n * Supports [GS1 semantics](https://www.gs1.org/standards/barcodes/2d) and digital links\n * Can generate quality metrics for verification reports\n * Parallelized with [OpenMP](https://www.openmp.org)\n * No dependencies or supply chains!\n\n## Build\n\nInstall the build system:\n\n``` bash\nsudo apt install build-essential\n```\n\nThen compile.\n\n``` bash\nmake\n```\n\nAnd finally install.\n\n``` bash\nsudo make install\n```\n\n## Example usage\n\n``` bash\ndatamatrix -f examples/01.png\n```\n\nWhen possible, decoded text will appear in a more verbose human readable form. However if you want to know what text the datamatrix directly encodes then you can use the *--raw* option.\n\n``` bash\ndatamatrix -f examples/01.png --raw\n```\n\nWhen decoding GS1 datamatrix symbols you can also specify a [GS1 resolver](https://www.gs1.org/standards/resolver) if you want a digital link to be returned.\n\n``` bash\ndatamatrix -f examples/01.png --resolver https://id.gs1.org\n```\n\nIf you set the resolver as a '.' character then the GS1 code will be shown with brackets, such as *(01)00068780000108(13)301231(10)ABC123*.\n\n``` bash\ndatamatrix -f examples/01.png --resolver .\n```\n\nIf you know the range of grid dimensions which are expected then you can narrow down the search using the *--mingrid* and *--maxgrid* options.\n\n``` bash\ndatamatrix -f examples/01.png --mingrid 10 --maxgrid 20\n```\n\nIf needed, an image can be saved showing the detected datamatrix region and also the grid.\n\n``` bash\ndatamatrix -f examples/01.png -o detection.png -g grid.png\n```\n\nIf you want to calculate quality metrics for symbol verification purposes:\n\n``` bash\ndatamatrix -f examples/01.png -o detection.png -g grid.png --quality\n```\n\nMetrics can also be output in *CSV* or *JSON* formats, for easy import into other systems.\n\n``` bash\ndatamatrix -f examples/01.png -o detection.png -g grid.png --quality --csv\ndatamatrix -f examples/01.png -o detection.png -g grid.png --quality --json\n```\n\nOptionally, if you want debugging information and images for each decoding stage:\n\n``` bash\ndatamatrix -f examples/01.png --debug\n```\n\n## Testing\n\nUnit tests may be run with:\n\n``` bash\ndatamatrix --tests\n```\n\nIf you want to test how well the decoding works with a specific settings:\n\n``` bash\ndatamatrix -f examples/01.png --debug \\\n    --erode [value] --dilate [value] \\\n    --meanlight [value] --edgethresh [value]\n```\n\n*erode* and *dilate* values are in pixels. *meanlight* is typically in the range 0-20 and *edgethresh* is typically in the range 0-10.\n\nA set of images will be produced which show the detection process at each stage.\n\n## References\n\n[Canny edge detection](https://en.wikipedia.org/wiki/Canny_edge_detector)\n\n[Data Matrix](https://en.wikipedia.org/wiki/Data_Matrix)\n\n[Edge linking](https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MARSHALL/node30.html)\n\n[GS1 General Specifications](https://www.gs1.org/standards/barcodes-epcrfid-id-keys/gs1-general-specifications)\n\n[GS1 2D Barcode Verification Process Implementation Guideline](https://www.gs1.org/docs/barcodes/2D_Barcode_Verification_Process_Implementation_Guideline.pdf)\n\n[Line–line intersection](https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection)\n\n[Popular ISO/IEC 15434 Barcode Formats](https://www.barcodefaq.com/2d/data-matrix/iso-iec-15434)\n\n[Reed–Solomon error correction](https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashrc2%2Fdatamatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashrc2%2Fdatamatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashrc2%2Fdatamatrix/lists"}