Page 138 -
P. 138

112   Chapter 3 ■ Digital Morphology


                             OPERATOR     LEFT        RIGHT    RESULT    DESCRIPTION

                             <-           pixel       image    image     Translate the image by the
                                                                         pixel.

                             @            pixel       image    int       Membership: Is the pixel in
                                                                         the image?
                             []           [int, int]                     Pixel generator. Result is the
                                                                         pixel whose row is the first int
                                                                         and whose column is the
                                                                         second int.

                             .            image.rows                     Each image has 4 attributes:
                                          image.cols                     number of rows and
                                          image                          columns, and the row and
                                          .origin_x                      column locations of the
                                          image                          origin. These can be accessed
                                          .origin_y                      by imagename.attrname.

                             .            pixel.row                      Each pixel has two attributes:
                                          pixel.col                      the row and column indices.
                             UNARY OPERATORS

                             ∼                                           Set complement.
                             !                                           Allocate a new image like the
                                                                         given one.
                             #                                           The (integer) number of
                                                                         isolated pixels in an image.
                             -                                           Integer negation.
                             IMAGE GENERATOR

                             {PIXEL1, PIXEL2, ‘‘0110101 ... ’’}          Generates an image, whose
                                                                         size is given by PIXEL1, whose
                                                                         origin is given by PIXEL2, and
                                                                         whose pixels are specified by
                                                                         the string.




                             Parentheses can be used in expressions to specify the order of evaluation.
                           There is no precedence implicit in the operators other than that unary oper-
                           ators will be computed before binary ones, and evaluation is otherwise left
                           to right.
                             There is a collection of test programs named t1.max through t30.max;any
                           MAX program must have the .max suffix. Running the compiler is quite simple.
                           It used to run from the command line, but it is rare these days to run from the
   133   134   135   136   137   138   139   140   141   142   143