VCL3D / DeepPanoramaLighting

Deep Lighting Environment Map Estimation from Spherical Panoramas (CVPRW20)
https://vcl3d.github.io/DeepPanoramaLighting/
67 stars 12 forks source link

How to get spherical harmonics Coeeficients by sh_functions.py #5

Closed jxl0131 closed 1 year ago

jxl0131 commented 1 year ago

Hi !

I am trying to find codes to help me compute spherical harmonics Coeeficients from hdr panorama images(such as panoramas from LavalInDoor datasets). I have read your paper and code, and i think the function "getCoeeficientsMatrix(...)" in sh_functions.py can help me, but i haven't found how to set the image as a input in this function. Can you tell me how to use sh_functions.py to compute spherical harmonics Coeeficients? Or if sh_functions.py couldn't do this, can anyone tell my which code can do this?

Thanks!

VasilisGks commented 1 year ago

Hi @jxl0131. getCoefficientsMatrix computes the SH basis matrix. In order to get the coefficients for your signal, you have to project it into SH basis. You can use this function: https://github.com/chalmersgit/SphericalHarmonics/blob/cee7e6ea6bcf385202587ebeea0ee42d482ba295/sphericalHarmonics.py#L144.