File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6167,7 +6167,8 @@ namespace TinyDIP
61676167 // Safely deduce the exact returned multi-channel image type directly
61686168 auto deduce_type_lambda = [&](auto && each_plane)
61696169 {
6170- return difference_of_gaussian (each_plane, initial_sigma, initial_sigma);
6170+ // Force floating-point precision on the plane before DoG evaluation
6171+ return TinyDIP::difference_of_gaussian (TinyDIP::im2double (each_plane), initial_sigma, initial_sigma);
61716172 };
61726173 using MultiChannelDiffT = decltype (apply_each (input, deduce_type_lambda));
61736174
@@ -6184,10 +6185,11 @@ namespace TinyDIP
61846185 #pragma omp parallel for
61856186 for (int i = 0 ; i < static_cast <int >(number_of_scale_levels) - 1 ; ++i)
61866187 {
6187- octaves[i] = apply_each (input, [&](auto && each_plane)
6188+ // Safely capture 'i' by value and the rest by reference to prevent race conditions
6189+ octaves[i] = apply_each (input, [&, i](auto && each_plane)
61886190 {
6189- return difference_of_gaussian (
6190- each_plane,
6191+ return TinyDIP:: difference_of_gaussian (
6192+ TinyDIP::im2double ( each_plane) ,
61916193 initial_sigma * std::pow (k, static_cast <double >(i)),
61926194 initial_sigma * std::pow (k, static_cast <double >(i + 1 ))
61936195 );
You can’t perform that action at this time.
0 commit comments