Skip to content

ori-drs/rosbag_blur_face_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

107 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rosbag_blur_face_tool

Tool to manually blur faces in rosbag images. The user draws an ellipse on each image and can use shortcuts to move forward and back in the rosbag. We used it to carry out privacy blurring of the Oxford Spires Dataset.

The input is a rosbag. The output is a rosbag with the blurred images. The ellipses ("blur regions") can be written to a text file to allow the blurring to be refined later, if needed.

This tool currently works for ROS1/2 bag files.

vilens_logo

Installation

pip install -r requirements.txt

Configuration and Usage

First configure a main.py file - using the examples in this directory to have the correct list of camera_topics and passthrough_topics.

Then you can run the module as follows - configured for your specific device:

# ros2
python main.py <path-to-ros2bag.db3>

# ros1
python main.py <path-to-ros1bag.bag>

Docker

docker compose -f .docker/docker-compose.yml run --build blur_face

In side the docker, install the dependencies, then run the main script

pip install -r requirements.txt
python main.py <path_to_bag_file_or_folder> <save_path_prefix> <export_path>

Be aware to set the export path to an attached volume so that the output is saved in the host computer. If not set, the output will be saved in the docker workspace and not in the host computer.

Description

  • Opens bag files and displays three separate windows for cam0, cam1, and cam2.
  • Allows click-and-drag to create blur regions, which can be further stamped with left-click.
  • S key: Stamps the current blur region and advances by 1 frame.
  • Z, A, D, C keys: Navigate backward and forward by 10 or 1 frames.
  • Regions can be saved and loaded from a .txt file.
  • Erase blur regions: Press X, middle-click, or right-click.
  • E key: Exports blurred images and additional topics (IMU and LiDAR) to a new bag file.

Dependencies

Key Bindings

  • 1-0: Quick warp to 10%-100% of frames.
  • O: Warp to the 0% frame position.
  • Q: Quit.
  • W: Write blur regions to .txt.
  • R: Read blur regions from .txt.
  • E: Exports blurred images and additional topics (IMU and LiDAR) to a new bag file.
  • A / D: Move back or forward by 1 frame.
  • Z / C: Move back or forward by 10 frames.
  • S: Stamp previous blur region and advance by 1 frame.
  • Left Click: Stamp previous blur region.
  • Left Click + Drag + Release: Create and stamp a new blur region.
  • X / Middle Click / Right Click: Remove blur region.
  • F / V: Increase or decrease stamp size.
  • B: Toggle display between blurred region and blur border outline.

Author

Jiahao Wang, Oxford Robotics Institute

License

This work is licensed under a BSD 3-Clause License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •