make sure kernel sizes are 1 at least

pull/3471/head
kallaballa 2 years ago
parent 81eabc5549
commit 5e3ba1ebc0
  1. 2
      src/beauty/beauty-demo.cpp
  2. 2
      src/optflow/optflow-demo.cpp
  3. 2
      src/tetra/tetra-demo.cpp
  4. 3
      src/video/video-demo.cpp

@ -17,7 +17,7 @@ constexpr bool OFFSCREEN = false;
constexpr int VA_HW_DEVICE_INDEX = 0;
constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
constexpr int BLUR_KERNEL_SIZE = DIAG / 413 % 2 == 0 ? DIAG / 413 + 1 : DIAG / 413;
constexpr int BLUR_KERNEL_SIZE = std::max(int(DIAG / 413 % 2 == 0 ? DIAG / 413 + 1 : DIAG / 413), 1);
using std::cerr;
using std::endl;

@ -36,7 +36,7 @@ constexpr float POINT_LOSS = 25;
// of tracked points and therefor is usually much smaller.
constexpr int MAX_STROKE = 17;
// Intensity of glow defined by kernel size. The default scales with the image diagonal.
constexpr int GLOW_KERNEL_SIZE = DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138;
constexpr int GLOW_KERNEL_SIZE = std::max(int(DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138), 1);
//hue, saturation, lightness and alpha all from 0 to 255
const cv::Scalar EFFECT_COLOR(26, 255, 153, 7);

@ -10,7 +10,7 @@ constexpr const char* OUTPUT_FILENAME = "tetra-demo.mkv";
constexpr const int VA_HW_DEVICE_INDEX = 0;
constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
constexpr int GLOW_KERNEL_SIZE = DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138;
constexpr int GLOW_KERNEL_SIZE = std::max(int(DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138), 1);
using std::cerr;
using std::endl;

@ -10,8 +10,7 @@ constexpr bool OFFSCREEN = false;
constexpr const char *OUTPUT_FILENAME = "video-demo.mkv";
constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
constexpr int GLOW_KERNEL_SIZE = DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138;
constexpr int GLOW_KERNEL_SIZE = std::max(int(DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138), 1);
using std::cerr;
using std::endl;

Loading…
Cancel
Save