Depthmap from laser scanner - 24 bits depth

  • Hello Klaus, thank you for the Krpano program. This message will be a little bit longer


    I made a program to generate an image depthmap the from laser scanner 32 bits float depthmap. The 8 bits depth limit is a big problem. Please see the images bellow.


    I understood that krpano generates a 24 bits depthmap internally from stl. Could Krpano read the depthmap from a 24 bits RGB PNG as a 24 bits depthmap?


    https://krpano.com/forum/wbb/inde…79766#post79766
    I generated PNG depthmap using the RGB to code a 24 bits integer representing 16,777,216 units of depth. BLUE store the most significant byte and RED the less significant.

    Could you consider making krpano able to read depthmaps from a color PNG file generated like this?

    The files I generated can be download from here. Please let me know if you want more examples or the files generated in other way.


    Bellow some images to illustrate the problems with 8 bits depthmaps. I did not yet upgrade my brand free license to the new version ...

    In this scene, the maximum distance is around 29 m, when mapped to only 256 values allowed by 8 bits it, one unit is ~ 0.1133 m this results in strange artifacts as showed:

    Limiting the max distance to 7.00 m makes one unit ~ 0.027 m. The artifacts are reduced but not eliminated and this introduces errors beyond 7.00 meters.

    After 7 m it becomes like a sphere

    Above, we can see the borders distorted as a sphere. Bellow, the full 29m range, but with larger artifacts

    The pano are:

    And an PNG BW 16 bits gray

  • it is documented that 16/24/32 bit images are not supported (it is a browser limitation)
    https://krpano.com/docu/xml/#depthmap

    maybe you can play with depthmap.subdiv to see if you can improve results

    but... for a room like that and in general it is better to use a 3dmodel/stl than a depthmap.
    rendermode=3dmodel needs less memory and does not give you these jagged edges.

  • Hi,

    Zitat

    Could Krpano read the depthmap from a 24 bits RGB PNG as a 24 bits depthmap?


    Support for such RGB-encoded images could be added (no big thing), but the big problem with these images is that are becoming huge - specially the less significant bits/bytes (in your case the red channel) looks like noise and therefore can be hardy any compressed.

    Your p1-018-4096_24bits__depthmap.png file is already more than 10mb large and that size will be noticeable when loading it...

    Can you change your blue and red channels in the PNG?
    Internally in krpano I'm storing the 24bit depthmap RGB images in a different order - RED = most significant byte and BLUE = less significant.
    Then adding support for these images should be simple and wouldn't need extra shaders.

    Beside of that - as indexofrefraction already wrote, trying to generate a 3d model might be the better and more efficient solution.

    Best regards,
    Klaus

  • Internally in krpano I'm storing the 24bit depthmap RGB images in a different order - RED = most significant byte and BLUE = less significant.

    Klaus, thank you for your response! I have generated new files with RED = most significant byte and BLUE = less significant, 1024 width. Please see BGR_depthmaps folder.

    I know a model can bring better results. A day of scanner work can generate more than 100 scenes. With 24bit depthmap RGB images I can generate it automatically.

    I will make a version to generate only 16 bits ( Green and Blue, 65,536 depth units ) depthmaps to see if it could bring good results and better performance.

    Please, let me know if you want more info or samples

    Thank you

    Roberto

  • Hello,
    With a 16bit greyscale depthmap PNG, I would like to generate a 'hacked' RGB24 PNG that holds the full 16 bits in the R and B channels as described in the latest depthmap documentation (if I read it correctly). I believe I 'see' the idea well enough.

    Is there a tool that people are using to move the bytes to their proper place (e.g. image magick or ?) for this full 16 bit greyscale depthmap in an rgb24 PNG format?

    (perhaps there is a very obvious/simple trick I haven't learned with the krpano tools yet?)

    thanks in advance for any tips/tricks,
    --ms

  • Hi,

    Zitat

    From 16 bit greyscale to krpano 24 bit RGB depthmap


    With ImageMagick (Q16) this is possible this way:

    Code
    convert depthmap_gray16bit.png -channel red -fx '(int(u*65535)>>8)/255.0' -channel green -fx '(int(u*65535)&255)/255.0' -channel blue -fx '0' depthmap_rg16bit_encoded.png

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!