> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/cameras-and-gravadores/integracao-api-cftvip-e-mibo/cameras-e-gravadores/contagem-de-pessoas.md).

# Contagem de Pessoas

Integração de people counting via API/CGI. Inclui endpoints de resumo, consulta por período, assinatura/streaming com heartbeat e limpeza de estatísticas.

## Dicas & Boas Práticas <a href="#dicas-and-boas-praticas" id="dicas-and-boas-praticas"></a>

* Prefira o modo **Webhook (Push ativo)** sempre que disponível.
* Garanta que os endpoints estejam **acessíveis na internet** e respondam **HTTP 200**.
* Utilize **HTTPS** e **HTTP Digest Authentication** em todas as integrações.
* Trate corretamente **eventos, imagens e payloads JSON** recebidos.
* Monitore o **Heartbeat (KeepAlive)** para validar a disponibilidade do dispositivo.
* Evite ferramentas como Postman ou Insomnia para eventos em tempo real.
* Trate exceções, timeouts e reenvio de eventos para garantir estabilidade.

***

### Tabela de Parâmetros

<table><thead><tr><th>Name</th><th width="95.8148193359375">Type</th><th width="68.74072265625">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>groupID</td><td>string</td><td>R</td><td>Identificador do grupo facial, máx. 63 caracteres</td><td><code>"10000"</code></td></tr><tr><td>groupName</td><td>string</td><td>R</td><td>Nome do grupo facial, máx. 127 caracteres</td><td><code>"Test1"</code></td></tr><tr><td>groupDetail</td><td>string</td><td>O</td><td>Descrição do grupo facial, máx. 255 caracteres</td><td><code>"ForTest1"</code></td></tr><tr><td>similarity</td><td>uint8</td><td>O</td><td>Limite de similaridade [0–100]</td><td>90</td></tr><tr><td>alive</td><td>uint8</td><td>O</td><td>Limite de vivacidade [0–100]</td><td>90</td></tr><tr><td>maskSimilarity</td><td>uint8</td><td>O</td><td>Limite de similaridade com máscara [0–100]</td><td>0</td></tr><tr><td>groupSize</td><td>int</td><td>R</td><td>Quantidade de pessoas no grupo</td><td>30</td></tr><tr><td>groupType</td><td>string</td><td>O</td><td>Tipo do grupo facial</td><td><code>"BlackListDB"</code></td></tr><tr><td>channels</td><td>int[]</td><td>O</td><td>Índices de canais associados ao grupo</td><td><code>[0,1]</code></td></tr><tr><td>timeSection</td><td>string[][][]</td><td>O</td><td>Períodos de tempo válidos do grupo</td><td>—</td></tr><tr><td>featureState</td><td>uint[4]</td><td>O</td><td>Estado das features [preparando, falhou, OK, remodelável]</td><td><code>[100,10,200,50]</code></td></tr><tr><td>channel</td><td>int</td><td>R</td><td>Índice do canal de vídeo</td><td>1</td></tr><tr><td>startTime</td><td>string</td><td>O</td><td>Hora inicial da busca (ISO8601)</td><td><code>"2018-01-13T00:00:00Z"</code></td></tr><tr><td>endTime</td><td>string</td><td>O</td><td>Hora final da busca (ISO8601)</td><td><code>"2018-01-14T00:00:00Z"</code></td></tr><tr><td>startTimeRealUTC</td><td>string</td><td>O</td><td>Hora inicial UTC real</td><td><code>"2018-01-13T00:00:00Z"</code></td></tr><tr><td>endTimeRealUTC</td><td>string</td><td>O</td><td>Hora final UTC real</td><td><code>"2018-01-14T00:00:00Z"</code></td></tr><tr><td>similaritySearch</td><td>int</td><td>R</td><td>Similaridade mínima da busca [1–100]</td><td>80</td></tr><tr><td>maxCandidate</td><td>int</td><td>O</td><td>Máximo de candidatos retornados</td><td>200</td></tr><tr><td>objectType</td><td>int</td><td>O</td><td>Tipo de alvo (0 Face, 1 Corpo, 2 Veículo)</td><td>1</td></tr><tr><td>ordered</td><td>int</td><td>O</td><td>Ordem dos resultados</td><td>1</td></tr><tr><td>range</td><td>char[8][16]</td><td>O</td><td>Base de dados consultada</td><td><code>["HistoryDB"]</code></td></tr><tr><td>found</td><td>int</td><td>R</td><td>Quantidade de resultados encontrados</td><td>12</td></tr><tr><td>UID</td><td>string</td><td>R</td><td>Identificador único da pessoa</td><td><code>"0001"</code></td></tr><tr><td>name</td><td>string</td><td>R</td><td>Nome da pessoa</td><td><code>"ZhangSan"</code></td></tr><tr><td>sex</td><td>string</td><td>O</td><td>Sexo (<code>Male</code>, <code>Female</code>, <code>Unknown</code>)</td><td><code>"Male"</code></td></tr><tr><td>age</td><td>int</td><td>O</td><td>Idade estimada</td><td>26</td></tr><tr><td>birthday</td><td>string</td><td>O</td><td>Data de nascimento</td><td><code>"1980-01-01"</code></td></tr><tr><td>country</td><td>string</td><td>O</td><td>País (ISO3166, 2 letras)</td><td><code>"CN"</code></td></tr><tr><td>province</td><td>string</td><td>O</td><td>Província</td><td><code>"XXX"</code></td></tr><tr><td>city</td><td>string</td><td>O</td><td>Cidade</td><td><code>"YYY"</code></td></tr><tr><td>certificateType</td><td>string</td><td>O</td><td>Tipo de documento (<code>IC</code>, <code>Passport</code>)</td><td><code>"Passport"</code></td></tr><tr><td>id</td><td>string</td><td>O</td><td>Número do documento</td><td><code>"3333333333333"</code></td></tr><tr><td>className</td><td>string</td><td>O</td><td>Classe personalizada</td><td>—</td></tr><tr><td>academe</td><td>string</td><td>O</td><td>Instituição / academia</td><td>—</td></tr><tr><td>picUrl</td><td>string</td><td>O</td><td>Caminho da imagem da pessoa</td><td><code>"/mnt/.../1.jpg"</code></td></tr><tr><td>featureStatePerson</td><td>int</td><td>O</td><td>Estado da feature (0 Unknown, 1 Failed, 2 OK)</td><td>2</td></tr><tr><td>similarityResult</td><td>int</td><td>R</td><td>Similaridade do resultado</td><td>86</td></tr><tr><td>time</td><td>string</td><td>O</td><td>Horário de aparição</td><td><code>"2013-09-02 00:00:00"</code></td></tr><tr><td>timeRealUTC</td><td>string</td><td>O</td><td>Horário UTC real</td><td><code>"2013-09-01T16:00:00Z"</code></td></tr><tr><td>boundingBox</td><td>int[4]</td><td>R</td><td>Caixa delimitadora do rosto</td><td><code>[2992,136,6960,8192]</code></td></tr><tr><td>faceFeature</td><td>string[]</td><td>O</td><td>Características faciais</td><td><code>["Smile","WearGlasses"]</code></td></tr><tr><td>eye</td><td>int</td><td>O</td><td>Estado dos olhos (0–2)</td><td>2</td></tr><tr><td>mouth</td><td>int</td><td>O</td><td>Estado da boca (0–2)</td><td>1</td></tr><tr><td>mask</td><td>int</td><td>O</td><td>Uso de máscara (0–2)</td><td>1</td></tr><tr><td>beard</td><td>int</td><td>O</td><td>Barba (0–2)</td><td>2</td></tr><tr><td>alarmEnable</td><td>bool</td><td>R</td><td>Habilita saída de alarme</td><td>true</td></tr><tr><td>alarmRuleMask</td><td>int</td><td>R</td><td>Máscara de regra (bit0 sucesso, bit1 falha)</td><td>3</td></tr><tr><td>alarmOutLatch</td><td>int</td><td>R</td><td>Delay do alarme (s)</td><td>5</td></tr><tr><td>eventEnableMask</td><td>int</td><td>R</td><td>Máscara de eventos reportados</td><td>3</td></tr><tr><td>recordEnableMask</td><td>int</td><td>R</td><td>Máscara de gravação</td><td>0</td></tr><tr><td>snapEnableMask</td><td>int</td><td>R</td><td>Máscara de captura</td><td>3</td></tr><tr><td>mailEnableMask</td><td>int</td><td>R</td><td>Máscara de envio de e-mail</td><td>0</td></tr><tr><td>token</td><td>uint</td><td>O</td><td>Token de importação</td><td>1</td></tr><tr><td>state</td><td>string</td><td>O</td><td>Estado da importação</td><td><code>"Run"</code></td></tr><tr><td>center</td><td>Point[]</td><td>O</td><td>Centro do rosto na imagem</td><td><code>[Point]</code></td></tr><tr><td>multiFind</td><td>bool</td><td>O</td><td>Busca multi-canal simultânea</td><td>true</td></tr><tr><td>maxFaceType</td><td>uint32</td><td>O</td><td>Máx. tipos de face customizados</td><td>32</td></tr><tr><td>functionType</td><td>enumint</td><td>O</td><td>Tipo de serviço de reconhecimento</td><td>1</td></tr><tr><td>reAbstract</td><td>enumint</td><td>O</td><td>Métodos de reconstrução suportados</td><td>1</td></tr><tr><td>detectMethod</td><td>uint8</td><td>O</td><td>Método de detecção suportado</td><td>1</td></tr><tr><td>faceBoxColorSupport</td><td>bool</td><td>O</td><td>Suporte a cor dinâmica da box</td><td>false</td></tr><tr><td>defaultBoxColor</td><td>uint8[4]</td><td>O</td><td>Cor padrão da box (RGBA)</td><td><code>[255,0,0,0]</code></td></tr><tr><td>asyncPush</td><td>bool</td><td>O</td><td>Push assíncrono de busca</td><td>true</td></tr><tr><td>modifyPersonByToken</td><td>uint8</td><td>O</td><td>Permite editar pessoa por token</td><td>1</td></tr><tr><td>maxGroupNum</td><td>uint32</td><td>O</td><td>Máx. grupos faciais</td><td>20</td></tr><tr><td>maxPersonNum</td><td>uint32</td><td>O</td><td>Máx. pessoas cadastradas</td><td>300000</td></tr><tr><td>maxHistoryPersonNum</td><td>uint32</td><td>O</td><td>Máx. pessoas histórico</td><td>1000000</td></tr><tr><td>singlePicMaxLength</td><td>uint32</td><td>O</td><td>Tamanho máx. da imagem (KB)</td><td>150</td></tr><tr><td>searchObjectTypeMask</td><td>uint32</td><td>O</td><td>Máscara de tipos suportados</td><td>0</td></tr><tr><td>supportRealUTC</td><td>enumint</td><td>O</td><td>Suporte a UTC real</td><td>1</td></tr></tbody></table>

