Project

General

Profile

Bug #11854

exported photo has black area, logs "[dev_pixelpipe] module `haze removal' outputs non-finite floats! [export]"

Added by Ben Klopfenstein 7 months ago. Updated 7 months ago.

Status:
Triaged
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
Start date:
12/12/2017
Due date:
% Done:

20%

Affected Version:
2.4.0rc0
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

When exporting with the haze removal module, a black area exists in the resultant image.

Logging with "/opt/darktable/bin/darktable -d dev -d opencl -d perf -d nan" for the export:

[dev_pixelpipe] took 0.007 secs (0.016 CPU) initing base buffer [export]
[dev_pixelpipe] took 0.006 secs (0.012 CPU) processed `raw black/white point' on CPU, blended on CPU [export]
[dev_pixelpipe] module `raw black/white point' min: (0.011341) max: (1.000000) [export]
[dev_pixelpipe] took 0.006 secs (0.016 CPU) processed `white balance' on CPU, blended on CPU [export]
[dev_pixelpipe] module `white balance' min: (0.028350) max: (2.499883) [export]
[dev_pixelpipe] took 0.005 secs (0.020 CPU) processed `highlight reconstruction' on CPU, blended on CPU [export]
[dev_pixelpipe] module `highlight reconstruction' min: (0.028350) max: (1.000000) [export]
[dev_pixelpipe] took 0.141 secs (0.488 CPU) processed `chromatic aberrations' on CPU, blended on CPU [export]
[dev_pixelpipe] module `chromatic aberrations' min: (0.030132) max: (1.021473) [export]
[dev_pixelpipe] took 0.136 secs (0.480 CPU) processed `demosaic' on CPU, blended on CPU [export]
[dev_pixelpipe] module `demosaic' min: (0.025807; 0.000000; 0.000000) max: (1.151476; 1.000000; 1.087004) [export]
[dev_pixelpipe] took 0.040 secs (0.100 CPU) processed `exposure' on CPU, blended on CPU [export]
[dev_pixelpipe] module `exposure' min: (-0.136847; -0.053364; -0.030953) max: (1.939428; 1.660033; 1.820510) [export]
[dev_pixelpipe] took 2.995 secs (9.960 CPU) processed `lens correction' on CPU, blended on CPU [export]
[dev_pixelpipe] module `lens correction' min: (-0.121636; -0.020245; 0.000000) max: (1.911895; 1.875406; 1.835942) [export]
[dev_pixelpipe] took 0.091 secs (0.276 CPU) processed `base curve' on CPU, blended on CPU [export]
[dev_pixelpipe] module `base curve' min: (0.000000; 0.000000; 0.000000) max: (1.165220; 1.159934; 1.154128) [export]
[dev_pixelpipe] took 5.136 secs (17.272 CPU) processed `haze removal' on CPU, blended on CPU [export]
[dev_pixelpipe] module `haze removal' outputs non-finite floats! [export]
[dev_pixelpipe] module `haze removal' min: (-0.150864; 0.000000; -0.019978) max: (577128.562500; 359493.093750; 260114.187500) [export]
[dev_pixelpipe] took 0.093 secs (0.320 CPU) processed `input color profile' on CPU, blended on CPU [export]
[dev_pixelpipe] module `input color profile' outputs NaNs! [export]
[dev_pixelpipe] module `input color profile' min: (-2.144508; -121.628342; -212.336349) max: (8409.938477; 2254.402100; 2764.198975) [export]
[dev_pixelpipe] took 21.411 secs (79.800 CPU) processed `denoise (non-local means)' on CPU, blended on CPU [export]
[dev_pixelpipe] module `denoise (non-local means)' outputs NaNs! [export]
[dev_pixelpipe] module `denoise (non-local means)' min: (-1.339372; -121.627716; -79.181244) max: (244.796661; 86.326126; 396.557709) [export]
[dev_pixelpipe] took 0.138 secs (0.428 CPU) processed `contrast brightness saturation' on CPU, blended on CPU [export]
[dev_pixelpipe] module `contrast brightness saturation' outputs NaNs! [export]
[dev_pixelpipe] module `contrast brightness saturation' min: (0.000000; -156.899750; -102.143799) max: (244.772995; 111.360703; 511.559418) [export]
[dev_pixelpipe] took 0.248 secs (0.884 CPU) processed `sharpen' on CPU, blended on CPU [export]
[dev_pixelpipe] module `sharpen' outputs NaNs! [export]
[dev_pixelpipe] module `sharpen' min: (-6.236555; -156.899750; -102.143799) max: (244.772995; 111.360703; 511.559418) [export]
[dev_pixelpipe] took 0.240 secs (0.800 CPU) processed `output color profile' on CPU, blended on CPU [export]
[dev_pixelpipe] module `output color profile' outputs NaNs! [export]
[dev_pixelpipe] module `output color profile' min: (0.000000; 0.000000; 0.000000) max: (3.848927; 2.633491; 2.051061) [export]
[dev_pixelpipe] took 0.430 secs (1.564 CPU) processed `vignetting' on CPU, blended on CPU [export]
[dev_pixelpipe] module `vignetting' outputs NaNs! [export]
[dev_pixelpipe] module `vignetting' min: (0.000000; 0.000000; 0.000000) max: (3.345367; 2.367682; 1.886706) [export]
[dev_pixelpipe] took 0.619 secs (0.616 CPU) processed `watermark' on CPU, blended on CPU [export]
[dev_pixelpipe] module `watermark' outputs NaNs! [export]
[dev_pixelpipe] module `watermark' min: (0.000000; 0.000000; 0.000000) max: (3.345367; 2.367682; 1.886706) [export]
[dev_pixelpipe] took 0.072 secs (0.236 CPU) processed `gamma' on CPU, blended on CPU [export]
[dev_process_export] pixel pipeline processing took 36.704 secs (118.584 CPU)
[export_job] exported to `/home/benklop/Pictures/Synced/Processed/Fiji/Day 2/CRW_9798_04.jpg'

CRW_9798_04.jpg (3.05 MB) Ben Klopfenstein, 12/12/2017 09:31 PM

CRW_9798.DNG.xmp (6.64 KB) Ben Klopfenstein, 12/12/2017 09:32 PM

CRW_9798.DNG (18.3 MB) Ben Klopfenstein, 12/12/2017 09:32 PM

Associated revisions

Revision 83959cb0
Added by Heiko Bauke 7 months ago

hazeremoval: avoid numerical overflows in almost haze-free images, fix bug #11854 (#1583)

History

#1 Updated by Tobias Ellinghaus 7 months ago

  • System changed from Ubuntu to all
  • % Done changed from 0 to 20
  • Status changed from New to Triaged
  • Category set to Darkroom

#2 Updated by Tobias Ellinghaus 7 months ago

  • Target version set to 2.4.0

A little update:

The problem is in haze removal.

There are a lot of pixels where the red channel is 0. This results in dark_channel() returning 0 for those regions. Then in ambient_light() that propagates along, until eventually crit_haze_level is set to 0 and therefore the return value is inf which gets stored in distance_max in process(). Then t_min is evaluated to 0 which happens to be bigger than what's in c_trans_map_filtered.data[i]. Thus t is 0, leading to divisions by 0 and the output pixel being infinity.

The easiest fix I could come up with was to add img2.data[i] = fmaxf(m, 0.0001); to the end of the loop in dark_channel(). Someone knowing the algorithm should look over this please.

#3 Updated by Roman Lebedev 7 months ago

  • Target version changed from 2.4.0 to 2.6.0

Also available in: Atom PDF