How to save real depth of image.

15 views
Skip to first unread message

John Sarcovich

unread,
Apr 24, 2024, 7:08:18 AM4/24/24
to scalismo-faces
Hello. First of all thanks for your work! It really awesome.

I want to save depth maps in m or mm.

I tried to check were to do this, I found some code that normalizes outputs for depth in ModalityRendererRGBA.scala:

    //visualization
    val values  = depthMap.values.toIndexedSeq.flatten
    val ma = values.max
    val mi = values.min
    val mami = ma-mi
    depthMap.map{d=>
      if(d.isEmpty)
        RGBA(0.0)
      else {
        RGBA(1.0 - (d.get - mi)/mami)
      }
    }
  }
}

There is normalization on values, I thought that ma and mi are values in m or mm but I printed them and discovered that they are may be normalized too because they are in range of 0.2 - 0.9. 

Can you point me how to get the real range of depth and how to save depth in uint16 not uint8 because there would be a great loss of quality of depth.


Reply all
Reply to author
Forward
0 new messages