Function mola::vision::sobelGradients

Function Documentation

void mola::vision::sobelGradients(const mrpt::img::CImage &img, Eigen::MatrixXf &Ix, Eigen::MatrixXf &Iy)

Compute Sobel gradient images Ix and Iy using 3x3 separable kernels.

Uses: Ix = [-1 0 1] ⊗ [1 2 1]ᵀ Iy = [1 2 1] ⊗ [-1 0 1]ᵀ

Input: grayscale CImage (CH_GRAY, D8U). Output: Ix, Iy as Eigen::MatrixXf (same size as input). Border pixels are set to zero.

Complexity: O(W*H) with constant factor ≈ 8 muls + 6 adds per pixel (two separable passes of 3-tap filters).