The Stack Overflow answer 15192809 is very slow for real resolution images. Why is it so slow, is not the element result only dependent of the associated initial elements, as it seems to be the case on the trivial example described in the git issue comment issues/63#issuecomment-1811?
Treat image as a single array? This does not seem correct. Can think for the 2D case about a subimage scanning a greater sized image. Then for the same size images correlation can think how would proceed in a subimage case and generalize. The Wikipedia example shows how to proceed for valued functions so it is identical. The question is then when have the correlation matrix how do we attribute a source camera?
[The Stack Overflow answer 15192809](https://stackoverflow.com/a/15192809) is very slow for real resolution images. Why is it so slow, is not the element result only dependent of the associated initial elements, as it seems to be the case on the trivial example described in the git issue comment [issues/63#issuecomment-1811](https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/issues/63#issuecomment-1811)?
```py
from scipy import signal
from PIL import Image
import numpy as np
def getImage(imagePath):
return np.array(Image.open(imagePath).convert('RGB'))[:100,:100,0]
im1 = getImage('RAISE,Rafael 23_04_24_mean_estimated_prnu_camera_Rafael 23_04_24.png')
im2 = getImage('RAISE,Rafael 23_04_24_mean_estimated_prnu_camera_RAISE.png')
print(f'{im1.shape=} {im2.shape=}')
cor = signal.correlate2d(im1, im2)
print(f'{cor.shape=}')
```
https://en.wikipedia.org/w/index.php?title=Cross-correlation&oldid=1220518127#Cross-correlation_of_deterministic_signals
https://en.wikipedia.org/wiki/Digital_image_correlation_and_tracking
Related to [the Stack Overflow question 189943](https://stackoverflow.com/q/189943).
Treat image as a single array? This does not seem correct. Can think for the 2D case about a subimage scanning a greater sized image. Then for the same size images correlation can think how would proceed in a subimage case and generalize. The Wikipedia example shows how to proceed for valued functions so it is identical. The question is then when have the correlation matrix how do we attribute a source camera?
Should give a try and verify the correctness of [the Stack Overflow answer 75690643](https://stackoverflow.com/a/75690643).
Related to #63.
Unclear if correlation should in absolute be close to 1 or just close to 1.
According to supervisors the absolute distance to 1 makes sense, for instance for a signal with a phase offset of half its period, then the correlation should be -1 but it is the same signal to some extent.
Unclear if correlation should in absolute be close to 1 or just close to 1.
According to supervisors the absolute distance to 1 makes sense, for instance for a signal with a phase offset of half its period, then the correlation should be -1 but it is the same signal to some extent.
Should implement an enum to choose between RMS and correlation. Done, see 6a9900df91.
~~Should implement an enum to choose between RMS and correlation.~~ Done, see https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/commit/6a9900df91e3bf3f5ade7b984c9fa0775fd21018.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The Stack Overflow answer 15192809 is very slow for real resolution images. Why is it so slow, is not the element result only dependent of the associated initial elements, as it seems to be the case on the trivial example described in the git issue comment issues/63#issuecomment-1811?
https://en.wikipedia.org/w/index.php?title=Cross-correlation&oldid=1220518127#Cross-correlation_of_deterministic_signals
https://en.wikipedia.org/wiki/Digital_image_correlation_and_tracking
Related to the Stack Overflow question 189943.
Treat image as a single array? This does not seem correct. Can think for the 2D case about a subimage scanning a greater sized image. Then for the same size images correlation can think how would proceed in a subimage case and generalize. The Wikipedia example shows how to proceed for valued functions so it is identical. The question is then when have the correlation matrix how do we attribute a source camera?
Should give a try and verify the correctness of the Stack Overflow answer 75690643.
Related to #63.
https://en.wikipedia.org/wiki/Pearson_correlation_coefficient
https://numpy.org/doc/1.26/reference/generated/numpy.corrcoef.html
Still returns a matrix it seems, see:
https://docs.scipy.org/doc/scipy-1.13.0/reference/generated/scipy.stats.pearsonr.html (source: Wikipedia)
Unclear if correlation should in absolute be close to 1 or just close to 1.
According to supervisors the absolute distance to 1 makes sense, for instance for a signal with a phase offset of half its period, then the correlation should be -1 but it is the same signal to some extent.
Should implement an enum to choose between RMS and correlation.Done, see6a9900df91.Should execute one more time to see if face negative Pearson correlation with current setup.