37 from __future__
import print_function
42 from numpy
import pi, sin, cos
50 deformation = False, speed = 0.25, **params):
60 self.
sceneBgsceneBg = np.zeros(defaultSize, defaultSize, np.uint8)
72 self.
initialRectinitialRect = np.array([ (self.
hh/2, self.
ww/2), (self.
hh/2, self.
ww/2 + self.
ww/10),
73 (self.
hh/2 + self.
hh/10, self.
ww/2 + self.
ww/10), (self.
hh/2 + self.
hh/10, self.
ww/2)]).astype(int)
91 x1, y1 = tmp + self.
foregroundforeground.shape[0:2]
92 return np.array([y0, x0, y1, x1])
96 return np.array([y0, x0, y1, x1])
106 return np.array([y0, x0, y1, x1])
110 return np.array([x0, y0, x1, y1])
113 img = self.
sceneBgsceneBg.copy()
123 cv.fillConvexPoly(img, self.
currentRectcurrentRect, (0, 0, 255))
133 backGr = cv.imread(cv.samples.findFile(
'graf1.png'))
134 fgr = cv.imread(cv.samples.findFile(
'box.png'))
140 img = render.getNextFrame()
141 cv.imshow(
'img', img)
150 if __name__ ==
'__main__':
153 cv.destroyAllWindows()
def getXOffset(self, time)
def getYOffset(self, time)
def setInitialRect(self, rect)
def __init__(self, bgImg=None, fgImg=None, deformation=False, speed=0.25, **params)
def getRectInTime(self, time)