mirror of
https://github.com/karma-riuk/hdr_esim.git
synced 2024-11-16 19:30:26 +01:00
Fix crash when contrast threshold < 0 #43
This commit is contained in:
parent
980f97e392
commit
dc8a94f2b0
@ -58,6 +58,8 @@ Events EventSimulator::imageCallback(const Image& img, Time time)
|
|||||||
if(sigma_C > 0)
|
if(sigma_C > 0)
|
||||||
{
|
{
|
||||||
C += ze::sampleNormalDistribution<ImageFloatType>(false, 0, sigma_C);
|
C += ze::sampleNormalDistribution<ImageFloatType>(false, 0, sigma_C);
|
||||||
|
constexpr ImageFloatType minimum_contrast_threshold = 0.01;
|
||||||
|
C = std::max(minimum_contrast_threshold, C);
|
||||||
}
|
}
|
||||||
ImageFloatType curr_cross = prev_cross;
|
ImageFloatType curr_cross = prev_cross;
|
||||||
bool all_crossings = false;
|
bool all_crossings = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user