Number of entries in the HORUS database.
The operator count_relation counts the number of entries in one of the four relations of the HORUS database. The HORUS database is organized as follows:
There are two basic relations for region data and image matrixes. The HORUS objects region and image are constructed from elements from these two relations: a region consists of a pointer to a tuplet in the region-data relation. An image consists also of a pointer to a tuplet in the region-data relation (like a region) and additionally of one or more pointers to tuplets in the matrix relation. If there is more than one matrix pointer, the image is called a multi-channel image.
Both regions and images are called objects. A region can be considered as the special case of an iconic object having no image matrixes. For reasons of an efficient memory managment, the tuplets of the region-data relation and the image-matrix relation will be used by different objects together. Therefore there may be for example more images than image matrices. Only the two lowlevel relations are of relevance to the memory consumption. Image objects (regions as well as images) consist only of references on region and matrix data and therefore only need a couple of bytes of memory.
Possible values for RelationName:
'image' Image matrices. One matrix may also be the component of more than one image (no redundant storage). 'region' Regions (the full and the empty region are always available). One region may of course also be the component of more than one image object (no redundant storage). 'object' Iconic objects. Composed of a region (called region) and optionally image matrices (called image). 'tuple' In the compact mode, tuplets of iconic objects are stored as a surrogate in this relation. Instead of working with the individual object keys, only this tuplet key is used. It depends on the host language, whether the objects are passed individually (Prolog and C++) or as tuplets (C, Smalltalk, Lisp, OPS-5).
Certain database objects will be created already by the operator init_horus and therefore have to be available all the time (the undefined gray value component, the objects 'full' (FULL_REGION in HORUS/C) and 'empty' (EMPTY_REGION in HORUS/C) as well as the herein included empty and full region). By calling comp_info, the operator therefore appears correspondingly also as 'creator' of the full and empty region. The procedure can be used for example to check the completeness of the clear operation.
RelationName (input_control) |
string -> string |
Relation of interest of the HORUS database. | |
Default value: 'object' | |
List of values: 'image', 'region', 'object', 'tuple' |
NumOfTuples (output_control) |
integer -> integer |
Number of tuplets in the relation. |
init_horus(::512,512,3:) > count_relation(::image:I1) > count_relation(::region:R1) > count_relation(::object:O1) > count_relation(::tuple:T1) > read_image(:X:'affe':) > count_relation(::image:I2) > count_relation(::region:R2) > count_relation(::object:O2) > count_relation(::tuple:T2). /* Result: I1 = 1 (undefined image) R1 = 2 (full and empty region) O1 = 2 (full and empty objects) T1 = 0 (always 0 in the normal mode ) I2 = 2 (additionally the image 'affe') R2 = 2 (read_image uses the full region) O2 = 3 (additionally the image object X) T2 = 0. */
If the parameter is correct, the operator count_relation returns the value TRUE. Otherwise an exception is raised.