Im trying to make a bot for a game. Basically it picks up items from the ground, thing is these items look different sometimes for ex. the angle is different or they are lying on differentyl coloured ground etc. To make everything work I need multiple templates. Is there any way to do that? If you dont understand just tell me in the comments. Here is what I tried so far:
files = ["bones_{}.png".format(x) for x in range(6)]
for i in range(6):
img_gray = cv2.cvtColor(imageGrab(), cv2.COLOR_BGR2GRAY)
f = str(files[i])
template = cv2.imread(f, 0)
w, h = template.shape[:: -1]
res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
threshhold = 0.70
loc = np.where( res >= threshhold)
This works but It could be better. Do you have any ideas?