Knowledge Based System for Visual Computing of Depth in 2D Images of Geometric Objects Like Straight Lines, Planes and Solids and their Applications in Engineering Graphics 1

An attempt was made in this study, to develop a ”Knowledge Based System” for i)computing the depth (or the third dimension) of 3D objects, ii) computing the inclinations of 2D planes with predefined reference planes and iii) computing the inclinations of a straight line with predefined reference planes. The development of the proposed “Knowledge Based System” was based on the “Principle of Color Gradation”.


INTRODUCTION
The development of the proposed "Knowledge Based System" is based on the "Principle of Color Gradation". This method is based on the fact that, "The gray color intensity (or the pixel value of the gray color) on the surface of an object, gets faded away, as they move farther from the observer and ultimately, gets merged with the distant background color". The maximum variation in the pixel value is between 0 and 255, with 0 corresponding to pure black, and 255 corresponding to pure white [1].
Literature review reveals that, conventional methods based on the principles of "Orthographic Projections" are available for developing Knowledge Based System to compute the above said depth etc. However, no attempt was made to develop a Knowledge Based System, based on the principle of "Color Gradation" exclusively for applications in Engineering Graphics. Hence the paper.
The Conventional method of obtaining i),ii),iii) as given in Abstract are based on the principles of Orthographic Projections. Here more emphasis is given on the Human capabilities for computation. A Vertical Plane(VP) and a Horizontal Plane (HP) which are perpendicular to each other are used in the conventional method.
An attempt is made in this paper to make use of Computer capabilities to develop a "Knowledge Based System", for i)computing the depth (or the third dimension of 3D objects, ii)computing the inclinations of 2D planes with Vertical and Horizontal planes and iii)computing the inclinations of a straight line with the vertical and horizontal planes.
The development of the proposed "Knowledge Based System" is based on the "Principle of Color Gradation". This method is based on the fact that, "The gray color intensity (or the pixel value of the gray color) on the surface of an object, gets faded away, as they move farther from the observer and ultimately, gets merged with the distant background color". The maximum variation in the pixel value is between 0 and 255, with 0 corresponding to pure black and 255 corresponding to pure white.
Assumptions made to ensure the conditions of orthographic projection : In this proposed method a Computer acquired image of the object is obtained, making sure that the image corresponds to the one as obtained in Orthographic projection. To achieve this, the various assumptions made are: The observer looks at the object (say, a straight line of one metre length) from a fairly long distance (20 metres), in order that the visual rays are parallel to each other and are perpendicular to the plane of projection (Vertical Plane). A plane perpendicular to the Vertical plane is imagined and is termed as Horizontal Plane. Through out the period of obtaining the Computer acquired images of the objects, the light intensity (day light) is assumed to be uniform and the same conditions are used while using this Expert System for further investigations.

MATERIALS AND METHODS
The analysis of solids/planes begins with the analysis of straight lines. To start with, a detailed methodology is developed to compute the color intensity variations along the length of the line, while the lines makes different angles, with predefined vertical and horizontal planes. Keeping one end of a line (which is parallel to a horizontal plane) fixed, it is rotated about the fixed point, to make different angles(from 0 to 90°) insteps of 5° with the Vertical Plane. The computer acquired images of this line (Fig. 1), for various known inclinations (n) are obtained using a high resolution Digital Camera. A detailed analysis of these lines is made, to compute the Ratio (R) between the gray color intensity variation between two points on the line and the corresponding length of the acquired line. These ratios (R) are computed for various inclinations (n) of the line and are listed in Table 2 [2] . There are slight variations in the positions of various points which could not be shown in the graph with the fear that they may hinder with the existing clarity of the graphs. The best fitting curves are drawn making use of the principles of statistics for best fitting curves. Table 1 gives the variation of pf value with xf for a given known value of n. The average value of R for the given angle (n=25) is computed with this table.
Keeping the ambient conditions (day light etc) the same, the computer-acquired image of a line parallel to Horizontal Plane making an unknown angle with the  Vertical Plane is obtained. The above-referred ratio (R) for this line is computed. Using the calibration curve, the unknown angle is determined. This computed angle is related to the depth of the other end of the line, by suitably developed Trignometrical equation, namely: n=Tan -1 ( R ) (1) Where n is the unknown angle to be computed and R is the ratio of gray color pixel value variation between two points on the computer acquired line and the corresponding length [3]. Figure 1 shows the various computer acquired images of a line (of given length) parallel to Horizontal Plane and making different known angles with Vertical Plane. Table-1 gives the pixel values at different points on the acquired image of the line for a given inclination (n = 25°) of the line (18 such tables are prepared for n varying from 0 to 90°, in steps of 5°). The ratio R is also seen in the table. Figure  2 gives the variation of pixel value along the length of the Computer acquired image of the line for various inclinations of the line (n varies from 0 to 90° in steps of 5°). The pixel values are plotted on the Y-axis and the length on the X-axis. Table-2 gives the computed ratios (R) and the corresponding known inclinations (n). Considering the pixel values between any two points on  Figure 3 gives the calibration curve. The above analysis is, for computing depth in Horizontal direction. A similar analysis is made for computing depth in Vertical direction. This time the same straight line, is considered as parallel to Vertical Plane. One end of the line is fixed and the line is rotated about the fixed point to make different angles with Horizontal Plane [4] . The same procedure is repeated. The ambient conditions are kept the same [2].
The computer acquired images are in black and white mode(Gray color mode), which will help in, easy finding of the pixel values.
Extension of this analysis for computing the depth for 2D planes and 3D solids: The analysis of a 2D plane or the 2D surface of a 3D geometric solid can be made using the above methodology. We may consider a line parallel to HP on the 2D plane or a line parallel to HP on the 2D surface of 3D solid. The inclinations made by this line with VP also correspond to the inclination of the plane or the 2D surface of a 3D solid with VP.
Finally a Data Base can be created for lines of varying length and making different known angles. An extended Data Base is also created for planes and solids. A knowledge component can be introduced to this data base, which forms the proposed "Knowledge Based System", as envisaged in the title of the paper.
A comparison made, between the results obtained from the proposed system and those from the conventional system, reveals that the variation in the depth is with in ±2%. This is due to the limitations in the accuracy, with which the pixel values can be read.

RESULTS AND DISCUSSION
As seen above, a comparison between the values obtained from the conventional method and from the proposed method reveal that the variation is within ±2%. This variation may be attributed due to the fact that, there can be a small error in reading the pixel values at different points along the acquired straight line. Since the variation is only within ±2%, this method of computing depth etc can reasonably used for solving problems on Engineering Graphics. There is ample scope for future work in this direction, provided we can develop a method of reading the pixel values with higher degree of accuracy. This proposed method offers a good substitution for solving problems in Engineering Graphics and eliminates the tedious methods involved in Engineering Graphics like Line Rotation Method, Trapezoidal Method etc.

CONCLUSION
Apart from using this "Knowledge Based System" for analysis of 3D solids etc, its applications can be extended to the area of computer Integrated Manufacturing (CIM), Mathematical Programming, Rapid Manufacturing and Satellite Picture Reading etc.
The reliability and accuracy of the proposed method for computing depth largely depends on Simulating the identical ambient conditions used while obtaining the data for preparing the calibration curve. Any variation in the ambient conditions will alter the pixel values considerably and will lead to unrealistic results.