RAW image processing #49
Labels
No Label
bug
Context-Adaptive Interpolator
duplicate
enhancement
epic
help wanted
high priority
invalid
left for future work
low priority
medium
medium priority
meta
question
quick
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones#49
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
skipping low-level methods proposing an alternative.
Do not get
_visible
meaning.Note that according to the Stack Overflow answer 51304155
_visible
array versions are not contiguous, hence imply very significant performance decrease. It seems thatOWNDATA
flag is also involved:Why different
raw_width
andwidth
?raw_image
seems to have0
in this case at the right side while it does not inraw_image_visible
.Could verify color correctness in the RAW array. As in internship offer display image without interpolation would ease doing so it seems, in addition to be interesting.
seem to show that we have to do it on our own.
How to compute PRNU on these arrays? Only considering a given color channel seems to make sense. Pay attention that green might have a different shape. More precisely it does not seem to have the grid shape as the 2 other channels.
Raw script:
np.unique(raw_image_visible)
shows that values1
,2
etc are also taken, there is no gap.Taken with
Nikon D90
:The bottom left white part is interesting to see the colored tiles in the three color channels.
At the top image border and mainly at left there are 2 red colored dots.
Red colored artificial flowers on the plates are also interesting to see almost only red tiles.
Increasing brightness and contrast also show the tiles everywhere.
Except if the Bayer filter is particularly involved in the PRNU, the color channel should not matter a lot, see #50. Related to #44.
Let us give a try with red as above red image looks easier to understand than the blue one.
Considering a subset of the green image seems appropriate as well assuming the independence of sensors which is maybe not exactly the case, especially for green ones.
Can verify the consistency of the subset of pixels by verifying areas using as most as possible a single color channel.
search_green.py
:Could iterate on images to find the most clear one.
Pay attention to possible
visible
offset.Related to Benjamin_Loison/rawpy/issues/1.
Related to Benjamin_Loison/vpv/issues/3 and Benjamin_Loison/darktable/issues/3.
Would be nice to not have to
assert
raw.raw_pattern
.ra2c888f8t
was done with Nikon D7000.Could consider the channel having the most variance on the considered set of images.
Are raw values bounded? Should check other
rawpy.RawPy
elements and compute statistics on a given image.With wavelet denoiser:
With bilateral denoiser:
Rafael ARW sky wavelet:
Rafael ARW wall wavelet:
I do not seem to find any visual feature in both. Except maybe the latter with an horizontal line at the bottom and possibly a lens circle at the top and bottom right.
Rafael ARW sky bilateral:
Rafael ARW wall bilateral:
Should implement estimating the PRNU for the 3 color channels. Considering a raw image as if not interpolating does not seem correct despite each color channel image having the same size as others, because the resulting pixel does not have the same light trajectory.
Just for visualizing can do so but otherwise should compute the distance as the sum for each color channel or regular euclidian for instance?
As requested by Marina:
Concerning merging multiple color channels PRNU estimations, I choose to input multiple images instead of multiple Numpy arrays, as I may adjust with GIMP to have brightness and contrast settings easing the visualization.
Il y aura probablement un problème d’échelles entre les canaux puisque deux pixels adjacents de couleurs différentes vont enregistrer des intensités potentiellement très différentes.
Flat-field wavelet:
Improved visualization thanks to brightness and contrast change, only contrast if I remember correctly:
Flat-field bilateral:
For unclear reasons the colors of green right and bottom differ quite significantly, displaying the actual distribution would help understand.
Correctly assembled 4 PRNUs:
Do not have lines anymore, as do not
- npArrayMin
, as I thought it was to make matplotlib happy but it does not seem to care and it only introduce bias by introducing a different offset per color channel.Also note that we do not notice the Bayer filter pattern, i.e. red being particularly present as the wall look orange for instance, as we are considering noise for each color channel, so the resulting image is just about difference in each color channel which is more similar than absolute values of each color channel.
Improved brightness and contrast:
4 PRNUs bilateral denoiser assembled for Rafael wall:
Modified brightness and contrast:
Do we also notice lines with wavelet denoiser and on sky too?
Seems to have similar behavior with Rafael sky with mean denoiser (related to #57):
Modified brightness and contrast:
Similar result with the wall:
Could upload 4 PRNUs bilateral denoiser assembled for Rafael sky.
Why is the Bayer filter that visible?
First image histogram:
Mean of images histogram:
First Bayer filter occurrence histogram:
First Bayer filter occurrence minus mean of images histogram:
RAISE flat-field incorrect PRNU estimation with mean denoiser (the PRNU estimation is just the mean of images) with 4 color channels assembled:
With modified brightness and contrast:
The respective corrected images:
Annotated
flat_099.tif
showing some circles on the camera.RAISE flat-field timeline:
Rafael 24/04/24:
3064 to 3078:
22/04/24:
23/04/24: