diff --git a/src-core/common/image/composite.cpp b/src-core/common/image/composite.cpp index cf2368100..73fb140a0 100644 --- a/src-core/common/image/composite.cpp +++ b/src-core/common/image/composite.cpp @@ -116,7 +116,7 @@ namespace image for (int i = 0; i < (int)inputChannels.size(); i++) { channelValues[i] = 0; - rgbParser.DefineVar("ch" + channelNumbers[i], &channelValues[i]); + rgbParser.DefineVar(channelNumbers[i], &channelValues[i]); } try diff --git a/src-core/products/image_products.cpp b/src-core/products/image_products.cpp index d2459011f..8b2863580 100644 --- a/src-core/products/image_products.cpp +++ b/src-core/products/image_products.cpp @@ -243,7 +243,7 @@ namespace satdump std::string str_to_find_channels = cfg.equation; - if (cfg.lut != "" || cfg.lua != "") + if (cfg.lut.size() != 0 || cfg.lua.size() != 0) str_to_find_channels = cfg.channels; for (int i = 0; i < (int)product.images.size(); i++) diff --git a/src-testing/main.cpp b/src-testing/main.cpp index ee942d1eb..33ccaae1c 100644 --- a/src-testing/main.cpp +++ b/src-testing/main.cpp @@ -37,10 +37,10 @@ int main(int /*argc*/, char *argv[]) // rgb_cfg.equation = "(chb - 0.6)*4"; // rgb_cfg.equation = "(chb - 0.65)*5"; rgb_cfg.lua = "scripted_compos/underlay_with_clouds.lua"; - rgb_cfg.channels = "ch4"; - rgb_cfg.lua_vars["minoffset"] = 0.5; + rgb_cfg.channels = "chb"; + rgb_cfg.lua_vars["minoffset"] = 0.32; rgb_cfg.lua_vars["scalar"] = 4.0; - rgb_cfg.lua_vars["thresold"] = 0; + rgb_cfg.lua_vars["thresold"] = 0.00; auto input_image = satdump::make_composite_from_product(img_pro, rgb_cfg, nullptr); diff --git a/tools/proj_test/main.cpp b/tools/proj_test/main.cpp index e9b3038fc..7008beb83 100644 --- a/tools/proj_test/main.cpp +++ b/tools/proj_test/main.cpp @@ -9,13 +9,19 @@ #include "common/projection/gcp_compute/gcp_compute.h" #include "common/projection/projs/equirectangular.h" #include "common/utils.h" +#include "init.h" int main(int /*argc*/, char *argv[]) { initLogger(); - std::string user_path = std::string(getenv("HOME")) + "/.config/satdump"; - satdump::config::loadConfig("satdump_cfg.json", user_path); + // std::string user_path = std::string(getenv("HOME")) + "/.config/satdump"; + // satdump::config::loadConfig("satdump_cfg.json", user_path); + + // We don't wanna spam with init this time around + logger->set_level(spdlog::level::level_enum::off); + satdump::initSatdump(); + logger->set_level(spdlog::level::level_enum::trace); satdump::ImageProducts img_pro; img_pro.load(argv[1]); @@ -23,7 +29,7 @@ int main(int /*argc*/, char *argv[]) logger->trace("\n" + img_pro.contents.dump(4)); satdump::ImageCompositeCfg rgb_cfg; - rgb_cfg.equation = "chm5,chm4,chm3"; //"(ch3 * 0.4 + ch2 * 0.6) * 2.2 - 0.15, ch2 * 2.2 - 0.15, ch1 * 2.2 - 0.15"; + rgb_cfg.equation = "chb,chb,chb"; //"(ch3 * 0.4 + ch2 * 0.6) * 2.2 - 0.15, ch2 * 2.2 - 0.15, ch1 * 2.2 - 0.15"; rgb_cfg.equalize = true; rgb_cfg.white_balance = true;