This project analyzes JPEG images to determine if one image is a subset of another (e.g., a cropped version). It uses libjpeg-turbo for efficient JPEG handling, reducing the image size and removing color data for faster processing. The program outputs a table showing which images are subsets of others.
-
Subset Detection: Identifies cropped images within a set of JPEG files.
-
Efficient Comparison: Reduces image size and color data to streamline analysis.
-
JPEG Handling with libjpeg-turbo: Leverages the high-speed library for JPEG processing.
Ensure the following dependencies are installed:
C++ Compiler (e.g., GCC, Clang)
libjpeg-turbo: JPEG library for image handling and compression
▪️ Ubuntu/Debian:
sudo apt-get update
sudo apt-get install libjpeg-turbo8-dev
▪️ macOS (using Homebrew):
brew install jpeg-turbo
▪️ Windows: Download and install from libjpeg-turbo's official site.
-
Clone the Repository:
git clone https://github.com/Maliha-Tasnim/image-subset-analyzer cd image-subset-analyzer
-
Compile the Project: Use the provided Makefile to compile the code:
make
This will create an executable file (typically named main or image-analyzer-subset).
-
In main.cpp:
BWString filepath = "E:\\C++\\Images"; BWString ref_file = "78771293.jpg";
indicate two separate elements:
a. ref_file
as the Source Image: The ref_file
(e.g., 78771293.jpg) serves as the reference or source image. This is the main image against which other images in the directory (filepath) are compared.
Replace the ref_file
(source image) with desired one.
b. filepath
or Other Images as Potential Subsets: The program iterates through all other images within filepath
and compares each one to ref_file
(source image) to determine if any of them are subsets
or cropped versions of the source image. Replace the filepath
with desired location containing the subset image's folder.
-
Run the Program:
./main
The program will output a table indicating which images are subsets of others.