***

### Obter Resumo

* **Tópico**: Obtenha informações resumidas das estatísticas de pessoas no vídeo.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=getSummary`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=getSummary&channel=1&RuleName=Number
Stat&AreaID=1
```

**Resposta:**

```json
summary.Channel=0 
summary.RuleName=NumberStat 
summary.EnteredSubtotal.Today=0 
summary.EnteredSubtotal.Total=14 
summary.EnteredSubtotal.TotalInTimeSection=0 
summary.ExitedSubtotal.Today=0 
summary.ExitedSubtotal.Total=32 
summary.ExitedSubtotal.TotalInTimeSection=0 
summary.PassedSubtotal.Hour=0 
summary.PassedSubtotal.Today=0 
summary.PassedSubtotal.Total=142 
summary.PassedSubtotal.TotalInTimeSection=0 
summary.EnteredDupSubtotal.Hour=0 
summary.EnteredDupSubtotal.Today=0 
summary.EnteredDupSubtotal.Total=0 
summary.EnteredDupSubtotal.TotalInTimeSection=0 
summary.EnteredSubtotal.TotalInTimeSection=17 
summary.ExitedDupSubtotal.Hour=0 
summary.ExitedDupSubtotal.Today=0 
summary.ExitedDupSubtotal.Total=0 
summary.ExitedDupSubtotal.TotalInTimeSection=0 
summary.InsideSubtotal.Total=65 
summary.InsideSubtotal.ManStayStat[0].EnterTime=2025-01-04 00:00:00 
summary.InsideSubtotal.ManStayStat[0].ExitTime=2025-01-04 00:00:45 
summary.InsideSubtotal.ManStayStat[1].EnterTime=2025-01-04 00:00:00 
summary.InsideSubtotal.ManStayStat[1].ExitTime=2025-01-04 00:00:45 
summary.EnteredNoDupSubtotal.Hour=0 
summary.EnteredNoDupSubtotal.Today=0 
summary.EnteredNoDupSubtotal.Total=32  
summary.EnteredNoDupSubtotal.TotalInTimeSection=0 
summary.ExitedNoDupSubtotal.Hour=0 
summary.ExitedNoDupSubtotal.Today=0 
summary.ExitedNoDupSubtotal.Total=142  
summary.ExitedNoDupSubtotal.TotalInTimeSection=0 
summary.RealNumber.Hour=0 
summary.RealNumber.Today=0 
summary.RealNumber.Total=0  
summary. RealNumber.TotalInTimeSection=0 
summary.EnteredFilterSubtotal.Hour=0 
summary.EnteredFilterSubtotal.Today=0 
summary.EnteredFilterSubtotal.Total=0 
summary.EnteredFilterSubtotal.TotalInTimeSection=0  
summary.ExitedFilterSubtotal.Hour=0 
summary.ExitedFilterSubtotal.Today=0 
summary.ExitedFilterSubtotal.Total=0 
summary.ExitedFilterSubtotal.TotalInTimeSection=0
```

