File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,15 @@ namespace cv {
100
100
// gliese581h suggested filling a cv::Mat with descriptors to enable BFmatcher compatibility
101
101
// speed-ups and enhancements by gliese581h
102
102
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
+ }
107
112
108
113
Mat_<Vec3b> src;
109
114
You can’t perform that action at this time.
0 commit comments