Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Recognition and Augmented Reality

Similar presentations


Presentation on theme: "Object Recognition and Augmented Reality"— Presentation transcript:

1 Object Recognition and Augmented Reality
10/21/10 Dali, Swans Reflecting Elephants Computational Photography Derek Hoiem, University of Illinois

2 Last class: Image Stitching
Detect keypoints Match keypoints Use RANSAC to estimate homography Project onto a surface and blend

3 Augmented reality Adding fake objects/textures to real images
Project by Karen Liu Interact with object in scene Responsive characters in AR Overlay information on a display Tagging reality Layar Google goggles T2 video (13:23)

4 Adding fake objects to real video
Approach Recognize and/or track points that give you a coordinate frame Apply homography (flat texture) or perspective projection (3D model) to put object into scene Main challenge: dealing with lighting, shadows, occlusion

5 Information overlay Approach
Recognize object that you’ve seen before Retrieve info and overlay Main challenge: how to match reliably and efficiently?

6 Today How to quickly find images in a large database that match a given image region?

7 Let’s start with interest points
Database Query Compute interest points (or keypoints) for every image in the database and the query

8 Simple idea See how many keypoints are close to keypoints in each other image Lots of Matches Few or No Matches But this will be really, really slow!

9 Key idea 1: “Visual Words”
Cluster the keypoint descriptors

10 Key idea 1: “Visual Words”
K-means algorithm 1. Randomly select K centers 2. Assign each point to nearest center 3. Compute new center (mean) for each cluster Illustration:

11 Key idea 1: “Visual Words”
K-means algorithm 1. Randomly select K centers 2. Assign each point to nearest center Back to 2 3. Compute new center (mean) for each cluster Illustration:

12 Key idea 1: “Visual Words”
Cluster the keypoint descriptors Assign each descriptor to a cluster number What does this buy us? Each descriptor was 128 dimensional floating point, now is 1 integer (easy to match!) Is there a catch? Need a lot of clusters (e.g., 1 million) if we want points in the same cluster to be very similar Points that really are similar might end up in different clusters

13 Key idea 1: “Visual Words”
Cluster the keypoint descriptors Assign each descriptor to a cluster number Represent an image region with a count of these “visual words”

14 Key idea 1: “Visual Words”
Cluster the keypoint descriptors Assign each descriptor to a cluster number Represent an image region with a count of these “visual words” An image is a good match if it has a lot of the same visual words as the query region

15 Naïve matching is still too slow
Imagine matching 1,000,000 images, each with 1,000 keypoints

16 Key Idea 2: Inverse document file
Like a book index: keep a list of all the words (keypoints) and all the pages (images) that contain them. Rank database images based on tf-idf measure. tf-idf: Term Frequency – Inverse Document Frequency # documents # times word appears in document # documents that contain the word # words in document

17 Fast visual search “Video Google”, Sivic and Zisserman, ICCV 2003
“Scalable Recognition with a Vocabulary Tree”, Nister and Stewenius, CVPR 2006.

18 110,000,000 Images in 5.8 Seconds Slide Slide Credit: Nister
Very recently, we have scaled the system even further. The system we just demo’d searches a 50 thousand image index in the RAM of this laptop at real-time rates. We have built and programmed a desktop system at home in which we currently have 12 hard drives. We bypass the operating system and read and write the disk surfaces directly. Last week this system clocked in on 110 Million images in 5.8 seconds, so roughly 20Million images per second and machine. The images consist of around 10 days of four TV channels, so more than a month of TV. Soon we don’t have to watch TV, because we’ll have machines doing it for us. Slide Slide Credit: Nister

19 Slide Slide Credit: Nister
To continue the analogy, if we printed all these images on paper, and stacked them, Slide Slide Credit: Nister

20 The pile would stack, as high as
Slide Slide Credit: Nister

21 Slide Slide Credit: Nister Mount Everest.
Another way to put perspective on this is, Google image search not too long ago claimed to index 2 billion images, although based on meta-data, while we do it based on image content. So, with about 20 desktop systems like the one I just showed, it seems that it may be possible to build a web-scale content-based image search engine, and we are sort of hoping that this paper will fuel the race for the first such search engine. So, that is some motivation. Let me now move to the contribution of the paper. As you can guess by now, it is about scalability of recognition and retrieval. Slide Slide Credit: Nister

22 Key Ideas Visual Words Inverse document file
Cluster descriptors (e.g., K-means) Inverse document file Quick lookup of files given keypoints tf-idf: Term Frequency – Inverse Document Frequency # documents # times word appears in document # documents that contain the word # words in document

23 Recognition with K-tree
Following slides by David Nister (CVPR 2006)

24 I will now try to describe the approach with an animation.
The first, offline phase, is to train the vocabulary tree. We use Maximally Stable Extremal Regions by Matas et al. and then we extract SIFT descriptors from the MSER regions. Regarding the feature extraction, we are not really claiming anything other than down-in-the-trenches nose-to-the-grindstone hard work to get good implementations of the state-of-the-art, and since we are all obsessed with novelty I will not spend any time talking about the feature extraction. We believe that the vocabulary tree approach will work well on any of your favorite descriptors.