***

### Consultar a Contagem de Pessoas

#### 1. Começar a procurar

* Comece a encontrar informações estatísticas de vídeo, em resposta, há um token para o processo de busca de informações adicionais, e há um totalCount que mostra quantos dados existem.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=startFind`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=startFind&channel=1&condition.StartTime=201
1-01-01%2012:00:00&condition.EndTime=2011-01-10%2012:00:00&condition.Granularity=Hour&condit
ion.RuleType=NumberStat&condition.MinStayTime=20&condition.AreaID[0]=2&condition.AreaID[1]=3&
condition.GranularityExt=5
```

**Resposta:**

```json
token=12345 
totalCount=56 
```

#### 2 . Obter o resultado da busca

* Obtenha o resultado da pesquisa de informações de estatísticas de vídeo com canal, token, número inicial e contagem.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=doFind`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=doFind&channel=1&token=12345&beginNumb
er=0&count=20
```

**Resposta:**

```json
found=20 
info[0].Channel=0 
info[0].AreaID=2 
info[0].RuleName=NumberStat 
info[0].StartTime=2025-03-14 00:00:00 
info[0].EndTime=2025-04-14 00:00:00 
info[0].EnteredSubtotal=14 
info[0].ExitedSubtotal=5 
info[0].InsideSubtotal=65 
info[0].PassedSubtotal=0 
info[0].EnteredDupSubtotal=0 
info[0].ExitedDupSubtotal=0 
info[1].Channel=0 
info[1].AreaID=3 
info[1].RuleName=NumberStat 
info[1].StartTime=2025-03-14 00:00:00 
info[1].EndTime=2025-04-14 00:00:00 
info[1].EnteredSubtotal=14 
info[1].ExitedSubtotal=5 
info[1].InsideSubtotal=65 
info[1].PassedSubtotal=0 
info[1].EnteredDupSubtotal=0 
info[1].ExitedDupSubtotal=0 
info[1].EnteredNoDupSubtotal=5 
info[1].ExitedNoDupSubtotal=65 
info[1].RealNumber=0 
info[1].EnteredFilterSubtotal=0 
info[1].ExitedFilterSubtotal=0 
 
…
```

