blakeblackshear / blakeblackshear/frigate

Allow min/max area filters to be configurable based on location

Open
#2,330 17 comments 0 reactions 0 assignees View on GitHub
enhancement planned
Dominant language
TypeScript
Stars
35.9k
Forks
3.6k
Avg merge
8h 39m
Merged PRs (30d)
122

Description

### Describe the problem you are having

Hello,

I'm trying to filter out false positives using min_area/max_area.
However the numerical values of min_area/max_area depend if the person is near or away from the camera.
Therefore I'm using zones:
```yaml
zones:
near:
coordinates: ...
filters:
person:
min_area: 90000
max_area: 400000
away:
coordinates: ...
filters:
person:
max_area: 130000
```
This works as expected (#1738)

However I'm still receiving events for detection labeled as person without any zone on MQTT `events` topic.
I may filter them out using Home Assistant (i.e., ensuring that there is a zone), but this adds increased complexity (cameras with zones, cameras without zone, etc.)

I'm already using the `required_zones` parameter:
```yaml
record:
enabled: true
retain_days: 0
events:
objects:
- person
required_zones:
- near
- away
mqtt:
required_zones:
- near
- away
```

IMO using `required_zones` in `mqtt` should prevent any MQTT message (including events) if the detection is not in the `required_zones`.
What is your opinion?
Is there another way to achieve the same goal?

Thanks for your hard work for this project!

### Version

0.10.0-c1155af

### Frigate config file

```yaml
See relevant parts above
```

### Relevant log output

```shell
N/A
```

### FFprobe output from your camera

```shell
N/A
```

### Frigate stats

```json
N/A
```

### Operating system

Other Linux

### Install method

Docker Compose

### Coral version

PCIe

### Network connection

Wired

### Camera make and model

N/A

### Any other information that may be helpful

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the zone filter and MQTT required_zones configuration paths described in the report, then trace how detections without a matching zone reach the events topic. Done means the configured required zones consistently prevent those MQTT messages while preserving the existing near and away area filters.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.