25 All the descriptor vectors are thrown into a common space.
This is done for many images, the goal being to acquire enough statistics on how natural images distribute points in the descriptor space.

26

27

28

29

30

31 We then run k-means on the descriptor space
We then run k-means on the descriptor space. In this setting, k defines what we call the branch-factor of the tree, which indicates how fast the tree branches. In this illustration, k is three. We then run k-means again, recursively on each of the resulting quantization cells. This defines the vocabulary tree, which is essentially a hierarchical set of cluster centers and their corresponding Voronoi regions. We typically use a branch-factor of 10 and six levels, resulting in a million leaf nodes. We lovingly call this the Mega-Voc.

32

33

34

35

36

37

38

39

40

41 We now have the vocabulary tree, and the online phase can begin.
In order to add an image to the database, we perform feature extraction. Each descriptor vector is now dropped down from the root of the tree and quantized very efficiently into a path down the tree, encoded by a single integer. Each node in the vocabulary tree has an associated inverted file index. Indicies back to the new image are then added to the relevant inverted files. This is a very efficient operation that is carried out whenever we want to add an image.

42

43

44

45

46 When we then wish to query on an input image, we quantize the descriptor vectors of the input image in a similar way, and accumulate scores for the images in the database with so called term frequency inverse document frequency (tf-idf). This is effectively an entropy weighting of the information. The winner is the image in the database with the most common information with the input image.

47 Performance One of the reasons we managed to take the system this far is that we have worked with rigorous performance testing against a database with ground truth. We now have a benchmark database with over images grouped in sets of four images of the same object. We query on one of the images in the group and see how many of the other images in the group make it to the top of the query. In the paper, we have tested this up to a million images, by embedding the ground truth database into a database encompassing all the frames of 10 feature length movies.

48 More words is better Improves Retrieval Improves Speed Branch factor
We have used the performance testing to explore various settings for the algorithm. The most important finding is that the number of leaf nodes in the vocabulary tree is very important. In principle, there is a trade-off, because we wish to have discriminative quantizations, which implies many leaf-nodes, while we also wish to have repeatable quantizations, which implies few leaf nodes. However, it seems that in a large practical range, the bigger the better when it comes to the vocabulary. This probably depends on the descriptors used, but is not entirely surprising, since we are trying to divide up a 128-dimensional space in discriminative bins. This is a very useful finding, because it means that we are in a win-win situation: a larger vocabulary improves retrieval performance. It turns out that it also improves the retrieval speed, because our inverted file index becomes much sparser, so we exploit the true power of inverted files better with a larger vocabulary. We also use a hierarchical scoring scheme, which has the nice property that the performance will only level out, not actually go down.

49 Higher branch factor works better (but slower)
We also find that performance improves with the branch factor. This improvement is not dramatic, but it is interesting to note that very low branch factors are somewhat weak, and a branch factor of two results in partitioning the space with planes.

50 Can we be more accurate? So far, we treat each image as containing a “bag of words”, with no spatial information Which matches better? h a f e a f z e h a f e e

51 Can we be more accurate? So far, we treat each image as containing a “bag of words”, with no spatial information Real objects have consistent geometry

52 Final key idea: geometric verification
Goal: Given a set of possible keypoint matches, figure out which ones are geometrically consistent How can we do this?

53 Final key idea: geometric verification
RANSAC for affine transform Repeat N times: a f z e a f e z Randomly choose 3 matching pairs Estimate transformation Affine Transform a f z e a f e Predict remaining points and count “inliers” z

54 Application: Large-Scale Retrieval
Query Results on 5K (demo available for 100K) K. Grauman, B. Leibe [Philbin CVPR’07]

55 Application: Image Auto-Annotation
Moulin Rouge Old Town Square (Prague) Tour Montparnasse Colosseum Viktualienmarkt Maypole Left: Wikipedia image Right: closest match from Flickr K. Grauman, B. Leibe [Quack CIVR’08]

56 Example Applications Mobile tourist guide Self-localization
Aachen Cathedral Mobile tourist guide Self-localization Object/building recognition Photo/video augmentation B. Leibe [Quack, Leibe, Van Gool, CIVR’08]

57 Video Google System Collect all words within query region
Inverted file index to find relevant frames Compare word counts Spatial verification Sivic & Zisserman, ICCV 2003 Demo online at : Retrieved frames K. Grauman, B. Leibe

58 Summary: Uses of Interest Points
Interest points can be detected reliably in different images at the same 3D location DOG interest points are localized in x, y, scale SIFT is robust to rotation and small deformation Interest points provide correspondence For image stitching For defining coordinate frames for object insertion For object recognition and retrieval

59 Announcements Project 4 is due Monday I’ll be out of town next Tues
Kevin Karsch will talk about his cool work I’ll still be here for office hours Mon (but leaving soon after for DC)


Download ppt "Object Recognition and Augmented Reality"

Similar presentations


Ads by Google