Commit be1d0615 authored by Gihan Jayatilaka's avatar Gihan Jayatilaka

rand-data

parent 3f20fffa
......@@ -29,6 +29,8 @@ def makeVideo(READ_VIDEO_FILE,msg,WRITE_VIDEO_FILE,DELTA):
for col in [red,green,blue,red,green,blue,white,white,white,white]:
video.write(col)
frameIndex=0
while inputVideo.isOpened():
if frameIndex==NO_FRAMES_MAX:
......@@ -36,11 +38,19 @@ def makeVideo(READ_VIDEO_FILE,msg,WRITE_VIDEO_FILE,DELTA):
ret, frame = inputVideo.read()
if ret:
mask = msg[frameIndex].astype(np.float32)
mask = msg[frameIndex]
mask = np.repeat(mask, HEIGHT/GRID_Y, axis=0)
mask = np.repeat(mask, WIDTH/GRID_X, axis=1)
#print(msg)
mask = mask.astype(np.float32) +\
(mask==np.full(shape=mask.shape,fill_value=0)).astype(np.float32)*np.random.uniform(low=0.0,high=0.2,size=mask.shape) \
+ (mask==np.full(shape=mask.shape,fill_value=1)).astype(np.float32)*np.random.uniform(low=0.8,high=1.0,size=mask.shape)
r=np.random.randint(low=2,high=6,size=1)
r=r[0]
r=5
mask=cv2.GaussianBlur(mask,ksize=(r,r),sigmaX=0)
raw = cv2.cvtColor(cv2.resize(frame, (WIDTH, HEIGHT)), cv2.COLOR_BGR2LAB)
l,a,b = cv2.split(raw)
......@@ -48,7 +58,7 @@ def makeVideo(READ_VIDEO_FILE,msg,WRITE_VIDEO_FILE,DELTA):
upper = lnorm*0.015
lower = np.sqrt(lnorm + 20)
delt = np.divide((upper + lower), lower)*DELTA[frameIndex]*2.55
delt = delt
lmod = l + np.multiply(mask, delt)
calib = np.max(lmod)
......
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