Grayscale: avoid darkening pages with little content (#158)
Adjust black point: 0.01 -> 0.004
This commit is contained in:
@@ -253,7 +253,7 @@ fun enhanceGrayscaleImage(img: Mat): Mat {
|
|||||||
val sorted = Mat()
|
val sorted = Mat()
|
||||||
Core.sort(flat, sorted, Core.SORT_ASCENDING)
|
Core.sort(flat, sorted, Core.SORT_ASCENDING)
|
||||||
val n = sorted.cols()
|
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]
|
val pHigh = sorted.get(0, (n * 0.99).toInt())[0]
|
||||||
flat.release(); sorted.release()
|
flat.release(); sorted.release()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user