match: SIFT Plan for keypoints matching

Contains a class for creating a matching plan, allocating arrays, compiling kernels and other things like that

class silx.opencl.sift.match.MatchPlan(size=16384, devicetype='ALL', profile=False, device=None, block_size=None, roi=None, ctx=None)[source]

Plan to compare sets of SIFT keypoint and find common ones.

siftp = sift.MatchPlan(devicetype="ALL")
commonkp = siftp.match(kp1,kp2)

where kp1, kp2 is a n x 132 array. the second dimension is composed of x,y, scale and angle as well as 128 floats describing the keypoint. commonkp is mx2 array of matching keypoints

match(nkp1, nkp2, raw_results=False)[source]

Calculate the matching of 2 keypoint list

Parameters:
  • nkp1 – numpy 1D recarray of keypoints or equivalent GPU buffer
  • nkp2 – numpy 1D recarray of keypoints or equivalent GPU buffer
  • raw_results – if true return the 2D array of indexes of matching keypoints (not the actual keypoints)

TODO: implement the ROI ...

reset_timer()

Resets the profiling timers

set_roi(roi)[source]

Defines the region of interest

Parameters:roi – region of interest as 2D numpy array with non zero where valid pixels are
unset_roi()[source]

Unset the region of interest

silx.opencl.sift.match.match_py(nkp1, nkp2, raw_results=False)[source]

Pure numpy implementation of match:

Parameters:
  • nkp2 (nkp1,) – Numpy record array of keypoints with descriptors
  • raw_results – return the indices of valid indexes instead of
Returns:

(2,n) 2D array of matching keypoints.