Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to solve this opencv-program

http://jwlee2218.blogspot.com/2017/11/opencv-feature-matching.html

i want to make a program that searches the wally.

image description

this is a code But i have another error.

this is a error: syntaxerror keyword can't be an expression

I don't understand what they say

how to solve this opencv-program

http://jwlee2218.blogspot.com/2017/11/opencv-feature-matching.html

i want to make a program that searches the wally.

image descriptionimport bumpy as np import cv2 import matplotlib.pyplot as pat

img1=cv2.imread(‘icy.jpg’,0) img2=cv2.imread(‘wally.png’,0)

sift=cv2.xfeatures2d.SIFT_create()

kp1,des1=sift.detectAndCompute(img1,None) kp1,des2=sift.detectAndCompute(img2,None)

bf=cv2.BFMatcher() matches=bf.knnMatch(des1,des2,k=2)

good=[] for m,n in matches: if m.distance<0.75*n.distance: good.append([m])

img3=cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2)

plt.imshow(img3) plt.show()

this is a code But i have another error.

this is a error: syntaxerror keyword can't be an expression

I don't understand what they say

how to solve this opencv-program

http://jwlee2218.blogspot.com/2017/11/opencv-feature-matching.html

i want to make a program that searches the wally.

this is a code:

import bumpy as np np

import cv2 cv2

import matplotlib.pyplot as pat

img1=cv2.imread(‘icy.jpg’,0) img1=cv2.imread(‘icy.jpg’,0)

img2=cv2.imread(‘wally.png’,0)

sift=cv2.xfeatures2d.SIFT_create()

kp1,des1=sift.detectAndCompute(img1,None) kp1,des1=sift.detectAndCompute(img1,None)

kp1,des2=sift.detectAndCompute(img2,None)

bf=cv2.BFMatcher() bf=cv2.BFMatcher()

matches=bf.knnMatch(des1,des2,k=2)

good=[] good=[]

for m,n in matches: if m.distance<0.75*n.distance: good.append([m])

img3=cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2)

plt.imshow(img3) plt.imshow(img3)

plt.show()

this is a code But i have another error.errors.

this is a error: syntaxerror keyword can't be an expression

I don't understand what they say

how to solve this opencv-program

http://jwlee2218.blogspot.com/2017/11/opencv-feature-matching.html

i want to make a program that searches the wally.

this is a code:

import bumpy as np

np import cv2

import cv2

import matplotlib.pyplot as pat

pat

img1=cv2.imread(‘icy.jpg’,0)

img2=cv2.imread(‘wally.png’,0)

img1=cv2.imread(‘icy.jpg’,0) img2=cv2.imread(‘wally.png’,0) sift=cv2.xfeatures2d.SIFT_create() kp1,des1=sift.detectAndCompute(img1,None) kp1,des2=sift.detectAndCompute(img2,None) bf=cv2.BFMatcher() matches=bf.knnMatch(des1,des2,k=2) good=[]

sift=cv2.xfeatures2d.SIFT_create()

kp1,des1=sift.detectAndCompute(img1,None)

kp1,des2=sift.detectAndCompute(img2,None)

bf=cv2.BFMatcher()

matches=bf.knnMatch(des1,des2,k=2)

good=[]

for m,n in matches: if m.distance<0.75*n.distance: good.append([m])

good.append([m])

img3=cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2)

plt.imshow(img3)

img3=cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2) plt.imshow(img3)

plt.show()

plt.show()

But i have another errors.

this is a error: syntaxerror keyword can't be an expression

I don't understand what they say