layers are cleanly extracted
This commit is contained in:
parent
6fb5d6714e
commit
31974e4d68
5
Layer.py
5
Layer.py
|
|
@ -1,17 +1,18 @@
|
|||
class Layer:
|
||||
#data = [(contour, (x,y,w,h)),]
|
||||
data = []
|
||||
|
||||
startFrame = None
|
||||
lastFrame = None
|
||||
backgroundImage = []
|
||||
|
||||
def __init__(self, startFrame, data):
|
||||
self.startFrame = startFrame
|
||||
self.lastFrame = startFrame
|
||||
self.data = []
|
||||
self.data.append(data)
|
||||
|
||||
print("Layer constructed")
|
||||
|
||||
def add(self, frameNumber, data):
|
||||
if not (self.startFrame + len(self.data) - frameNumber < 0):
|
||||
self.lastFrame = frameNumber
|
||||
self.data.append(data)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class LayerFactory:
|
|||
print("LayerFactory: Layer knew no bounds")
|
||||
continue
|
||||
|
||||
if frameNumber - layer.lastFrame <= 5:
|
||||
if frameNumber - layer.lastFrame <= 1:
|
||||
(x2,y2,w2,h2) = layer.data[-1][1]
|
||||
if self.contoursOverlay((x-tol,y+h+tol), (x+w+tol,y-tol), (x2,y2+h2), (x2+w2,y2)):
|
||||
foundLayer = True
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue