Help for SHADY

 PURPOSE:

 shady is a VICAR applications program which introduces shading
 and contour lines on a picture.  Shading is created by computing
 the spatial derivative of the image in a specified direction.  
 Shading and contours may be suppressed, if desired.

 EXECUTION:

  	 shady  INP  OUT  user-parameters... 
 where
	INP is the input picture (byte format).
	OUT is the output picture (byte format).
 OPERATION:

 shady uses a simple-minded algorithm to introduce solar shading into
 an image. (Note:  A more general algorithm is available in the VICAR
 program shady2.) 

 The direction of the sun is specified by the SHADE parameter.
 Shading is introduced by computing the spatial derivative between
 neighboring pixels.  Consider a 3x3 pixel area of the input image,

			x3   x2   x1

			x4   x    x0

		        x5   x6   x7

 where x1,x2,x3,... are the pixels surrounding pixel x.  Let the direction
 of the sun be specified by the parameter SHADE=3.  If contour lines are
 suppressed, then the output pixel y (corresponding to input pixel x) is
 computed as follows:

		y = A*(x7 - x3) + B

 where A and B are specified by the SCALE parameter.

 Contour lines are generated by first dividing the DN scale
 into the R specified regions (see Figure 2).


        1        2        3       ...       R
   |________|________|________|________|________|
   0        L       L+I     L+2I    L+(R-2)I   255

                Figure 2
 DN values from 1 to L-1 are assigned to region 1, etc.
 Let M = (m  ) be a region picture, where m   is the region
           ij                              ij
 number associated with input picture element x  .  An element
                                               ij
 m    is considered a boundary point if 
  ij

         m    = m         or    m   = m
          ij     i,j-1           ij    i-1,j

 If m   is a boundary point, then element y   of the output is 
     ij                                    ij
 assigned a DN value of 255.
TIMING: 
  For a 500x500 Byte image, on a Vax-8600, the following CPU times
  were measured:

  For contouring ('NOSHADE):  3.30 sec.
  For shading ('NOCONTOU):    2.64 sec.
  For both:                   4.29 sec.

HISTORY:

 WRITTEN BY:             Gary Yagi,  18 April 1973
 COGNIZANT PROGRAMMER:   Florance Moss

 REVISIONS:
 15 Jan 84  C Avis	Convert from IBM to VAX
 17 Feb 86  F Moss	VICAR2 conversion
 22 SEP 87  S Pohorsky  Corrected xvptst call for nocontou.
 02 Nov 88  G Yagi	Changes to help file.  Reverse sense of SHADE parameter
 16 Jul 93  G Madrid	Ported to Unix.


PARAMETERS:


INP

INPUT FILE NAME

OUT

OUTPUT FILE NAME

SIZE

STANDARD VICAR SIZE FIELD

SL

STARTING LINE

SS

STARTING SAMPLE

NL

NUMBER OF LINES

NS

NUMBER OF SAMPLES

SHADE

Direction of the sun.

SCALE

SCALE AND OFFSET CONSTANTS

CONTOUR

CONTOUR REGION SPECIFICATIONS

NOSHADE

SUPPRESSES SHADING

NOCONTOU

SUPPRESSES CONTOUR LINES

DBUG

GIVE DEBUG PRINTOUT

See Examples:


Cognizant Programmer: