Skip to content

Commit 1169bed

Browse files
committed
Grayscale: avoid darkening pages with little content (#158)
Adjust black point: 0.01 -> 0.004
1 parent 8b80ca1 commit 1169bed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

imageprocessing/src/main/java/org/fairscan/imageprocessing/PostProcessing.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ fun enhanceGrayscaleImage(img: Mat): Mat {
253253
val sorted = Mat()
254254
Core.sort(flat, sorted, Core.SORT_ASCENDING)
255255
val n = sorted.cols()
256-
val pLow = sorted.get(0, (n * 0.01).toInt())[0]
256+
val pLow = sorted.get(0, (n * 0.004).toInt())[0]
257257
val pHigh = sorted.get(0, (n * 0.99).toInt())[0]
258258
flat.release(); sorted.release()
259259

0 commit comments

Comments
 (0)