{"action":"created","issue":{"url":"https://api.github.com/repos/naptha/tesseract.js/issues/111","repository_url":"https://api.github.com/repos/naptha/tesseract.js","labels_url":"https://api.github.com/repos/naptha/tesseract.js/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/naptha/tesseract.js/issues/111/comments","events_url":"https://api.github.com/repos/naptha/tesseract.js/issues/111/events","html_url":"https://github.com/naptha/tesseract.js/issues/111","id":209743172,"number":111,"title":"How to determine Page segmentation method ?","user":{"login":"seme1","id":8105948,"avatar_url":"https://avatars0.githubusercontent.com/u/8105948?v=4","gravatar_id":"","url":"https://api.github.com/users/seme1","html_url":"https://github.com/seme1","followers_url":"https://api.github.com/users/seme1/followers","following_url":"https://api.github.com/users/seme1/following{/other_user}","gists_url":"https://api.github.com/users/seme1/gists{/gist_id}","starred_url":"https://api.github.com/users/seme1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seme1/subscriptions","organizations_url":"https://api.github.com/users/seme1/orgs","repos_url":"https://api.github.com/users/seme1/repos","events_url":"https://api.github.com/users/seme1/events{/privacy}","received_events_url":"https://api.github.com/users/seme1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-02-23T12:05:20Z","updated_at":"2018-02-23T17:38:59Z","closed_at":null,"author_association":"NONE","body":"Using the tesseract command line in linux, one can do so with the -psm parameter. \r\nHow to achieve the same with tesseract.js ?? I need to tell tesseract that the image contains only a fixed number of characters in a single word with no spaces.\r\n\r\nAlso, is there a way, method to tell tesseract that the number of characters is always fixed ??"},"comment":{"url":"https://api.github.com/repos/naptha/tesseract.js/issues/comments/368082713","html_url":"https://github.com/naptha/tesseract.js/issues/111#issuecomment-368082713","issue_url":"https://api.github.com/repos/naptha/tesseract.js/issues/111","id":368082713,"user":{"login":"chadmwest","id":4993000,"avatar_url":"https://avatars3.githubusercontent.com/u/4993000?v=4","gravatar_id":"","url":"https://api.github.com/users/chadmwest","html_url":"https://github.com/chadmwest","followers_url":"https://api.github.com/users/chadmwest/followers","following_url":"https://api.github.com/users/chadmwest/following{/other_user}","gists_url":"https://api.github.com/users/chadmwest/gists{/gist_id}","starred_url":"https://api.github.com/users/chadmwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadmwest/subscriptions","organizations_url":"https://api.github.com/users/chadmwest/orgs","repos_url":"https://api.github.com/users/chadmwest/repos","events_url":"https://api.github.com/users/chadmwest/events{/privacy}","received_events_url":"https://api.github.com/users/chadmwest/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T17:38:59Z","updated_at":"2018-02-23T17:38:59Z","author_association":"NONE","body":"You have to put the number in quotation marks. However, it appears the documentation at [https://github.com/naptha/tesseract.js/blob/master/docs/tesseract_parameters.md](https://github.com/naptha/tesseract.js/blob/master/docs/tesseract_parameters.md) is incorrect for the parameter `tessedit_pageseg_mode`. \r\n\r\nThe correct PSM values are numbers 1-10 at [the official Tesseract documentation](https://github.com/tesseract-ocr/tesseract/wiki/Command-Line-Usage) (the remaining three options on that page are Tesseract 4.0 options, but tesseract.js uses 3.04). For instance,`tessedit_pageseg_mode: '10',` actually maps to `SINGLE_CHAR`, not 7 (which is actually `SINGLE_LINE`) as stated in the docs here.\r\n\r\nThe following works for me to analyze a single character in Japanese:\r\n\r\n```(JavaScript)\r\nvar myImage = document.getElementById('someImage');\r\n\r\nTesseract.recognize(myImage, {\r\n    lang: 'jpn',\r\n    tessedit_pageseg_mode: '10',\r\n})\r\n.then(function(result){\r\n    console.log(result)\r\n})\r\n```"}}
{"actor":{"display_login":"chadmwest"}}