i want code match 2 pictures on basis of sift keypoints.?
i have following code sift
public static image<bgr, byte> siftfunction(bitmap sourcebitmap) { image<gray, byte> modelimage = new image<gray, byte>(sourcebitmap); siftdetector siftcpu = new siftdetector(); vectorofkeypoint modelkeypoints = new vectorofkeypoint(); mkeypoint[] mkeypoints = siftcpu.detectkeypoints(modelimage, null); modelkeypoints.push(mkeypoints); imagefeature<float>[] reulst = siftcpu.computedescriptors(modelimage, null, mkeypoints); image<bgr, byte> result = features2dtoolbox.drawkeypoints(modelimage, modelkeypoints, new bgr(color.red), features2dtoolbox.keypointdrawtype.default); return result; }
one solution use provided example of object detection , compare area of detection. in case whole observed image corresponds model image - images match.
other solution - not use descriptors @ select key points. compare key points arrays of 2 pictures , in case of equality consider images matching.
first solution somehow more reliable while second faster , easier.
Comments
Post a Comment