feat: add contrast/sharpen strength controls, disable binarization

Major improvements to preprocessing controls:

Backend:
- Add contrast_strength (0.5-3.0) and sharpen_strength (0.5-2.0) to PreprocessingConfig
- Auto-detection now calculates optimal strength based on image quality metrics:
  - Lower contrast → Higher contrast_strength
  - Lower edge strength → Higher sharpen_strength
- Disable binarization in auto mode (rarely beneficial)
- CLAHE clipLimit now scales with contrast_strength
- Sharpening uses unsharp mask with variable strength

Frontend:
- Add strength sliders for contrast and sharpen in manual mode
- Sliders show current value and strength level (輕微/正常/強/最強)
- Move binarize option to collapsible "進階選項" section
- Updated i18n translations for strength labels

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
egg
2025-11-27 17:18:44 +08:00
parent f6d2957592
commit 5982fff71c
7 changed files with 212 additions and 53 deletions

View File

@@ -39,7 +39,9 @@ export default function ProcessingPage() {
const [preprocessingMode, setPreprocessingMode] = useState<PreprocessingMode>('auto')
const [preprocessingConfig, setPreprocessingConfig] = useState<PreprocessingConfig>({
contrast: 'clahe',
contrast_strength: 1.0,
sharpen: true,
sharpen_strength: 1.0,
binarize: false,
})