From 2075fa9c156bb3c96d7abfab724258af89c23996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ma=C5=A1ek?= Date: Tue, 20 Nov 2018 15:08:40 +0100 Subject: [PATCH] Resolve #13219: Make randomly generated colours opaque. --- modules/features2d/src/draw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/features2d/src/draw.cpp b/modules/features2d/src/draw.cpp index 21d2f35d1b..ee0c4822ca 100644 --- a/modules/features2d/src/draw.cpp +++ b/modules/features2d/src/draw.cpp @@ -117,7 +117,7 @@ void drawKeypoints( InputArray image, const std::vector& keypoints, In end = keypoints.end(); for( ; it != end; ++it ) { - Scalar color = isRandColor ? Scalar(rng(256), rng(256), rng(256)) : _color; + Scalar color = isRandColor ? Scalar( rng(256), rng(256), rng(256), 255 ) : _color; _drawKeypoint( outImage, *it, color, flags ); } } @@ -173,7 +173,7 @@ static inline void _drawMatch( InputOutputArray outImg, InputOutputArray outImg1 { RNG& rng = theRNG(); bool isRandMatchColor = matchColor == Scalar::all(-1); - Scalar color = isRandMatchColor ? Scalar( rng(256), rng(256), rng(256) ) : matchColor; + Scalar color = isRandMatchColor ? Scalar( rng(256), rng(256), rng(256), 255 ) : matchColor; _drawKeypoint( outImg1, kp1, color, flags ); _drawKeypoint( outImg2, kp2, color, flags );