This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person | |
bicycle | |
car | |
motorbike | |
aeroplane | |
bus | |
train | |
truck | |
boat | |
trafficlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4.999769926071169768e-01 6.525340080261230469e-01 | |
5.000259876251219593e-01 5.474870204925540440e-01 | |
4.999740123748779852e-01 6.023719906806950242e-01 | |
4.821130037307739813e-01 4.719790220260620117e-01 | |
5.001509785652159534e-01 5.271559953689579636e-01 | |
4.999099969863889936e-01 4.982529878616330232e-01 | |
4.995230138301849920e-01 4.010620117187500000e-01 | |
2.897120118141169876e-01 3.807640075683589864e-01 | |
4.999549984931950242e-01 3.123980164527889736e-01 | |
4.999870061874390204e-01 2.699189782142640270e-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# empty overlay image to which we render the effect | |
overlay = np.zeros((192, 192, 4), np.uint8) | |
# loop through all triangles computed with Delaunay triangulation | |
for idx_tri in triangles: | |
# Step 1 - get corresponding triangles from source and target image | |
idx_tri = idx_tri.astype(int) | |
src_tri = src_points[idx_tri] | |
dst_tri_full = dst_points[idx_tri] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compute alpha masks | |
a = overlay[:, :, 3] | |
# we can also add some blur | |
# a = cv2.medianBlur(a,1) | |
b = 255 - a | |
# sum | |
overlay[:,:,:3] * np.dstack([a/255]*3) + frame[:,:,:3] * np.dstack([b/255]*3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subdiv = cv2.Subdiv2D((0, 0, 192, 192)) | |
subdiv.insert(list(ldms[:, :2])) | |
for triangle in subdiv.getTriangleList(): | |
triangle_pts = np.array(triangle.reshape((3,2)).astype(np.int32).tolist()) | |
cv2.drawContours(frame, [triangle_pts], 0, (0,255,0), 1) |