Pipeline. RGB → grayscale (Y = 0.299R + 0.587G + 0.114B) → separable Gaussian blur G(x) ∝ exp(-x²/2σ²) to suppress sensor noise → Sobel gradients. With kernels Kx = [[-1,0,1],[-2,0,2],[-1,0,1]] and Ky = KxT, |G| = √(Gx²+Gy²) and direction θ = atan2(Gy,Gx). A pixel is an edge when |G| exceeds the threshold. A perfect 0|255 step gives |G| = 4×255 = 1020 (checked on load).
Blob detection and bearing. Pixels with a strong red channel are grouped by connected-component labelling. For a pinhole camera with horizontal field of view FOV the focal length in pixels is f = (W/2)/tan(FOV/2) and the bearing of a pixel column u is atan((u-W/2)/f), which a robot would use to steer towards or around an object.
Simplifications: synthetic flat scene, additive Gaussian noise, no lens distortion, no depth, fixed colour thresholds, no non-maximum suppression (edges are thick when blur is small).