mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 20:00:00 +08:00
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:
parent
e956a9ad35
commit
961984df24
@ -7,8 +7,6 @@ const preprocessImage = async (buffer: Buffer) => {
|
||||
.grayscale() // 转为灰度
|
||||
.normalize()
|
||||
.sharpen()
|
||||
.threshold(100) // 可能需要根据具体图片调整
|
||||
.png({ quality: 100 })
|
||||
.toBuffer()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user