Jamy-L / Handheld-Multi-Frame-Super-Resolution

Handheld Multi-image Super-resolution [Wronski et al., SIGGRAPH19]. Non-official GPU-supported Python implementation.
MIT License
117 stars 20 forks source link

Different .dng tags #22

Closed vvubbalubba closed 1 year ago

vvubbalubba commented 1 year ago

Hi! I'm trying to use this method for my own photos in .dng format, but i have

Traceback (most recent call last): File "/home/jovyan/fominaav/Multi-frame-SR/Handheld-Multi-Frame-Super-Resolution/run_handheld.py", line 176, in handheld_output = process(args.impath, options, params) File "/home/jovyan/fominaav/Multi-frame-SR/Handheld-Multi-Frame-Super-Resolution/handheld_super_resolution/super_resolution.py", line 325, in process ref_raw, raw_comp, ISO, tags, CFA, xyz2cam, ref_path = load_dng_burst(burst_path) File "/home/jovyan/fominaav/Multi-frame-SR/Handheld-Multi-Frame-Super-Resolution/handheld_super_resolution/utils_dng.py", line 85, in load_dng_burst white_level = tags['Image Tag 0xC61D'].values[0] # there is only one white level KeyError: 'Image Tag 0xC61D'

I checked the tags in your .dng-s and mine - they are different. Is there amy tool to fix it?

Jamy-L commented 1 year ago

Hi,

It is very likely that the camera manufacter of your .dng's has put the whitebalance tag somewhere else. If your images display properly in regular image viewers, it probably means that the error is on our side.

I have just pushed a fix in which the reading is done using rawpy, which should be more robust to that. Please let me know if the issue still persists

vvubbalubba commented 1 year ago

Thank you for replying!

I tried new version with rawpy for WhiteLevel, but same issue with BlackLevel appeared.

I changed it to black_levels = raw.black_level_per_channel and also there is same problem with CFAPattern

In my photos there is no CFAPattern, but I have 'EXIF CVAPattern' I don't know exactly how it should be handled maybe you know a way to generalize this similarly via rawpy.

Jamy-L commented 1 year ago

I have pushed a fix for the black level reading and the CFA. Problems may still occur for the ISO and for the noise profile, which cannot be read using rapy. Please let me know if any issue persists

vvubbalubba commented 1 year ago

Issue fixed, thanks!