fix: add sharp dependency for image processing and improve ocr (#9554)

build: add sharp dependency for image processing

* Added sharp as a dependency in package.json to enhance image processing capabilities.
* Removed sharp from the devDependencies section.
* Refactored OCR image preprocessing by integrating grayscale and normalization directly into the process, improving overall efficiency.
This commit is contained in:
beyondkmp 2025-08-26 14:34:16 +08:00 committed by GitHub
parent e956a9ad35
commit 961984df24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,6 @@ const preprocessImage = async (buffer: Buffer) => {
.grayscale() // 转为灰度
.normalize()
.sharpen()
.threshold(100) // 可能需要根据具体图片调整
.png({ quality: 100 })
.toBuffer()
}