frigate: Poor motion detection when dark and mismatching object

Describe the problem you are having

Hi all

During night, I have poor motion detection and most of the times it mismatches objects like in this snapshot

snapshot-1707329221 905571-mghzsc

or like in this clip

https://github.com/blakeblackshear/frigate/assets/6501444/0600fd97-bf3e-4c4f-b308-5c53d99bcf0d

Is there a way to avoid these modifying the config.yml ?

My cam is a Imou Cruiser SE+ 4MP

Thanks

Version

0.13.1-34FB1C2

Frigate config file

ui:
  use_experimental: false
  live_mode: mse


database:
  path: /media/frigate/db/frigate.db

mqtt:
  host: 192.168.xx.xx
  user: user
  password: password
  topic_prefix: frigate


ffmpeg:
  global_args: -hide_banner -loglevel warning


  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p



detectors:
  coral:
    type: edgetpu
    device: usb


birdseye:
  enabled: True
  mode: continuous
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8



cameras:
  cancello:

    ffmpeg:
      inputs:
        - path: "rtsp://admin:pwd@192.168.xx.xx/cam/realmonitor?channel=1&subtype=1&authbasic=auth"
          roles:
            - detect
            - record
    detect:
      enabled: True
      width: 1280
      height: 720
      fps: 5
      min_initialized: 2
      # Optional: Number of frames without a detection before Frigate considers an object to be gone. (default: 5x the frame rate)
      max_disappeared: 25
    motion:
      threshold: 30
      lightning_threshold: 0.8
      contour_area: 20
      frame_alpha: 0.01
      improve_contrast: True
      # giorno
      mask: 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0


    zones:
      # giorno
      lontano:
        coordinates: 0,425,313,347,299,200,144,174,95,234,56,239,0,246
      vicino:
        coordinates: 308,202,635,163,804,167,942,93,1280,122,1280,720,658,720,0,720,0,524,0,393,313,365

    objects:
      track:
        - person
        - cat
        - dog
        - car
        - motorcycle
      filters:
        person:
          min_area: 4000
          max_area: 100000
          min_ratio: 0.62
          max_ratio: 2.0
          min_score: 0.4
          threshold: 0.5
          mask:
            # giorno
            - 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0

        car:
          min_area: 5000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.3
          threshold: 0.5
          mask:
            # giorno
            - 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0

        motorcycle:
          mask:
            # giorno
            - 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0

        dog:
          mask:
            # giorno
            - 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0
          min_area: 5000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.3
          threshold: 0.5

        cat:
          mask:
            # giorno
            - 0,259,114,224,186,194,478,200,704,194,913,297,1118,320,1197,109,1238,59,1280,0,0,0
          min_area: 5000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.3
          threshold: 0.5

    snapshots:
      required_zones:
        - lontano
        - vicino
      enabled: True
      bounding_box: True
      retain:
        default: 7
        mode: active_objects
        objects:
          dog: 1
          cat: 1
          car: 5
          motorcycle: 5
          person: 7


    record:
      enabled: True
      retain:
        days: 7
        mode: motion
      events:
        pre_capture: 30
        post_capture: 60
        retain:
          default: 7
          mode: active_objects
          objects:
            dog: 1
            cat: 1
            car: 5
            motorcycle: 5
            person: 7
        required_zones:
          - lontano
          - vicino

Relevant log output

none

Frigate stats

No response

Operating system

Proxmox

Install method

Docker CLI

Coral version

USB

Any other information that may be helpful

I’ve installed Frigate on Proxmox 8.1.4 following the official documentation

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 34

Most upvoted comments

the best snapshot is chosen based on a number of things including the score of the object, how long the object has been detected, etc.

The first one, I would try doing 0 ~ 24 on the shutter and then 0 ~ 30 on the gain and see what the camera image looks like

No need to create a separate config file, you can add this camera right besides the other or just comment out the rtsp path and add the path and different input_args while you test

I don’t think there is a good way to totally ignore headlights which is essentially causing motion across a lot of the frame. You could try turning down lightning_threshold