Fixed crash in local retinex
This commit is contained in:
@@ -53,7 +53,8 @@
|
||||
namespace
|
||||
{
|
||||
void retinex_scales(float* scales, int nscales, int mode, int s, float high)
|
||||
{
|
||||
{ if(s < 3) s = 3;//to avoid crash in MSRlocal if nei small
|
||||
|
||||
if (nscales == 1) {
|
||||
scales[0] = (float)s / 2.f;
|
||||
} else if (nscales == 2) {
|
||||
@@ -851,6 +852,7 @@ void ImProcFunctions::MSRLocal(int sp, float** luminance, float** templ, const f
|
||||
constexpr auto maxRetinexScales = 8;
|
||||
float RetinexScales[maxRetinexScales];
|
||||
|
||||
// retinex_scales(RetinexScales, scal, moderetinex, nei, high);
|
||||
retinex_scales(RetinexScales, scal, moderetinex, nei, high);
|
||||
|
||||
|
||||
|
@@ -110,7 +110,7 @@ Locallab::Locallab():
|
||||
// Retinex
|
||||
str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0, 100, 1, 0))),
|
||||
chrrt(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHRRT"), 0, 100, 1, 0))),
|
||||
neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), -100, 150, 1, 100))),//14, 150, 1, 50))),
|
||||
neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), 14, 200, 1, 50))),//14, 150, 1, 50))),
|
||||
vart(Gtk::manage(new Adjuster(M("TP_LOCALLAB_VART"), 50, 500, 1, 200))),
|
||||
dehaz(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEHAZ"), 0, 100, 1, 0))),
|
||||
sensih(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIH"), 0, 100, 1, 19))),
|
||||
|
Reference in New Issue
Block a user