[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EGC2GHG36QE35QPPR39CTV":3,"skill-same:01M6EGC2GHG36QE35QPPR39CTV":51},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EGC2GHG36QE35QPPR39CTV","tesseract",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ftesseract\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# Tesseract — Open-Source OCR Engine\n\nYou are an expert in Tesseract OCR, the most popular open-source optical character recognition engine. You help developers extract text from images, PDFs, and scanned documents using Tesseract's LSTM neural network engine, multi-language support (100+ languages), page segmentation modes, and integration with image preprocessing for maximum accuracy.\n\n## Core Capabilities\n\n### Basic Usage\n\n```python\n# pip install pytesseract Pillow\nimport pytesseract\nfrom PIL import Image\nimport cv2\n\n# Simple text extraction\ntext = pytesseract.image_to_string(Image.open(\"document.png\"))\nprint(text)\n\n# With language specification\ntext_de = pytesseract.image_to_string(Image.open(\"german_doc.png\"), lang=\"deu\")\n\n# Multiple languages\ntext_multi = pytesseract.image_to_string(Image.open(\"mixed.png\"), lang=\"eng+fra+deu\")\n\n# Get bounding boxes for each word\ndata = pytesseract.image_to_data(Image.open(\"invoice.png\"), output_type=pytesseract.Output.DICT)\nfor i, word in enumerate(data[\"text\"]):\n    if word.strip():\n        x, y, w, h = data[\"left\"][i], data[\"top\"][i], data[\"width\"][i], data[\"height\"][i]\n        conf = int(data[\"conf\"][i])\n        print(f\"'{word}' at ({x},{y},{w},{h}) confidence: {conf}%\")\n\n# PDF to text\nfrom pdf2image import convert_from_path\npages = convert_from_path(\"document.pdf\", dpi=300)\nfull_text = \"\"\nfor page in pages:\n    full_text += pytesseract.image_to_string(page) + \"\\n\\n\"\n```\n\n### Image Preprocessing for Better Accuracy\n\n```python\nimport cv2\nimport numpy as np\n\ndef preprocess_for_ocr(image_path: str) -> np.ndarray:\n    \"\"\"Preprocess image for optimal OCR accuracy.\n\n    Steps: grayscale → denoise → threshold → deskew → resize\n    \"\"\"\n    img = cv2.imread(image_path)\n\n    # Grayscale\n    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n\n    # Denoise\n    denoised = cv2.fastNlMeansDenoising(gray, h=10)\n\n    # Adaptive threshold (handles uneven lighting)\n    thresh = cv2.adaptiveThreshold(\n        denoised, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,\n        cv2.THRESH_BINARY, 11, 2,\n    )\n\n    # Deskew (fix rotated scans)\n    coords = np.column_stack(np.where(thresh > 0))\n    angle = cv2.minAreaRect(coords)[-1]\n    if angle \u003C -45:\n        angle = -(90 + angle)\n    else:\n        angle = -angle\n\n    (h, w) = thresh.shape\n    center = (w \u002F\u002F 2, h \u002F\u002F 2)\n    M = cv2.getRotationMatrix2D(center, angle, 1.0)\n    rotated = cv2.warpAffine(thresh, M, (w, h), flags=cv2.INTER_CUBIC,\n                              borderMode=cv2.BORDER_REPLICATE)\n\n    # Scale up if too small (Tesseract works best at 300+ DPI)\n    if w \u003C 1000:\n        scale = 2.0\n        rotated = cv2.resize(rotated, None, fx=scale, fy=scale, interpolation=cv2.INTER_CUBIC)\n\n    return rotated\n\n# Use preprocessed image\nprocessed = preprocess_for_ocr(\"scan.jpg\")\ntext = pytesseract.image_to_string(processed, config=\"--psm 6\")\n```\n\n### Page Segmentation Modes\n\n```python\n# PSM modes control how Tesseract analyzes page layout\n# --psm 0: Orientation and script detection only\n# --psm 1: Automatic with OSD\n# --psm 3: Fully automatic (default)\n# --psm 4: Assume single column\n# --psm 6: Assume single uniform block of text\n# --psm 7: Treat image as single text line\n# --psm 8: Treat image as single word\n# --psm 11: Sparse text, no order\n# --psm 13: Raw line (no layout analysis)\n\n# For receipts\u002Finvoices (structured single column)\ntext = pytesseract.image_to_string(img, config=\"--psm 4\")\n\n# For single line (serial numbers, license plates)\ntext = pytesseract.image_to_string(img, config=\"--psm 7\")\n\n# For scattered text (signs in a photo)\ntext = pytesseract.image_to_string(img, config=\"--psm 11\")\n\n# Whitelist specific characters\ntext = pytesseract.image_to_string(img, config=\"--psm 7 -c tessedit_char_whitelist=0123456789ABCDEF\")\n```\n\n## Installation\n\n```bash\n# System package\nbrew install tesseract                     # macOS\napt install tesseract-ocr                 # Ubuntu\u002FDebian\napt install tesseract-ocr-deu tesseract-ocr-fra  # Additional languages\n\n# Python binding\npip install pytesseract Pillow\n\n# Node.js\nnpm install tesseract.js                  # Pure JS (runs in browser too)\n```\n\n## Best Practices\n\n1. **Preprocess images** — Grayscale → denoise → threshold → deskew before OCR; preprocessing improves accuracy 30-50%\n2. **300 DPI minimum** — Tesseract works best at 300+ DPI; scale up small images before processing\n3. **PSM selection** — Choose the right page segmentation mode; PSM 6 for documents, PSM 7 for single lines, PSM 11 for sparse\n4. **Language data** — Install language-specific traineddata files; use `lang=\"eng+deu\"` for multilingual documents\n5. **Whitelist characters** — For known formats (serial numbers, dates), restrict character set for higher accuracy\n6. **Confidence filtering** — Use `image_to_data` to get per-word confidence; filter out low-confidence results\n7. **Tesseract.js for browser** — Use the JavaScript version for client-side OCR; no server needed, runs in Web Workers\n8. **LSTM engine** — Tesseract 4+ uses LSTM neural networks by default; much more accurate than Tesseract 3's pattern matching\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Ftesseract",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill tesseract",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill tesseract",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill tesseract","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ftesseract\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fdetection-rules.md","REFERENCE","参考文档",3487,"https:\u002F\u002Fgithub.com\u002Fsajor2000\u002Fmethodsmith\u002Fblob\u002Fmain\u002Fplugins\u002Fmethodsmith\u002Fskills\u002Fmethod-language-detect\u002Freferences\u002Fdetection-rules.md",[52,61,70,79,85,91],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[58,59,60],"model","model hierarchy","model hierarchy skill",{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[67,68,69],"MCP","zoom","zoom mcp",{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[76,77,78,68],"sdk","zoom apps sdk","apps",{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[93]]