#### 3. Pare a sessão de busca

* Parar de consultar estatísticas de vídeo por canal e token.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=stopFind`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=stopFind&channel=1&token=12345
```

**Resposta:**

```
OK
```

### Limpar as Informações de Contagem de Pessoas

* **Tópico:** Limpar as informações de contagem de pessoas.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=clearSectionStat`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=clearSectionStat&channel=1
```

**Resposta:**

```
OK
```

### Inscrever-se nas Informações de Contagem de Pessoas

* **Tópico:** Assine as informações sobre a contagem de pessoas.
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=attach`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=attach&channel=1&heartbeat=5
```

**Resposta:**

```http
HTTP/1.1 200 OK 
Server: Device/1.0 
Content-Type: multipart/x-mixed-replace; boundary=<boundary> 
Connection: closed 
 --<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
summary.Channel=0 
summary.RuleName=NumberStat 
summary.EnteredSubtotal.Today=2 
summary.EnteredSubtotal.Total=14 
summary.EnteredSubtotal.TotalInTimeSection=1 
summary.ExitedSubtotal.Today=3 
summary.ExitedSubtotal.Total=32 
summary.ExitedSubtotal.TotalInTimeSection=2 
summary.PassedSubtotal.Hour=0 
summary.PassedSubtotal.Today=0 
summary.PassedSubtotal.Total=142 
summary.PassedSubtotal.TotalInTimeSection=0 
summary.EnteredDupSubtotal.Hour=0 
summary.EnteredDupSubtotal.Today=0 
summary.EnteredDupSubtotal.Total=0 
summary.EnteredDupSubtotal.TotalInTimeSection=0 
summary.EnteredSubtotal.TotalInTimeSection=17 
summary.ExitedDupSubtotal.Hour=0 
summary.ExitedDupSubtotal.Today=0 
summary.ExitedDupSubtotal.Total=0 
summary.ExitedDupSubtotal.TotalInTimeSection=0 
summary.InsideSubtotal.Total=65 
summary.InsideSubtotal.ManStayStat[0].EnterTime=2025-01-04 00:00:00 
summary.InsideSubtotal.ManStayStat[0].ExitTime=2025-01-04 00:00:45 
summary.InsideSubtotal.ManStayStat[1].EnterTime=2025-01-04 00:00:00 
summary.InsideSubtotal.ManStayStat[1].ExitTime=2025-01-04 00:00:45 
summary.EnteredNoDupSubtotal.Hour=0 
summary.EnteredNoDupSubtotal.Today=0 
summary.EnteredNoDupSubtotal.Total=32  
summary.EnteredNoDupSubtotal.TotalInTimeSection=0 
summary.ExitedNoDupSubtotal.Hour=0 
summary.ExitedNoDupSubtotal.Today=0 
summary.ExitedNoDupSubtotal.Total=142  
summary.ExitedNoDupSubtotal.TotalInTimeSection=0 
summary.RealNumber.Hour=0 
summary.RealNumber.Today=0 
summary.RealNumber.Total=0  
summary.RealNumber.TotalInTimeSection=0 
summary.EnteredFilterSubtotal.Hour=0 
summary.EnteredFilterSubtotal.Today=0 
summary.EnteredFilterSubtotal.Total=0 
summary.EnteredFilterSubtotal.TotalInTimeSection=0  
summary.ExitedFilterSubtotal.Hour=0 
summary.ExitedFilterSubtotal.Today=0 
summary.ExitedFilterSubtotal.Total=0 
summary.ExitedFilterSubtotal.TotalInTimeSection=0 
 --<boundary> 
Content-Type: text/plain 
Content-Length: 11 
 
Heartbeat --<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
summary.Channel=0 
summary.RuleName=NumberStat 
summary.EnteredSubtotal.Today=2 
summary.EnteredSubtotal.Total=14 
…
```

