Unverified Commit 6a1568ae authored by tilman's avatar tilman
Browse files

add final batch of results

parent 6884a3f2
......@@ -30,7 +30,7 @@ OVERLAY_ALPHA = 0.2
COLORED_CANVAS = True
BISEC_SKIP_LOWER_LEVELS = False
DISPLAY_RASTER_ELEMENTS = 500
KMEANS_AREA_MASK_THRESHOLD = 0.04 #0.08 #max 1.0 (percent of pixels), cur 0.09, sonntag mittag 0.05, #smaller threshold -> more colors, higher threshold -> less colors
KMEANS_AREA_MASK_THRESHOLD = 0.06 #0.08 #max 1.0 (percent of pixels), cur 0.09, sonntag mittag 0.05, #smaller threshold -> more colors, higher threshold -> less colors
KMEANS_K = 7 #10
#KMEANS_K = 6 #10
OUT_DIR = 'images/out/images_imdahl/kmeans_output_canvas/final'
......@@ -109,8 +109,13 @@ for img_name in images:
# target = cv2.medianBlur(target,53) #remove big color patches
# target = cv2.bilateralFilter(target,13,90,90) #bring back edges and remove textures
#target = cv2.medianBlur(target,11) #smoothen cracks
target = cv2.medianBlur(target,int(esz*5)+1 if int(esz*5)%2==0 else int(esz*5)) #smoothen cracks
target = cv2.bilateralFilter(target,int(esz*25),int(esz*40),int(esz*40)) #remove cracks
md = int(esz*4)+1 if int(esz*4)%2==0 else int(esz*4)
bl1 = int(esz*20)
bl2 = int(esz*40)
target = cv2.medianBlur(target,md if md<14 else 13) #smoothen cracks
target = cv2.bilateralFilter(target,bl1 if bl1<31 else 31 ,bl2 if bl2<80 else 80,bl2 if bl2<80 else 80) #remove cracks
# target = cv2.medianBlur(target,) #smoothen cracks
# target = cv2.bilateralFilter(target,50,70,70) #remove cracks
print("filter vals: med",int(esz*5)+1 if int(esz*5)%2==0 else int(esz*5), "bil1", int(esz*25), "bil2,3", int(esz*40))
cv2.imwrite(os.path.basename(img_name)+'_inkm_step1_crackremoval.jpg',target)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment