EVALGLARE(1)

NAME
evalglare (version v2.05) - determines and evaluates glare sources within a 180 degree fisheye HDR image

SYNOPSIS
evalglare [ -s ] [ -y ] [ -Y value ] [ -A maskfile ][ -B angle ] [ -b factor ] [ -c checkfile ] [ -f ] [ -t xpos ypos angle ] [ -T xpos ypos angle ] [ -d ] [ -r angle ] [ -i Ev ] [ -I Ev yfill_max y_fill_min ] [ -v ] [ -V ] [ -g type ] [ -G type ] [-q mode ][ -u r g b ] [ -vf viewfile ] [ -vtt ] [ -vv vertangle ] [ -vh horzangle ] [hdrfile]

DESCRIPTION
Evalglare determines and evaluates glare sources within a 180 degree fisheye image, given in the RADIANCE image format (.pic or .hdr). If hdrfile is not given as an argument, the standard input is read. The image should be rendered as fisheye (e.g. using the -vta or -vth option) using 180 degrees for the horizontal and vertical view angle (-vv 180, -vh 180.) Due to runtime reasons of the evalglare code, the image should be smaller than 1500x1500 pixels. The recommended size is 1000x1000 pixels, the minimum recommended size is 800x800 pixels. In the first step, the program uses a given threshold to determine all glare sources. Three different threshold methods are implemented. The recommended method is to define a task area by -t or -T option. In this (task) area the average luminance is calculated. Each pixel, exceeding this value multiplied by the -b factor, default 5, is treated as a potential glare source. The other two methods are described below, see -b. In the second step the program tries to merge glare source pixels to one glare source, when they are placed nearby each other. This merging is performed between search areas, given by an opening angle -r, default 0.2 radians. If a check file is written -c fname, the detected glare sources will be colored to different colors where the rest of the image is set to gray. The luminance values of all pixels are kept to the initial value. The color is chosen by chance, no significance is given by the color. Using the option -u r g b applies a uniform coloring of the glare sources. Luminance peaks can be extracted to separate glare sources by using the -y or -Y value option (default since version v0.9c). The default value -y is 50000 cd/m2, which can be changed by using the -Y value option. A smoothing option, -s, counts initial non-glare source pixels to glare sources, when they are surrounded by a glare source.
The program calculates the daylight glare probability (DGP) as well as other glare indexes (DGI, DGI_MOD, UGR, UGR_EXP, VCP, CGI, UDP) to the standard output. The DGP describes the fraction of persons disturbed caused by glare from daylight as a number from 0 to 1, where 0 is no-one disturbed and 1 is everyone. Values lower than 0.2 are out of the range of the user assessment tests, where the program is based on and should be interpreted carefully. A low light correction is applied to the DGP when the vertical illumiance is lower than 500 lux. By the use of -g or -G the field of view is cut according the the definition of Guth. (***citation here) The option -B angle (in radians) calculates the average luminance of a horizontal band. In the case of non-180 degree images, an external measured illuminance value can be provided by using the -i or -I option. The use of the -I option enables the filling up of images, which are horizontally cut. The age correction is not supported any more and disabled.
A masking option -A enables the user to specify an area to be statistically analysed (e.g. the window). Masking is applied after glare source detecting, therefore it has no influence on most of the metrics. The maskfile must be of the same size than the evaluated image. The maskfile simply defines the area to be statistically evaluated in the evaluation image. All pixels larger than 0 in the masking pic define the masking area. For the masked area in the evaluation image, the average luminance, median luminance, 75% and 95% percentile luminance, the min and max luminance as well as the PSGV are calculated. The PSGV can be only used, when the masking area is a window and the camera viewing direction is facing perpendicular to the facade (restriction of PSGV). Masking requires the -d option and may not be combined with the zoning options -l or -L.
Circular zone evaluation can be activated by -l (one zone) or -L (two zones). If two zones are selected they share the same center. The center of the zone(s) can be specified by the x and y coordinates. The size of the zone(s) is specified by the opening angle(s) in radians. If glare sources crosses the border of a zone, then this glare source will be split up into two or three glare sources, so that no glare source is crossing the border of a zone any more. For each glare source the zonal location is given in the glare source section of the detailed output. Glare sources outside zone 1 or zone 2 are labelled as zone 0. For each zone following values are calculated: The average luminance, median luminance, 75% and 95% percentile luminance, the min and max luminance. Zoning requires the -d option.
The luminance distribution of a horizontal band can be analysed by the -B angle option. Within the angle the average lumianance, median luminance, 75% and 95% percentile luminance, the min and max luminance are calculated and printed. It requires the -d option. In case to be combined with -A or -L or -l, the band properties will be calculated first. The band-option has no influence on glare source detection, masking areas or zones.
If the option -d is used, all found glare sources and their position, size, luminance values, x,y and z-directions and zone belonging are printed to the standard output (first section), too. The last line gives following values (in brackets the column, 1st column is explaining text) : DGP (2), average luminance of image (3), vertical illuminance (4), background luminance (5), direct vertical illuminance (6), DGI (7), UGR (8), VCP (9), CGI (10), average luminance of all glare sources (11), sum of solid angles of glare sources (12), Veiling luminance (disability glare according Poynter)(13), Veiling luminance (sum of disability glare according Stiles-Holladay CIE) (14), DGR (15), UGP (16), UGR_EXP (17), DGI_MOD (18), average luminance weighted by position index (19), average luminance weighted by squared position index (20), median luminance of image (21), median of position index weighted luminance of image (22), median of squared position index weighted luminance of image (23)
The header of the image is checked for obvious mistakes (but not for all possible, the user should always check the image header in advance for validity!). Obvious mistakes are:
   -using a -vtv view AND having black corners. This happens, when a fish eye lens is used and the view type is not set correctly. Evalglare is stopping, except the forcing option -f is activated.
   -invalid exposure in the header. This might be caused by the use of pcomb or pcompos in advance. Evalglare is stopping in any case.
   -invalid view specified. This might be caused by the use of pcomb or pcompos in advance. Evalglare is stopping. View can be overwritten by giving view options to the command line (see below)
