English | Deutsch
The object_blur stage enables automatic blurring of detected objects in the video stream. This is useful for privacy applications or to obscure specific objects in real-time.
Important: This stage is not standalone and requires a previous object detection stage to function.
Required:
- An object detection stage like
hailo_yolo_inferencemust be configured beforeobject_blurin your JSON - The detection stage must provide bounding boxes via
object_detect.results
Example minimal working configuration:
{
"hailo_yolo_inference": {
"hef_file_8": "/usr/share/hailo-models/yolov8s_h8.hef",
"max_detections": 20,
"threshold": 0.4
},
"object_blur": {
"overlay_blur": ["person"]
}
}Without a detection stage, object_blur will have no objects to blur and will do nothing.
The stage reads object detections from previous stages (e.g., hailo_yolo_inference) and applies various blur effects to the detected objects. Objects to be blurred are specified via their COCO class names (e.g., "person", "cup", "wine glass").
Pro Tip: You can record "normal" videos with active inference but without bounding boxes by omitting object_detect_draw_cv from your configuration. This creates a clean, professional look where objects are blurred live without visible detection frames - perfect for privacy-focused live recordings! There's no need for time-consuming post-processing video editing...
- Overview
- Dependencies
- How it works
- JSON Configuration
- Minimal Configuration
- Full Configuration
- Parameter Reference
- Usage Examples
- COCO Class Names
- Performance Tips
- Installation
- Troubleshooting
{
"object_blur": {
"overlay_blur": ["person", "cup", "wine glass"]
}
}{
"object_blur": {
"overlay_blur": ["person", "cup", "wine glass", "bottle"],
"blur_type": "pixelate",
"blur_strength": 16,
"gaussian_sigma": 0,
"expand_box": false,
"expand_pixels": 0,
"_info": {
"description": "Blur detected objects based on COCO class names",
"overlay_blur": "Array of COCO class names to blur (required)",
"blur_type": "Blur method: 'pixelate' (default, fastest), 'gaussian' (smooth), 'median' (noise reduction)",
"blur_strength": "Blur intensity: 0=auto, pixelate:8-32, gaussian/median:15-51 (must be odd)",
"gaussian_sigma": "Gaussian blur sigma: 0=auto (kernel_size/6), higher=stronger blur",
"expand_box": "Expand bounding box before blur: true/false",
"expand_pixels": "Pixels to expand box: 0=auto 10% if expand_box=true, or fixed pixel value"
}
}
}- Type: Array of Strings
- Description: List of COCO class names to be blurred
- Examples:
["person"]- blur persons only["wine glass", "cup", "bottle"]- beverage-related objects only["cell phone", "laptop"]- electronic devices
- Type: String
- Default:
"pixelate" - Possible Values:
"pixelate"- Pixelation effect (Minecraft-like look, fastest)"gaussian"- Smooth Gaussian blur (camera-like blur)"median"- Median blur (good for noise reduction, medium speed)
- Type: Integer
- Default:
0(automatically calculated based on object size) - Description:
- For
pixelate: Block size in pixels (larger values = stronger pixelation)- Recommended values: 8, 12, 16, 20, 24, 32
- For
gaussian/median: Kernel size (must be odd)- Recommended values: 15, 21, 31, 41, 51
- For
- Examples:
blur_strength: 8- light pixelationblur_strength: 32- strong pixelationblur_strength: 51- very strong Gaussian blur
- Type: Integer
- Default:
0(automatically calculated as kernel_size / 6) - Description: Only relevant for
blur_type: "gaussian". Higher values = stronger blur effect - Recommended values: 0 (auto), 5, 10, 15, 20
- Type: Boolean
- Default:
false - Description: Expands the bounding box before blurring
false- only exact detection box is blurredtrue- box is expanded by 10% or byexpand_pixels
- Type: Integer
- Default:
0 - Description: Number of pixels to expand the bounding box in all directions
- Examples:
expand_pixels: 10- 10 pixel border around each objectexpand_pixels: 20- 20 pixel border (useful for completely covering faces)expand_pixels: 0withexpand_box: true- automatically 10% of box size
{
"hailo_yolo_inference": {
"hef_file_8": "/usr/share/hailo-models/yolov8s_h8.hef",
"max_detections": 20,
"threshold": 0.4
},
"object_blur": {
"overlay_blur": ["person"],
"blur_type": "pixelate",
"blur_strength": 20,
"expand_box": true,
"expand_pixels": 15
}
}Record a "normal" video with live object blurring but no visible detection frames:
{
"hailo_yolo_inference": { ... },
"object_blur": {
"overlay_blur": ["person", "cell phone"],
"blur_type": "gaussian",
"blur_strength": 31
}
}Note: Simply omit object_detect_draw_cv to record without bounding boxes!
{
"hailo_yolo_inference": { ... },
"object_blur": {
"overlay_blur": ["tv", "laptop", "cell phone"],
"blur_type": "median",
"blur_strength": 21,
"expand_pixels": 10
}
}Commonly used COCO class names (depends on YOLO model):
- Persons:
person - Vehicles:
car,truck,bus,motorcycle,bicycle - Electronics:
tv,laptop,cell phone,keyboard,mouse - Beverages:
bottle,wine glass,cup - Food:
banana,apple,sandwich,pizza,donut,cake - Furniture:
chair,couch,bed,dining table - Animals:
cat,dog,bird,horse,sheep,cow
See assets/coco.names for the complete list of available classes.
- Pixelate is fastest and sufficient for most applications
- Gaussian is slower but looks more natural
- Median is slowest but good for noise reduction
- Smaller
blur_strengthvalues are faster expand_boxwithoutexpand_pixelsis faster than with fixed pixel values
The stage is included in rpicam-apps by default. After compilation it's automatically available:
cd /home/admin/rpicam-apps
meson compile -C build
sudo meson install -C buildrpicam-vid --post-process-file assets/hailo_yolov8_inference.json --timeout 10000Note: You need a JSON configuration that includes both the detection stage (e.g., hailo_yolo_inference) AND the object_blur stage. A minimal example would combine detection with blur - see the configuration examples above.
Problem: Objects are not being blurred
- Check if
hailo_yolo_inferencestage is defined before in the JSON - Check if object names are spelled correctly (case-sensitive)
- Increase logging level to see which objects are being detected
Problem: Blur is too weak
- Increase
blur_strengthto a higher value - Enable
expand_box: trueor setexpand_pixelsto a higher value
Problem: Performance issues
- Switch from
gaussiantopixelate - Reduce
blur_strength - Reduce the number of object classes to blur
Die object_blur Stage ermöglicht es, erkannte Objekte im Video-Stream automatisch zu blurren (verwischen/verpixeln). Dies ist nützlich für Datenschutz-Anwendungen oder um bestimmte Objekte in Echtzeit zu verbergen.
Wichtig: Diese Stage ist nicht eigenständig und benötigt eine vorherige Objekterkennungs-Stage.
Erforderlich:
- Eine Objekterkennungs-Stage wie
hailo_yolo_inferencemuss vorobject_blurin der JSON konfiguriert sein - Die Erkennungs-Stage muss Bounding Boxes über
object_detect.resultsbereitstellen
Beispiel minimal funktionierende Konfiguration:
{
"hailo_yolo_inference": {
"hef_file_8": "/usr/share/hailo-models/yolov8s_h8.hef",
"max_detections": 20,
"threshold": 0.4
},
"object_blur": {
"overlay_blur": ["person"]
}
}Ohne Erkennungs-Stage hat object_blur keine Objekte zum Blurren und macht nichts.
Die Stage liest Objekterkennungen aus vorherigen Stages (z.B. hailo_yolo_inference) und wendet verschiedene Blur-Effekte auf die erkannten Objekte an. Die zu blurrenden Objekte werden über ihre COCO-Klassennamen (z.B. "person", "cup", "wine glass") spezifiziert.
Pro-Tipp: Man kann "normale" Videos mit aktiver Inferenz aber ohne Bounding Boxes aufnehmen, indem man object_detect_draw_cv aus der Konfiguration weglässt. Das erzeugt einen sauberen, professionellen Look, bei dem Objekte live geblurred werden, ohne sichtbare Erkennungs-Rahmen - perfekt für datenschutzorientierte Live-Aufnahmen! Es entfällt auch die Notwendigkeit einer anschließenden aufwendigen Videobearbeitung...
- Übersicht
- Abhängigkeiten
- Funktionsweise
- JSON-Konfiguration
- Minimale Konfiguration
- Vollständige Konfiguration
- Parameter-Referenz
- Verwendungsbeispiele
- COCO-Klassennamen
- Performance-Tipps
- Installation
- Troubleshooting
{
"object_blur": {
"overlay_blur": ["person", "car", "wine glass"]
}
}{
"object_blur": {
"overlay_blur": ["person", "cup", "wine glass", "bottle"],
"blur_type": "pixelate",
"blur_strength": 16,
"gaussian_sigma": 0,
"expand_box": false,
"expand_pixels": 0
}
}- Typ: Array von Strings
- Beschreibung: Liste der COCO-Klassennamen, die geblurred werden sollen
- Beispiele:
["person"]- nur Personen blurren["wine glass", "cup", "bottle"]- nur Getränke-bezogene Objekte["cell phone", "laptop"]- elektronische Geräte
- Typ: String
- Standard:
"pixelate" - Mögliche Werte:
"pixelate"- Pixelierungs-Effekt (wie Minecraft-Look, am schnellsten)"gaussian"- Weicher Gaussian-Blur (wie Kamera-Unschärfe)"median"- Median-Blur (gut gegen Rauschen, mittlere Geschwindigkeit)
- Typ: Integer
- Standard:
0(automatisch berechnet basierend auf Objektgröße) - Beschreibung:
- Für
pixelate: Blockgröße in Pixeln (größere Werte = stärkere Verpixelung)- Empfohlene Werte: 8, 12, 16, 20, 24, 32
- Für
gaussian/median: Kernel-Größe (muss ungerade sein)- Empfohlene Werte: 15, 21, 31, 41, 51
- Für
- Beispiele:
blur_strength: 8- leichte Pixelierungblur_strength: 32- starke Pixelierungblur_strength: 51- sehr starker Gaussian-Blur
- Typ: Integer
- Standard:
0(automatisch berechnet als kernel_size / 6) - Beschreibung: Nur relevant für
blur_type: "gaussian". Höhere Werte = stärkerer Blur-Effekt - Empfohlene Werte: 0 (auto), 5, 10, 15, 20
- Typ: Boolean
- Standard:
false - Beschreibung: Erweitert die Bounding Box vor dem Blurren
false- nur exakte Detection-Box wird geblurredtrue- Box wird um 10% oder umexpand_pixelserweitert
- Typ: Integer
- Standard:
0 - Beschreibung: Anzahl der Pixel, um die die Bounding Box in alle Richtungen erweitert wird
- Beispiele:
expand_pixels: 10- 10 Pixel Rand um jedes Objektexpand_pixels: 20- 20 Pixel Rand (nützlich um z.B. Gesichter komplett zu verdecken)expand_pixels: 0mitexpand_box: true- automatisch 10% der Box-Größe
{
"hailo_yolo_inference": {
"hef_file_8": "/usr/share/hailo-models/yolov8s_h8.hef",
"max_detections": 20,
"threshold": 0.4
},
"object_blur": {
"overlay_blur": ["person"],
"blur_type": "pixelate",
"blur_strength": 20,
"expand_box": true,
"expand_pixels": 15
}
}Ein "normales" Video mit Live-Objekt-Blurring aber ohne sichtbare Erkennungs-Rahmen aufnehmen:
{
"hailo_yolo_inference": { ... },
"object_blur": {
"overlay_blur": ["person", "cell phone"],
"blur_type": "gaussian",
"blur_strength": 31
}
}Hinweis: Einfach object_detect_draw_cv weglassen, um ohne Bounding Boxes aufzuzeichnen!
{
"hailo_yolo_inference": { ... },
"object_blur": {
"overlay_blur": ["tv", "laptop", "cell phone"],
"blur_type": "median",
"blur_strength": 21,
"expand_pixels": 10
}
}Häufig verwendete COCO-Klassennamen (je nach verwendetem YOLO-Modell):
- Personen:
person - Fahrzeuge:
car,truck,bus,motorcycle,bicycle - Elektronik:
tv,laptop,cell phone,keyboard,mouse - Getränke:
bottle,wine glass,cup - Essen:
banana,apple,sandwich,pizza,donut,cake - Möbel:
chair,couch,bed,dining table - Tiere:
cat,dog,bird,horse,sheep,cow
Die vollständige Liste hängt vom verwendeten YOLO-Modell ab. Siehe assets/coco.names für alle verfügbaren Klassen.
- Pixelate ist am schnellsten und ausreichend für die meisten Anwendungen
- Gaussian ist langsamer, aber sieht natürlicher aus
- Median ist am langsamsten, aber gut gegen Rauschen
- Kleinere
blur_strengthWerte sind schneller expand_boxohneexpand_pixelsist schneller als mit festen Pixel-Werten
Die Stage ist standardmäßig in rpicam-apps enthalten. Nach dem Kompilieren steht sie automatisch zur Verfügung:
cd /home/admin/rpicam-apps
meson compile -C build
sudo meson install -C buildrpicam-vid --post-process-file assets/hailo_yolov8_inference.json --timeout 10000Hinweis: Du benötigst eine JSON-Konfiguration, die sowohl die Erkennungs-Stage (z.B. hailo_yolo_inference) ALS AUCH die object_blur Stage enthält. Ein minimales Beispiel würde Detection mit Blur kombinieren - siehe die Konfigurations-Beispiele oben.
Problem: Objekte werden nicht geblurred
- Prüfe, ob die
hailo_yolo_inferenceStage vorher in der JSON definiert ist - Prüfe, ob die Objektnamen korrekt geschrieben sind (case-sensitive)
- Erhöhe die Logging-Level um zu sehen, welche Objekte erkannt werden
Problem: Blur ist zu schwach
- Erhöhe
blur_strengthauf einen höheren Wert - Aktiviere
expand_box: trueoder setzeexpand_pixelsauf einen höheren Wert
Problem: Performance-Probleme
- Wechsle von
gaussianzupixelate - Reduziere
blur_strength - Reduziere die Anzahl der zu blurrenden Objektklassen
Copyright (C) 2026, Kletternaut