added check of output image in drawKeypoints()
This commit is contained in:
parent
a46da86325
commit
0d55ccac74
@ -54,6 +54,7 @@ namespace cv
|
|||||||
*/
|
*/
|
||||||
static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& color, int flags )
|
static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& color, int flags )
|
||||||
{
|
{
|
||||||
|
CV_Assert( !img.empty() );
|
||||||
Point center( cvRound(p.pt.x * draw_multiplier), cvRound(p.pt.y * draw_multiplier) );
|
Point center( cvRound(p.pt.x * draw_multiplier), cvRound(p.pt.y * draw_multiplier) );
|
||||||
|
|
||||||
if( flags & DrawMatchesFlags::DRAW_RICH_KEYPOINTS )
|
if( flags & DrawMatchesFlags::DRAW_RICH_KEYPOINTS )
|
||||||
@ -111,6 +112,7 @@ void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, Mat& ou
|
|||||||
RNG& rng=theRNG();
|
RNG& rng=theRNG();
|
||||||
bool isRandColor = _color == Scalar::all(-1);
|
bool isRandColor = _color == Scalar::all(-1);
|
||||||
|
|
||||||
|
CV_Assert( !outImage.empty() );
|
||||||
for( vector<KeyPoint>::const_iterator i = keypoints.begin(), ie = keypoints.end(); i != ie; ++i )
|
for( vector<KeyPoint>::const_iterator i = keypoints.begin(), ie = keypoints.end(); i != ie; ++i )
|
||||||
{
|
{
|
||||||
Scalar color = isRandColor ? Scalar(rng(256), rng(256), rng(256)) : _color;
|
Scalar color = isRandColor ? Scalar(rng(256), rng(256), rng(256)) : _color;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user