## Obter Informações da Área

* **Tópico:** Obter informações da área
* **Métodos: `GET`**` ``/cgi-bin/api/videoStatServer/getAreaInfo`

**Exemplo:**

```json
{ 
“channel”:0 
} 
```

**Resposta:**

```json
{ 
    "Channel": 1, 
    "info": [{ 
        "AreaID": 1, 
        "Type": "ManNumDetection", 
        "DetectRegion": [Point, Point, Point ], 
        "AreaName": "RuleName1", 
        "DetectLine": [Point, Point ] 
    },…{}] 
} 
```

### Dados do Período de Estatísticas de Assinaturas

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `POST`**` ``/cgi-bin/api/videoStatServer/attachStatistics`

**Exemplo:**

```json
{ 
    "condition": { 
            "RuleType": "NumberStat", 
            "Granularity": "Minute", 
            "Cycle": 5, 
            "StartTime": "2025-05-31 00:00:00" 
        }, 
"Heartbeat": 5, 
“channel’:0 
} 
```

**Resposta:**

```json
HTTP/1.1 200 OK 
Content-Type: multipart/x-mixed-replace; boundary=<boundary> 
Connection: close --<boundary> 
Content-Type: application/json 
Content-Length: <data length> 
{ 
     "SID": 10336U, 
        "info": { 
            "Channel": 0, 
            "PtzPresetId": 1, 
            "AreaID": 1, 
            "RuleName": "NumberStat1", 
            "StartTime": "2025-05-31 00:00:00", 
            "RuleType": "NumberStat", 
            "Granularity": "Minute", 
            "Cycle": 5, 
            "EnteredSubtotal": 56, 
            "ExitedSubtotal": 56 
        }  
} --<boundary> 
Content-Type: text/plain 
Content-Length: 11 
Heartbeat --<boundary>
```

