MCPcopy Index your code
hub / github.com/drinkingcoder/NeuralMarker / blend

Function blend

evaluation_DVL.py:59–71  ·  view source on GitHub ↗
(out, source, scene, blend_type, mask=None, use_colormap=False)

Source from the content-addressed store, hash-verified

57 return outImg
58
59def blend(out, source, scene, blend_type, mask=None, use_colormap=False):
60 if mask is None:
61 intensity = np.linalg.norm(out, axis=2)
62 mask = (intensity == 0)[:,:,np.newaxis]
63 else:
64 mask = mask
65 scene = source if blend_type=='L' or blend_type == 'mix' else scene
66 if not use_colormap:
67 result = (out * (1 - mask) + scene * mask).astype(np.uint8)
68 else:
69 colormap = cv2.addWeighted(out, 0.5, scene, 0.5, 0)
70 result = (colormap * (1 - mask) + scene * mask).astype(np.uint8)
71 return result, mask
72
73def blend_pdc(scene_images, marker, flow_estimator, estimate_uncertainty, source=None, blend_type='D', use_colormap=True):
74 print('blend with pdc')

Callers 5

blend_pdcFunction · 0.70
blend_lifeFunction · 0.70
blend_RANSACFunction · 0.70
blend_homographyFunction · 0.70
blend_SPSGFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected