• No se han encontrado resultados

EVENTOS SUSTANTIVOS EN LAS SANCIONES URBANISTICAS

3. SANCIONES URBANISTICAS

3.1 EVENTOS SUSTANTIVOS EN LAS SANCIONES URBANISTICAS

Pre-processing covers all those functions carried out to prepare original image to be suitable for later recognition stages. For off-line systems, pre-processing functions include: binarisation, noise filtering, skew detection and correction. These situations and others make it

56

difficult to analyse and process document images. Here, the aim of the pre-processing is mainly eliminating distortions at edges as a first step followed by skew detection and correction. Finally, document image is segmented into various zones like sections, text lines and words.

3.6.3.1

Skew Detection and Correction

In practice, these scanned documents can contain number of unavoidable and crucial problems; it can be noised, skewed, deformed.

in this context, presence of skew in scanned document images is a very common problem. The document image is skewed if it is not fed straight into the scanner either manually or automatically. Existence of a few degrees of skew within about three degrees is unavoidable [52]. This is feasible if the document is fed by a human operator. The automatic feeders may cause the document to rotate up to 20 degrees [52]. The skew of a document image called “global skew”, where all text lines will have the same orientation, deviate from the true horizontal x-axis. Consequently, correcting the skew, orienting the text lines to be horizontal, is an important pre-processing step because it affects the efficiency of subsequent processing stages, such as segmentation and classification.

Skew correction is generally carried out by calculating the skew angle “θ” of the raw image and rotates it by “θ” in the opposite direction. A number of methods have been proposed for skew detection such as Projection Profile, Cross Correlation, and Hough Transform. In this work,

57

Hough transform, the widely used approach, is the adopted method for determining the skew angle.

The Hough transform technique detects lines, circles and other structures whenever their parametric equation is known. In the present context, it will be used for the detection of straight lines for skew angle determination. As the equation of any straight line in Cartesian space is:

Equation ‎3.1: Straight line equation

The polar (also called normal) representation of straight lines is:

Equation ‎3.2: Straight line polar equation

Where ρ (rho) is the perpendicular distance of the line from the origin, and θ (theta) is the angle from the horizontal of the perpendicular line, Figure ‎3.7 illustrate this concept. In image analysis context, Hough transform maps each point in Cartesian image space (x, y) to a set of all straight lines going through that point in the (ρ, θ) Hough space.

58

Figure ‎3.7: The representation of a line in the (x, y) space using (ρ, θ)‎

In general, to estimate the skew angle, the Hough-transform is applied on the image and the longest straight line will show the most accurate skew angle. The whole document image skew angle is calculated from the slope of one of the two separating lines. The line detection in a binary image can be summarized as follows:

1. Segment area enclosing pixels of one candidate separating lines; reducing the input data to process for low computational complexity

2. Apply an edge detection method to find all the edge points in the segmented area; In this work, the Canny method is applied for detecting boundaries of features within an image

3. Perform Hough transform on the detected edges for line detection. It maps all the data points in the image (x, y) into Hough space (p, θ)

59

4. The mapping result is the accumulator array element A(ρ, θ) represents the number of points lying on the corresponding line in the x-y plane

5. Detect best line candidates as local maxima in the accumulator cell array, the longest digital straight line, and its angle “θ” considered as the actual skew angle

In addition to the skew problem, the scanner sometimes presents distortions at the edge such as bounding box or lines. Before performing the skew angle detection, these edge distortions should be eliminated firstly. This can be done by pruning the image by specify the crop rectangle around the image with suitable margins, which can be defined experimentally.

3.6.3.2

Word Segmentation

The subsequent task to document-image skew correction is word segmentation. The imaginary text table plays a very important role in all levels of segmentation process; providing vertices pixel coordinates of text section and lines, and words. Accordingly, at different levels in the hierarchy, the crop rectangle around each component is defined and then it gets clipped. The clipped text section is as depicted in Figure ‎3.8, while Figure ‎3.9 shows a segmented line. Figure ‎3.10 illustrate word image, the prerequisite for the next step where each block should contain only one word.

60

Figure ‎3.8: Text section

61

Figure ‎3.10: Segmented word using crop rectangle

The main objective of this stage is to find the “body” of the word in a binary image. To achieve this; firstly, complement the original word image to get binary-scale image having writing stroke in white pixels and background pixels are black. Secondly, the picture is “smeared” horizontally using Run-Length Smoothing Algorithm (RLSA). The RLSA is applied row-by-row to an image document. The principle of this smoothing algorithm is based on smearing a consecutive white pixels (represented by 1‟s) along the horizontal direction: i.e. the black space (represented by 0‟s) between them is filled with white pixels if their distance is within a predefined threshold.

Thirdly, find region boundaries of the largest white area in the smeared image. Finally, crop the word body in the original binary image based on the vertices of the smallest rectangle containing the region. Figure ‎3.11 displays the “body” of the word image as result of the tidy segmentation.

62

The tidy whole word binary images are saved with resolution of 300 DPI in TIFF-format files. During all processing stages, images are verified at section, line, and word levels to ensure that there are no errors in segmentation process. The verification is crucial, because any random noise or smearing may make word segmentation imperfect. In the event of imperfect word tidy segmentation because of presence background noise, it's being eliminated manually and reapplies the Run-Length Smoothing Algorithm on it again.

The image name represents its attribute, and it is formatted, from left to right, as follows: one letter subset name, data type digit, font information part and the word position in the corpus. For example, the image file name a05140-01-002-164-006 indicates that the word-image is from subset (a), scanned, written in font number 5 in size 14 pts in plain style, related to group number 1, located in the corpus at chapter (2), verse number (164) word (6). The word-images are classified in group-subsets according to document type and font name.

Documento similar