Skip to main content

ZensimResult

Struct ZensimResult 

Source
pub struct ZensimResult { /* private fields */ }
Expand description

Result from a zensim comparison.

Contains the final score, the raw distance used to derive it, and the full per-scale feature vector (useful for diagnostics or weight training).

Implementations§

Source§

impl ZensimResult

Source

pub fn nan() -> Self

Create a NaN sentinel result (for error/placeholder paths).

Source

pub fn score(&self) -> f64

Quality score on a 0–100 scale. 100 = identical, 0 = maximally different. Derived from raw_distance via a power-law mapping.

Source

pub fn raw_distance(&self) -> f64

Raw weighted feature distance before nonlinear mapping. Lower = more similar. Not bounded to a fixed range; depends on image content and weights.

Source

pub fn features(&self) -> &[f64]

Per-scale raw features as a slice.

Layout: 4 scales × 3 channels (X, Y, B) × 19 features per channel = 228. See FeatureView for named access.

Source

pub fn into_features(self) -> Vec<f64>

Consume the result and return the owned feature vector.

Source

pub fn profile(&self) -> ZensimProfile

Which profile produced this score.

Source

pub fn mean_offset(&self) -> [f64; 3]

Per-channel XYB mean offset: mean(src_xyb[c]) - mean(dst_xyb[c]).

Captures global color/luminance shifts (CMS errors, white balance changes). Channels: [X, Y, B], signed. Positive = distorted is darker/less saturated.

Source

pub fn dissimilarity(&self) -> f64

Convert the score to a dissimilarity value.

Dissimilarity is (100 - score) / 100: 0 = identical, higher = worse. This is the inverse of the 0–100 score scale, normalized to 0–1.

See also score_to_dissimilarity for the standalone conversion.

Source

pub fn approx_ssim2(&self) -> f64

Approximate SSIMULACRA2 score from the raw distance.

Direct power-law fit: 100 - 19.04 × d^0.598, calibrated on 344k synthetic pairs. MAE: 4.4 SSIM2 points, Pearson r = 0.974.

More accurate than mapping::zensim_to_ssim2(score) (MAE 4.9, r = 0.932) because it skips the intermediate score mapping.

Source

pub fn approx_dssim(&self) -> f64

Approximate DSSIM value from the raw distance.

Direct power-law fit: 0.000922 × d^1.224, calibrated on 344k synthetic pairs. MAE: 0.00129, Pearson r = 0.952.

Significantly more accurate than mapping::zensim_to_dssim(score) (MAE 0.00213, r = 0.719) because DSSIM’s natural exponent (1.22) differs from the score mapping exponent (0.70).

Source

pub fn approx_butteraugli(&self) -> f64

Approximate butteraugli distance from the raw distance.

Direct power-law fit: 2.365 × d^0.613, calibrated on 344k synthetic pairs. MAE: 1.65 distance units, Pearson r = 0.713.

Butteraugli’s weak correlation with our features (r = 0.71) limits approximation accuracy regardless of mapping choice.

Trait Implementations§

Source§

impl Clone for ZensimResult

Source§

fn clone(&self) -> ZensimResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ZensimResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.