---
title: 函数：set_aipp_dtc_pixel_mean
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclpythondevg_01_0180.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclpythondevg_01_0180.html
indexId: 700fa067500720a8a92ad138b6b6464732b4f0c495dbc936d94401c1a565514075
---
# 函数：set_aipp_dtc_pixel_mean

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | x |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

动态AIPP场景下，设置通道的均值。


#### 函数原型

- C函数原型
  1 aclError aclmdlSetAIPPDtcPixelMean(aclmdlAIPP *aippParmsSet, int16_t dtcPixelMeanChn0, int16_t dtcPixelMeanChn1, int16_t dtcPixelMeanChn2, int16_t dtcPixelMeanChn3, uint64_t batchIndex)

- python函数
  1 ret = acl.mdl.set_aipp_dtc_pixel_mean(aipp_parms_set, dtc_pixel_mean_chn0, dtc_pixel_mean_chn1, dtc_pixel_mean_chn2, dtc_pixel_mean_chn3, batch_index)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| aipp\_parms\_set | int，动态AIPP参数对象的指针地址，需提前调用acl.mdl.create\_aipp接口创建aclmdlAIPP类型的数据。 |
| dtc\_pixel\_mean\_chn0 | int，通道0的均值，取值范围：[0, 255]。 |
| dtc\_pixel\_mean\_chn1 | int，通道1的均值，取值范围：[0, 255]。 |
| dtc\_pixel\_mean\_chn2 | int，通道2的均值，取值范围：[0, 255]。 |
| dtc\_pixel\_mean\_chn3 | int，通道3的均值，如果只有3个通道，则该参数传默认值0。取值范围：[0, 255]。 |
| batch\_index | int，指定对第几个Batch上的图片设置通道均值，默认为0，取值范围：[0, batch\_size)，batch\_size是在调用acl.mdl.create\_aipp接口创建aclmdlAIPP类型的数据时设置。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码 返回0表示成功。 返回其它值(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclpythondevg\_01\_0911.html)表示失败。 |
