Math 101 to Meow Filter: How Calculus Detects My Crush's Face!



📸
Math 101 to Meow Filter: How Calculus Detects My Crush's Face!


A Fun & Educational Journey from Classroom to Camera

👩‍🏫 Why This Topic?

My crush complained that Snapchat filters fail to detect her face correctly. I cloned the app and realized the real issue: detecting edges. And surprisingly, my Math 101 course saved me!

🧠 Core Math Concepts Used

  • Partial Derivatives
  • Gradient Magnitude
  • Coordinate Geometry
  • Rate of Change

📐 Mathematical Example

Given pixel gradients:

∂f/∂x = 3
∂f/∂y = 2

Edge strength (Gradient Magnitude):

G = √(3² + 2²) = √13 ≈ 3.6

🎯 How Filter is Positioned

To place a PNG (cat nose) of size 40x20 on nose center (130,120):

Top-left position = (130 - 20, 120 - 10) = (110, 110)

🤖 Behind the Scene — Snapchat Style

  • Convert to Grayscale
  • Detect Edges via Sobel / Derivatives
  • Use Landmark Detection
  • Overlay Filter on Correct Coordinates

📚 Project Highlights

Source Code : Github
Click on this to redirect

Project Link : Deploy on github
Click on this to redirect


📚 Source Highlights

Source 1: Digital Image Processing: Edge Detection
Read on Medium

Source 2: Efficient and Automated Herbs Classification (Research Paper)
Read on ResearchGate

Source 3: How Snapchat's filters work (YouTube)
Watch on YouTube

Source 4: Image Filters Explained (YouTube)
Watch on YouTube

Source 5: AI Tools Used: ChatGPT, Perplexity, Gemini

✅ Conclusion

Math 101 isn’t just for theory — it powers face detection, edge recognition, and filter placement. From my classroom notes to real-time filters, calculus really does create magic!

Comments