QuestionQuestion

Transcribed TextTranscribed Text

Warping, Matching, Stitching, Blending you may Python but you should implement your own computer vision ope rations (with some exceptions below) You donot have tore implement image I/O routines (i.e you may use Python libraries for reading and writing images). You may alsouse libraries fo outines not related computer vision (e. data structures, sorting algorithms, matris operations,etc.) It also acceptableto semultipl programming languages, longas your code works as required below All that said erecommend using either Python with the Pillow library C/C++ with the Clmg library. No matter what language and library use make sure that your program obeys the input and output requirements below (e.g takes the right command line parameters in the rightor der, and creates the right output files) since we use testing scripts that automaticall test your program If you haveany questions about any of this, plesase ask the coursestaff Part 0: Getting started You can find your assigned teammate(s) by logging into IU Github, at http ://github iu edu/ In the upper left hand corner of the screen, you should see pull-down menu Select cs b657 sp2019 Then in the yellow box tothe right, you should see repository called userid1 userid2 userid3 userid -a2. where the other user ID(s)corresponds to your tenmmates. Part 1: Image matching and clustering As cameras continue to pervade our lives, not an exaggeration to say that the world is drowning in visual data: consumers will take about 1.5 trillion photos this year alone roughly the same number that were taken all of human history upto the year 2000. With so much visual data, we need tools to help people automatically organize their photos. Sometimes we might know ahead of time what people are looking for Figure Sample visualization of SIFT matches in photos, and can organize based on semantic content (e.g. place the photo was taken, who is in the photo, etc). Other times may simply want help people organize their photos into coherent groupes according to similar visual content even the algorithms do not attempt recognize what that similar content A natural idea this context is to cluster photos into small number of groups according to visual similarity across photos. In class, we discussed SIFT technique to detect corners and other "interest' or "fenture" points. For each interest point SIFT produces 128-dimensional vector that supposed to be invariant to image transformations like scaling, rotation. etc. These features be useful for discovering similarities visual content across images. SIFT very popular but has several problems including that it ir protected by patents Although we can use SIFT academia for research and education purposes without license there are few high- quality open-source SIFT implementations available. We suggest using one of two approaches: 1 If you warit touse Python wesuggest using similar descriptor ORB instesd ofSIFT Theider behind ORB very similar takessan image and produces set of keypoints( (x.y coordinates) and descriptors (high dimensional vectors). In your repository we've provided some sample code for computing ORB features using the OpenCV library. The code also shows how to compute the distance betweer ORB features: they are binary features so bitwise Hamming distance typically recommended. 2. If you use C++, we have provided an implementation of SIFT that we prepared ORB was designed tobe much faster than SIFT while offering similar performance 1 Write function that takes two images, applies ORB/SIFT on ench one. and counts the number of matching ORB/SIFT descriptors across the two images. Remember that ORB/SIFT 'match is usually defined by looking at the ratio of the Euclidean distances between the closest match and the second-closest match and comparing to threshold (Although not required you may find helpful to also create function that visualizes these matches, asin Figure 1). 2. Use your function above to implement simple image clustering program, that organizes set of unordered images into groups. where is a parameter given by the user Your program should take command line arguments like this: /a2 parti k img. png ing_2.png ing. png output file txt and then produce an output file with lines, each of which lists the irnages assigned to that cluster. For example, for k=2 your output file might be: ing .png ing 1.png ing. png ing 3.png img. 5.png Hints: You can use any clustering technique you a like although natural one might be touse k clustering A key design decision your choice of distance metric i.e. how you compare two images. You might start with count of matching ORB/SIFT descriptors #1 above, but feel free to refine this get better results. 3. We will provide small test image collection in your GitHub repo consisting of few dozen images from well- known tourist attractions There are 10 classes this dataset with the file names indicating the correct classes. (You can use these file names evaluating the accuracy your clustering, but of course you cannot use the names to help with the clustering that would be cheating! In your report, show some sample failures (assuming you have some failures) and try explain what went wrong. Report your performance quantitatively using the following measure For the images in the dataset. consider each the possible N(N - : pairs images. TP be the number of pairs where your clustering correctly assigned them to the correct cluster. and TN be the number of pairs where your clustering correctly assigned them to different clusters The Pairwise Clustering Accuracy then simply TR+TN which ranges from to where higher accuracies indicat better performance. A small portion of your grade for this assignment will based on how well your clustering performs on our (separate) test dataset on this task. compared with others in the class

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

from __future__ import print_function
import cv2
import numpy as np
import pdb
from matplotlib import pyplot as plt
import os
import random

MAX_FEATURES = 500

def load_images_from_folder(folder):
    images = []
    imagesFileNames = []
    for filename in os.listdir(folder):
       print("Reading ",filename)
       img = cv2.imread(os.path.join(folder,filename))
       img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
       if img is not None:
            images.append(img)
            imagesFileNames.append(filename)
    return images, imagesFileNames


def imageDist(im1Gray, im2Gray):

    # Detect ORB features and compute descriptors.
    orb = cv2.ORB_create(MAX_FEATURES)
    keypoints1, descriptors1 = orb.detectAndCompute(im1Gray, None)
    keypoints2, descriptors2 = orb.detectAndCompute(im2Gray, None)

    # Match features.
    # create BFMatcher object
    bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=False)
    # Match descriptors.
    matches = bf.knnMatch(descriptors1,descriptors2, k=2)...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$100.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats