Commit f217180d authored by Jay's avatar Jay Committed by jay
Browse files

Updates to better pass args. for graph vis.

parent b5d92204
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
import inspect
import math
import numpy as np
import networkx as nx
@@ -168,27 +169,17 @@ def plot_edge(edge, ax=None, clean_keys=[], image_space=100,
    if clean_keys:
        matches, mask = edge._clean(clean_keys)

    marker = '.'
    if 'marker' in scatter_kwargs.keys():
        marker = scatter_kwargs['marker']
        scatter_kwargs.pop('marker', None)

    color = 'r'
    if 'color' in scatter_kwargs.keys():
        color = scatter_kwargs['color']
        scatter_kwargs.pop('color', None)

    # Plot the source
    source_idx = matches['source_idx'].values
    s_kps = source_keypoints.iloc[source_idx]
    ax.scatter(s_kps['x'], s_kps['y'], marker=marker, color=color, **scatter_kwargs)
    ax.scatter(s_kps['x'], s_kps['y'], **scatter_kwargs)

    # Plot the destination
    destination_idx = matches['destination_idx'].values
    d_kps = destination_keypoints.iloc[destination_idx]
    x_offset = s_shape[0] + image_space
    newx = d_kps['x'] + x_offset
    ax.scatter(newx, d_kps['y'], marker=marker, color=color, **scatter_kwargs)
    ax.scatter(newx, d_kps['y'], **scatter_kwargs)

    # Draw the connecting lines
    color = 'y'
@@ -205,6 +196,7 @@ def plot_edge(edge, ax=None, clean_keys=[], image_space=100,

    return ax


def plotAdjacencyGraphFeatures(graph, pointColorAndHatch='b.', featurePointSize=7):
    """
    Plot each image in an adjacency graph and its found features in a single figure.