MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / CvtColor

Function CvtColor

python/mod_cvcuda/operators/OpCvtColor.cpp:57–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57Tensor CvtColor(Tensor &input, NVCVColorConversionCode code, std::optional<Stream> pstream)
58{
59 nvcv::ImageFormat outputFormat = GetOutputFormat(input.dtype(), code);
60 nvcv::TensorShape outputShape = GetOutputTensorShape(input.shape(), outputFormat, code);
61 nvcv::DataType outputDType = outputFormat.planeDataType(0).channelType(0);
62
63#ifndef NDEBUG
64 assert(outputFormat.numPlanes() == 1);
65 nvcv::DataType channelDType = outputFormat.planeDataType(0).channelType(0);
66 for (int c = 1; c < outputFormat.planeDataType(0).numChannels(); ++c)
67 {
68 assert(channelDType == outputFormat.planeDataType(0).channelType(c));
69 }
70#endif
71
72 Tensor output = Tensor::Create(outputShape, outputDType);
73
74 return CvtColorInto(output, input, code, pstream);
75}
76
77ImageBatchVarShape CvtColorVarShapeInto(ImageBatchVarShape &output, ImageBatchVarShape &input,
78 NVCVColorConversionCode code, std::optional<Stream> pstream)

Callers

nothing calls this directly

Calls 9

GetOutputFormatFunction · 0.85
GetOutputTensorShapeFunction · 0.85
CvtColorIntoFunction · 0.85
dtypeMethod · 0.45
shapeMethod · 0.45
channelTypeMethod · 0.45
planeDataTypeMethod · 0.45
numPlanesMethod · 0.45
numChannelsMethod · 0.45

Tested by

no test coverage detected