0

I have an image and i want to locate key points by using SIFT detector and group them, then i want to generate local features for each key point by using SIFT, would you please help me how I can do it ? Please give me any suggestions I really appreciate your help

Baran Barani
  • 21
  • 1
  • 2

2 Answers2

0

I'm not sure that I understand what you mean, but if you extract SIFT features from an image, you automatically get the feature descriptor which is used to compare features to each other. Of course you also get the feature location, size, direction and hessian value with it.

While you can group those features by there position in the image, but there is currently no way that I'm aware of to compare those groups, since they may be locally related, but can have wildly different feature descriptors.

Also I would suggest SURF. It is faster and not patent encumbered.

Have a look at the examples from OpenCV if you want specific instructions on how to retrieve and compare descriptors.

Darcara
  • 1,558
  • 1
  • 11
  • 32
  • @ Darcara: Thank you so much for your suggestions, it was really helpful. I am going to do it in Matlab. I want to search for similarities in one image, for example if you copy one part of image and paste it to other part of the same image, i want to search for these copy and pasted areas. do you think I can use SURF for this purpose? or do you have any other suggestion? – Baran Barani Jul 25 '12 at 06:25
  • @Baran Barani: If it is only copied and pasted, but not tampered with (scale, rotation, brightness, etc) then yes it can work if the patch is big enough. For small patches you'd need lot's more features detected, and that will increase false positives. Have a look at the paper [Super Resolution from a Single Image](http://www.wisdom.weizmann.ac.il/~vision/SingleImageSR.html). They look for similar patches in the same image. Additionally you might be able to find the paste-border of patches, as they might not blend with their new surroundings, depending on the type of the image. – Darcara Jul 25 '12 at 17:33
  • Thank you for your Suggestions,I will read this paper, for me it is important to detect tampered area if rotated or scaled, and in some cases it maybe small patch, do you think I can use SIFT to find duplicated areas even in small portions? – Baran Barani Aug 05 '12 at 08:45
  • Yes, although SIFT has it's limit if the image is transformed too much. To know for certain, you'll need to look at your test cases. If tamper detection is what you want, you might want to look at [Image Fingerprinting](http://stackoverflow.com/questions/596262/image-fingerprint-to-compare-similarity-of-many-images) – Darcara Aug 05 '12 at 11:59
  • the exact thing I want is tamper detection, the image fingerprinting is works to compare each image to other images , what I want is to search in one image only, not to compare 2 image with each other. In one image if i copy one part and paste it to another part in same image it can detect it. Please let me know if you have any other suggestions, thank you so much. – Baran Barani Aug 06 '12 at 04:58
  • SURF is also patented by the way. – Matthias Odisio Dec 18 '12 at 22:05
0

If you are using opencv here are the commands to do it, else if you are using the matlab see the link MATCHING_using surf


USING OPENCV::

// you can change the parameters for your requirement

    double hessianThreshold=200; 
    int octaves=3;
    int octaveLayers=4;
    bool upright=false;
    vector<KeyPoint>keypoints;

//The detector detects the keypoints in an image here image is RGBIMAGE of Mat type

SurfFeatureDetector detector( hessianThreshold, octaves, octaveLayers, upright );
detector.detect(RGB_IMAGE, keypoints);

//The extractor computesthe local features around the keypoints

SurfDescriptorExtractor extractor;
Mat descriptors;
extractor.compute( last_ref, keypoints, descriptors);

// all the key points local features are stored in rows one after another in descriptors matrix...

Hope it is useful:)

G453
  • 1,426
  • 10
  • 13