<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using Autocnet image match script
Table of Contents
Introduction
Code Breakdown
The Config File & Parameter Breakdown
TODO
Step1:  The graph object
Everything in Autocnet operates on a NetworkX graph object as the underlying structure. Every node is an image and each edge contains data expressing the relationship bertween every image (e.g. feature matches), in other words, edges connect overlapping images and describe their relationship. Here, we populate the graph from the input file and store it into cg. This can be either an ISIS cube, GDAL supported file, or an adjacency matrix (the least ideal option).
TODO
Step2:  Feature Extraction
Step3:  The graph method extract_features uses OpenCV in the background to calcluate features for every node in the graph using the detector methods SIFT, SURF, ORB or FAST. Here, you can see we are using SIFT. Every node now contains a pandas dataframe containing keypoint information. Along with the dataframe, there is descriptor information and image metadata. 
We can see this be ploting a single node (i.e. a single image)
Step4:  We can see more by printing node data and the first few keypoints from the pandas dataframe
<ASSISTANT_TASK:>
Python Code:
import os
import sys
import argparse
import yaml
import networkx as nx
sys.path.insert(0, os.path.abspath('..'))
from autocnet.examples import get_path
from autocnet.graph.network import CandidateGraph
from autocnet.fileio.io_controlnetwork import to_isis, write_filelist
from IPython.display import display
%pylab inline
adjacency = get_path('three_image_adjacency.json')
basepath = get_path('Apollo15')
# Matches the images in the input file using various candidate graph methods
# produces two files usable in isis
try:
    cg = CandidateGraph.from_adjacency(adjacency, basepath=basepath)
except:
    cg = CandidateGraph.from_filelist(args.input_file)
Explanation: Using Autocnet image match script
Table of Contents
Introduction
Code Breakdown
The Config File & Parameter Breakdown
TODO: Maybe break this down into sub categories? 
Introduction<a name="intro"></a>
Autocnet (Automatic Control Networks) uses modern computer vision techniques in order to automatically generate an ISIS compatible control network (CN) from ISIS Cubes or GDAL supported formats. The image match script encapsulates Autocnet's functionality with configurable parameters though a YAML file. 
TODO: Insert example of input/output after image_match w/ config file is completed merged
Code Breakdown<a name="cb"></a>
End of explanation
cg.plot()
Explanation: The graph object
Everything in Autocnet operates on a NetworkX graph object as the underlying structure. Every node is an image and each edge contains data expressing the relationship bertween every image (e.g. feature matches), in other words, edges connect overlapping images and describe their relationship. Here, we populate the graph from the input file and store it into cg. This can be either an ISIS cube, GDAL supported file, or an adjacency matrix (the least ideal option).
TODO: Find better input file example
End of explanation
# Apply SIFT to extract features
cg.extract_features(method='sift', extractor_parameters={'nfeatures': 1000})
Explanation: Feature Extraction
End of explanation
cg.node[0].plot()
Explanation: The graph method extract_features uses OpenCV in the background to calcluate features for every node in the graph using the detector methods SIFT, SURF, ORB or FAST. Here, you can see we are using SIFT. Every node now contains a pandas dataframe containing keypoint information. Along with the dataframe, there is descriptor information and image metadata. 
We can see this be ploting a single node (i.e. a single image):
End of explanation
print(cg.node[0])
print("\n\n", cg.node[0].keypoints[:5])
Explanation: We can see more by printing node data and the first few keypoints from the pandas dataframe:
End of explanation
<END_TASK>