Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 1.11 KB

File metadata and controls

41 lines (22 loc) · 1.11 KB

This is a collection of OpenCV scripts. Hope you will find them useful to your projects!

Template Matching

So we have an image like this

Alt text

We'd like to find the monster and the player:

Alt text

Alt text

in this image. The script finds the two objects and draws them on the image in rectangles:

Alt text

See "detect_templates.py".

Best Template Matching

The monster can move and turn left and turn right. We want to keep track of its position and direction. We can use templates of this monster facing front, left and right:

Alt text

Alt text

Alt text

The script finds the most matching and draws on the image:

Alt text

See "detect_best_matching_template.py"

Cropping.

Say you want to implement a cropping function in an image editor. User draws a rectangle on an image. The script crops it and save the crop in another image.

See "cropping.py".