Skip to content

Fix drawMatches and drawKeypoints for BGRA input images - #13481

Merged
alalek merged 3 commits into
opencv:3.4from
dkurt:fix_13227
Dec 25, 2018
Merged

alalek merged 3 commits into
opencv:3.4from
dkurt:fix_13227

Conversation

@dkurt

@dkurt dkurt commented Dec 19, 2018 •

Copy link
Copy Markdown
Member

This pullrequest changes

resolves #13227

Comment thread modules/features2d/src/draw.cpp Outdated
}
else if( image.type() == CV_8UC4 )
{
cvtColor( image, outImage, COLOR_BGRA2BGR );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed to force 3 channel images. For example, 4 channel "RGBA" is used on Android.

Update the first "copyTo" condition instead:

if (image.type() == CV_8UC3 || image.type() == CV_8UCU)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If drawKeypoints can produce BGRA output images we can expect similar functionality from drawMatches. However drawMatches takes two inputs and we need to add extra logic to determine output depth.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you 👍

@alalek
alalek merged commit ff8c53e into opencv:3.4 Dec 25, 2018
@alalek alalek mentioned this pull request Dec 27, 2018
@dkurt
dkurt deleted the fix_13227 branch May 6, 2019 05:50
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
* Fix drawMatches and drawKeypoints for BGRA input images

* keep BGRA too

* Combine different input types for drawMatches test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants