polimi-ispl / prnu-python

Python implementation of PRNU extractor
MIT License
70 stars 32 forks source link

pce function incomplete #2

Closed AMontiB closed 3 years ago

AMontiB commented 4 years ago

Good Morning, first of all thank you for these precious libraries. What I have noticed is that the function you implemented for the computation of the PCE works fine only if we compare residuals and fingerprints having same dimensions. If we are working with cropped or scaled images (i.e. which residuals will result to be smaller w.r.t. the reference fingerprint) the final PCE value will results incorrect since we are searching for all the possible shifts and not only for the valid ones. If we compare the results with the ones obtained with Goljian and Friedrich's libraries in case of cropped and scaled images indeed, these ones will not be the same anymore. I suggest to add a variable "range" to the function "pce" in order to limit the search of the peak only inside a certain valid region in the xcorr matrix.

nicobonne commented 3 years ago

Hi Andrea, thanks for pointing this out. I'm sorry, your request somehow got lost and I noticed it just now.

We will look into the issue and try to fix it.

smandelli commented 3 years ago

Hi @AndreaMontibeller, we checked the last release of Camera Fingerprint-MATLAB Implementation. What we noticed is that it is not possible to compare two terms with different sizes (i.e., the cropped/scaled residual and the reference fingerprint). The code will give an error in line 17 of "crosscorr.m" function. Which code were you using to compute the crosscorrelation between the two terms? It would be great if you could provide us your crosscorr-PCE MATLAB version (with the results obtained limiting the research range) in order to fairly compare the two solutions and to better understand where our error can be localized.