{"id":26784470,"url":"https://github.com/image-js/stroke-width-transform","last_synced_at":"2025-04-19T16:51:33.241Z","repository":{"id":57381486,"uuid":"119400626","full_name":"image-js/stroke-width-transform","owner":"image-js","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-01T14:24:48.000Z","size":3234,"stargazers_count":9,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T08:03:46.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/image-js.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}},"created_at":"2018-01-29T15:25:01.000Z","updated_at":"2023-03-29T11:52:37.000Z","dependencies_parsed_at":"2023-02-01T11:00:26.071Z","dependency_job_id":null,"html_url":"https://github.com/image-js/stroke-width-transform","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/image-js%2Fstroke-width-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fstroke-width-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fstroke-width-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fstroke-width-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/image-js","download_url":"https://codeload.github.com/image-js/stroke-width-transform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246171437,"owners_count":20734999,"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":[],"created_at":"2025-03-29T10:28:47.712Z","updated_at":"2025-03-29T10:28:48.337Z","avatar_url":"https://github.com/image-js.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stroke-width-transform\n\n  [![NPM version][npm-image]][npm-url]\n  [![build status][travis-image]][travis-url]\n  [![npm download][download-image]][download-url]\n\nStroke Width Transform for detecting text on images using [CCV library](https://github.com/liuliu/ccv) and it's [Javascript bindings](https://github.com/fta2012/ccv-js).\n\n## Installation\n\n`$ npm install --save stroke-width-transform`\n\n## Usage\n\n```js\nimport strokeWidthTransform from 'stroke-width-transform';\nimport Image from 'image-js';\n\nconst swtOptions = {\n  interval: 1,\n  minNeighbors: 1,\n  scaleInvariant: true,\n  direction: 0,\n  sameWordThresh: [0.1, 0.8],\n  size: 3,\n  lowThresh: 124,\n  highThresh: 204,\n  maxHeight: 300,\n  minHeight: 8,\n  minArea: 38,\n  letterOccludeThresh: 3,\n  aspectRatio: 8,\n  stdRatio: 0.83,\n  thicknessRatio: 1.5,\n  heightRatio: 1.7,\n  intensityThresh: 31,\n  distanceRatio: 2.9,\n  intersectRatio: 1.3,\n  elongateRatio: 1.9,\n  letterThresh: 3,\n  breakdown: 1,\n  breakdownRatio: 1 \n};\n\nImage.load('myImage.png').then((image) =\u003e {\n  var rois = strokeWidthTransform(image, swtOptions); // rois contains the regions with text\n})\n```\n\nSample input             |  Image with ROI's\n:-------------------------:|:-------------------------:\n![](./example/sample.jpg)  |  ![](./example/sample-output.jpg)\n\n## Install it from source\n\n* Download the repo and it's submodules `git clone --recursive https://github.com/image-js/stroke-width-transform.git`.\n* Install [emscripten](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).\n* Run `emmake make` over the root repo to compile the SWT.\n* Run `npm run test` to check if the compilation works.\n\n## [API Documentation](https://image-js.github.io/stroke-width-transform/)\n\n## License\n\n  [BSD 3-clause License](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/stroke-width-transform.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/stroke-width-transform\n[travis-image]: https://img.shields.io/travis/image-js/stroke-width-transform/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/image-js/stroke-width-transform\n[download-image]: https://img.shields.io/npm/dm/stroke-width-transform.svg?style=flat-square\n[download-url]: https://www.npmjs.com/package/stroke-width-transform\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Fstroke-width-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimage-js%2Fstroke-width-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Fstroke-width-transform/lists"}