-A masking-file
    Use a masking file to enable statistical analysis on a certain area. Does not affect glare source detection. The masking threshold is 0.1 cd/m2 (all pixels exceeding 0.1 cd/m2 are treated as "inside" the mask.)
    It requires the -d option. The result of the analysis of the masking area is given in the first line of the output. Should not be combined with -l or -L options.
-B angle
       Calculate average luminance of a horizontal band. The angle is in radians. This calculation does not affect glare source detection. Output only when using the -d option.
       The result of the analysis of the band is given in the first line of the output.
-b factor
       Threshold factor; if factor is larger than 100, it is used as constant threshold in cd/m2, regardless if a task position is given or not. If factor is less or equal than 100 and a task position is given, this factor multiplied by the average task luminance will be used as threshold for detecting the glare sources. If factor is less than or equal to 100 and no task position is given, this factor multiplied by the average luminance in the entire picture will be used as threshold for detecting the glare sources (not recommended). Default value of factor is 2000 (fixed threshold method).
-c fname
       writes a checkfile in the RADIANCE picture format
-d enables detailed output (default: disabled)
-f forcing option to prevent from stopping when -vtv is used and black corners are detected (default: disabled)
-g type
       cut field of view according to Guth, write checkfile specified by -c and exit without any glare evaluation. Type 1: total field of view. Type 2: field of view seen by both eyes
-G type
       Cut the field of view according to Guth, perform glare evaluation. Type 1: total field of view. Type 2: field of view seen by both eyes
-i Ev The vertical illuminance Ev in lux is measured externally. This value will be used for calculating the DGP.
-I Ev y_max y_min
       The vertical illuminance Ev in lux is measured externally. This value will be used for calculating the DGP. Below y_min and above y_max, the picture is filled up by the last known value. This option should be used, when the provided picture is cut horizontally.
-l xpos ypos angle
       Activate circular one zone evaluation. The center of the zone is given by xpos and ypos. The opening angle of the zone is specified in radians.
       The result of the analysis of zone1 is given in the first line of the output.
-L xpos ypos angle1 angle2
       Activate circular two zone evaluation. The center of the zone is given by xpos and ypos. The opening angle of the inner zone1 is specified by angle1 in radians, the opening angle of the outer zone2 by angle2.
       The result of the analysis of the zones is given in the first two lines of the output.

-N xpos ypos angle Ev fname
       Pixel replacement in case of pixel overflow in hdr image and measured Ev (in lux) is available. Writes the modified image to fname and exists immediately (without glare evaluation).
       Replaces pixels in a circular zone to match Ev. The center of the zone is given by xpos and ypos. The opening angle of the zone is specified in radians.
       This option should be applied very carefully and only exceptionally. Pixel overflow should be avoided from the beginning by applying shorter exposure times and/or neutral filters.

-q mode toggle modes for the background luminance calculation: 0 (default): CIE-mode Lb=(Ev-Edir)/pi; 1: Lb= mathematical average luminance without glare sources; 2(not recommended): Lb=Ev/pi
-r angle
       search radius (angle in radians) between pixels, where evalglare tries to merge glare source pixels to the same glare source (default value: 0.2 radians)
-s enables smoothing function (default: disabled)
-t xpos ypos angle
       definition of task position in x and y coordinates, and its opening angle in radians
-T xpos ypos angle
       same as -t, except that the task area is colored bluish in the checkfile
-u r g b
       color glare sources unfiformly when writing check file (implies -c option). Color given in r g b. (in any range, values are normalized)
-v show version of evalglare and exit
-V calculate the vertical illuminance and exit
-x disable peak extraction
-y enables peak extraction (default: enabled)
-Y value
       enables peak extraction with value (in cd/m2) as threshold for extracted peaks
In case, the view settings within the image are missing or are not valid (e.g. after the use of pcompos or pcomb), the view options can be set by command line options. As soon as view options are set within the command line, view options within the image are ignored. The view options are implemented according to the RADIANCE definition (please read man page of rpict for details):
-vtt Set view type to t (for fisheye views, please use -vta or -vth preferably)
-vf viewfile
       Get view parameters from file
-vv val
       Set the view vertical size to val
-vh val
       Set the view horizontal size to val

AUTHOR
Jan Wienold.

SEE ALSO
The program is based on the studies by J. Christoffersen and J. Wienold (see "Evaluation methods and development of a new glare prediction model for daylight environments with the use of CCD cameras and RADIANCE," Energy and Buildings 38, 2006, pp. 743-757, doi:10.1016/j.enbuild.2006.03.017. More details can be also found in following dissertation: J. Wienold, Daylight glare in offices, Fraunhofer IRB, 2010, available online at <http://publica.fraunhofer.de/dokumente/N-141457.html>.

ACKNOWLEDGEMENTS
The evalglare program was originally developed by Jan Wienold at the Fraunhofer Institute for Solar Energy Systems in Freiburg, Germany. It is being further developed and maintained by the same author at EPFL, Lausanne, Switzerland.
The author would like to thank C. Reetz for his generous help and his support of providing libraries for the program. The EU Commission supported this work as part of the EU project "Energy and Comfort Control for Building management systems" (ECCO-Build, Contract ENK6-CT-2002-00656).
German Research Foundation (DFG) contract WI 1304/7-2 supported the research for the extension of evalglare for low light scenes.