[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C64JTHPWWCKDGHPAGCEGA7":3,"skill-same:01M7C64JTHPWWCKDGHPAGCEGA7":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7C64JTHPWWCKDGHPAGCEGA7","image-ocr",null,"Extract text content from images using Tesseract OCR via Python","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002F对于jpg-ocr-stat的尝试\u002Fskills\u002Fbundles\u002Frepeat-template-round21-20261010\u002Finputs\u002Fround-21\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: image-ocr\ndescription: Extract text content from images using Tesseract OCR via Python\n---\n\n# Image OCR Skill\n\n## Purpose\nThis skill enables accurate text extraction from image files (JPG, PNG, etc.) using Tesseract OCR via the `pytesseract` Python library. It is suitable for scanned documents, screenshots, photos of text, receipts, forms, and other visual content containing text.\n\n## When to Use\n- Extracting text from scanned documents or photos\n- Reading text from screenshots or image captures\n- Processing batch image files that contain textual information\n- Converting visual documents to machine-readable text\n- Extracting structured data from forms, receipts, or tables in images\n\n## Required Libraries\n\nThe following Python libraries are required:\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\n```\n\n## Input Requirements\n- **File formats**: JPG, JPEG, PNG, WEBP\n- **Image quality**: Minimum 300 DPI recommended for printed text; clear and legible text\n- **File size**: Under 5MB per image (resize if necessary)\n- **Text language**: Specify if non-English to improve accuracy\n\n## Output Schema\nAll extracted content must be returned as valid JSON conforming to this schema:\n\n```json\n{\n  \"success\": true,\n  \"filename\": \"example.jpg\",\n  \"extracted_text\": \"Full raw text extracted from the image...\",\n  \"confidence\": \"high|medium|low\",\n  \"metadata\": {\n    \"language_detected\": \"en\",\n    \"text_regions\": 3,\n    \"has_tables\": false,\n    \"has_handwriting\": false\n  },\n  \"warnings\": [\n    \"Text partially obscured in bottom-right corner\",\n    \"Low contrast detected in header section\"\n  ]\n}\n```\n\n\n### Field Descriptions\n\n- `success`: Boolean indicating whether text extraction completed\n- `filename`: Original image filename\n- `extracted_text`: Complete text content in reading order (top-to-bottom, left-to-right)\n- `confidence`: Overall OCR confidence level based on image quality and text clarity\n- `metadata.language_detected`: ISO 639-1 language code\n- `metadata.text_regions`: Number of distinct text blocks identified\n- `metadata.has_tables`: Whether tabular data structures were detected\n- `metadata.has_handwriting`: Whether handwritten text was detected\n- `warnings`: Array of quality issues or potential errors\n\n\n## Code Examples\n\n### Basic OCR Extraction\n\n```python\nimport pytesseract\nfrom PIL import Image\n\ndef extract_text_from_image(image_path):\n    \"\"\"Extract text from a single image using Tesseract OCR.\"\"\"\n    img = Image.open(image_path)\n    text = pytesseract.image_to_string(img)\n    return text.strip()\n```\n\n### OCR with Confidence Data\n\n```python\nimport pytesseract\nfrom PIL import Image\n\ndef extract_with_confidence(image_path):\n    \"\"\"Extract text with per-word confidence scores.\"\"\"\n    img = Image.open(image_path)\n\n    # Get detailed OCR data including confidence\n    data = pytesseract.image_to_data(img, output_type=pytesseract.Output.DICT)\n\n    words = []\n    confidences = []\n\n    for i, word in enumerate(data['text']):\n        if word.strip():  # Skip empty strings\n            words.append(word)\n            confidences.append(data['conf'][i])\n\n    # Calculate average confidence\n    avg_confidence = sum(c for c in confidences if c > 0) \u002F len([c for c in confidences if c > 0]) if confidences else 0\n\n    return {\n        'text': ' '.join(words),\n        'average_confidence': avg_confidence,\n        'word_count': len(words)\n    }\n```\n\n### Full OCR with JSON Output\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\n\ndef ocr_to_json(image_path):\n    \"\"\"Perform OCR and return results as JSON.\"\"\"\n    filename = os.path.basename(image_path)\n    warnings = []\n\n    try:\n        img = Image.open(image_path)\n\n        # Get detailed OCR data\n        data = pytesseract.image_to_data(img, output_type=pytesseract.Output.DICT)\n\n        # Extract text preserving structure\n        text = pytesseract.image_to_string(img)\n\n        # Calculate confidence\n        confidences = [c for c in data['conf'] if c > 0]\n        avg_conf = sum(confidences) \u002F len(confidences) if confidences else 0\n\n        # Determine confidence level\n        if avg_conf >= 80:\n            confidence = \"high\"\n        elif avg_conf >= 50:\n            confidence = \"medium\"\n        else:\n            confidence = \"low\"\n            warnings.append(f\"Low OCR confidence: {avg_conf:.1f}%\")\n\n        # Count text regions (blocks)\n        block_nums = set(data['block_num'])\n        text_regions = len([b for b in block_nums if b > 0])\n\n        result = {\n            \"success\": True,\n            \"filename\": filename,\n            \"extracted_text\": text.strip(),\n            \"confidence\": confidence,\n            \"metadata\": {\n                \"language_detected\": \"en\",\n                \"text_regions\": text_regions,\n                \"has_tables\": False,\n                \"has_handwriting\": False\n            },\n            \"warnings\": warnings\n        }\n\n    except Exception as e:\n        result = {\n            \"success\": False,\n            \"filename\": filename,\n            \"extracted_text\": \"\",\n            \"confidence\": \"low\",\n            \"metadata\": {\n                \"language_detected\": \"unknown\",\n                \"text_regions\": 0,\n                \"has_tables\": False,\n                \"has_handwriting\": False\n            },\n            \"warnings\": [f\"OCR failed: {str(e)}\"]\n        }\n\n    return result\n\n# Usage\nresult = ocr_to_json(\"document.jpg\")\nprint(json.dumps(result, indent=2))\n```\n\n### Batch Processing Multiple Images\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\nfrom pathlib import Path\n\ndef process_image_directory(directory_path, output_file):\n    \"\"\"Process all images in a directory and save results.\"\"\"\n    image_extensions = {'.jpg', '.jpeg', '.png', '.webp'}\n    results = []\n\n    for file_path in sorted(Path(directory_path).iterdir()):\n        if file_path.suffix.lower() in image_extensions:\n            result = ocr_to_json(str(file_path))\n            results.append(result)\n            print(f\"Processed: {file_path.name}\")\n\n    # Save results\n    with open(output_file, 'w') as f:\n        json.dump(results, f, indent=2)\n\n    return results\n```\n\n\n## Tesseract Configuration Options\n\n### Language Selection\n\n```python\n# Specify language (default is English)\ntext = pytesseract.image_to_string(img, lang='eng')\n\n# Multiple languages\ntext = pytesseract.image_to_string(img, lang='eng+fra+deu')\n```\n\n### Page Segmentation Modes (PSM)\n\nUse `--psm` to control how Tesseract segments the image:\n\n```python\n# PSM 3: Fully automatic page segmentation (default)\ntext = pytesseract.image_to_string(img, config='--psm 3')\n\n# PSM 4: Assume single column of text\ntext = pytesseract.image_to_string(img, config='--psm 4')\n\n# PSM 6: Assume uniform block of text\ntext = pytesseract.image_to_string(img, config='--psm 6')\n\n# PSM 11: Sparse text - find as much text as possible\ntext = pytesseract.image_to_string(img, config='--psm 11')\n```\n\nCommon PSM values:\n- `0`: Orientation and script detection (OSD) only\n- `3`: Fully automatic page segmentation (default)\n- `4`: Single column of text of variable sizes\n- `6`: Uniform block of text\n- `7`: Single text line\n- `11`: Sparse text\n- `13`: Raw line\n\n\n## Image Preprocessing\n\nFor better OCR accuracy, preprocess images:\n\n```python\nfrom PIL import Image, ImageFilter, ImageOps\n\ndef preprocess_image(image_path):\n    \"\"\"Preprocess image for better OCR results.\"\"\"\n    img = Image.open(image_path)\n\n    # Convert to grayscale\n    img = img.convert('L')\n\n    # Increase contrast\n    img = ImageOps.autocontrast(img)\n\n    # Apply slight sharpening\n    img = img.filter(ImageFilter.SHARPEN)\n\n    return img\n\n# Use preprocessed image for OCR\nimg = preprocess_image(\"document.jpg\")\ntext = pytesseract.image_to_string(img)\n```\n\n### Advanced Preprocessing Strategies\n\nFor difficult images (low contrast, faded text, dark backgrounds), try multiple preprocessing approaches:\n\n1. **Grayscale + Autocontrast** - Basic enhancement for most images\n2. **Inverted** - Use `ImageOps.invert()` for dark backgrounds with light text\n3. **Scaling** - Upscale small images (e.g., 2x) before OCR to improve character recognition\n4. **Thresholding** - Convert to binary using `img.point(lambda p: 255 if p > threshold else 0)` with different threshold values (e.g., 100, 128)\n5. **Sharpening** - Apply `ImageFilter.SHARPEN` to improve edge clarity\n\n\n## Multi-Pass OCR Strategy\n\nFor challenging images, a single OCR pass may miss text. Use multiple passes with different configurations:\n\n1. **Try multiple PSM modes** - Different page segmentation modes work better for different layouts (e.g., `--psm 6` for blocks, `--psm 4` for columns, `--psm 11` for sparse text)\n\n2. **Try multiple preprocessing variants** - Run OCR on several preprocessed versions of the same image\n\n3. **Combine results** - Aggregate text from all passes to maximize extraction coverage\n\n```python\ndef multi_pass_ocr(image_path):\n    \"\"\"Run OCR with multiple strategies and combine results.\"\"\"\n    img = Image.open(image_path)\n    gray = ImageOps.grayscale(img)\n\n    # Generate preprocessing variants\n    variants = [\n        ImageOps.autocontrast(gray),\n        ImageOps.invert(ImageOps.autocontrast(gray)),\n        gray.filter(ImageFilter.SHARPEN),\n    ]\n\n    # PSM modes to try\n    psm_modes = ['--psm 6', '--psm 4', '--psm 11']\n\n    all_text = []\n    for variant in variants:\n        for psm in psm_modes:\n            try:\n                text = pytesseract.image_to_string(variant, config=psm)\n                if text.strip():\n                    all_text.append(text)\n            except Exception:\n                pass\n\n    # Combine all extracted text\n    return \"\\n\".join(all_text)\n```\n\nThis approach improves extraction for receipts, faded documents, and images with varying quality.\n\n\n## Error Handling\n\n### Common Issues and Solutions\n\n**Issue**: Tesseract not found\n\n```python\n# Verify Tesseract is installed\ntry:\n    pytesseract.get_tesseract_version()\nexcept pytesseract.TesseractNotFoundError:\n    print(\"Tesseract is not installed or not in PATH\")\n```\n\n**Issue**: Poor OCR quality\n\n- Preprocess image (grayscale, contrast, sharpen)\n- Use appropriate PSM mode for the document type\n- Ensure image resolution is sufficient (300+ DPI)\n\n**Issue**: Empty or garbage output\n\n- Check if image contains actual text\n- Try different PSM modes\n- Verify image is not corrupted\n\n\n## Quality Self-Check\n\nBefore returning results, verify:\n\n- [ ] Output is valid JSON (use `json.loads()` to validate)\n- [ ] All required fields are present (`success`, `filename`, `extracted_text`, `confidence`, `metadata`)\n- [ ] Text preserves logical reading order\n- [ ] Confidence level reflects actual OCR quality\n- [ ] Warnings array includes all detected issues\n- [ ] Special characters are properly escaped in JSON\n\n\n## Limitations\n\n- Tesseract works best with printed text; handwriting recognition is limited\n- Accuracy decreases with decorative fonts, artistic text, or extreme stylization\n- Mathematical equations and special notation may not extract accurately\n- Redacted or watermarked text cannot be recovered\n- Severe image degradation (blur, noise, low resolution) reduces accuracy\n- Complex multi-column layouts may require custom PSM configuration\n\n\n## Version History\n\n- **1.0.0** (2026-01-13): Initial release with Tesseract\u002Fpytesseract OCR\n\n## Structured Receipt Workflow Template\n\nFor tasks requiring exact receipt fields, implement the following workflow in\naddition to the OCR techniques above. Keep separate OCR observations and\nfield decisions; merged multi-pass text is an observation, not a field verdict.\nUse the task's prescribed output schema for delivery and separate JSON records\nfor working evidence.\n\nExecute these stages in order: initialize the persistent ledger, checkpoint\nthe first pass, persist the review queue, review individual fields, then\nmaterialize and verify the workbook. Complete each stage's file check before\nadvancing. The working JSON files below are execution artifacts that your\nscript must create and maintain, not descriptions to put in the final reply.\n\n### 1. Execute a working extraction script\n\nUse a terminal tool call to check `python3`, Tesseract, Pillow, pytesseract, and\nthe workbook writer. Create a script using those available tools and execute it\nwith `python3`. After a command error, issue the corrected command as an actual\ntool call and inspect its result. Saying that a command will be run is not an\nexecution step. Implement the ledger, queue, protected-update, and workbook\nfunctions in the actual script before starting bulk OCR. Inspect the script\nto check that these functions are called on its executed path.\n\nCreate a working directory beside the prescribed workbook, for example\n`ocr_work\u002F`, containing `field_ledger.json` and `review_queue.json`. Initialize\none `date` and one `total_amount` record for every input filename, or load\nexisting records on resume. Execute this initialization, reopen both JSON\nfiles, and print input count, field count, and state counts. Start bulk OCR\nonly after this check succeeds. A list of scalar workbook rows is not this\nledger.\n\nRun long OCR scripts with `python3 -u` or flushed progress messages. Print the\nfilename and field\u002Fpass being processed before and after each expensive OCR\npass, and checkpoint after each image. For long terminal executions and waits,\nuse the tool's supported `timeout` parameter with a longer interval, such as\n180 seconds, rather than repeatedly accepting its short default. A running\ncommand without a new message is not proof of failure: inspect its progress\nand checkpoint before another wait. Do not issue repeated identical short\nempty waits or start a duplicate full-batch extraction while it is running.\n\n### 2. Checkpoint field records after each image\n\nUse `field_ledger.json` as the source of truth, keyed by filename and then\nfield. Each field record has this structure:\n\n```json\n{\n  \"value\": null,\n  \"state\": \"unresolved\",\n  \"first_pass_done\": false,\n  \"candidates\": [],\n  \"evidence\": {\n    \"raw_text\": null,\n    \"label\": null,\n    \"bbox\": null,\n    \"ocr_source\": null\n  },\n  \"confirmation_reason\": null,\n  \"review_reason\": \"first pass pending\",\n  \"changes\": []\n}\n```\n\nPopulate candidates with the complete raw reading, label, source region, and\nOCR variant. Use `candidate`, `unresolved`, and `confirmed` as distinct states.\nConfirmation requires an explanation tying that complete reading to the actual\nfield. Non-empty values, valid formats, keyword scores, and repeated readings\nalone leave a field unconfirmed. Set `first_pass_done` after recording that\nfield's initial observations and decision, even when its value is unresolved.\nSave the records after each image, and save each subsequent review decision.\nEach candidate must retain its complete raw reading, normalized proposal,\nlabel, region coordinates, and OCR source. Preserve competing observations\ninstead of stopping when the first legal date or amount is found. Set\n`confirmed` only when source evidence establishes both the complete reading\nand its association with the requested field; explain that evidence in\n`confirmation_reason`. Otherwise keep a proposed value as `candidate`, or\nuse `unresolved` when no defensible proposal exists.\n\nFirst-pass completion check: reopen the ledger and verify that every required\nfield has `first_pass_done=true`, recorded observations or a missing-evidence\nreason, and an explicit state. Print state counts and save the provisional\nworkbook from these records. Proceed to review even when every provisional\nworkbook cell is populated.\n\n### 3. Select fields and build a review queue\n\nFor amounts, identify the final payable field after applicable tax, discount,\nand rounding. Keep subtotal, tax charge, payment, change, item count, and\nidentifier candidates separate. A GST-inclusive final total remains eligible.\nGST inclusion alone does not make an intermediate amount the final payable\namount: distinguish pre-rounding totals from the amount due after rounding.\nUse displayed adjustments, their signs, and the receipt's arithmetic to link\nthese fields. A keyword score can propose a candidate, but cannot confirm it\nor outrank a supported final-payable relationship. Queue label\u002Fvalue conflicts\nand inconsistent amount relationships even when every number is well formed.\nFor cross-line fields, establish the label\u002Fvalue association from the layout\nand surrounding text before choosing a complete number.\n\nPreserve original punctuation. Apply character or separator corrections only\ninside an identified numeric field with source evidence. Keep four-digit years\nas four-digit years; interpret two-digit years and day\u002Fmonth order from receipt\ncontext. A legal date or plausible monetary value is not proof of a correct\nreading.\n\nBuild `review_queue.json` from the saved ledger, with one entry per filename\nand field: `filename`, `field`, `reason`, `status`, and `outcome`. Initialize\nrequired reviews as `pending`; store the review result in `outcome` and set\nstatus to `reviewed` or `unresolved` after executing that review. Save the\nqueue whenever its membership or a review result changes.\n\nQueue every missing, conflicting, ambiguous, or weak-fallback-dependent field,\nincluding populated values produced by unsupported repairs. Every field not\nyet confirmed enters the queue; confirmed fields also enter when new evidence\nconflicts with them or an applicable parser change requires review. Queue\nmembership comes from evidence and extraction path, not an empty-cell check.\nDo not accept agreement between OCR variants when they share an ambiguous\nreading without checking the original labeled field. For each\nqueued field, save a crop containing its label and complete value, recognize\nthat crop, and preserve the crop coordinates and OCR observations, using\nthe original image and an appropriate OCR mode. Compare same-field readings\nand use field meaning, arithmetic, and date context to decide. Inspect the\nsource region directly if the available tools support it and OCR remains\nambiguous. Record the decision; retain unresolved status when evidence is\ninsufficient. Clear evidence needs no additional voting.\n\nQueue completion check: print each queued filename, field, reason, and final\nreview status. An empty queue is valid only when every field is confirmed\nwith supporting evidence and no unresolved conflict. A non-empty cell or\nrepeated OCR agreement alone cannot remove an entry. Keep unresolved entries\nvisible when source evidence remains insufficient.\n\n### 4. Review locally and update incrementally\n\nReload the saved ledger and queue when reviewing or resuming. For each pending\nentry, execute the local review, save its observations, and pass the proposal\nthrough a single protected-update function. Save the resulting ledger and\nqueue before processing the next entry. Use the stored record when building\nthe workbook; a new full-batch extraction is not the resume path.\n\nImplement the protected-update function with these branches:\n\n1. An unconfirmed field accepts an evidence-backed proposal and retains the\n   preceding candidate history.\n2. A confirmed field with no new same-field contradiction keeps its value,\n   state, evidence, and confirmation reason.\n3. A contradiction or applicable parser change creates a review entry and\n   keeps the saved confirmed value until that review resolves the conflict.\n4. Change a confirmed value only after local review supplies stronger source\n   evidence for that same field. Append old value, new value, supporting\n   evidence, and correction reason to `changes`; preserve prior history.\n\nBefore bulk processing, exercise this function on synthetic records: a weak\ndifferent proposal preserves a confirmed record, stronger same-field evidence\ncan correct it with a change entry, and updating another field leaves the\nconfirmed record unchanged. Execute these checks, rather than merely naming\nthe function in comments. Confirmation protects an evidenced decision, not\nthe first plausible guess; contradictions always require review.\n\nWhen changing a shared parser, load the saved ledger, identify the affected\nfields, and generate separate proposals for those fields. Compare proposals\nwith the saved values, queue differences for local review, and apply reviewed\nupdates through the same function. Print the changed filename\u002Ffield and\nreason, and verify that unaffected confirmed records remain unchanged.\n\nThe following describes the required control flow; implement each helper in\nthe actual script, using the persistent files and update branches above:\n\n```python\nimages = enumerate_input_images_sorted()\nrecords = load_working_records_or_initialize(images)\n\nfor image in images:\n    pending = [field for field in (\"date\", \"total_amount\")\n               if not records[image.name][field][\"first_pass_done\"]]\n    if not pending:\n        continue  # resume from saved records; do not overwrite prior decisions\n    print(f\"first pass: {image.name}; fields={pending}\", flush=True)\n    observations = recognize_with_text_and_regions(image)  # log each OCR pass\n    for field in pending:\n        before = copy_field_record(records[image.name][field])\n        proposal = select_with_field_evidence(observations, field)\n        proposal[\"first_pass_done\"] = True\n        records[image.name][field] = protect_confirmed_field(before, proposal)\n    save_working_records(records)  # checkpoint before processing the next image\n    print(f\"checkpoint saved: {image.name}\", flush=True)\n\nqueue = fields_requiring_review(records)  # also includes non-empty weak guesses\nfor filename, field in queue:\n    before = copy_field_record(records[filename][field])\n    print(f\"local review: {filename}; field={field}\", flush=True)\n    proposal = review_original_field_region(filename, field, before)\n    proposal[\"first_pass_done\"] = True\n    records[filename][field] = protect_confirmed_field(before, proposal)\n    save_working_records(records)\n\nrows = materialize_prescribed_rows(records)  # confirmed values; null if unresolved\nwrite_required_workbook(rows)\nreopened_rows = reopen_required_workbook()\nassert reopened_rows == rows\nassert sorted_input_coverage_is_complete(reopened_rows, images)\nreport_confirmed_and_unresolved_counts(records)\n```\n\n`copy_field_record` preserves an independent snapshot of the existing value and\nevidence. `protect_confirmed_field` keeps that snapshot unless a proposed change\nhas stronger evidence for the same field and records the reason for correction;\nan unrelated rerun or parser preference cannot overwrite a confirmed result.\nRetain confirmation and evidence when a new proposal adds no stronger support.\nOn resume, fields with a completed first pass go directly to this evidence-based\nreview path when needed, rather than being reinitialized by full-batch OCR.\n\nAn OCR\u002Fparser change updates affected fields through this review path. Preserve\nunaffected confirmed fields and their evidence. If a shared parser changes,\ncompare affected proposals with saved records and apply only evidence-backed\nupdates. Rebuilding the workbook uses saved records; it does not rerun OCR for\nthe entire batch. Keep the working JSON outside the final workbook's schema.\n\n### 5. Verify the actual deliverable before finishing\n\nExecute the script and inspect its exit status. Reopen the actual target\nworkbook, verify the required sheets, columns, ordering and full input coverage,\nand compare each saved field with its working record. Reopen the ledger and\nqueue too: verify required field coverage, supporting evidence for confirmed\nrecords, and executed outcomes for review entries. Print the confirmed,\ncandidate, unresolved, and pending-review counts. Every non-confirmed field\nmust have a queue entry explaining its state, and no required review may\nsilently disappear. A record marked confirmed must carry its source evidence\nand confirmation reason; a queued field must carry its review outcome.\nResolve outstanding fields where the source supports a decision. Otherwise use\nthe task's prescribed missing value and disclose the remaining uncertainty.\nInvoke finish only after this execution and file verification, with an accurate\ndescription of what was delivered.\n","# Image OCR Skill\n\n## Purpose\nThis skill enables accurate text extraction from image files (JPG, PNG, etc.) using Tesseract OCR via the `pytesseract` Python library. It is suitable for scanned documents, screenshots, photos of text, receipts, forms, and other visual content containing text.\n\n## When to Use\n- Extracting text from scanned documents or photos\n- Reading text from screenshots or image captures\n- Processing batch image files that contain textual information\n- Converting visual documents to machine-readable text\n- Extracting structured data from forms, receipts, or tables in images\n\n## Required Libraries\n\nThe following Python libraries are required:\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\n```\n\n## Input Requirements\n- **File formats**: JPG, JPEG, PNG, WEBP\n- **Image quality**: Minimum 300 DPI recommended for printed text; clear and legible text\n- **File size**: Under 5MB per image (resize if necessary)\n- **Text language**: Specify if non-English to improve accuracy\n\n## Output Schema\nAll extracted content must be returned as valid JSON conforming to this schema:\n\n```json\n{\n  \"success\": true,\n  \"filename\": \"example.jpg\",\n  \"extracted_text\": \"Full raw text extracted from the image...\",\n  \"confidence\": \"high|medium|low\",\n  \"metadata\": {\n    \"language_detected\": \"en\",\n    \"text_regions\": 3,\n    \"has_tables\": false,\n    \"has_handwriting\": false\n  },\n  \"warnings\": [\n    \"Text partially obscured in bottom-right corner\",\n    \"Low contrast detected in header section\"\n  ]\n}\n```\n\n\n### Field Descriptions\n\n- `success`: Boolean indicating whether text extraction completed\n- `filename`: Original image filename\n- `extracted_text`: Complete text content in reading order (top-to-bottom, left-to-right)\n- `confidence`: Overall OCR confidence level based on image quality and text clarity\n- `metadata.language_detected`: ISO 639-1 language code\n- `metadata.text_regions`: Number of distinct text blocks identified\n- `metadata.has_tables`: Whether tabular data structures were detected\n- `metadata.has_handwriting`: Whether handwritten text was detected\n- `warnings`: Array of quality issues or potential errors\n\n\n## Code Examples\n\n### Basic OCR Extraction\n\n```python\nimport pytesseract\nfrom PIL import Image\n\ndef extract_text_from_image(image_path):\n    \"\"\"Extract text from a single image using Tesseract OCR.\"\"\"\n    img = Image.open(image_path)\n    text = pytesseract.image_to_string(img)\n    return text.strip()\n```\n\n### OCR with Confidence Data\n\n```python\nimport pytesseract\nfrom PIL import Image\n\ndef extract_with_confidence(image_path):\n    \"\"\"Extract text with per-word confidence scores.\"\"\"\n    img = Image.open(image_path)\n\n    # Get detailed OCR data including confidence\n    data = pytesseract.image_to_data(img, output_type=pytesseract.Output.DICT)\n\n    words = []\n    confidences = []\n\n    for i, word in enumerate(data['text']):\n        if word.strip():  # Skip empty strings\n            words.append(word)\n            confidences.append(data['conf'][i])\n\n    # Calculate average confidence\n    avg_confidence = sum(c for c in confidences if c > 0) \u002F len([c for c in confidences if c > 0]) if confidences else 0\n\n    return {\n        'text': ' '.join(words),\n        'average_confidence': avg_confidence,\n        'word_count': len(words)\n    }\n```\n\n### Full OCR with JSON Output\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\n\ndef ocr_to_json(image_path):\n    \"\"\"Perform OCR and return results as JSON.\"\"\"\n    filename = os.path.basename(image_path)\n    warnings = []\n\n    try:\n        img = Image.open(image_path)\n\n        # Get detailed OCR data\n        data = pytesseract.image_to_data(img, output_type=pytesseract.Output.DICT)\n\n        # Extract text preserving structure\n        text = pytesseract.image_to_string(img)\n\n        # Calculate confidence\n        confidences = [c for c in data['conf'] if c > 0]\n        avg_conf = sum(confidences) \u002F len(confidences) if confidences else 0\n\n        # Determine confidence level\n        if avg_conf >= 80:\n            confidence = \"high\"\n        elif avg_conf >= 50:\n            confidence = \"medium\"\n        else:\n            confidence = \"low\"\n            warnings.append(f\"Low OCR confidence: {avg_conf:.1f}%\")\n\n        # Count text regions (blocks)\n        block_nums = set(data['block_num'])\n        text_regions = len([b for b in block_nums if b > 0])\n\n        result = {\n            \"success\": True,\n            \"filename\": filename,\n            \"extracted_text\": text.strip(),\n            \"confidence\": confidence,\n            \"metadata\": {\n                \"language_detected\": \"en\",\n                \"text_regions\": text_regions,\n                \"has_tables\": False,\n                \"has_handwriting\": False\n            },\n            \"warnings\": warnings\n        }\n\n    except Exception as e:\n        result = {\n            \"success\": False,\n            \"filename\": filename,\n            \"extracted_text\": \"\",\n            \"confidence\": \"low\",\n            \"metadata\": {\n                \"language_detected\": \"unknown\",\n                \"text_regions\": 0,\n                \"has_tables\": False,\n                \"has_handwriting\": False\n            },\n            \"warnings\": [f\"OCR failed: {str(e)}\"]\n        }\n\n    return result\n\n# Usage\nresult = ocr_to_json(\"document.jpg\")\nprint(json.dumps(result, indent=2))\n```\n\n### Batch Processing Multiple Images\n\n```python\nimport pytesseract\nfrom PIL import Image\nimport json\nimport os\nfrom pathlib import Path\n\ndef process_image_directory(directory_path, output_file):\n    \"\"\"Process all images in a directory and save results.\"\"\"\n    image_extensions = {'.jpg', '.jpeg', '.png', '.webp'}\n    results = []\n\n    for file_path in sorted(Path(directory_path).iterdir()):\n        if file_path.suffix.lower() in image_extensions:\n            result = ocr_to_json(str(file_path))\n            results.append(result)\n            print(f\"Processed: {file_path.name}\")\n\n    # Save results\n    with open(output_file, 'w') as f:\n        json.dump(results, f, indent=2)\n\n    return results\n```\n\n\n## Tesseract Configuration Options\n\n### Language Selection\n\n```python\n# Specify language (default is English)\ntext = pytesseract.image_to_string(img, lang='eng')\n\n# Multiple languages\ntext = pytesseract.image_to_string(img, lang='eng+fra+deu')\n```\n\n### Page Segmentation Modes (PSM)\n\nUse `--psm` to control how Tesseract segments the image:\n\n```python\n# PSM 3: Fully automatic page segmentation (default)\ntext = pytesseract.image_to_string(img, config='--psm 3')\n\n# PSM 4: Assume single column of text\ntext = pytesseract.image_to_string(img, config='--psm 4')\n\n# PSM 6: Assume uniform block of text\ntext = pytesseract.image_to_string(img, config='--psm 6')\n\n# PSM 11: Sparse text - find as much text as possible\ntext = pytesseract.image_to_string(img, config='--psm 11')\n```\n\nCommon PSM values:\n- `0`: Orientation and script detection (OSD) only\n- `3`: Fully automatic page segmentation (default)\n- `4`: Single column of text of variable sizes\n- `6`: Uniform block of text\n- `7`: Single text line\n- `11`: Sparse text\n- `13`: Raw line\n\n\n## Image Preprocessing\n\nFor better OCR accuracy, preprocess images:\n\n```python\nfrom PIL import Image, ImageFilter, ImageOps\n\ndef preprocess_image(image_path):\n    \"\"\"Preprocess image for better OCR results.\"\"\"\n    img = Image.open(image_path)\n\n    # Convert to grayscale\n    img = img.convert('L')\n\n    # Increase contrast\n    img = ImageOps.autocontrast(img)\n\n    # Apply slight sharpening\n    img = img.filter(ImageFilter.SHARPEN)\n\n    return img\n\n# Use preprocessed image for OCR\nimg = preprocess_image(\"document.jpg\")\ntext = pytesseract.image_to_string(img)\n```\n\n### Advanced Preprocessing Strategies\n\nFor difficult images (low contrast, faded text, dark backgrounds), try multiple preprocessing approaches:\n\n1. **Grayscale + Autocontrast** - Basic enhancement for most images\n2. **Inverted** - Use `ImageOps.invert()` for dark backgrounds with light text\n3. **Scaling** - Upscale small images (e.g., 2x) before OCR to improve character recognition\n4. **Thresholding** - Convert to binary using `img.point(lambda p: 255 if p > threshold else 0)` with different threshold values (e.g., 100, 128)\n5. **Sharpening** - Apply `ImageFilter.SHARPEN` to improve edge clarity\n\n\n## Multi-Pass OCR Strategy\n\nFor challenging images, a single OCR pass may miss text. Use multiple passes with different configurations:\n\n1. **Try multiple PSM modes** - Different page segmentation modes work better for different layouts (e.g., `--psm 6` for blocks, `--psm 4` for columns, `--psm 11` for sparse text)\n\n2. **Try multiple preprocessing variants** - Run OCR on several preprocessed versions of the same image\n\n3. **Combine results** - Aggregate text from all passes to maximize extraction coverage\n\n```python\ndef multi_pass_ocr(image_path):\n    \"\"\"Run OCR with multiple strategies and combine results.\"\"\"\n    img = Image.open(image_path)\n    gray = ImageOps.grayscale(img)\n\n    # Generate preprocessing variants\n    variants = [\n        ImageOps.autocontrast(gray),\n        ImageOps.invert(ImageOps.autocontrast(gray)),\n        gray.filter(ImageFilter.SHARPEN),\n    ]\n\n    # PSM modes to try\n    psm_modes = ['--psm 6', '--psm 4', '--psm 11']\n\n    all_text = []\n    for variant in variants:\n        for psm in psm_modes:\n            try:\n                text = pytesseract.image_to_string(variant, config=psm)\n                if text.strip():\n                    all_text.append(text)\n            except Exception:\n                pass\n\n    # Combine all extracted text\n    return \"\\n\".join(all_text)\n```\n\nThis approach improves extraction for receipts, faded documents, and images with varying quality.\n\n\n## Error Handling\n\n### Common Issues and Solutions\n\n**Issue**: Tesseract not found\n\n```python\n# Verify Tesseract is installed\ntry:\n    pytesseract.get_tesseract_version()\nexcept pytesseract.TesseractNotFoundError:\n    print(\"Tesseract is not installed or not in PATH\")\n```\n\n**Issue**: Poor OCR quality\n\n- Preprocess image (grayscale, contrast, sharpen)\n- Use appropriate PSM mode for the document type\n- Ensure image resolution is sufficient (300+ DPI)\n\n**Issue**: Empty or garbage output\n\n- Check if image contains actual text\n- Try different PSM modes\n- Verify image is not corrupted\n\n\n## Quality Self-Check\n\nBefore returning results, verify:\n\n- [ ] Output is valid JSON (use `json.loads()` to validate)\n- [ ] All required fields are present (`success`, `filename`, `extracted_text`, `confidence`, `metadata`)\n- [ ] Text preserves logical reading order\n- [ ] Confidence level reflects actual OCR quality\n- [ ] Warnings array includes all detected issues\n- [ ] Special characters are properly escaped in JSON\n\n\n## Limitations\n\n- Tesseract works best with printed text; handwriting recognition is limited\n- Accuracy decreases with decorative fonts, artistic text, or extreme stylization\n- Mathematical equations and special notation may not extract accurately\n- Redacted or watermarked text cannot be recovered\n- Severe image degradation (blur, noise, low resolution) reduces accuracy\n- Complex multi-column layouts may require custom PSM configuration\n\n\n## Version History\n\n- **1.0.0** (2026-01-13): Initial release with Tesseract\u002Fpytesseract OCR\n\n## Structured Receipt Workflow Template\n\nFor tasks requiring exact receipt fields, implement the following workflow in\naddition to the OCR techniques above. Keep separate OCR observations and\nfield decisions; merged multi-pass text is an observation, not a field verdict.\nUse the task's prescribed output schema for delivery and separate JSON records\nfor working evidence.\n\nExecute these stages in order: initialize the persistent ledger, checkpoint\nthe first pass, persist the review queue, review individual fields, then\nmaterialize and verify the workbook. Complete each stage's file check before\nadvancing. The working JSON files below are execution artifacts that your\nscript must create and maintain, not descriptions to put in the final reply.\n\n### 1. Execute a working extraction script\n\nUse a terminal tool call to check `python3`, Tesseract, Pillow, pytesseract, and\nthe workbook writer. Create a script using those available tools and execute it\nwith `python3`. After a command error, issue the corrected command as an actual\ntool call and inspect its result. Saying that a command will be run is not an\nexecution step. Implement the ledger, queue, protected-update, and workbook\nfunctions in the actual script before starting bulk OCR. Inspect the script\nto check that these functions are called on its executed path.\n\nCreate a working directory beside the prescribed workbook, for example\n`ocr_work\u002F`, containing `field_ledger.json` and `review_queue.json`. Initialize\none `date` and one `total_amount` record for every input filename, or load\nexisting records on resume. Execute this initialization, reopen both JSON\nfiles, and print input count, field count, and state counts. Start bulk OCR\nonly after this check succeeds. A list of scalar workbook rows is not this\nledger.\n\nRun long OCR scripts with `python3 -u` or flushed progress messages. Print the\nfilename and field\u002Fpass being processed before and after each expensive OCR\npass, and checkpoint after each image. For long terminal executions and waits,\nuse the tool's supported `timeout` parameter with a longer interval, such as\n180 seconds, rather than repeatedly accepting its short default. A running\ncommand without a new message is not proof of failure: inspect its progress\nand checkpoint before another wait. Do not issue repeated identical short\nempty waits or start a duplicate full-batch extraction while it is running.\n\n### 2. Checkpoint field records after each image\n\nUse `field_ledger.json` as the source of truth, keyed by filename and then\nfield. Each field record has this structure:\n\n```json\n{\n  \"value\": null,\n  \"state\": \"unresolved\",\n  \"first_pass_done\": false,\n  \"candidates\": [],\n  \"evidence\": {\n    \"raw_text\": null,\n    \"label\": null,\n    \"bbox\": null,\n    \"ocr_source\": null\n  },\n  \"confirmation_reason\": null,\n  \"review_reason\": \"first pass pending\",\n  \"changes\": []\n}\n```\n\nPopulate candidates with the complete raw reading, label, source region, and\nOCR variant. Use `candidate`, `unresolved`, and `confirmed` as distinct states.\nConfirmation requires an explanation tying that complete reading to the actual\nfield. Non-empty values, valid formats, keyword scores, and repeated readings\nalone leave a field unconfirmed. Set `first_pass_done` after recording that\nfield's initial observations and decision, even when its value is unresolved.\nSave the records after each image, and save each subsequent review decision.\nEach candidate must retain its complete raw reading, normalized proposal,\nlabel, region coordinates, and OCR source. Preserve competing observations\ninstead of stopping when the first legal date or amount is found. Set\n`confirmed` only when source evidence establishes both the complete reading\nand its association with the requested field; explain that evidence in\n`confirmation_reason`. Otherwise keep a proposed value as `candidate`, or\nuse `unresolved` when no defensible proposal exists.\n\nFirst-pass completion check: reopen the ledger and verify that every required\nfield has `first_pass_done=true`, recorded observations or a missing-evidence\nreason, and an explicit state. Print state counts and save the provisional\nworkbook from these records. Proceed to review even when every provisional\nworkbook cell is populated.\n\n### 3. Select fields and build a review queue\n\nFor amounts, identify the final payable field after applicable tax, discount,\nand rounding. Keep subtotal, tax charge, payment, change, item count, and\nidentifier candidates separate. A GST-inclusive final total remains eligible.\nGST inclusion alone does not make an intermediate amount the final payable\namount: distinguish pre-rounding totals from the amount due after rounding.\nUse displayed adjustments, their signs, and the receipt's arithmetic to link\nthese fields. A keyword score can propose a candidate, but cannot confirm it\nor outrank a supported final-payable relationship. Queue label\u002Fvalue conflicts\nand inconsistent amount relationships even when every number is well formed.\nFor cross-line fields, establish the label\u002Fvalue association from the layout\nand surrounding text before choosing a complete number.\n\nPreserve original punctuation. Apply character or separator corrections only\ninside an identified numeric field with source evidence. Keep four-digit years\nas four-digit years; interpret two-digit years and day\u002Fmonth order from receipt\ncontext. A legal date or plausible monetary value is not proof of a correct\nreading.\n\nBuild `review_queue.json` from the saved ledger, with one entry per filename\nand field: `filename`, `field`, `reason`, `status`, and `outcome`. Initialize\nrequired reviews as `pending`; store the review result in `outcome` and set\nstatus to `reviewed` or `unresolved` after executing that review. Save the\nqueue whenever its membership or a review result changes.\n\nQueue every missing, conflicting, ambiguous, or weak-fallback-dependent field,\nincluding populated values produced by unsupported repairs. Every field not\nyet confirmed enters the queue; confirmed fields also enter when new evidence\nconflicts with them or an applicable parser change requires review. Queue\nmembership comes from evidence and extraction path, not an empty-cell check.\nDo not accept agreement between OCR variants when they share an ambiguous\nreading without checking the original labeled field. For each\nqueued field, save a crop containing its label and complete value, recognize\nthat crop, and preserve the crop coordinates and OCR observations, using\nthe original image and an appropriate OCR mode. Compare same-field readings\nand use field meaning, arithmetic, and date context to decide. Inspect the\nsource region directly if the available tools support it and OCR remains\nambiguous. Record the decision; retain unresolved status when evidence is\ninsufficient. Clear evidence needs no additional voting.\n\nQueue completion check: print each queued filename, field, reason, and final\nreview status. An empty queue is valid only when every field is confirmed\nwith supporting evidence and no unresolved conflict. A non-empty cell or\nrepeated OCR agreement alone cannot remove an entry. Keep unresolved entries\nvisible when source evidence remains insufficient.\n\n### 4. Review locally and update incrementally\n\nReload the saved ledger and queue when reviewing or resuming. For each pending\nentry, execute the local review, save its observations, and pass the proposal\nthrough a single protected-update function. Save the resulting ledger and\nqueue before processing the next entry. Use the stored record when building\nthe workbook; a new full-batch extraction is not the resume path.\n\nImplement the protected-update function with these branches:\n\n1. An unconfirmed field accepts an evidence-backed proposal and retains the\n   preceding candidate history.\n2. A confirmed field with no new same-field contradiction keeps its value,\n   state, evidence, and confirmation reason.\n3. A contradiction or applicable parser change creates a review entry and\n   keeps the saved confirmed value until that review resolves the conflict.\n4. Change a confirmed value only after local review supplies stronger source\n   evidence for that same field. Append old value, new value, supporting\n   evidence, and correction reason to `changes`; preserve prior history.\n\nBefore bulk processing, exercise this function on synthetic records: a weak\ndifferent proposal preserves a confirmed record, stronger same-field evidence\ncan correct it with a change entry, and updating another field leaves the\nconfirmed record unchanged. Execute these checks, rather than merely naming\nthe function in comments. Confirmation protects an evidenced decision, not\nthe first plausible guess; contradictions always require review.\n\nWhen changing a shared parser, load the saved ledger, identify the affected\nfields, and generate separate proposals for those fields. Compare proposals\nwith the saved values, queue differences for local review, and apply reviewed\nupdates through the same function. Print the changed filename\u002Ffield and\nreason, and verify that unaffected confirmed records remain unchanged.\n\nThe following describes the required control flow; implement each helper in\nthe actual script, using the persistent files and update branches above:\n\n```python\nimages = enumerate_input_images_sorted()\nrecords = load_working_records_or_initialize(images)\n\nfor image in images:\n    pending = [field for field in (\"date\", \"total_amount\")\n               if not records[image.name][field][\"first_pass_done\"]]\n    if not pending:\n        continue  # resume from saved records; do not overwrite prior decisions\n    print(f\"first pass: {image.name}; fields={pending}\", flush=True)\n    observations = recognize_with_text_and_regions(image)  # log each OCR pass\n    for field in pending:\n        before = copy_field_record(records[image.name][field])\n        proposal = select_with_field_evidence(observations, field)\n        proposal[\"first_pass_done\"] = True\n        records[image.name][field] = protect_confirmed_field(before, proposal)\n    save_working_records(records)  # checkpoint before processing the next image\n    print(f\"checkpoint saved: {image.name}\", flush=True)\n\nqueue = fields_requiring_review(records)  # also includes non-empty weak guesses\nfor filename, field in queue:\n    before = copy_field_record(records[filename][field])\n    print(f\"local review: {filename}; field={field}\", flush=True)\n    proposal = review_original_field_region(filename, field, before)\n    proposal[\"first_pass_done\"] = True\n    records[filename][field] = protect_confirmed_field(before, proposal)\n    save_working_records(records)\n\nrows = materialize_prescribed_rows(records)  # confirmed values; null if unresolved\nwrite_required_workbook(rows)\nreopened_rows = reopen_required_workbook()\nassert reopened_rows == rows\nassert sorted_input_coverage_is_complete(reopened_rows, images)\nreport_confirmed_and_unresolved_counts(records)\n```\n\n`copy_field_record` preserves an independent snapshot of the existing value and\nevidence. `protect_confirmed_field` keeps that snapshot unless a proposed change\nhas stronger evidence for the same field and records the reason for correction;\nan unrelated rerun or parser preference cannot overwrite a confirmed result.\nRetain confirmation and evidence when a new proposal adds no stronger support.\nOn resume, fields with a completed first pass go directly to this evidence-based\nreview path when needed, rather than being reinitialized by full-batch OCR.\n\nAn OCR\u002Fparser change updates affected fields through this review path. Preserve\nunaffected confirmed fields and their evidence. If a shared parser changes,\ncompare affected proposals with saved records and apply only evidence-backed\nupdates. Rebuilding the workbook uses saved records; it does not rerun OCR for\nthe entire batch. Keep the working JSON outside the final workbook's schema.\n\n### 5. Verify the actual deliverable before finishing\n\nExecute the script and inspect its exit status. Reopen the actual target\nworkbook, verify the required sheets, columns, ordering and full input coverage,\nand compare each saved field with its working record. Reopen the ledger and\nqueue too: verify required field coverage, supporting evidence for confirmed\nrecords, and executed outcomes for review entries. Print the confirmed,\ncandidate, unresolved, and pending-review counts. Every non-confirmed field\nmust have a queue entry explaining its state, and no required review may\nsilently disappear. A record marked confirmed must carry its source evidence\nand confirmation reason; a queued field must carry its review outcome.\nResolve outstanding fields where the source supports a decision. Otherwise use\nthe task's prescribed missing value and disclose the remaining uncertainty.\nInvoke finish only after this execution and file verification, with an accurate\ndescription of what was delivered.\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fresults\u002F对于jpg-ocr-stat的尝试\u002Fskills\u002Fbundles\u002Frepeat-template-round21-20261010\u002Finputs\u002Fround-21\u002Fskills\u002Fimage-ocr",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill image-ocr",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill image-ocr",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill image-ocr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002F对于jpg-ocr-stat的尝试\u002Fskills\u002Fbundles\u002Frepeat-template-round21-20261010\u002Finputs\u002Fround-21\u002Fskills\u002Fimage-ocr\u002FSKILL.md",true,[],[46,53,60,66,71,76],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":5,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":67,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":72,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":77,"name":5,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]