def merge_mean_color(graph, src, dst):
 graph.node[dst]['total color'] += graph.node[src]['total color']
 graph.node[dst]['pixel count'] += graph.node[src]['pixel count']
 graph.node[dst]['mean color'] = (graph.node[dst]['total color'] / graph.node[dst]['pixel count'])

def merge_mean_color ( graph , src , dst ) : graph . node [ dst ] [ 'total color' ] += graph . node [ src ] [ 'total color' ] graph . node [ dst ] [ 'pixel count' ] += graph . node [ src ] [ 'pixel count' ] graph . node [ dst ] [ 'mean color' ] = ( graph . node [ dst ] [ 'total color' ] / graph . node [ dst ] [ 'pixel count' ] )
callback called before merging two nodes of a mean color distance graph .