0

Normalize a floating point image automatically

Hello:

  I have frames that can have values from 0-MAXFLOATVALUE (roughly 0-4,000,000,000).  Is there a way for rv to normalize this frame back to 0-1 so it can be visualized?  I would like for it to happen without any interaction from the user and the normalization could change per frame as well.  Thanks!

 

Jake

8 comments

  • 0
    Avatar
    Jon Morley

    Hi Jake,

    Here is the section in our docs about setting the exposure (you can also use "-exposure <value>" on the command line):

    http://tweaksoftware.com/static/documentation/rv/current/html/rv_reference.html#Chapter_2_Image_Processing_Graph_Addressing_Properties

    And here is the section about how that value is applied:

    https://support.shotgunsoftware.com/entries/99067977-Stereo-Per-Shot-Convergence

    Please let me know if that will work for you.

    Thanks,
    Jon

  • 0
    Avatar
    Jake Richards

    Jon:

      I was hoping for something a bit more dynamic/automatic than having to set the value manually.  I did follow your link and did see this very promising attribute on the RVColor node:

    color.normalize
    int
    1
    Non-0 means to normalize the incoming pixels to [0,1]

    However, when I set that attribute, nothing appears to happen to my image.  I'm simply putting this command in a small python script with a hotkey:

    setIntProperty("#RVColor.color.normalize", [1], True)

    Am I understanding the normalize attribute correctly?  As in, I have a depth image that has values from 10-1000, it'll remap the colors so that 10 is 0 and 1000 is 1 so it's viewable?

    Thanks!

    Jake

  • 0
    Avatar
    Jon Morley

    Hi Jake,

    Sorry for any confusion there. That property should be removed. It is no longer connected to anything. The earlier approach I described is all we have out of the box.

    Thanks,
    Jon

  • 0
    Avatar
    Jake Richards

    Ah, ok, thanks for the clarification.  Do you think it'd be possible with a glsl node?  The math is pretty basic per pixel but the part I'm having difficulty with is getting the Max/Min values for the entire image.

     

    Thanks!

  • 0
    Avatar
    Jon Morley

    Hi Jake,

    I was reading about alternate solutions right when you replied. The problem with the old solution that you uncovered the property for is that the piece of code that was setting the min and max values is gone.

    You can pursue making a custom GLSL node for RV, but you will still need to know the min/max ahead of time right? I mean because the GLSL operation will happen per frame, but you want to normalize across your entire image sequence right?

    Thanks,
    Jon

  • 0
    Avatar
    Jon Morley

    Hi Jake,

    So you are fully up-to-date. We have a new solution designed, but our personnel shifted and we have had to work on other tasks for the time being. This is on our list of features to restore, but it isn't clear when that will happen at the moment.

    Thanks,
    Jon

  • 0
    Avatar
    Jake Richards

    For now it would only be a per frame Min/Max and not for the whole sequence.  It mainly just to visualize the depth.  We also have other frames like heat maps that go beyond 1 that we'd like to normalize as well and that could be per frame (which part of the frame took longest to render)

     

    Thanks again!

    jake

  • 0
    Avatar
    Jon Morley

    Hi Jake,

    I see. Well I don't know much GLSL myself, but if you know how to achieve that in GLSL I can help you make a custom GLSL node for RV. You can read about it for starters here:

    http://tweaksoftware.com/static/documentation/rv/current/html/rv_reference.html#Chapter_3_Writing_a_Custom_GLSL_Node

    Thanks,Jon

Please sign in to leave a comment.