I have a sample image which contains an object, such as the earrings in the following image:
http://imgur.com/luj2Z
I then have a large candidate set of imag
Fortunately, the kind guys from OpenCV just did that for you. Check in your samples folder "opencv\samples\cpp\matching_to_many_images.cpp". Compile and give it a try wih the default images.
The algorithm can be easily adapted to make it faster or more precise.
Mainly, object recognition algorithms are split in two parts: keypoint detection& description adn object matching. For both of them there are many algorithms/variants, with wich you can play directly into OpenCV.
Detection/description can be done by: SIFT/SURF/ORB/GFTT/STAR/FAST and others.
For matching you have: brute force, hamming, etc. (Some methods are specific for a given detection algorithm)
HINTS to start:
crop your original image so the interesting object covers as much as possible of the image area. Use it as training.
SIFT is the most accurate and the laziest descriptor. FAST is a good combination of precision and accuracy. GFTT is old and quite unreliable. ORB is newly added to OPENCV and is very promising, both in speed and accuracy.
So, you can find the best combination for you by trial and error.
For the details of every implementation, you should read the original papers/tutorials. google scholar is a good start