No version for distro humble showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro jazzy showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro kilted showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro rolling showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro github showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro galactic showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro iron showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro melodic showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file

No version for distro noetic showing lyrical. Known supported distros are highlighted in the buttons above.
Repo symbol

mcap_anonymizer repository

mcap_anonymizer

ROS Distro
lyrical

Repository Summary

Description
Checkout URI https://github.com/MOLAorg/mcap_anonymizer.git
VCS Type git
VCS Version main
Last Updated 2026-11-18
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mcap_anonymizer 0.1.0

README

mcap_anonymizer

test License: BSD-3-Clause

Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Blurs the faces in the camera images of MCAP files (ROS 2 bags), so datasets recorded among people can be shared without privacy issues, while keeping everything else exactly as it was recorded.

  • Only the faces change. In raw images (sensor_msgs/Image), every pixel outside the blurred faces stays bit-exact, and so do the encoding, step, header and message size. Each encoding is processed in its own format: a Bayer image is still a valid mosaic, a YUV 4:2:2 image keeps its chroma subsampling, 16-bit images keep their depth and byte order.
  • Everything else is untouched. All other messages are copied byte by byte, with their log and publish times and sequence numbers, in the same order. Schemas, channels (also those without messages, with their QoS metadata), metadata and attachment records, and the chunk compression are kept. For a rosbag2 directory, its metadata.yaml is copied.
  • Compressed images (sensor_msgs/CompressedImage): PNG is re-encoded losslessly (same channels and bit depth); JPEG is re-encoded with its own quantization tables and chroma subsampling, so the extra loss in the rest of the image is minimal.
  • Privacy first. A low detection threshold, boxes enlarged by a margin and propagated to the neighboring frames (so a face missed by the detector in a few frames is still covered), a review video to check the result, and hand-added boxes for anything missed. Topics that may contain images but cannot be processed (e.g. compressed video) stop the tool, instead of being silently copied.
  • Large and unfinished bags. Files are streamed (memory use is about one MCAP chunk, whatever the bag size), and recordings that were never closed (no summary section, truncated last chunk) are processed up to their last complete record. The output is always a complete, indexed MCAP file.

Faces are detected with CenterFace at a low threshold (high recall), and doubtful detections are kept only if a person detector (YOLOX-s) finds a person around them, which removes most false positives (foliage, wheels, machinery…). Both are ONNX models that run with OpenCV (no extra dependencies), or with onnxruntime on the CPU or an NVIDIA GPU. All the bundled code and models have permissive licenses (BSD, MIT, Apache-2.0).

Install

ROS 2 (Humble, Jazzy, Kilted, Lyrical, Rolling)

From source, in a colcon workspace:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mcap_anonymizer.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select mcap_anonymizer
source install/setup.bash
ros2 run mcap_anonymizer mcap_anonymize --help

Its only dependencies are python3-numpy, python3-opencv and python3-pil; the MCAP reader and writer (the mcap Python library, MIT) is bundled.

pip (no ROS needed)

pip install 'mcap-anonymizer[compression] @ git+https://github.com/MOLAorg/mcap_anonymizer.git'
mcap_anonymize --help

Optional extras

  • zstd or lz4 compressed MCAP chunks need the Python packages zstandard or lz4 (Ubuntu: sudo apt install python3-zstandard python3-lz4; pip: the [compression] extra). Bags recorded with rosbag2’s default MCAP settings are not compressed.
  • Faster detection with onnxruntime: pip install onnxruntime. It is used automatically when installed (--backend auto).
  • NVIDIA GPU: pip install 'onnxruntime-gpu[cuda,cudnn]' (and not onnxruntime), then --device cuda (or auto). Older GPUs (Pascal: GTX 10xx, Quadro Pxxx) are not supported by the CUDA 13 libraries of the latest versions; on them, use pip install 'onnxruntime-gpu[cuda,cudnn]==1.22.0' 'nvidia-cudnn-cu12==9.5.1.17'.

Quick start

mcap_anonymize run input.mcap output.mcap --detections detections.json
mcap_anonymize run my_rosbag2_dir/ my_rosbag2_dir_anonymized/   # all the .mcap files of a bag

With ROS 2, use ros2 run mcap_anonymizer mcap_anonymize instead of mcap_anonymize.

All the image topics are processed. The tool prints how many images of each topic were anonymized, and detections.json keeps the detected faces.

```bash

1. Detect the faces (the slow part; see “Performance”)

mcap_anonymize detect input.mcap detections.json

File truncated at 100 lines see the full file