### Limpar Estatísticas Na Seção de Tempo

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `GET`**` ``/cgi-bin/videoStatServer.cgi?action=clearSectionStat`

**Exemplo:**

```http
http://<ip>/cgi-bin/videoStatServer.cgi?action=clearSectionStat&AreaID=2
```

**Resposta:**

```
OK
```

### Consultar Detalhes do Pessoal

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `POST`**` ``/cgi-bin/api/NumberStatCluster/startFindDetail`

**Exemplo:**

```json
{ 
    "Condition": { 
        "Channel": 0, 
        "PtzPresetId": 1, 
        "AreaIDEx": [1,2], 
        "StartRealUTC": 1465389120, 
        "EndRealUTC": 1465389120, 
        "StartUTC": 1465389120, 
"EndUTC": 1465389120, 
"StaffType": -1 
    } 
}
```

**Resposta:**

```json
{ 
    "count": 50, 
"Token": 3145 
} 
```

### Ler Resultados da Consulta de Detalhes de Pessoal

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `POST`**` ``/cgi-bin/api/NumberStatCluster/doFindDetail`

**Exemplo:**

```json
{ 
    "Token": 81375, 
    "StartIndex": 2000, 
    "Count": 1000 
}
```

**Resposta:**

```json
{ 
    "ClusterDetail": [{ 
        "ProfileID": 87153, 
        "Channel": 1, 
        "Age": 2, 
        "Gender": 2, 
        "StaffType": -1, 
        "HumanState": 1, 
        "Emotion": "Smile", 
        "ObjectUUID": "urn:uuid:f81d4fae-7dec-11d0-a765- 00a0c91e6bf6", 
        "PtzPresetId": 0, 
        "AreaIDEx": 1, 
        "RealUTC": 1465389120, 
        "UTC": 1465389120, 
        "HumanAttributes": { 
            "CoatType": 0, 
            "CoatColor": "White", 
            "TrousersType": 0, 
            "TrousersColor": "White" 
} 
    },…{}], 
    "found": 950 
}
```

### Encerrar Consulta de Detalhes do Pessoal

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `POST`**` ``/cgi-bin/api/NumberStatCluster/stopFindDetail`

**Exemplo:**

```json
{ 
    "Token": 46878 
} 
```

**Resposta:**

```
{}
```

### Anexar Dados de Estatísticas de Vídeo

* **Tópico:** Dados do período de estatísticas de assinaturas
* **Métodos: `POST`**` ``/cgi-bin/api/videoStatisticsService/attach`

**Exemplo:**

```json
{ 
    "Channel": 0, 
    "Type": 0 
}
```

**Resposta:**

```json
HTTP/1.1 200 OK 
Content-Type: multipart/x-mixed-replace; boundary=<boundary> 
Connection: close --<boundary> 
Content-Type: application/json 
Content-Length: <data length> 
{ 
  "Type": 0 
    "VideoStatSummary":  
{ 
        "Channel" : 0, 
        "PtzPresetId" : 1 
        "Type" : 0,  
        "UTC" : 1354658724,  
        "InsideSubtotal" : {, 
        "PosXs" : [1,2], 
        } 
  }   
  Content-Type: application/json 
Content-Length: <data length> 
{ 
  "Type": 0 
    "VideoStatSummary":  
{ 
        "Channel" : 0, 
        "PtzPresetId" : 1 
        "Type" : 0,  
        "UTC" : 1354658724,  
        "InsideSubtotal" : {, 
        "PosXs" : [1,2], 
        } 
  }  --<boundary> 
… 
  
}]
```

### Comportamento Estéreo

* **Tópico:** Análise de atividade em tempo real

**Exemplo:**

```json
{ 
    "Channel" : 0, 
    "PtzPresetId" : 1 
    "Type" : 0,  
    "UTC" : 1354658724,  
    "InsideSubtotal" : {, 
       "PosXs" : [1,2], 
     } 
} 
```

### Mapa De Distribuição De Multidão

* **Tópico:** Análise de atividade em tempo real

**Exemplo:**

```json
{ 
    "Channel": 0, 
    "PresetId": 0, 
    "UTC": 1354658724, 
    "RegionNum": 4, 
    "RegionList": [{ 
        "RegionName": "“Region1”", 
        "RegionPeopleNum": 100 
    },…{}] 
} 
```

### Distribuição De Veículos

* **Tópico:** Dados em tempo real do relatório de densidade de veículos

**Exemplo:**

```json
{ 
    "Channel": 0, 
    "PresetId": 0, 
    "UTC": 1354658724, 
    "RuleNum": 4, 
    "VehiclesData": [{ 
        "RuleName": "teste", 
        "VehiclesNum": 200, 
        "RuleId": 12, 
        "RuleType": "CongestionDetection" 
    },…{}] 
}
```

### Estacionamento Inteligente

* **Tópico:** Dados em tempo real para estacionamento inteligente

**Exemplo:**

```json
{ 
    "Channel": 0, 
    "PtzPresetId": 1, 
    "Type": 0, 
    "UTC": 1354658724, 
    "PlanArea": { 
        "IDInfoArray": [{ 
            "Id": 1, 
            "IsUsed": 1 
        },…{}] 
    }, 
    "OpenArea": { 
            "Id": 1, 
            "ParkingNum": 1 
    } 
} 
```

### Detecção de Levantamento de Cabeça

* **Tópico:** Retorno de chamada relatado durante o ciclo de detecção de cabeça erguida

**Exemplo:**

```json
{ 
 "Channel": 0, 
 "PtzPresetId": 1, 
 "UTC": 1354658724, 
 "FaceCount": 10, 
 "HumanCount": 50 
}
```

### Detecção De Capacidade Do Tanque

* **Tópico:** Retorno de chamada dos dados de relatório em tempo real para detecção da capacidade do tanque de armazenamento

**Exemplo:**

```json
{ 
 "Channel": 0, 
 "TankStatus": “Discharging”, 
 "UTC": 1354658724, 
 "CurrentRatio": 70, 
} 
```

### Detecção De Taxa De Presença

* **Tópico:** Retorno de chamada relatado durante o ciclo de detecção da taxa de presença

**Exemplo:**

```json
{ 
 "Channel": 0, 
 "PtzPresetId": 1, 
 "UTC": 1354658724, 
 "HumanCount": 50, 
 "TotalCount": 100 
} 
```

### Detecção De Taxa De Assentos

* **Tópico:** Retorno de chamada relatado durante o ciclo de detecção da taxa de assentos

**Exemplo:**

```json
{ 
 "Channel": 0, 
 "PtzPresetId": 1, 
 "UTC": 1354658724, 
 "HumanCount": 50, 
 "SeatCount": 100 
} 
```

### Obter Status do Número do Widget de Vídeo

* **Tópico:** Obter configuração de status do número do widget de vídeo

**Exemplo:**

```http
http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidgetNumberStat
```

**Resposta:**

