<jupyter_start><jupyter_text>Mini Project  4 - Finding Waldo<jupyter_code>import cv2
import numpy as np

# Load input image and convert to grayscale
image = cv2.imread('./images/WaldoBeach.jpg')
cv2.imshow('Where is Waldo?', image)
cv2.waitKey(0)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# Load Template image
template = cv2.imread('./images/waldo.jpg',0)

result = cv2.matchTemplate(gray, template, cv2.TM_CCOEFF)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)

#Create Bounding Box
top_left = max_loc
bottom_right = (top_left[0] + 50, top_left[1] + 50)
cv2.rectangle(image, top_left, bottom_right, (0,0,255), 5)

cv2.imshow('Where is Waldo?', image)
cv2.waitKey(0)
cv2.destroyAllWindows()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13531799729364005, 'fraction_numerical': 0.04194857916102842, 'mean_word_length': 6.254901960784314, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '641000', 'license': 'MIT', 'n_tokens_mistral': 312, 'n_tokens_neox': 300, 'n_words': 62, 'path': 'LECTURES/Lecture 5.2 - Mini Project # 4 - Finding Waldo.ipynb', 'repo_name': 'PacktPublishing/Master-Computer-Vision-OpenCV3-in-Python-and-Machine-Learning', 'size': '739'}