Alright, so today I’m gonna walk you through this little side project I did called “funny football pics.” It was basically a way for me to mess around with some image processing and, you know, just have some laughs. Don’t expect anything groundbreaking, it’s more of a weekend warrior kinda thing.
It all started when I was scrolling through Instagram and saw a bunch of those warped face filters. Got me thinking, what if I could apply similar effects to football photos? You know, stretch faces, make helmets look huge, that kinda stuff.
First thing I did was gather the pics. I just Googled “funny football pictures,” made sure they were royalty-free, and downloaded a bunch. I ended up with like, 50 or so images. Real mix of stuff – players making weird faces, awkward poses, that kind of thing.
Next, I needed to choose a language and some tools. I figured Python would be the easiest. I’m not a Python guru or anything, but I know enough to get by. I grabbed OpenCV for image manipulation, and Pillow (PIL) ’cause it’s super handy for basic image stuff. I just ran pip install opencv-python pillow in my terminal to get those installed.
Then came the fun part: coding! I started with something simple. Just loading an image and displaying it. It’s always good to start small and make sure everything’s working. The OpenCV code looks something like this:
import cv2
img = *('football_pic_*')
*('Original Image', img)
*(0)
That just opens up a window showing the image. Pretty basic, but crucial.
Okay, so now for the funny stuff. I wanted to try a face warping effect. After some research, I decided to use something called “affine transformation.” It basically lets you distort an image by mapping three points from the original image to three different points in the output image. I found a few tutorials online and adapted them for my needs.
Here’s the basic idea:
Detect faces in the image. I used OpenCV’s built-in Haar cascade classifier for this. It’s not perfect, but it’s good enough for a quick and dirty project.
For each face, pick three key points – maybe the corners of the eyes and the tip of the nose.
Define three new points that are slightly offset from the original points. This will create the warp.
Use OpenCV’s to calculate the transformation matrix.
Apply the transformation to the image using .
It took a bit of trial and error to get the warping looking decent. I messed around with the offset values for the key points until I got some results that I liked. Some faces ended up looking super stretched, others looked subtly distorted – it was all part of the fun.
I also tried some other simple effects, like increasing the saturation to make the colors pop, or adding a blur to make things look a bit more surreal.
img[y:y+h, x:x+w] = warped_face # Replace original face with warped face
return img
img = *('football_pic_*')
gray = *(img, *_BGR2GRAY)
faces = face_*(gray, 1.1, 4)
for face in faces:
img = warp_face(img,face)
*('Warped Image', img)
*(0)
I ran this on all my football pics, and the results were… well, funny. Some of them were genuinely hilarious. I saved the modified images to a new folder.
Finally, I put together a little slideshow using Pillow. I just cycled through the modified images and displayed them for a few seconds each. Nothing fancy, but it was a fun way to showcase the results.
Overall, this “funny football pics” project was a blast. It was a good excuse to brush up on my Python skills, and I ended up with a bunch of silly images that made me laugh. It proves that you don’t need complex algorithms or tons of experience to have fun with image processing. Just grab some pictures, fire up your favorite editor, and start experimenting!