#ifndef float_image_gradient_2_H #define float_image_gradient_2_H /* Extra tools for image gradients. */ /* Last edited on 2024-12-04 23:28:13 by stolfi */ #include #include #include #include void float_image_gradient_sqr_relative_2 ( float_image_t *A, int32_t cA, double noise, float_image_t *G, int32_t cG ); /* Computes the relativized gradient squared of image {A}, stores it into channel {cG} of image {G} (which must have the same dimensions as {A}). If {cA} is non-negative, the sample of {G} at pixel {p} and channel {cG} is {g2/(v2+noise^2)}, where {g2} is the squared {3×3} Sobel gradient of channel {cA} of {A} at {p}, and {v2} is the local variance of channel {cA} of {A} within a {5×5} Gaussian-like window. If {cA} is negative, the result is the arithmetic average of {g2/(v2 + noise^2)} over all channels of {A}. */ #endif