vta 2 vth

Hi Greg (and everybody in the group),

I have used the formula Greg provided for a previous discussion (http://www.radiance-online.org/pipermail/radiance-general/2009-January/005644.html) to convert an angular projection to hemispherical fisheye projection.

I am getting bizarre results. So, just to see what is going on, I have generated an overcast sky with vta option (-vta -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0)

I have used your formula:

pcomb -e 'sq(x):x*x' \
   -e 'ar=190/2*PI/180*sqrt(sq(2/xmax*x-1)+sq(2/ymax*y-1))' \
  -e 'cf=WE*sq(190*PI/180*2/(xmax+ymax))*if(ar-PI/2,0,if(ar-.01,cos(ar) *sin(ar)/ar,1))' \
  -e 'lo=cf*li(1)' input.hdr > corrected.hdr

(I used 181 degrees instead of 190)

and I was hoping to have an image similar to what I would have generated using the vth option (-vth -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0).

After the correction, my luminance values dropped significantly (2500 cd/m2 dropped to 4.3). You can find the original and corrected images at: http://faculty.washington.edu/inanici/vta/

Any ideas why I am having difficulties with this? Thanks in advance...

Cheers,
Mehlika

Hi Mehlika,

what exactly do you want to achieve? The command you quoted from Greg's
mail does not change the projection (or view-type). It corrects for the
weigth of luminances according to their angle from the optical axis (or
the view-direction of the sensor) when contributing to the illuminance
of a point, which is also known as the cosine law. So you can expect a
fall-off. Do you want to change the projection of an existing image?

Lars.

Hi Lars,

Yes, I would like to change the projection of the existing image from an equi-angular to hemispherical fisheye, if that is doable. But my intention was similar to your motive. I have used hemisherical fisheye images in the past to calculate illuminance at the camera point (averaging luminance within the circular area and multiplying by pi). Since the physical fisheye lenses have equi-angular (or equi distant) projections (not cosine corrected hemispherical fisheye projections), I am trying to calculate illuminance from a HDR photograph taken with a fisheye lens.

Thanks,
Mehlika

Lars O. Grobe wrote:

···

Hi Mehlika,

what exactly do you want to achieve? The command you quoted from Greg's
mail does not change the projection (or view-type). It corrects for the
weigth of luminances according to their angle from the optical axis (or
the view-direction of the sensor) when contributing to the illuminance
of a point, which is also known as the cosine law. So you can expect a
fall-off. Do you want to change the projection of an existing image?

Lars.

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Mehlika,

I think the output of this command was originally intended for the "total" command to add up illuminance in lux. Thus, the pixel values get added up and divided by the total number of above-hemisphere pixels, which you don't want to do in this case. I guess what you're trying to do instead is reweight your pixels according to the cosine, but it doesn't really make sense to me. If you actually want to change the projection rather than creating a reweighted image, you should use pinterp, instead:

  pinterp -vf input.hdr -vth -x 1024 -y 1024 -ff input.hdr 1 > hemi.hdr

(Just saw Lars' response, which is along similar lines to this...)

If you still want to go ahead with the command, you can modify it thusly to get more what you say you're expecting:

pcomb -e 'sq(x):x*x' \
   -e 'ar=190/2*PI/180*sqrt(sq(2/xmax*x-1)+sq(2/ymax*y-1))' \
  -e 'cf=WE/le(1)*if(ar-PI/2,0,if(ar-.01,cos(ar) *sin(ar)/ar,1))' \
  -e 'lo=cf*li(1)' input.hdr > corrected.hdr

Best,
-Greg

···

From: Mehlika Inanici <[email protected]>
Date: February 18, 2009 10:32:07 AM PST

Hi Greg (and everybody in the group),

I have used the formula Greg provided for a previous discussion (http://www.radiance-online.org/pipermail/radiance-general/2009-January/005644.html) to convert an angular projection to hemispherical fisheye projection.

I am getting bizarre results. So, just to see what is going on, I have generated an overcast sky with vta option (-vta -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0)

I have used your formula:

pcomb -e 'sq(x):x*x' \
   -e 'ar=190/2*PI/180*sqrt(sq(2/xmax*x-1)+sq(2/ymax*y-1))' \
  -e 'cf=WE*sq(190*PI/180*2/(xmax+ymax))*if(ar-PI/2,0,if(ar-.01,cos(ar) *sin(ar)/ar,1))' \
  -e 'lo=cf*li(1)' input.hdr > corrected.hdr

(I used 181 degrees instead of 190)

and I was hoping to have an image similar to what I would have generated using the vth option (-vth -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0).

After the correction, my luminance values dropped significantly (2500 cd/m2 dropped to 4.3). You can find the original and corrected images at: http://faculty.washington.edu/inanici/vta/

Any ideas why I am having difficulties with this? Thanks in advance...

Cheers,
Mehlika

Thanks Gerg and Lars. pinterp seems to be the solution!

Cheers,
Mehlika

Greg Ward wrote:

···

Hi Mehlika,

I think the output of this command was originally intended for the "total" command to add up illuminance in lux. Thus, the pixel values get added up and divided by the total number of above-hemisphere pixels, which you don't want to do in this case. I guess what you're trying to do instead is reweight your pixels according to the cosine, but it doesn't really make sense to me. If you actually want to change the projection rather than creating a reweighted image, you should use pinterp, instead:

    pinterp -vf input.hdr -vth -x 1024 -y 1024 -ff input.hdr 1 > hemi.hdr

(Just saw Lars' response, which is along similar lines to this...)

If you still want to go ahead with the command, you can modify it thusly to get more what you say you're expecting:

pcomb -e 'sq(x):x*x' \
     -e 'ar=190/2*PI/180*sqrt(sq(2/xmax*x-1)+sq(2/ymax*y-1))' \
    -e 'cf=WE/le(1)*if(ar-PI/2,0,if(ar-.01,cos(ar) *sin(ar)/ar,1))' \
    -e 'lo=cf*li(1)' input.hdr > corrected.hdr

Best,
-Greg

From: Mehlika Inanici <[email protected]>
Date: February 18, 2009 10:32:07 AM PST

Hi Greg (and everybody in the group),

I have used the formula Greg provided for a previous discussion (http://www.radiance-online.org/pipermail/radiance-general/2009-January/005644.html) to convert an angular projection to hemispherical fisheye projection.

I am getting bizarre results. So, just to see what is going on, I have generated an overcast sky with vta option (-vta -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0)

I have used your formula:

pcomb -e 'sq(x):x*x' \
     -e 'ar=190/2*PI/180*sqrt(sq(2/xmax*x-1)+sq(2/ymax*y-1))' \
    -e 'cf=WE*sq(190*PI/180*2/(xmax+ymax))*if(ar-PI/2,0,if(ar-.01,cos(ar) *sin(ar)/ar,1))' \
    -e 'lo=cf*li(1)' input.hdr > corrected.hdr

(I used 181 degrees instead of 190)

and I was hoping to have an image similar to what I would have generated using the vth option (-vth -vp 1.000 1.000 0.000 -vd 0.000 0.000 1.000 -vu -1 0 0 -vh 180 -vv 180 -vs 0 -vl 0).

After the correction, my luminance values dropped significantly (2500 cd/m2 dropped to 4.3). You can find the original and corrected images at: http://faculty.washington.edu/inanici/vta/

Any ideas why I am having difficulties with this? Thanks in advance...

Cheers,
Mehlika

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general