kornia/kornia-rs

[Feature]: add resize_fast_uyvy for packed YUV 4:2:2 images

Open

#910 opened on May 20, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (188 forks)auto 404
enhancementhelp wantedtriage

Repository metrics

Stars
 (675 stars)
PR merge metrics
 (PR metrics pending)

Description

🚀 Feature Description

Add a resize_fast_uyvy function to kornia-imgproc that resizes images in UYVY packed 4:2:2 format directly, without requiring an intermediate conversion to RGB.

📂 Feature Category

Image Processing

💡 Motivation

Camera capture pipelines commonly produce frames in UYVY 4:2:2 format. Currently, resizing a UYVY frame requires first converting to RGB, which allocates an intermediate buffer and performs a full colour space conversion before the resize. This is wasteful when the resized output will be consumed as a tensor. A native UYVY resize avoids this unnecessary allocation and conversion.

💭 Proposed Solution

Add a resize_fast_uyvy function following the same pattern as the existing resize_fast_rgb and resize_fast_mono functions:

📚 Library Reference

UYVY/YUV 4:2:2 format is a well established standard, documented by V4L2: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-packed-yuv.html The implementation reuses existing internal kernels already present in kornia-imgproc: bilinear::resize_bilinear_u8_nch, nearest::resize_nearest_u8, and separable::resize_separable_u8

🔄 Alternatives Considered

Converting UYVY to RGB first and then resizing using the existing resize_fast_rgb — this works but allocates an unnecessary intermediate buffer and performs a redundant colour space conversion.

🎯 Use Cases

Camera pipelines that capture in UYVY and need to resize frames before ML inference, avoiding an RGB intermediate Any application working with V4L2 camera output that needs efficient resizing without a colour space round-trip

📝 Additional Context

No response

🤝 Contribution Intent

  • I plan to submit a PR to implement this feature
  • I'm requesting this feature but not planning to implement it

Contributor guide