```json
table.VideoWidgetNumberStat[0].EncodeBlend=true 
table.VideoWidgetNumberStat[0].ShowEnterNum=true 
table.VideoWidgetNumberStat[0].ShowExitNum=true 
table.VideoWidgetNumberStat[0].TextAlign=0 
… 
```

### Definir Status do Número do Widget de Vídeo

* **Tópico:** Definir configuração de status do número do widget de vídeo

**Exemplo:**

```http
http://<ip>/cgi-bin/configManager.cgi?action=setConfig&VideoWidgetNumberStat[0].EncodeBl
end=true&VideoWidgetNumberStat[0].ShowEnterNum=true&VideoWidgetNumberStat[0].ShowExitNum
=true&VideoWidgetNumberStat[0].TextAlign=0
```

**Resposta:**

```
OK
```

### Estatística Numérica

* **Código da Ação**: `NumberStat`
* **Ação do evento:** `Start/Stop`

**Exemplo:**

```powershell
--<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
Code=NumberStat;action=Start;index=0;data={ 
  "Number": 120, 
  "EnteredNumber": 180, 
  "ExitedNumber": 60, 
  "PassedNumber": 60, 
  "EnteredDupNumber": 180, 
  "ExitedDupNumber": 60, 
  "Type": "EnterOver", 
  "Area": 2 
} --<boundary> 
```

### Detecção De Número De Homem

* **Código da Ação**: `ManNumDetection`
* **Ação do evento:** `Start/Stop`

**Exemplo:**

```powershell
--<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
Code=ManNumDetection;action=pulse;index=0;data={ 
  "ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 }, 
    { "BoundingBox": [4392,4136,6960,6512], "Stature": 175 }, 
{…}, … ], 
  "AreaID" : 2 
} --<boundary> 
```

### Detecção de Multidões

* **Código da Ação**: `CrowdDetection`
* **Ação do evento:** `Start/Stop`

**Exemplo:**

```powershell
--<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
Code=CrowdDetection;action=start;index=0;data={ 
  "CrowdList": [ { "Center" : [5734,2377],"Radius" : 10}, …{} ], 
"RegionList" : [ { "RegionID" : 0, "PeopleNum" : 100 },…{} ] 
} --<boundary> 
```

### Detecção de Ausência

* **Código da Ação**: `LeaveDetection`
* **Ação do evento:** `Pulse`

**Exemplo:**

```powershell
--<boundary> 
Content-Type: text/plain 
Content-Length: <length> 
 
Code=LeaveDetection;action=Pulse;index=0;data={ 
    "Name": "LeaveDetection", 
    "DetectRegion": [], 
    "Count": 100, 
    "TriggerMode": "NoPerson", 
    … 
} --<boundary>
```

### Obter Contagem de Alvos no Intervalo de Tempo

* **Métodos: `POST`**` ``/cgi-bin/api/videoStatServer/getCount`

**Exemplo:**

```json
{ 
 "Condition": { 
  "Channels": [ 
   0, 
   1, 
   2, 
   5 
  ], 
  "StartTimeRealUTC": "2010-05-25T04:05:00Z", 
  "EndTimeRealUTC": "2010-05-25T04:10:00Z", 
  "StartTime": "2010-05-25 12:05:00", 
  "EndTime": "2010-05-25 12:10:00", 
  "Direction": "Both", 
  "RuleType": "CrossLineStat", 
  "AlarmId": 1 
 } 
} 
```

**Resposta:**

```json
{ 
    "TotalCount": 1000, 
} 
```

***

Notas finais:

* Os dados de contagem devem ser interpretados conforme o posicionamento correto da câmera (zonas de entrada e saída).
* As zonas de **entrada e saída devem estar corretamente configuradas**.
* Alterações físicas no ambiente podem impactar a precisão da contagem.
* Eventos de contagem e fila são enviados em **tempo real via streaming**.
* Um mesmo evento pode gerar **múltiplas mensagens multipart**.
* Contadores podem ser **resetados manualmente** quando necessário.
* Seguir estas práticas garante **precisão, confiabilidade e escalabilidade** da solução.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/cameras-and-gravadores/integracao-api-cftvip-e-mibo/cameras-e-gravadores/contagem-de-pessoas.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
