mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -178,6 +178,8 @@ void cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
|
||||
{
|
||||
CV_INSTRUMENT_REGION()
|
||||
|
||||
CV_Assert(!_src.empty());
|
||||
|
||||
if(dcn <= 0)
|
||||
dcn = dstChannels(code);
|
||||
|
||||
|
||||
@@ -247,10 +247,14 @@ struct CvtHelper
|
||||
{
|
||||
CvtHelper(InputArray _src, OutputArray _dst, int dcn)
|
||||
{
|
||||
CV_Assert(!_src.empty());
|
||||
|
||||
int stype = _src.type();
|
||||
scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype);
|
||||
|
||||
CV_Assert( VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) );
|
||||
CV_Check(scn, VScn::contains(scn), "Invalid number of channels in input image");
|
||||
CV_Check(dcn, VDcn::contains(dcn), "Invalid number of channels in output image");
|
||||
CV_CheckDepth(depth, VDepth::contains(depth), "Unsupported depth of input image");
|
||||
|
||||
if (_src.getObj() == _dst.getObj()) // inplace processing (#6653)
|
||||
_src.copyTo(src);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "precomp.hpp"
|
||||
#include "color.hpp"
|
||||
|
||||
#define IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3 1
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
@@ -1228,10 +1230,12 @@ static ippiGeneralFunc ippiRGB2GrayC4Tab[] =
|
||||
};
|
||||
|
||||
|
||||
#if !IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3
|
||||
static IppStatus ippiGrayToRGB_C1C3R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize)
|
||||
{
|
||||
return CV_INSTRUMENT_FUN_IPP(ippiGrayToRGB_8u_C1C3R, pSrc, srcStep, pDst, dstStep, roiSize);
|
||||
}
|
||||
#endif
|
||||
static IppStatus ippiGrayToRGB_C1C3R(const Ipp16u* pSrc, int srcStep, Ipp16u* pDst, int dstStep, IppiSize roiSize)
|
||||
{
|
||||
return CV_INSTRUMENT_FUN_IPP(ippiGrayToRGB_16u_C1C3R, pSrc, srcStep, pDst, dstStep, roiSize);
|
||||
@@ -1516,7 +1520,11 @@ void cvtGraytoBGR(const uchar * src_data, size_t src_step,
|
||||
if(dcn == 3)
|
||||
{
|
||||
if( depth == CV_8U )
|
||||
{
|
||||
#if !IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3
|
||||
ippres = CvtColorIPPLoop(src_data, src_step, dst_data, dst_step, width, height, IPPGray2BGRFunctor<Ipp8u>());
|
||||
#endif
|
||||
}
|
||||
else if( depth == CV_16U )
|
||||
ippres = CvtColorIPPLoop(src_data, src_step, dst_data, dst_step, width, height, IPPGray2BGRFunctor<Ipp16u>());
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user