ros-perception / vision_opencv

Apache License 2.0
536 stars 599 forks source link

Ensure dynamic scaling works when given matrix with inf and -inf values. #498

Closed ijnek closed 1 year ago

ijnek commented 1 year ago

REP-117 mentions that inf and -inf are valid values in depth images. However, dynamic_scaling doesn't currently work when such values are in the image as the cv::minMaxLoc method doesn't expect inf and -inf values (it's fine with nan values).

By using a mask, we can ignore inf and non inf values when calling cv::minMaxLoc.

Resolves: #450

Signed-off-by: Kenji Brameld kenjibrameld@gmail.com

ijnek commented 1 year ago

@wep21 Could I ask you to review this one please?

wep21 commented 1 year ago

LGTM

ijnek commented 1 year ago

Thanks @wep21 !