SWFD - Sliding Window Fractal Dimension
Juan Ruiz de Miras. University of Granada - SPAIN. 2025.
Last update: May - 2025
Discriminating between original paintings and replicas is a challenging task. In recent years, the fractal dimension (FD) has been used as a quantitative measure
to analyze differences between similar paintings. However, previous FD tools require binarization or grayscale analysis and manual selection of painting areas.
Here we present SWFD, a novel color-FD-based method for differentiating original paintings from replicas, which uses a sliding window approach and color-FD computation techniques.
You can download the C++/CUDA source code of the SWFD algorithm by clicking here.
Once unzipped the file swfd.zip, you will find the following files:
- swfd.cpp and swfd.h: C++ files with the implementation of the sliding window fractal dimension algorithm (SWFD)
- test.cpp: example of C++ main file executing the SWFD algorithm for processing two datasets of paintings (Princeton and Cleveland datasets)
- test_openmp.cpp: example of C++ main file executing the SWFD algorithm for processing IN PARALLEL the two datasets of paintings
- license.html: terms of the license for the source code of SWFD
- README.txt: text file containing the present information about the program
- external/: folder with external code for DBC-RGB computing (by Juan Ruiz de Miras), linear regression computation (by geeksforgeeks.org) and reading BMP images (by Arash Partow)
Unzip the datasets.zip file in the same folder where test.cpp is located, what creates the folders datasets/cleveland/ and datasets/princeton/
containing the BMP files with the paintings to be analyzed.
REQUERIMENTS for compilation and execution
Hardware: Computer with a CUDA capable GPU (https://developer.nvidia.com/cuda-gpus)
Software:
COMPILATION AND RUNNING
The test.cpp file can be compiled with the following command: nvcc -O3 -o test external/dbc-rgb.cu swfd.cpp test.cpp
The test_openmp.cpp file can be compiled with the following command:
Windows: nvcc -O3 -o test_openmp external/dbc-rgb.cu swfd.cpp -Xcompiler "/openmp" test_openmp.cpp
Linux: nvcc -O3 -o test_openmp external/dbc-rgb.cu swfd.cpp -Xcompiler "-fopenmp" test_openmp.cpp
Run the files test or test_openmp to process the datasets. Results of analyzing each painting are saved in the CSV files:
- Princeton_FD_Results_XX.csv and Princeton_Times_XX.csv, where XX is the window overlap (0.00, 0.25, 0.50, 0.75 and 0.90)
- Cleveland_FD_Results_XX.csv and Cleveland_Times_XX.csv, where XX is the window overlap (0.00, 0.25, 0.50, 0.75 and 0.90)
FD and correlation values in the CSV files with the FD results correspond to each patch within each painting
Time values in the CSV files with the time results correspond to each painting
CITATION
If SWFD has been useful for your research, please, cite as:
"Fractal Dimension-Based Methodology for Discriminating Original Paintings from Replicas"
Juan Ruiz de Miras and Domingo MartÃn
Symmetry 17(5), 2025
https://doi.org/10.3390/sym17050703
CONTACT AND SUGGESTIONS
For contact information click here
FUNDING
This software is part of the I+D+i project PID2020-118638RB-I00 granted by MCIN/AEI/10.13039/501100011033/