python 2.7 - extract patches from detected features in skimage -
i'm getting confused on image processing assignment. need plot matching features of 2 pictures shot different angles. got features using blob detector, know relevant functions in skimage perform negative cross validation , plot matches. miss central part: have extract square of pixels using features , compute distance between patches of 2 images (to compute distances know need loop). i've started this, i'm not sure way proceed.
#my data img1 = data.imread('img.png') img2 = data.imread('img.png') #grayscale img1 = rgb2gray(img1) img2 = rgb2gray(img2) #detect features blobs1 = blob_dog(img1, max_sigma=30, threshold=.1) blobs2 = blob_dog(img2, max_sigma=30, threshold=.1) #my keypoints image1 y1 = [p[0] p in blobs1] x1 = [p[1] p in blobs1] #my keypoints image2 y2 = [p[0] p in blobs2] x2 = [p[1] p in blobs2] #extract patches (how?) #then compute distance between them loop # normalized cross correlation use this: match_template(image, template, pad_input=false, mode='constant', constant_values=0) # match use this: plot_matches(ax, img1, img2, keypoints1, keypoints2, matches, keypoints_color='k', matches_color=none, only_matches=false)
Comments
Post a Comment