---
title: NmsSortByArea
description: "根据面积大小过滤重复目标。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0339.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0339.html
indexId: 0a49f73500d28353b4761809adc49abcc81ecfc690f0bf05440ba064623d1689102
---
# NmsSortByArea

#### 函数功能

根据面积大小过滤重复目标。


#### 函数原型

```
void NmsSortByArea(std::vector<DetectBox>& detBoxes, const float iouThresh, const IOUMethod method = UNION);
```


```
void NmsSortByArea(std::vector<ObjectInfo>& detBoxes, const float iouThresh, const IOUMethod method = UNION);
```

#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| detBoxes | 输入/输出 | 待过滤DetectBox（中心点） / ObjectInfo（边角点）。输出过滤后的目标信息。 |
| iouThresh | 输入 | 过滤阀值。 |
| method | 输入 | IOU计算方式： MAX 重叠区域除以两者中面积大的。 MIN 重叠区域除以两者中面积小的。 UNION 重叠区域除以两者面积并集。 DIOU 重叠区域除以两者面积并集减去距离的交并比。 |
