Preprocessing of Digitalized Engineering Drawings

The concept of digital manufacturing assumes an application of digital technologies in the whole product life cycle. CAD product model replaced engineering drawing in digital manufacturing. In contemporary practice the engineering paper-based drawings are still archived. They could be digitalized and stored to one of the raster graphics format. After that they could be vectorized for interactive editing in the specific software system or for archiving in some of standard vector graphics file format. The vector format is suitable for 3D model generating too. The article deals with using of methods for preprocessing phase of digitalized engineering drawings vectorization process.


Introduction
The digitized engineering drawing created by scanning a template is in most cases necessary adjusted to a form suitable for vectorization.The digitized engineering drawing of raster format can contain errors and inaccuracies which according to the origin can be divided into:


errors derived from a paper template  errors introduced by a scanning process Into the first category may be included central contour arising by packaged document.Abrasion of paper media resulting into various smudges and stains.As well as the errors introduced by the designer in the process of drawing parts.The second category of the errors brought to the digitized engineering drawing is errors caused by the scanning device.
This can lead to the fact that the digitized engineering drawing contains various noises, surplus lines and clusters of colored pixels of different densities.In the process of preprocessing of digitized engineering drawing we try to identify these errors and remove them.In the following sections we will describe the methods available in the preprocessing of the digitized engineering drawing.Methods that can be used are thresholding, noise removal, edge detection, integral transform.

Thresholding
The easiest way to edit a processed image is thresholding.Based on the luminance or color component the input image is transformed to monochrome (black and white).The algorithm sequentially scans each pixel of the image and gradually replaces all values by 0 or 1.After this operation two changes are achieved.The first is the removal of color component, the second is separation of lighter background from darker objects of foreground.
The basis of the most automatic methods of thresholding is the histogram.This determines the multiplicity of luminance or color component of an image.The ideal histogram has only two peaks.One peak corresponds to the brightness value of the object and the second to the brightness of the background.The value of the minimal multiplicity between these two peaks then determines the value of thresholding (Russ, 2011).In practice, the histogram has more than two peaks or it is atypical.

Noise Removal
According to the theory of signal noise, noise is defined as new information that has been added to the original by a device, in our case, by a scanner, or during transport.Noise is tied to the original information.It is known more types of noise, such as Gaussian noise, white noise, salt and pepper.For noise removal can be used several methods, respectively smoothing filters.From these may be mentioned in particular Mean filter, Median filter, conservative and adaptive smoothing.

Corner Detectors
Neurophysiological and psychological research shows that the most important places in the image for the perception of higher animals are places where the brightness value rapidly changes.These places are called the edges.Because these places contain more information about the content of the image, we try to detect them during recognizing image content.The edges are somewhat invariant to illumination change or view (Šonka& Hlaváč&Boyle, 1993), (Gonzalez&Woods, 1992), (Marr&Hildrith, 1980), (Canny, 1986).In the engineering drawing the edges represent a component and therefore the use of the edge detectors may be desirable.Among the edge detectors are included discrete convolution, Roberts, Prewitt, Sobel, Kirsch, Laplace and Canny edge detector.

Integral Transforms
Integral transforms can be used in the process of preprocessing of the digitized engineering drawing.If the input image is very noisy and it is necessary to detect straight lines in the image, it is recommended to use a Hough transform, which is based on the transform of the Cartesian coordinate system into polar.This transform has been generalized and is useful for the detection of complex objects.For more see (Leavers, 1992).
Another important group is the methods based on the discrete Fourier transform, in particular its optimized form (FFT).These methods allow convert luminance waveforms on frequency waveforms and back (Ramirez, 1984).The use of FFT in the past was limited to a considerable computational complexity, which have led to the development of specialized hardware such as signal processors (DSP).

Usability Evaluation of the Selected Methods
For the evaluation an experimental approach was used.The methods of the integral transforms, corner detectors and filters were tested.We used the test application created at the workplace.Application loaded a raster image as input.After the application of selected integral transform it is possible to view the results of the original image.We tested three selected integral transforms (Fourier, Hough and cosine) in this experiment.These transforms were used for a specific number of test samples (Figure 1).Test samples were created in vector graphic editor.These samples were then printed and scanned to obtain raster representation of the image.

Results of Fourier Transform
Based on the above tests, it can be said that the Fourier transform can recognize almost all elements of the engineering drawing.The detection of two or more edges close to each other (betrayed and shading) caused minor problems, where there is a smearing of the individual edges in solid lines.Provided results are quite substantially affected by the set value of the minimum and maximum frequencies.After applying the transform to the image at a lower resolution there were observed only partial differences in the provided results.Significantly better results are achieved when applied to scanned black and white image.

Results of Hough Transform
Based on the tests, it can be stated that the results of Hough transform largely depend on the resolution of the input image and the image preprocessing.At resolution of 150 DPI transform failed to portray where there are edges of the lines.The results were satisfactory at 600 DPI.
Gaussian filter was used for smooth the noise, and then Canny edge detector was applied to the input image.This transform would fail to provide almost any real results without such modified input.It was found that Hough transform is unable to identify the start and end points of the lines, upon detection of the horizontal, vertical and oblique edges of each line, but only the lines that pass through to the overall picture.In some cases it was unable to find inscribed circle or circumscribed circle upon edges detection of the rectangular holes arrangement.
Similarly, it was unable to recognize the edges of other elements of the engineering drawing, e.g.: curvature, dimensions, technical writing and elliptical shape.

Results of Cosine Transform
Based on the above tests, it can be stated that the algorithm of cosine transform was able to sufficiently recognize almost all the elements of the engineering drawing.It has partial problems with the ends of individual edges.The dashed lines connect with the thin line and edges of solid lines continue a little further than it actually had.At the final image a kind of false responses of detected edges can be also observed.Casting of individual edges in the solid lines, e.g.dense hatch is not as visible as by the Fourier transform.When loaded the input samples at the resolutions of 150 and 600 DPI, it can be seen significant differences in provided results.

Discussion
Testing a suitability of the transforms for raster engineering drawings with focusing on recognition of line type and thickness shows that the transforms are suitable for solving the first task -line type recognition.Fourier transform also provides good results for recognition of geometric shapes and hatched regions.Hough transform has greater sensitivity to set parameters.The line thickness recognition in the test did not provide desired results.