Commit fb173c35 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Update MASA diff tool to use 0...1 range for spatial direction difference reporting.

parent 5d7a06a6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
# MASA-diff-tool

Version: 0.2.2
Version: 0.3.0

## Usage

@@ -20,8 +20,8 @@ compared metadata files are identical. The summary contains:
- Status for descriptive metadata difference
- Overall status for spatial metadata difference
- Across all frames max ABS and mean difference values for spatial metadata
  - Overall max ABS diff in spatial direction (degrees)
  - Overall mean ABS diff in spatial direction (degrees)
  - Overall max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°)
  - Overall mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°)
  - Overall max ABS diff in direct-to-total ratio
  - Overall mean ABS diff in direct-to-total ratio
  - Overall max ABS diff in diffuse-to-total ratio
@@ -47,8 +47,8 @@ When option `--csv` is given, then a frame-by-frame results is constructed in co
- Frame index
- Diff in descriptive metadata
- Diff in number of directions
- Max ABS diff: Direction (degrees spatial angle)
- Mean ABS diff: Direction (degrees spatial angle)
- Max ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)
- Mean ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)
- Max ABS diff: Direct-to-total ratio
- Mean ABS diff: Direct-to-total ratio
- Max ABS diff: Diffuse-to-total ratio
+30 −30
Original line number Diff line number Diff line
@@ -518,8 +518,8 @@ static int compareMasaFrameSpatialMeta( MasaDiffToolState *state, const int isDi
        if ( state->reportFilePtr != NULL )
        {
            fprintf( state->reportFilePtr, "Difference in spatial metadata\n" );
            fprintf( state->reportFilePtr, "Max ABS diff in spatial direction (degrees): %f\n", maxAbsDiffDirection );
            fprintf( state->reportFilePtr, "Mean ABS diff in spatial direction (degrees): %f\n", meanAbsDiffDirection );
            fprintf( state->reportFilePtr, "Max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %f\n", maxAbsDiffDirection / 180.0f );
            fprintf( state->reportFilePtr, "Mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %f\n", meanAbsDiffDirection / 180.0f );
            fprintf( state->reportFilePtr, "Max ABS diff in direct-to-total ratio: %f\n", maxAbsDiffDirRatio );
            fprintf( state->reportFilePtr, "Mean ABS diff in direct-to-total ratio: %f\n", meanAbsDiffDirRatio );
            fprintf( state->reportFilePtr, "Max ABS diff in diffuse-to-total ratio: %f\n", maxAbsDiffDiffRatio );
@@ -546,8 +546,8 @@ static int compareMasaFrameSpatialMeta( MasaDiffToolState *state, const int isDi
                      state->frame,
                      isDiff_frame_descriptiveMeta,
                      0, // Always identical in this function
                      maxAbsDiffDirection,
                      meanAbsDiffDirection,
                      maxAbsDiffDirection / 180.0f,
                      meanAbsDiffDirection / 180.0f,
                      maxAbsDiffDirRatio,
                      meanAbsDiffDirRatio,
                      maxAbsDiffDiffRatio,
@@ -704,9 +704,9 @@ static void writeCsvHeader( FILE *csvFilePtr )
    fprintf( csvFilePtr, "," );
    fprintf( csvFilePtr, "Diff in number of directions" );
    fprintf( csvFilePtr, "," );
    fprintf( csvFilePtr, "Max ABS diff: Direction (degrees spatial angle)" );
    fprintf( csvFilePtr, "Max ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)" );
    fprintf( csvFilePtr, "," );
    fprintf( csvFilePtr, "Mean ABS diff: Direction (degrees spatial angle)" );
    fprintf( csvFilePtr, "Mean ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)" );
    fprintf( csvFilePtr, "," );
    fprintf( csvFilePtr, "Max ABS diff: Direct-to-total ratio" );
    fprintf( csvFilePtr, "," );
@@ -805,8 +805,8 @@ static void printSummary( const MasaDiffToolState *state )
    if ( state->isDiff_overall_spatialMeta )
    {
        fprintf( stdout, "Spatial metadata is different.\n" );
        fprintf( stdout, "Overall max ABS diff in spatial direction (degrees): %3.2f\n", state->maxAbsDiffDirection_overall );
        fprintf( stdout, "Overall mean ABS diff in spatial direction (degrees): %3.2f\n", state->sumAbsDiffDirection / (float) state->sumAbsDiffDirectionValueCount );
        fprintf( stdout, "Overall max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %3.2f\n", state->maxAbsDiffDirection_overall / 180.0f );
        fprintf( stdout, "Overall mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %3.2f\n", ( state->sumAbsDiffDirection / (float) state->sumAbsDiffDirectionValueCount ) / 180.0f );
        fprintf( stdout, "Overall max ABS diff in direct-to-total ratio: %1.4f\n", state->maxAbsDiffDirRatio_overall );
        fprintf( stdout, "Overall mean ABS diff in direct-to-total ratio: %1.4f\n", state->sumAbsDiffDirRatio / (float) state->sumAbsDiffDirRatioValueCount );
        fprintf( stdout, "Overall max ABS diff in diffuse-to-total ratio: %1.4f\n", state->maxAbsDiffDiffRatio_overall );