Skip to content

tuildes/image-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Comparison

A fast, C-based CLI tool for generating and comparing PGM images using Local Binary Patterns (LBP) and histogram caching.

Platform C Language License

About

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.

Features

  • 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.

Installation

To compile the project, ensure you have a C compiler (like gcc) and make installed.

make

Usage

The executable ./LBP provides two main operating modes:

Mode 1: LBP Image Creation

Generates a new PGM file by applying the LBP algorithm to the original image.

./LBP -i original.pgm -o output.pgm

Mode 2: Image Comparison

Compares an input image against all PGM files inside a specified directory and returns the most similar one.

Bash
./LBP -i original.pgm -d images/

About

Basic program for comparing images using LBP (Local Binary Pattern)

Topics

Resources

Stars

Watchers

Forks

Contributors