180 likes | 195 Views
img1 img3 img5. Your task. Write Harris detector ComputeHarris() in features.cpp Write Feature descriptor ExtractDescriptor() in features.cpp Run your program to get required numerical and image results
E N D
img1 img3 img5
Your task • Write Harris detector ComputeHarris() in features.cpp • Write Feature descriptor ExtractDescriptor() in features.cpp • Run your program to get required numerical and image results • Compare results from your features and SIFT features
Interest Point Detection • Convert the RGB image to a gray-scale image. • (Save the RGB image for later.) • Apply a 9 x 9 Gaussian filter we give you. • 3. Construct the Harris matrix M using a 5 x 5 • neighborhood around each pixel. • Compute corner response R = det(M) – k*Tr(M)2 • at each pixel. • If R is above a threshold and is a local maximum • in a 3 x 3 neighborhood, select it as an interest point. • 600 to 3000 points are expected to be detected for each • image
Feature Description • Go back to RGB space. • 2. Take a 45 x 45 window around each feature point. • Divide that window into 9 x 9 squares, each • of them size 5 x 5. • Applying a (given) 5 x 5 mask to each of these • squares in each of R, G, and B, gives 3 results • per square x 81 squares = a vector V of 243 values. • Compute V = V / ||V||2 (V divided by its L2-norm). • V is the descriptor.
Feature Matching:Use the skeleton code and user interface provided. This is a 25 point assignment. There’s extra credit, too. From 5 to 20 points.
Examples for program running • Use command line to get feature files and numerical results • Use Interface to get image results
Command line • Run Harris operator and feature descriptor samplesolution computeFeatures img1.ppm feature1.f 1 • Run your feature’s matching (always between image1 and another image) • samplesolution testMatch feature1.f feature2.f H1to2p 1 • Run SIFT feature matching (always between image1 and another image) • samplesolution testSIFTMatch img1.key img2.key H1to2p 1 • Please name your feature files as feature1.f, feature2.f, … feature6.f otherwise you have to change the content of database file (eg. img1simple.kdb)
User Interface • Display Corners from your feature file Load the image and feature file of the image you want, example: File-> Load Query Image ->img2.ppm File- > Load Query Feautures->Normal ->feature2.f
Visualize matches • Load image and feature of img1.ppm (Matches are always between img1.ppm and another image) File-> Load Query Image ->img1.ppm File- > Load Query Feautures ->Normal ->feature1.f 2. Select all features points Image->Select All Features
3. Load database file of the image you want to compare with img1.ppm, example, • File->Load Image Database-> Normal -> img3simple.kdb 4. Perform Query • Image-> Perform Query
Base image (img1.ppm) on the left and target image (img3.ppm) on the right • On the right part, red makers are feature points for which no matches are found
Visualize SIFT matching • Steps File-> Load Query Image ->img1.ppm File- > Load Query Feautures ->SIFT ->img1.key Image->Select All Features File->Load Image Database-> SIFT-> img3.kdb Image-> Perform Query
Useful debugging method • After loading img1.ppm, select some feature points by single clicking red makers and then load database file and perform query
Other Tips Start early if you are not familiar with C++ Read lecture notes, webpage instruction, ppt slides, homework template and grading guildline Play with samplesolution Manage the size of your email
Good luck with this homework !