data_process.py [37:53]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		vector_image = []
		x_max = y_max = 0
		for step in vector_data['all_strokes']:
			vector_image.append([]) # for each step
			for stroke in step:
				if len(stroke) == 0: # skip the empty stroke
					vector_image[-1].append([])
					continue
				vector_image[-1].append(np.array([stroke[0][:2]]+[point[2:4] for point in stroke])) # add each stroke N x 2
				x_max_stroke, y_max_stroke = np.max(vector_image[-1][-1], 0)
				x_max = x_max_stroke if x_max_stroke>x_max else x_max
				y_max = y_max_stroke if y_max_stroke>y_max else y_max
		offset = ((original_side, original_side) - np.array([x_max, y_max])) / 2.
		offset = offset.reshape(1,2)
		for j in range(len(vector_image)):
			for k in range(len(vector_image[j])):
				vector_image[j][k] = vector_image[j][k]+offset  if len(vector_image[j][k]) > 0 else vector_image[j][k]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



data_process.py [102:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		vector_image = []
		x_max = y_max = 0
		for step in vector_data['all_strokes']:
			vector_image.append([]) # for each step
			for stroke in step:
				if len(stroke) == 0: # skip the empty stroke
					vector_image[-1].append([])
					continue
				vector_image[-1].append(np.array([stroke[0][:2]]+[point[2:4] for point in stroke])) # add each stroke N x 2
				x_max_stroke, y_max_stroke = np.max(vector_image[-1][-1], 0)
				x_max = x_max_stroke if x_max_stroke>x_max else x_max
				y_max = y_max_stroke if y_max_stroke>y_max else y_max
		offset = ((original_side, original_side) - np.array([x_max, y_max])) / 2.
		offset = offset.reshape(1,2)
		for j in range(len(vector_image)):
			for k in range(len(vector_image[j])):
				vector_image[j][k] = vector_image[j][k]+offset  if len(vector_image[j][k]) > 0 else vector_image[j][k]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



