kasper-boy commited on
Commit
2b6e4b5
·
verified ·
1 Parent(s): b16f7e9

Update app_pages/ocr_comparator.py

Browse files
Files changed (1) hide show
  1. app_pages/ocr_comparator.py +9 -0
app_pages/ocr_comparator.py CHANGED
@@ -27,6 +27,15 @@ from pytesseract import Output
27
  import os
28
  from mycolorpy import colorlist as mcp
29
 
 
 
 
 
 
 
 
 
 
30
 
31
  ###################################################################################################
32
  ## MAIN
 
27
  import os
28
  from mycolorpy import colorlist as mcp
29
 
30
+ from matplotlib.cm import get_cmap
31
+ import numpy as np
32
+
33
+ def gen_color_normalized(cmap_name, data_arr):
34
+ cmap = get_cmap(cmap_name)
35
+ norm_colors = cmap(data_arr / np.max(data_arr)) # normalize data and apply colormap
36
+ return norm_colors
37
+
38
+
39
 
40
  ###################################################################################################
41
  ## MAIN