Posts

Showing posts from November, 2022

Suspect Detection System using Template Matching in OpenCV.

Image
 Problem statement:  To detect the suspect from a photograph of a group of people. The pic of that suspect is already stored in the form of a template/patch. The project uses the concept of template matching(in OpenCV) and object detection.  Here the source image is a photograph of a group of people and the template is an image of the suspect. It compares the source and the template by finding the matching probability and encircles the portion in the source image with the maximum matching probability. Source image: Template (Suspect Image): Output: Result:  We found the suspect in the group photograph.  Code: import cv2 import numpy as np   GroupPhotograph=cv2.imread("group.png",cv2.IMREAD_UNCHANGED)   cv2.imshow("Image",GroupPhotograph) cv2.waitKey() cv2.destroyAllWindows()   Man=cv2.imread("man.png",cv2.IMREAD_UNCHANGED)   cv2.imshow("Image",Man) cv2.waitKey() cv2.destroyAllWindows()   result=cv2.matchTemplate(GroupPhotograph,Man,cv2.T...