You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

robjlg

Beginner

  • "robjlg" started this thread

Posts: 11

Location: Brazil

  • Send private message

1

Friday, June 19th 2020, 12:08am

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/index.php?p…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


2

Friday, June 19th 2020, 8:46am

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.

This post has been edited 1 times, last edit by "indexofrefraction" (Jun 19th 2020, 9:07am)


3

Friday, June 19th 2020, 9:08am

Hi,

Quoted

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

robjlg

Beginner

  • "robjlg" started this thread

Posts: 11

Location: Brazil

  • Send private message

4

Friday, June 19th 2020, 3:13pm

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

robjlg

Beginner

  • "robjlg" started this thread

Posts: 11

Location: Brazil

  • Send private message

5

Friday, June 19th 2020, 4:02pm

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.

Files with 16 bits, are on the BGR_depthmaps folder.

6

Monday, June 22nd 2020, 11:15am

Hi,

a quick update - the 24bit (and even just the 16bit) depthmap images work very well, much more accuracy.

Support for these images will be there in the next release (1.20.8).

Best regards,
Klaus

robjlg

Beginner

  • "robjlg" started this thread

Posts: 11

Location: Brazil

  • Send private message

7

Monday, June 22nd 2020, 3:16pm

Hi,

a quick update - the 24bit (and even just the 16bit) depthmap images work very well, much more accuracy.

Support for these images will be there in the next release (1.20.8).

Best regards,
Klaus
Very good news, thank you Klaus!

Roberto

8

Monday, June 22nd 2020, 5:05pm

it would be very interesting to see an example, when 1.20.8 is finished !

9

Tuesday, September 15th 2020, 5:18pm

Hi,

support for 16- or 24-bit depthmap-images is here:
krpano 1.20.8 - Textured 3D Models as Depthmap

and here an example:
https://krpano.com/examples/#depthmap-24bit-encoding

Best regards,
Klaus