Hacker News new | ask | show | jobs
by glkindlmann 10 days ago
This is like a 1D version of what a scientific computing person might describe as the distinction between node-centered ("standard" or "mid-tread" in this post) vs cell-centered ("alternative", "mid-riser") samples: do consider values to be at the middles of bins (or middles of triangles, or middle of tetrahedra), or the boundaries between intervals (or vertices of triangles, or of tets).

In a scientific computing setting it would be insane to start doing data processing without knowing how to interpret the values. In the context of audio signal processing, if you just get a stream of integers, you'd have to know the representational intent of those integers (mu-law encoding or linear?) if you're going to compute anything about the underlying signal. The meta-data accompanying the values would hopefully provide the answer.

But with 8-bit pixel values, absent any meta-data from a competent file format that can communicate the representational intent, we're adrift and there's no right answer (like the author says). Certainly no one can fault you for picking whichever one seems to be give better results for your application, but you can raise awareness that bits without context have had their meaning undermined.

2 comments

Your comment remembered me of ESA normalization value for the Sentinel-2 level-2 satellite image quantization.

Something like this:

Digital Number DN=0 remains the “NO_DATA” value

For a given DN in [1; 1;215-1], the L2A SR reflectance value will be:

L2A_SRi = (L2A_DNi + BOA_ADD_OFFSETi) / QUANTIFICATION_VALUE

https://sentiwiki.copernicus.eu/web/s2-products

In 8-bit (per channel) color there is a standard for when the context is unspecified: sRGB. It was developed to match the characteristics of a "typical" display at the time of its creation. It won't be 100% accurate, but it represents the best you can assume. You're not forced to throw up your hands and give up.
I see that https://en.wikipedia.org/wiki/SRGB#Translation_to_integers implies what I would call node-centered sampling ("standard" or "mid-tread" in the post), but are you aware of sRGB documentation that precisely specifies the quantization semantics?

Most of what I've read about sRGB focuses on the semantics of continuous (floating-point) R,G,B channels.