'**SUMMARY**
Draw keypoints draws a side by side representation of two images, calculates
keypoints for both images, determines the keypoint correspondences, and then draws
the correspondences. This method is helpful for debugging keypoint calculations
and also looks really cool :) .  The parameters mirror the parameters used
for findKeypointMatches to assist with debugging
**PARAMETERS**
* *template* - A template image.
* *quality* - The feature quality metric. This can be any value between about 300 and 500. Higher
values should return fewer, but higher quality features.
* *minDist* - The value below which the feature correspondence is considered a match. This
is the distance between two feature vectors. Good values are between 0.05 and 0.3
* *width* - The width of the drawn line.
**RETURNS**
A side by side image of the template and source image with each feature correspondence
draw in a different color.
**EXAMPLE**
>>> img = cam.getImage()
>>> template = Image("myTemplate.png")
>>> result = img.drawKeypointMatches(self,template,300.00,0.4):
**NOTES**
If you would prefer to work with the raw keypoints and descriptors each image keeps
a local cache of the raw values. These are named:
self._mKeyPoints # A tuple of keypoint objects
See: http://opencv.itseez.com/modules/features2d/doc/common_interfaces_of_feature_detectors.html#keypoint-keypoint
self._mKPDescriptors # The descriptor as a floating point numpy array
self._mKPFlavor = "NONE" # The flavor of the keypoints as a string.
**SEE ALSO**
:py:meth:`drawKeypointMatches`
:py:meth:`findKeypoints`
:py:meth:`findKeypointMatch`'

def drawKeypointMatches(self, template, thresh=500.0, minDist=0.15, width=1):

    if (template == None):
        return None
    resultImg = template.sideBySide(self, scale=False)
    hdif = ((self.height - template.height) / 2)
    (skp, sd) = self._getRawKeypoints(thresh)
    (tkp, td) = template._getRawKeypoints(thresh)
    if ((td == None) or (sd == None)):
        logger.warning("We    didn't    get    any    descriptors.    Image    might    be    too    uniform    or    blurry.")
        return resultImg
    template_points = float(td.shape[0])
    sample_points = float(sd.shape[0])
    magic_ratio = 1.0
    if (sample_points > template_points):
        magic_ratio = (float(sd.shape[0]) / float(td.shape[0]))
    (idx, dist) = self._getFLANNMatches(sd, td)
    p = dist[:, 0]
    result = ((p * magic_ratio) < minDist)
    for i in range(0, len(idx)):
        if result[i]:
            pt_a = (tkp[i].pt[1], (tkp[i].pt[0] + hdif))
            pt_b = ((skp[idx[i]].pt[1] + template.width), skp[idx[i]].pt[0])
            resultImg.drawLine(pt_a, pt_b, color=Color.getRandom(), thickness=width)
    return resultImg
