Commit 78f2dbcf authored by njean42's avatar njean42
Browse files

Fix debug shallow-copying panels, displaying strange processing steps.

parent 65b2f374
......@@ -172,7 +172,7 @@ class Kumiko:
panels.remove(p)
panels += new_panels
self.dbg.add_image(self.img, 'Split contours')
self.dbg.add_image(self.img, 'Split contours (shown as non-red contours)')
self.dbg.add_step('Panels from split contours', panels)
panels = list(filter(lambda p: not p.is_small(), panels))
......@@ -318,6 +318,7 @@ class Kumiko:
panels.append(Panel(polygon=approx))
self.dbg.add_step('Initial state', [])
self.dbg.add_image(self.img, 'Initial contours')
self.dbg.add_step('Panels from initial contours', panels)
......
import os, json
import os, json, copy
import cv2 as cv
from lib.html import HTML
......@@ -19,7 +19,7 @@ class Debug:
'yellow': (0,200,200),
'gray': (150,150,150),
}
subpanel_colours = list(colours.values())[3:] # white, red and green are used to display main and split panels
subpanel_colours = list(colours.values())[3:] # white, red and green are used to display main panels
def __init__(self, debug):
......@@ -36,7 +36,7 @@ class Debug:
self.steps.append({
'name': name,
'panels': panels.copy()
'panels': copy.deepcopy(panels)
})
......@@ -49,7 +49,7 @@ class Debug:
if len(self.steps) > 0:
currstep = list(reversed(self.steps))[0]['name']
filename = str(Debug.imgID) + label+'.jpg'
filename = str(Debug.imgID) + '-' + label + '.jpg'
Debug.imgID += 1
cv.imwrite(os.path.join('tests/results',filename),img)
......
Markdown is supported
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