Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def methodHierarchical(image,template,minX,minY):
- #success,image = vidcap.read()
- #template=cv2.imread('reference.jpg')
- image_gray=image
- template_gray=template
- width,height=image_gray.shape[::-1]
- #image_blur=cv2.blur(image_gray,image_gray.shape)
- #=cv2.blur(template_gray,template_gray.shape)
- imageSub=cv2.pyrDown(image_gray)
- tempSub=cv2.pyrDown(template_gray)
- imageSub2=cv2.pyrDown(imageSub)
- tempSub2=cv2.pyrDown(tempSub)
- x2,y2,tx,ty=methodExhaustive(imageSub2,tempSub2,int(minX/4),int(minY/4),1,p)
- x1,y1,tx,ty=methodLog(imageSub,tempSub,x2*2,y2*2,1,3)
- w,h=template.shape[::-1]
- return x1*2,y1*2,x1*2+w,y1*2+h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement