A fast, C-based CLI tool for generating and comparing PGM images using Local Binary Patterns (LBP) and histogram caching.
LBP Image Comparison is a lightweight software written in C designed to compare a base PGM image (P2 or P5) against a local database of images. It calculates similarities using Local Binary Patterns (LBP) and histograms. To optimize performance on repeated searches, the tool automatically caches the analyzed images.
- Pattern Recognition: Extracts and processes features using the LBP algorithm.
- Image Comparison: Finds the most similar image in a local database by comparing Euclidean distances of LBP histograms.
- Performance Caching: Automatically saves histogram data to speed up future comparisons.
- LBP Image Generation: Converts standard PGM images into their LBP visual representations.
To compile the project, ensure you have a C compiler (like gcc) and make installed.
makeThe executable ./LBP provides two main operating modes:
Generates a new PGM file by applying the LBP algorithm to the original image.
./LBP -i original.pgm -o output.pgmCompares an input image against all PGM files inside a specified directory and returns the most similar one.
Bash
./LBP -i original.pgm -d images/