This paper deals with line labeling of Trihedral (i.e. having been formed by three planes meeting at a point) blocks world images.
For a given target image each edge intersection is a variable. The domain size for each variable is 16, according to the Huffman and Clowes catalog. For each image with N variables, a NxN constraints matrix is built. This matrix represents which variables are constrained, i.e. which edge intersections are adjacent. Value 0 represents no constraint while value 1 represents a constraint. For example if variables 1 and 3 represent neighboring edge intersections then the value of the matrix at position [1][3] = [3][1] = 1. This is because the constraints are symmetrical. An additional conflicts matrix is built for each value 1 in the constraints matrix. This conflicts matrix is of size 16x16. In this matrix the value in [X][Y] indicates if domain value X has a conflict with domain value Y. For example assume that variables 3 and 6 represent adjacent neighbors, therefore the value [3][6] = 1 in the constraints matrix, and they have a conflicts table. In this table, if [4][14] = 1 then the domain value 4 for variable 3 is not consistent with domain value 14 for variable 6. Performing a check if variable A with value X is consistent with variable B with value Y includes checking constraints[A][B]. If constraints[A][B] = 0 return true. Otherwise constraints[A][B] = 1, then check the A-B conflicts table. If conflicts[X][Y] = 1 return false, else conflicts[X][Y] = 0 and return true.
Both algorithms were implemented in Java. The implementation includes 4 classes. Problem class represents the problem. Table class represents the data structure used to build problems. AlgoForwardChecking and AlgoBackTracking classes implement the respective algorithms.
In evaluation of Backtracking algorithms a Constraint Checks (CCs) measure is commonly used. This measure counts the number of times the algorithm checks the problem to see if two variables and their values are consistent. The advantage of using such a measure is that it is not implementation dependent. This means that the algorithm can be implemented in different programming languages and run on different machines, but the measure would still be valid. In the code the class Problem includes a counter that is incremented whenever the function “check” is called.
The program was tested on 3 different problems. For each problem, the edge intersections were arbitrarily numbered. The domain for each variable was 0-15, each number representing the respective edge intersection type from the numbered catalog (section 1.1). The received results are in form of pairs, where the first element is the edge intersection number and the second isthe domain value assigned to this variable. Pyramid target image:
Problem | Number of CCs – Naive Backtracking | Number of CCs – Forward Checking |
---|---|---|
Pyramid | 18633 | 130 |
Test | 4201144 | 1036 |
Block | 25228136 | 747 |
The program provided consistent line labeling for the given test problems. As expected in all tests the FC algorithm performed considerably better then the Na?ve Backtracking algorithm. Future work includes comparison of these results to consistent line drawing labeling via relaxation labeling, as well as other methods.
1. M. B. Clowes, "On seeing things," Artificial Intelligence, Vol. 2, No. 1, pp. 79-116, 1971.
2. D.A. Huffman, “Impossible objects as nonsense sentences,” Machine Imlligencc 6, pp, 295-323,1971.
3. Depth and Shape Inference (II), Introduction to Computational and Biological Vision, Computer Science Department, BGU, Ohad Ben-Shahar
4. P. Prosser: "Hybrid algorithms for the constraint satisfaction problem", Computational Intelligence, Vol. 9, pp. 268-99, 1993.