Grayscale: avoid darkening pages with little content (#158)

Adjust black point: 0.01 -> 0.004
This commit is contained in:
Pierre-Yves Nicolas
2026-04-21 15:38:45 +02:00
parent 8b80ca12b2
commit 1169bed9a5

View File

@@ -253,7 +253,7 @@ fun enhanceGrayscaleImage(img: Mat): Mat {
val sorted = Mat()
Core.sort(flat, sorted, Core.SORT_ASCENDING)
val n = sorted.cols()
val pLow = sorted.get(0, (n * 0.01).toInt())[0]
val pLow = sorted.get(0, (n * 0.004).toInt())[0]
val pHigh = sorted.get(0, (n * 0.99).toInt())[0]
flat.release(); sorted.release()