Cropping a .pic file

Hi,

I am wondering if there is a way to crop a .pic file generated using
rpict ? I would like to crop the .pic file so that it corresponds to
images with a 60 and 120 degree cone of vision to in order to
calculate luminance ratios for the task and surround area,
respectively. In other words, I was just thinking of cropping the 180
degree fisheye view to two smaller circles.

Thanks,

Krystyna

Hi Krystyna,

Can you share a few more details? What were the exact view parameters you gave to rpict, and do you need to compute circular area averages or would rectangular areas work?

This can probably be done with pcomb without needing to crop the images, but some math is required.

-Greg

···

From: Krystyna Zelenay <[email protected]>
Date: June 17, 2011 3:02:45 PM PDT

Hi,

I am wondering if there is a way to crop a .pic file generated using
rpict ? I would like to crop the .pic file so that it corresponds to
images with a 60 and 120 degree cone of vision to in order to
calculate luminance ratios for the task and surround area,
respectively. In other words, I was just thinking of cropping the 180
degree fisheye view to two smaller circles.

Thanks,

Krystyna

Hi Greg,

I am using DIVA for Rhino to do the renderings. It looks like the
rpict view parameters used in DIVA are the following:
-vta -vp 1275.98 31.928 229.686 -vd -17.783 -2.785 0 -vu 0 0 1 -vh 180
-vv 180 -vo 0 -va 0 -vs 0 -vl 0

DIVA outputs a pic file with a 180 degree fisheye view and I was
hoping that I could mask all but a 60 and 120 degree cone of vision
within the image so that I can calculate maximum and minimum pixel
values within these smaller views. Rectangular areas for calculating
averages would work.

Thank you,

Krystyna

···

On Fri, Jun 17, 2011 at 3:43 PM, Greg Ward <[email protected]> wrote:

Hi Krystyna,

Can you share a few more details? What were the exact view parameters you gave to rpict, and do you need to compute circular area averages or would rectangular areas work?

This can probably be done with pcomb without needing to crop the images, but some math is required.

-Greg

From: Krystyna Zelenay <[email protected]>
Date: June 17, 2011 3:02:45 PM PDT

Hi,

I am wondering if there is a way to crop a .pic file generated using
rpict ? I would like to crop the .pic file so that it corresponds to
images with a 60 and 120 degree cone of vision to in order to
calculate luminance ratios for the task and surround area,
respectively. In other words, I was just thinking of cropping the 180
degree fisheye view to two smaller circles.

Thanks,

Krystyna

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

Thanks, Krystyna -- this is helpful.

There are a few ways you could do this. The easiest might be to use pinterp to convert the view angles and average over rectangles, but the more accurate way if you really want a cone angle is with pcomb, like so:

angle = 60
pcomb -e "fang:$angle/180" -e 'xc:xmax/2;yc:ymax/2' -e 'r2=((x-xc)*(x-xc)+(y-yc)*(y-yc))/(xc*yc)' \
  -e 'lo=if(r2-fang*fang,0,WE/(PI*fang*xc*fang*yc)*li(1))' -o render.hdr \
  > pvalue -h -H -pG -df | total -if

Then repeat with angle=120. This command only works for angular fisheye images with 180 degrees in each dimension and square pixels (-vta -vh 180 -vv 180 -pa 1) which is what you have. (The -pa 1 option is defaulted.)

The reported result will be in averaged cd/m^2 (nits). If you want radiance units (watts/m^2) instead, take off the WE constant (=179) and substitute 1.0 in the final -e option to pcomb.

The command works by setting all pixels outside the desired cone to 0, and scaling the rest by one over the number of pixels inside the target radius. The picture is converted to IEEE floats by pvalue and summed up by the total utility.

I did a quick test and it seems to work OK.

Best,
-Greg

···

From: Krystyna Zelenay <[email protected]>
Date: June 19, 2011 9:41:51 PM PDT

Hi Greg,

I am using DIVA for Rhino to do the renderings. It looks like the
rpict view parameters used in DIVA are the following:
-vta -vp 1275.98 31.928 229.686 -vd -17.783 -2.785 0 -vu 0 0 1 -vh 180
-vv 180 -vo 0 -va 0 -vs 0 -vl 0

DIVA outputs a pic file with a 180 degree fisheye view and I was
hoping that I could mask all but a 60 and 120 degree cone of vision
within the image so that I can calculate maximum and minimum pixel
values within these smaller views. Rectangular areas for calculating
averages would work.

Thank you,

Krystyna

Hi Greg,

Thank you for your feedback. I will try this out.

I also found this document which may provide an alternative method to
creating a mask:
http://www.radiance-online.org/radiance-workshop8/Presentations/wienhold_rad_ws_2009_evalglare_intro.pdf

Krystyna

···

On Sun, Jun 19, 2011 at 10:17 PM, Greg Ward <[email protected]> wrote:

Thanks, Krystyna -- this is helpful.

There are a few ways you could do this. The easiest might be to use pinterp to convert the view angles and average over rectangles, but the more accurate way if you really want a cone angle is with pcomb, like so:

angle = 60
pcomb -e "fang:$angle/180" -e 'xc:xmax/2;yc:ymax/2' -e 'r2=((x-xc)*(x-xc)+(y-yc)*(y-yc))/(xc*yc)' \
-e 'lo=if(r2-fang*fang,0,WE/(PI*fang*xc*fang*yc)*li(1))' -o render.hdr \
> pvalue -h -H -pG -df | total -if

Then repeat with angle=120. This command only works for angular fisheye images with 180 degrees in each dimension and square pixels (-vta -vh 180 -vv 180 -pa 1) which is what you have. (The -pa 1 option is defaulted.)

The reported result will be in averaged cd/m^2 (nits). If you want radiance units (watts/m^2) instead, take off the WE constant (=179) and substitute 1.0 in the final -e option to pcomb.

The command works by setting all pixels outside the desired cone to 0, and scaling the rest by one over the number of pixels inside the target radius. The picture is converted to IEEE floats by pvalue and summed up by the total utility.

I did a quick test and it seems to work OK.

Best,
-Greg

From: Krystyna Zelenay <[email protected]>
Date: June 19, 2011 9:41:51 PM PDT

Hi Greg,

I am using DIVA for Rhino to do the renderings. It looks like the
rpict view parameters used in DIVA are the following:
-vta -vp 1275.98 31.928 229.686 -vd -17.783 -2.785 0 -vu 0 0 1 -vh 180
-vv 180 -vo 0 -va 0 -vs 0 -vl 0

DIVA outputs a pic file with a 180 degree fisheye view and I was
hoping that I could mask all but a 60 and 120 degree cone of vision
within the image so that I can calculate maximum and minimum pixel
values within these smaller views. Rectangular areas for calculating
averages would work.

Thank you,

Krystyna

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