by: https://x.com/deeplearnerd
Recently, I applied to my dream company and got rejected before even getting an interview call - simply because my work experience wasn't specifically in Computer Vision. I'll be honest, it stung a bit. I've always believed that my projects would speak for themselves, but maybe the company had a point. Looking back at my fundamentals, I realised most of what I learned in my undergrad CV course had completely vanished from my memory. So I thought, screw it - “shuru se shuru karte hai”.
Now, I have always learnt the best when I taught it so….whether you're a beginner or someone like me trying to refresh their knowledge, this blog series is for us. Let's dive in.
This blog has 3 main components:
We will be using OpenCV throughout this blog series so import it using import cv2
Before we begin with exploring the more complex parts of CV. Lets understand how exactly a computer looks at an image. What is an image for us is a grid of small blocks called pixels stacked against each other.
Each pixel can be assumed to be holding a value representing the colour of that particular pixel. The computer looks at these values and understands them as a whole.
Pixel Values in Grayscale Images
Each pixel in a grayscale image has a value from 0 to 255:
Example (3×3 pixel grayscale image):
$\\begin{bmatrix}
0 & 128 & 255 \\ 64 & 192 & 128 \\ 255 & 255 & 0 \end{bmatrix}$
image_grayscale = cv2.imread('path_to_image.jpg', cv2.IMREAD_GRAYSCALE)
print(image_grayscale)
Pixel Values in Coloured Images
When dealing with coloured image, your can think of it as a layered stack of three transparent sheets, each representing one colour: Red, Green, and Blue (RGB). Each sheet contributes a portion of its colour to form the final image.