Merge pull request #12465 from hmaarrfk:fix_bayer2rgba

pull/12054/head
Alexander Alekhin 6 years ago
commit 87ed12b8f3
  1. 5
      modules/imgproc/src/demosaicing.cpp

@ -1686,8 +1686,11 @@ void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn)
CV_Error(CV_StsUnsupportedFormat, "Bayer->Gray demosaicing only supports 8u and 16u types");
break;
case CV_BayerBG2BGR: case CV_BayerGB2BGR: case CV_BayerRG2BGR: case CV_BayerGR2BGR:
case CV_BayerBG2BGRA: case CV_BayerGB2BGRA: case CV_BayerRG2BGRA: case CV_BayerGR2BGRA:
if (dcn <= 0)
dcn = 4;
/* fallthrough */
case CV_BayerBG2BGR: case CV_BayerGB2BGR: case CV_BayerRG2BGR: case CV_BayerGR2BGR:
case CV_BayerBG2BGR_VNG: case CV_BayerGB2BGR_VNG: case CV_BayerRG2BGR_VNG: case CV_BayerGR2BGR_VNG:
{
if (dcn <= 0)

Loading…
Cancel
Save