Skip to content

Commit ff8a7b8

Browse files
committed
LUCID - Support RGBA
1 parent 01dbe00 commit ff8a7b8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

modules/xfeatures2d/src/lucid.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ namespace cv {
100100
// gliese581h suggested filling a cv::Mat with descriptors to enable BFmatcher compatibility
101101
// speed-ups and enhancements by gliese581h
102102
void LUCIDImpl::compute(InputArray _src, std::vector<KeyPoint> &keypoints, OutputArray _desc) {
103-
cv::Mat src_input = _src.getMat();
104-
if (src_input.empty())
105-
return;
106-
CV_Assert(src_input.depth() == CV_8U && src_input.channels() == 3);
103+
if (_src.empty()) return;
104+
CV_Assert(_src.depth() == CV_8U);
105+
cv::Mat src_input;
106+
if (_src.channels() == 4)
107+
cvtColor(_src, src_input, COLOR_BGRA2BGR);
108+
else {
109+
CV_Assert(_src.channels() == 3);
110+
src_input = _src.getMat();
111+
}
107112

108113
Mat_<Vec3b> src;
109114

0 commit comments

Comments
 (0)