Implements a Homomorphic Filter based on the algorithm described in Digital Image Processing by Rafael C. Gonzalez.
- Gaussian — smooth rolloff, controlled by sharpness parameter
c - Butterworth — steeper rolloff, controlled by
order - Ideal — sharp cutoff at the threshold distance (no transition band)
#include "homomorphic_filter.hpp"
// Convenience: apply directly with parameters (pads to image size internally)
cv::Mat result = applyHomomorphicFilter(input, cutoff, gammaH, gammaL, filterType, c, order);
// Or build the filter separately for reuse
cv::Mat f = createGaussianFilter(size, cutoff, gammaH, gammaL, c);
cv::Mat f = createButterworthFilter(size, cutoff, order, gammaH, gammaL);
cv::Mat f = createIdealFilter(size, cutoff, gammaH, gammaL);
cv::Mat result = applyHomomorphicFilter(input, f);| Parameter | Description |
|---|---|
cutoff |
Distance D₀ from frequency center (controls filter bandwidth) |
gammaH |
High-frequency gain (≥ 1). Boosts contrast/detail |
gammaL |
Low-frequency gain (0 < γL ≤ 1). Attenuates uneven illumination |
c |
Sharpness of Gaussian transition (1.0 = standard) |
order |
Butterworth rolloff steepness (higher = sharper) |
- CMake ≥ 3.14
- C++17
- OpenCV 4
- Qt 6 (for the GUI)
- OpenMP (optional, for parallelism)
cmake -B build
cmake --build buildThe GUI executable is build/dft_filters/dft_filters.
A command-line tool is available via build/cli/homo_filter_cli.
MIT