Image generation and PGM comparison algorithm using LBP
The LBP IMAGE COMPARISON project is a software written in the C language, designed for comparisons between a PGM database (P2 or P5) and another PGM image. It also allows for the creation of an LBP image using LBP (Local Binary Pattern) processing.
- Based on an original PGM image, the algorithm creates a second PGM file by processing the original file using LBP
- Input: base image.pgm
- Output (STDIN): none
- Output: creation of an output.pgm file with the specified name
./LBP -i original.pgm -o output.pgm
- Compares an input image with all PGM images within and returns the most similar one
- Input: image.pgm and directory/
- Output (STDIN): imgNear.pgm 134.670000
./LBP -i original.pgm -d images/# In the root (compile)
makefile
# Run software
./LBP src/ // Project SOURCE folder and code
├── auxiliary.c // Auxiliary project functions
├── auxiliary.h // Signatures of auxiliary functions
├── lbp.c // PGM and LBP manipulation functions
├── lbp.h // Signatures of PGM and LBP functions
└── main.c // Software body + main()
makefile // MAKEFILE file that generates the executable
README.md // This README contains the project description.
NOTE: More documentation and usage in the function signatures.
Folder with all source files: C and H
Auxiliary functions for the project with more generic functions:
- Euclidean distance calculation: euclidian_distance
- Show options manual: options_manual
- Destroy a matrix: destroy_matrix
- Prepare location (concatenate dir + file): prepare_location_image
Functions for manipulating PGM images and LBP files:
- Create matrix based on a PGM image: pgm_image_to_matrix
- Create LBP matrix based on a matrix: create_lbp_matrix
- Create PGM file using LBP matrix: create_pgm_image
- Create LBP histogram file: create_histogram_archive
- Verify histogram existence: verify_histogram_archive
- Transform histogram into a vector: histogram_file_to_vector
- Concatenate string + .lbp: concat_pgm
Software that handles errors and chooses two processing modes described above. In addition to calling several of the functions described above and handling directories.
Base file to facilitate compilation and standardization
Contains project information, tutorial, and a small documentation
Created with 💙 by tuildes