Skip to content

Commit b60c383

Browse files
authored
Merge pull request #5413 from maloel/rs-dnn-vino-fix
rs-dnn-vino compilation fix for Linux
2 parents 0ad9350 + deb40b4 commit b60c383

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

wrappers/openvino/dnn/rs-dnn-vino.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ void draw_detector_overlay(
178178
high_resolution_clock::time_point switch_time
179179
)
180180
{
181-
double alpha = std::max( 0LL, 1000 - duration_cast<milliseconds>(high_resolution_clock::now() - switch_time).count() ) / 1000.;
181+
auto ms_since_switch = duration_cast< milliseconds >( high_resolution_clock::now() - switch_time ).count();
182+
if( ms_since_switch > 1000 )
183+
ms_since_switch = 1000;
184+
double alpha = ( 1000 - ms_since_switch ) / 1000.;
182185
std::string str( 1, char( '1' + current_detector ) );
183186
auto size = cv::getTextSize( str, cv::FONT_HERSHEY_SIMPLEX, 3, 1, nullptr );
184187
cv::Point center{ image.cols / 2, image.rows / 2 };

0 commit comments

Comments
 (0)