(out, source, scene, blend_type, mask=None, use_colormap=False)
| 57 | return outImg |
| 58 | |
| 59 | def 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 | |
| 73 | def blend_pdc(scene_images, marker, flow_estimator, estimate_uncertainty, source=None, blend_type='D', use_colormap=True): |
| 74 | print('blend with pdc') |
no outgoing calls
no test coverage detected