voelin-media: say how the background mask is really sampled
The segment docs promised a bilinear, feathered mask; the frame path samples the nearest mask pixel and relies on the mask's own soft edge. Say so, here and in docs/studio.md, rather than promise a smoothing that is not there: a model's sharper mask will want it, and that is the place to add it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c41624e82d
commit
979fdced2c
2 files changed
+6
-4
No files matched your search
@@ -4,8 +4,9 @@
|
||||
//! is — on a thread of its own and at a lower rate than the video, because
|
||||
//! segmentation costs far more than a frame does and a mask is still good
|
||||
//! enough a few frames later. The frame path takes the newest mask through a
|
||||
//! latest-wins handoff, upsamples and feathers it, and mixes the person over a
|
||||
//! background it makes with [`blur_rgba`], an image or a colour.
|
||||
//! latest-wins handoff, samples it up to the frame (nearest: the mask's own
|
||||
//! soft edge is the feathering) and mixes the person over a background it
|
||||
//! makes with [`blur_rgba`], an image or a colour.
|
||||
//!
|
||||
//! The blur is a three-pass box blur (which approximates a Gaussian closely
|
||||
//! enough that nobody sees the difference at these radii), separable and with
|
||||
@@ -75,7 +76,7 @@ impl Mask {
|
||||
self.data.resize(width as usize * height as usize, 0);
|
||||
}
|
||||
|
||||
/// The mask value at a point of a `width` x `height` frame, bilinear.
|
||||
/// The mask value at a point of a `width` x `height` frame (nearest).
|
||||
fn sample(&self, x: u32, y: u32, width: u32, height: u32) -> u8 {
|
||||
let fx = (u64::from(x) * u64::from(self.width) / u64::from(width.max(1))) as u32;
|
||||
let fy = (u64::from(y) * u64::from(self.height) / u64::from(height.max(1))) as u32;
|
||||
|
||||
Reference in new issue
Block a user