proper display transforms for Depth?


Jeremy Selan <jeremy...@...>
 

In Katana we have a few buttons in the monitor popup to control things like this:

- First, we have a post-displaytransform color-correction where the user can specify viewmin, viewmax, viewgamma.(think pixel inspection).  These default to 0.0, 1.0, 1.0.  (code below)

- Then we have a 'calc z' button, which when pressed analyzes the image using "depth appropriate" settings.
(compute min,max but discarding all values < 1e-3, all value > something big, nans, and inf)
map the mindepth to 1.0, the maxdepth to 0.0 (mimics how prman's 'sho' displays depth files.)
It also should switch the input color space to data.

- There's also the 'calc' button, which does the same thing but doesnt discard negatives/zero values, and then maps min to black, and max to white.

-- Jeremy






        group = OCIO.GroupTransform()
       
        # First do a fit
        # catch any components where min == max
        newmin = [(i,0.0)[bool(i==j)] for i,j in zip(self.__viewMin, self.__viewMax)]
        newmax = [(j,1.0)[bool(i==j)] for i,j in zip(self.__viewMin, self.__viewMax)]
        mtx, offset = OCIO.MatrixTransform.Identity()
        mtx, offset = OCIO.MatrixTransform.Fit(newmin, newmax,
                                               (0.0,0.0,0.0,0.0), (1.0,1.0,1.0,1.0))
        transform = OCIO.MatrixTransform()
        transform.setValue(mtx, offset)
        group.push_back(transform)
       
        # Second, add the exponent
        transform = OCIO.ExponentTransform()
        transform.setValue([1.0 / max(1e-6, v) for v in self.__viewGamma])
        group.push_back(transform)
       
        self.__displayTransform.setDisplayCC(group)







On Tue, Mar 13, 2012 at 8:58 AM, Paul Miller <pa...@...> wrote:
On 3/13/2012 10:47 AM, dbr/Ben wrote:
Not sure I understand the question, but... The usual gain/gamma controls are useful on data, e.g for multiplying down distance-from-camera-in-world-units passes into some visible 0-1ish range

Makes sense. It seems I should have a separate set of slider values for depth gain/gamma. In my case, I'm creating a depth map, and I don't want the gain/gamma to throw off the perceived range of generated values.