{"id":37912085,"url":"https://github.com/chungkwong/mathocr-myscript","last_synced_at":"2026-01-16T17:20:30.303Z","repository":{"id":45534540,"uuid":"187008361","full_name":"chungkwong/mathocr-myscript","owner":"chungkwong","description":"Offline handwritten mathematical expression regnition via stroke extraction and MyScript","archived":false,"fork":false,"pushed_at":"2022-11-16T08:56:14.000Z","size":225,"stargazers_count":38,"open_issues_count":3,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-04T13:37:54.033Z","etag":null,"topics":["handwriting-recognition","mathematical-expressions","optical-character-recognition"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/chungkwong.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}},"created_at":"2019-05-16T10:46:03.000Z","updated_at":"2025-06-06T04:25:43.000Z","dependencies_parsed_at":"2023-01-23T10:15:13.021Z","dependency_job_id":null,"html_url":"https://github.com/chungkwong/mathocr-myscript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chungkwong/mathocr-myscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chungkwong%2Fmathocr-myscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chungkwong%2Fmathocr-myscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chungkwong%2Fmathocr-myscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chungkwong%2Fmathocr-myscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chungkwong","download_url":"https://codeload.github.com/chungkwong/mathocr-myscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chungkwong%2Fmathocr-myscript/sbom","scorecard":{"id":282048,"data":{"date":"2025-08-11","repo":{"name":"github.com/chungkwong/mathocr-myscript","commit":"71143b0a8af1f8efefce86c393a0c34a4df0a3bc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0 not signed: https://api.github.com/repos/chungkwong/mathocr-myscript/releases/17392963","Warn: release artifact v1.0 does not have provenance: https://api.github.com/repos/chungkwong/mathocr-myscript/releases/17392963"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"42 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-27xj-rqx5-2255","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-4w82-r329-3q67","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-58pp-9c76-5625","Warn: Project is vulnerable to: GHSA-5949-rw7g-wx7w","Warn: Project is vulnerable to: GHSA-5p34-5m6p-p58g","Warn: Project is vulnerable to: GHSA-5r5r-6hpj-8gg9","Warn: Project is vulnerable to: GHSA-758m-v56v-grj4","Warn: Project is vulnerable to: GHSA-89qr-369f-5m5x","Warn: Project is vulnerable to: GHSA-8c4j-34r4-xr8g","Warn: Project is vulnerable to: GHSA-8w26-6f25-cm9x","Warn: Project is vulnerable to: GHSA-95cm-88f5-f2c7","Warn: Project is vulnerable to: GHSA-9gph-22xh-8x98","Warn: Project is vulnerable to: GHSA-9m6f-7xcq-8vf8","Warn: Project is vulnerable to: GHSA-9vvp-fxw6-jcxr","Warn: Project is vulnerable to: GHSA-c265-37vj-cwcc","Warn: Project is vulnerable to: GHSA-c2q3-4qrh-fm48","Warn: Project is vulnerable to: GHSA-cvm9-fjm9-3572","Warn: Project is vulnerable to: GHSA-f9xh-2qgp-cq57","Warn: Project is vulnerable to: GHSA-fqwf-pjwf-7vqv","Warn: Project is vulnerable to: GHSA-gww7-p5w4-wrfv","Warn: Project is vulnerable to: GHSA-h3cw-g4mq-c5x2","Warn: Project is vulnerable to: GHSA-h4rc-386g-6m85","Warn: Project is vulnerable to: GHSA-j823-4qch-3rgm","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-m6x4-97wx-4q27","Warn: Project is vulnerable to: GHSA-mc6h-4qgp-37qh","Warn: Project is vulnerable to: GHSA-p43x-xfjf-5jhr","Warn: Project is vulnerable to: GHSA-q93h-jc49-78gg","Warn: Project is vulnerable to: GHSA-qjw2-hr98-qgfh","Warn: Project is vulnerable to: GHSA-r3gr-cxrf-hg25","Warn: Project is vulnerable to: GHSA-r695-7vr9-jgc2","Warn: Project is vulnerable to: GHSA-rf6r-2c4q-2vwg","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-rpr3-cw39-3pxh","Warn: Project is vulnerable to: GHSA-v3xw-c963-f5hc","Warn: Project is vulnerable to: GHSA-v585-23hc-c647","Warn: Project is vulnerable to: GHSA-vfqx-33qm-g869","Warn: Project is vulnerable to: GHSA-wh8g-3j2c-rqj5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T16:09:10.402Z","repository_id":45534540,"created_at":"2025-08-17T16:09:10.402Z","updated_at":"2025-08-17T16:09:10.402Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["handwriting-recognition","mathematical-expressions","optical-character-recognition"],"created_at":"2026-01-16T17:20:30.223Z","updated_at":"2026-01-16T17:20:30.280Z","avatar_url":"https://github.com/chungkwong.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["计算机视觉"],"readme":"# Offline handwritten mathematical expression recognition via stroke extraction\n\nThe repository provides a proof-of-concept stroke extractor that can extract strokes from clean\nbitmap images. The stroke extractor can be used to recognize offline handwritten\nmathematical expression if an online recognizer is given. For example, when combined\nwith MyScript, the resulting offline recognition system was **ranked #3 in the offline\ntask in CROHME 2019.**\n\n## Accuracy\n\nDataset|Correct|Up to 1 error|Up to 2 errors|Structural correct\n---|---|---|---|---\nCROHME 2014|58.22%|71.60%|75.15%|77.38%\nCROHME 2016|65.65%|77.68%|82.56%|85.00%\nCROHME 2019|65.22%|78.48%|83.07%|84.90%\n\nAlthough good accuracy is achieved on datasets of CROHME, the program\nmay produce poor results on real world images. For example, the procedure does not\nwork well on the following images:\n- Images containing other objects. An image should contain exactly one formula and nothing else.\nOrdinary text and grid lines are not allowed.\n- Images with low contrast. The strokes may not be distinguished from background properly.\n- Images with low resolution. The stroke extractor may not segment touching symbols correctly.\n- Printed mathematical expressions. Serifs can distract the stroke extractor.\n\n## Usage\n\nIn order to use the MyScript Cloud recognition engine, you need to [create a account](https://sso.myscript.com/register)\nand create an application.\n\n### Graphical interface\n\n1. Run the JAR by double clicking or a command like `java -jar mathocr-myscript.jar`\n2. Choose `Image file` from the menu `Recognize`\n3. Choose the image file\n4. Click the button `Recognize` under stroke preview\n\n### API\n\nFirst add the jar file to classpath. If you are using Maven, add the following\nto you `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.github.chungkwong\u003c/groupId\u003e\n\t\u003cartifactId\u003emathocr-myscript\u003c/artifactId\u003e\n\t\u003cversion\u003e1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThen you can recognize images of mathematical expression by using code like:\n\n```java\nString applicationKey=\"your application key for MyScript\";\nString hmacKey=\"hmac key of your Myscript account\";\nString grammarId=\"an uploaded grammar of your Myscript account\";\nint dpi=96;\nMyscriptRecognizer myscriptRecognizer=new MyscriptRecognizer(applicationKey,hmacKey,grammarId,dpi);\nExtractor extractor=new Extractor(myscriptRecognizer);\n\nFile file=new File(\"Path to file to be recognized\");\nEncodedExpression expression=extractor.recognize(ImageIO.read(file));\nString latexCode=expression.getCodes(new LatexFormat());\n```\n\n## Citation\n\nThe idea used is explained in the article\n__Stroke extraction for offline handwritten mathematical expression recognition__\n, which is available at [arXiv](https://arxiv.org/abs/1905.06749).\nYou can cite the article using the following BibTex code:\n\n```bibtex\n@misc{1905.06749,\nAuthor = {Chungkwong Chan},\nTitle = {Stroke extraction for offline handwritten mathematical expression recognition},\nYear = {2019},\nEprint = {arXiv:1905.06749},\n}\n```\n\n# 基于笔划提取的脱机手写数学公式识别\n\n本项目提供一个可从清晰的图片中还原笔划信息的程序原型。与联机手写数学公式识别结合的话，\n可以打造出脱机数学公式识别系统。例如与MyScript结合时 **在CROHME 2019的脱机任务中位列第3名**。\n\n## 准确度\n\n数据集|正确|至多一处错误|至多两处错误|结构正确\n---|---|---|---|---\nCROHME 2014|58.22%|71.60%|75.15%|77.38%\nCROHME 2016|65.65%|77.68%|82.56%|85.00%\nCROHME 2019|65.22%|78.48%|83.07%|84.90%\n\n虽然在CROHME数据集上取得了良好的表现，本程序对现实世界中的图片表现仍然可能未如理想。\n例如对以下类型的图片可能给出差劲的结果：\n\n- 含有其它对象的图片。图片中只应含有一条公式而没有其它东西，不能有普通文本或网格之类。\n- 低对比度图片。这时笔划难以从背景区分出来。\n- 低清晰度图片。这时粘连在一起的符号难以分割。\n- 印刷体数学公式。衬线会干扰笔划提取。\n\n## 用法\n\n如果使用MyScript Cloud作为联机手写数学公式识别器，请[注册一个帐号](https://sso.myscript.com/register)并创建一个应用。\n\n### 图形用户界面\n\n\n1. 通过双击或命令如`java -jar mathocr-myscript.jar`运行JAR文件\n2. 在菜单`识别`中选择`图片文件`\n3. 选择图像文件\n4. 点击笔划预览下的`识别`按钮（首次使用时需要输入你的MyScript Cloud应用标识和密钥）\n\n### API\n\n首先把JAR文件加到类路径。如果你使用Maven，把以下依赖加到`pom.xml`中`dependencies`下即可（其它构建系统类似）：\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.github.chungkwong\u003c/groupId\u003e\n\t\u003cartifactId\u003emathocr-myscript\u003c/artifactId\u003e\n\t\u003cversion\u003e1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n然后你可以使用以下样子的代码识别脱机手写数学公式:\n\n```java\nString applicationKey=\"your application key for MyScript\";\nString hmacKey=\"hmac key of your Myscript account\";\nString grammarId=\"an uploaded grammar of your Myscript account\";\nint dpi=96;\nMyscriptRecognizer myscriptRecognizer=new MyscriptRecognizer(applicationKey,hmacKey,grammarId,dpi);\nExtractor extractor=new Extractor(myscriptRecognizer);\n\nFile file=new File(\"Path to file to be recognized\");\nEncodedExpression expression=extractor.recognize(ImageIO.read(file));\nString latexCode=expression.getCodes(new LatexFormat());\n```\n\n## 引用\n\n本项目的描述参见文档 __通过笔划提取识别脱机手写数学公式__，它可从\n[arXiv](https://arxiv.org/abs/1905.06749)下载。你可以使用以下BibTex代码引用该文:\n\n```bibtex\n@misc{1905.06749,\nAuthor = {Chungkwong Chan},\nTitle = {Stroke extraction for offline handwritten mathematical expression recognition},\nYear = {2019},\nEprint = {arXiv:1905.06749},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchungkwong%2Fmathocr-myscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchungkwong%2Fmathocr-myscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchungkwong%2Fmathocr-myscript/lists"}