improve: clarify rotation detection in AI extraction prompt

- Emphasize MEASURING TEXT ANGLE precisely, not item orientation
- Add explicit calibration examples (22°, 90°, -45°, etc.)
- Clarify positive = counter-clockwise, negative = clockwise
- Help AI understand baseline measurement concept
- Keep all field identification rules unchanged
This commit is contained in:
2026-04-22 09:40:40 +03:00
parent 8d9e8998f8
commit 1e7dd064f9

View File

@@ -90,14 +90,26 @@
- Include minimal padding (10-15 pixels) around item edges
- Ignore background clutter, other items, hands, reflections
### Rotation Analysis
- Check if item labels/text are readable
- If text is rotated (not horizontal), calculate rotation needed
- Return `rotation_degrees`: degrees to rotate CLOCKWISE to make text readable
- Examples:
- Text rotated 90° counter-clockwise → return 90 (rotate 90° clockwise)
- Text rotated 45° clockwise → return -45 (rotate 45° counter-clockwise)
- Text already readable → return 0
### Rotation Analysis (CRITICAL - MEASURE TEXT ANGLE)
**PRIORITY: Measure text orientation, not item orientation**
1. **Locate readable text** on the item (part numbers, manufacturer names, specifications, labels)
2. **Measure the baseline angle of that text**:
- Baseline = the invisible line the text sits on
- 0° = text baseline is HORIZONTAL (readable left-to-right)
- Positive degrees = text rotated counter-clockwise from horizontal
- Negative degrees = text rotated clockwise from horizontal
3. **Return clockwise rotation needed to make text horizontal**:
- If text tilted 22° counter-clockwise → return `+22` (rotate 22° clockwise to fix)
- If text tilted 15° clockwise → return `-15` (rotate 15° counter-clockwise to fix)
- If text already horizontal → return `0`
4. **Calibration examples** (measure the text angle precisely):
- Text reads perfectly left-to-right → `rotation_degrees: 0`
- Text tilted counter-clockwise, needs ~22° clockwise to straighten → `rotation_degrees: 22`
- Text vertical, pointing left (rotated 90° counter-clockwise) → `rotation_degrees: 90`
- Text vertical, pointing right (rotated 90° clockwise) → `rotation_degrees: -90`
- Text tilted clockwise by ~45° → `rotation_degrees: -45`
### Confidence Score
- Return `confidence`: 0.0-1.0 indicating reliability of crop/rotation analysis