International Journal of Research in Computer Science
eISSN 2249-8265 Volume 2 Issue 3 (2012) pp. 37-40
© White Globe Publications
MODIFIED APPROACH OF HOUGH TRANSFORM FOR
SKEW DETECTION AND CORRECTION IN
Deepak Kumar1, Dalwinder Singh2
Department of information Technology, SBBSIET, Jalandhar
Department of Computer science & Engineering, Lovely Professional University
Abstract: In optical character recognition and recognition. Consequently, detecting the skew of a
document image analysis skew is introduced in coming document image and correcting it are important issues
documented image. Which degrade the performance of in realizing a practical document reader. It included the
OCR and image analysis system so to detection and skew which degrade the performance OCR system. So,
correction of skew angle is important step of to increase the performance of OCR system we must
preprocessing of document analysis. Many methods detect the skew as well as correct the skew. Normally,
have been proposed by researchers for the detection of when skew is detected and main work is done by
skew in binary image documents. The majority of them researchers to rotate into opposite direction. There are
are based on Projection profile, Fourier transform, various methods for detecting the skew which are like
and cross-correlation, Hough transform, Nearest projection profile, Fourier transform, Hough
Neighbor connectivity, linear regression analysis and transform, nearest neighbour connectivity, linear
mathematical morphology. Main advantage of Hough regression analysis and mathematical morphology so
transform is its accuracy and simplicity. But due to different researchers have to use different methods to
slow speed many researchers work on its speed solve this problem. Main advantage of Hough
complexity without compromising the accuracy. So, for transform is its accuracy and simplicity. But due to
improving computational efficiency of Hough slow speed many researchers work on its speed
transform there are various variations have been complexity without compromising the accuracy. So,
proposed by researchers to reduce the computational for improving computational efficiency of Hough
time for skew angle. In this Paper we introduced new transform there are various variations have been
method which reduces the time complexity without proposed by researchers to reduce the computational
compromising the accuracy of Hough transform. time for skew angle. There are basically three types of
skew in the images like on the basis on number of
Keywords: Hough transform, OCR, skew detection.
skew angle and orientation three types of skew
upcoming in scanning the document:
1. Global Skew: this come when document have
Document image processing has become an
common degree angle orientation.
increasingly important technology in the automation of
2. Multiple Skew: documents have different degree
office documentation tasks. Automatic document
of orientation in the different contents.
scanners such as text readers and OCR (Optical
3. Non-uniform text line skew: when documents
Character Recognition) systems are an essential
contain several orientation in the single line .
component of systems capable of those tasks. One of
the problems in this field is that the document to be
read is not always placed correctly on a ﬂatbed
scanner. This means that the document may be skewed
on the scanner bed, resulting in a skewed image. Skew
is any deviation of the image from that of the original
document, which is not parallel to the horizontal or
vertical. Skew Correction remains one of the vital parts
in Document Processing. Many methods have been
proposed by researchers for the detection of skew in
binary image documents . This skew has a
detrimental effect on document analysis, document
understanding, and character segmentation and Figure 1 Skewed image with 2 degree angle
38 Deepak Kumar, Dalwinder Singh
Figure 1 is skewed images which are deflected from centroids by using block adjacency graph then Hough
its normal angle by 2 degree as shown. In Figure 2, the transform is applied to centroids using two angular
skew angle is removed and hence we get the images in resolutions Spitz et al. used the data reductions
its correct form. There are various methods available techniques that used for compressed images, in which
data points are obtained with single pass and mapped
for the detection and correction of skew angle. Each
into Hough space . Chaudhary and Pal have
and every method has own advantages and proposed a technique for Indian language scripts in
disadvantages on the basis of we can calculate the which exploits the inherent properties of the script to
efficiency of any particular algorithm. determine the skew angle. The idea is to detect skew
angles of these head lines of scripts. The method
detecting skew angles in range (-45° to 45°) . Amin
and Fischer (2000) apply Hough transform to de-skew
the document image in two stages. First, blocks of text,
such as paragraphs and captions of pictures are
identiﬁed. Next, they calculate skew angle for each
block by ﬁtting straight lines using least square
method, only the bottom line of a block is considered
for skew detection in order to enhance the speed .
Singh et al. have purposed new algorithm which
speeds up the performance of classic Hough transform.
Mainly, this new algorithm converts the voting
procedure to hierarchy based voting method which
speeds up the performance and reduce the space
requirements. They perform fast Hough transform in
Figure 2.Documented image by rotation 2 degree angle which three sub processes are done. Firstly in pre-
processing stage block adjacency graph is used. Then
II. RELATED WORK in voting process done using Hough transform and at
finally, skew angle is corrected by rotation. But BAG
Generally, there are a variety of global skew based algorithm is found to be effective for Roman
detection and correction techniques available. Most of Scripts documents and is not satisfactory for Indian
these techniques are reviewed by Hull . Broadly scripts where headline is part of the script. So, this
skew estimation approaches are classified into basic approach is script dependent . Manjunath et al.
categories. It includes projection profile, Hough  also used Hough transform to detect the skew
transforms, nearest neighbour clustering, and cross angle in two steps. Initially, they identified character
correlation. Historically, Hough transform based blocks from document images and thinning process is
document skew detection and correction are proposed performed over all regions. Then next thinned
in Srihari and Govindaraju (1989) . They calculate conditions are fed to Hough transform. The primary
Hough transform at all angles of θ between 0 and 180. disadvantage of this technique is that time complexity
A heuristic measures the rate of change in accumulator does not include the thinning process time. Ruilin
values at each value of θ. The skew angle is set to the Zhang et al. uses the Hough transform in fabric images
value of theta that maximizes the heuristic . Hinds for skew detection using the multi-threshold analysis
et al. (1990) use Hough transform and run length . The principal of Hough transform for skew
encoding to estimate the document skew. Additionally, detection is analyzed in this paper and describes how
they reduce data with the use of horizontal and vertical to apply the method of using Hough transform
run length computations. The document image, combining with the Sobel operator in skew detection.
acquires at 300 dpi, is under sampled by a factor of 4
and transformed into a burst image. This image is built III. HOUGH TRANSFORM
by replacing each vertical black run with its length
placed in the bottom-most pixel of the run. The Hough Firstly Hough transform is the linear transform for
transform is then applied to all the pixels in the burst detecting straight lines. In the image representation
image that have value less than 25, aiming at there is image space, in which the straight line can be
discarding contributes of non-textual components. represented by equation y = mx + b and can be
The bin with maximum value in the Hough space graphically plotted for each pair of image points (x, y).
determines the skew angle Jiang et al. used Hough In the Hough transform, the main idea is to consider
transform with detecting points in coarse form and the characteristics of the straight line not as image
accurate skew is obtained by choosing peak value for points x or y, but in terms of its parameters, here the
skew angle . Yu and Jain used a fast and accurate slope parameter m and the intercept parameter b.
approach on set of low resolution images. They use Based on that fact, the straight line y = mx + b can be
hierarchical Hough transform and centroids of represented as a point (b, m) in the parameter space.
connected components. Firstly algorithms efficiently However, one faces the problem that vertical lines give
computing connected components and at their rise to unbounded values of the parameters m and b.
For computational reasons, it is therefore better to
Modified Approach of Hough Transform for Skew Detection and Correction in Documented Images 39
parameterize the lines in the Hough transform with must use the nearest integer results of float
two other parameters, commonly referred to as ρ (rho) operation
and θ (theta). In which line can be represented 2. Pre-computations:- Many operations which are
Cartesian equation x .cos θi + y. sin θi = ρi .Where the repetitive in detecting skew angle. That can be
parameter ρ represents the distance between the line
precomputed and stored into array so in this way
and the origin, and θ is the angle of the vector from the
origin to this closest point. Figure 3 shows the we reduced the number of calculations.
parameter plane of ρ and θ. In which X and Y are axis 3. Using Hierarchical approach:-The main idea of the
and ρ is distance and θ the angle .but the Cartesian above methods is to reduce the amount of Input
equation is slow for accumulating process than slope data. In this method researchers used coarser
and intercept equations. Hough space in which only rough estimate is
considered. This approach is equally suitable for
handwritten documents. .
4. Using BAG algorithm: - In this method input data
is reduced by taking centroids of connected
components rather than use of all image pixels
Figure 3 parameter plane of ρ and θ 5. Rotation: - Singh at al  shows that there are
The Hough transform accepts the input in the form two type of rotation which is forward rotation
of a binary edge map and find edges which are inverse rotation. We generally expect that results
positioned likes straight lines. The idea of the Hough of both rotations are same but he has observed that
transform is that every edge point in the edge map is results are not same .So he concluded that time
transformed to all possible lines that could pass taken by forward rotation is less than inverse
through that point. The line detection in a binary image rotations. But quality of rotated images is higher in
using the Hough transform algorithm is below: inverse rotation than forward rotation at special
1. Select the Hough transform parameters ρmin,
ρmax, θmin and θmax. V. PROPOSED SOLUTION
2. Quantize the (ρ,θ) plane into cells by forming an Our skew detection approach will be based on a
accumulator cell array A (ρ,θ), where ρ is between technique involving Modified Hough Transform to
ρmin and ρmax, and θ is between θmin and θmax. detect the skew. We apply Hough transform (HT) to
3. Assigning the element of an accumulator cell array the set of pixels. We apply HT with a modified
A to zero. technique so that the total time taken by the algorithm
4. For each black pixel in a binary image, perform the gets reduced keeping the accuracy of the process
following: intact. We divide the spectrum of the HT space i.e.,
angle of skew which can be 0 degree to 45 degree into
For each value of θi from min to max, calculate the one-tenths, thus getting the portion in which the
corresponding ρi using the equation: x .cosθi + y. resultant skew lies. Then only that portion is further
sin θi = ρi Round off the ρi value to the nearest investigated by diving it into one-tenths and so on.
allowed ρ value. Updating the accumulator array This way the algorithm reaches the solution quickly as
element A ( ρi, θi) by voting procedure. compared to the classical HT.
5. In last, local maxima in the accumulator cell array
correspond to a number of points lying in a
corresponding line in the binary image.
The running cost is O (n×A), where n is number of
points and A is number of different values of angles.
So more accuracy we need, then more fine angle
intervals we have to use and hence more different
values for angle, and more the running time.
IV. METHODS FOR INCREASE THE SPEED OF
1. Converting floating operations to integer
operations: - in this method we converted the
floating point operations into integer operations
which increase the speed of Hough transforms .but Figure 4: Representation of the proposed technique.
accuracy is affected so maintain the accuracy we
40 Deepak Kumar, Dalwinder Singh
Figure 4 depicts the proposed process. First HT is  Manjunath VN, Kumar GH, Shivakumara P (2006)
applied for angles from 0 degree to 45 degree with a Skew detection technique for binary document images
step of 4.5 degrees. Assume that the portion that based on Hough transform. International Journal
attracts the maximum votes is the angle from a degree Technologies l3(3):194–200.
to b degree. Then, only the portion from a to b degrees  Ruilin Zhang .Xianghui Z. A Skew Detection Method
is further explored using HT with higher resolution. of Fabric images Based on Multi-threshold Analysis.
There are different methods for document image
skew detection. These included projection profiles
which used different angles directly from image data,
methods that calculated projection profiles from image
features, and second algorithms that used the Hough
transform. On which we calculated the skew angle for
straight Line and other parametric curves another class
of technique extracted features with local, directionally
sensitive masks. The Speed of Hough transform is
slow but have anti interference capability so it is used
mostly in this paper we reviewed various variations of
Hough transform each methods have their own speed
for different scripts .Only preliminary efforts have
been conducted in comparative performance
evaluation. Further work in this area could help show
the performance of proposed solution.
 Hull, J., 1998. Document image skew detection: Survey
and annotated bibliography. Document Analysis
Systems II. World Scientific Pub. Co. Inc. pp. 40–64.
 Srihari SN, Govindaraju V (1989) Analysis of textual
images using the Hough transform. Mach Vis Appl
 Ciardielloat at al(1988). An Experimental System for
Office Document Handling and ext Recognition.
Proceeding of International Conference on Pattern
Recognition. (2): 739-743.
 Hinds J, Fisher L, D’Amato DP (1990) A document
skew detection method using run-length encoding and
the Hough transform. In: Proceedings of the 10th
international conference pattern recognition. IEEE CS
Press, Los Alamitos, CA, pp 464–468.
 Jiang H, Han C, Fan K (1997) A fast approach to the
detection and correction of skew documents. Pattern
Recognition Letter 18:675–686.
 Yu B, Jain AK (1996) A robust and fast skew detection
algorithm for generic documents. Pattern Recognition
 Spitz AL (1997) Determination of the script and
language content of document images. IEEE Trans
Pattern Anal Mach Intell 19(3):235–245.
 Pal U, Chaudhuri BB (1996) An improved document
skew angle estimation technique. Pattern Recogn Lett
 Amin, A., Fischer, S., 2000. A document detection
method using the Hough Transform. Pattern Anal.
Appl. 3, 243–253.
 Singh C, Bhatia N, Kaur A (2008) Hough transform
based fast skew detection and accurate Skew correction
methods. Pattern Recognition 41:3528–3546.
contains relevant information about the symptoms and In this case the user should first locate I1, follow the
causes of DIABETES. It contains 15 classes. It is role relationship to I2 and then extract a slot value to
populated with 257 instances. The maximum depth of find the answer to the query.
the “is-a” taxonomy tree is 13 classes. Multiple
inheritances have been employed for about 2 classes 3. Query related to the class hierarchy, the taxonomy.
and no other classes are having more than one parent. In this case, a class is described to the user and he/she
is asked to retrieve its direct subclasses. For example,
C. Experimental set-up
“What are the symptoms of the “Type 1”?
Before starting the evaluation process we had to In this example, the result is a set of class names,
perform some preliminary tests in order to decide upon which should be organized hierarchically.
the visualization method set-up to be used in the
experiment. 4. Querying for the number of instances of a specific
class. For example, “What is the number of the drug
Bearing in mind that we were investigating the
most suitable visualization not for ontology developers manufacturer?”
but for users that will use the ontology as an In this case the result is a number, so the user has to
information retrieval aid, we had to keep the locate the specific instances and count them or view
visualization method controls as simple as possible. their number if this feature is provided by the
Furthermore, for the size of the experiment ontology, interface.
some visualization set-ups were really cluttered and 5. Retrieve the number of instances with a specific
not at all useful for information retrieval. In the case of common slot value. For example, “What is the number
DLQuery, Query box, execute option; object of patients prescribed with a specific drug?”
properties, class hierarchy window, data properties,
checkboxes for super class, ancestor class, equivalent In this case, as in query 4 of the previous section,
class, subclass, descendent class and individuals and the result is a number, so the user has to locate the
Query result frame were introduced to the users. In the specific instances and count them (or view their
case of OntoGraf, focus on home, grid alphabet, radial, number if this feature is provided by the interface).
spring, tree-vertical & horizontal directed, zoom-in, However, this case is somewhat more complicated as
zoom-out, no-zoom, node-type, arc type and search not all the instances of an entity are requested, but a
(contains, start with, end with, exact match, reg exp) sub-set of them with a common slot value. The user
options were introduced to the users. Finally, for the groups were involved in retrieving the answers for
case of OWL2Query, we introduced the following those queries using DL Query, OWL2Query and
features to the users: toolbar, prefix editor, variable OntoGraf.
editor, layout editor, query graph, SPARQL query
E. Performance Evaluation
view, SPARQL-DL preview, result panel, edge editor,
property editor and Abox, Tbox & Rbox node editors. For each task (query), we measured the NASA
Task Load Index (TLX)  and the time that was
D. DIABETES ontology information retrieval tasks needed to perform the task. Figure 1 show the results
This experiment constructed five different queries of the comparison of OWL2Query, DLQuery and
to retrieve information from DIABETES ontology. OntoGraf ontology visualization tools based on the
The queries are then grouped into different types visualization scores as perceived by the users. As we
according to ontology related criteria, such as the expected, we can see that the group that was given a
number of different classes they entail, if they are short introduction into the tools, performed better on
relevant to the ontology hierarchy or not, if they ask average. It scored lower TLX and shorter time.
for the number of classes of instances with a common
A Comparative Study of Recent Ontology Visualization Tools with a Case of Diabetes Data 35
For task1, there was almost no difference observed also included in its analysis information about the
between the two groups with respect to Onto Graf. The import/export format, graph view, consistency check,
figure 1 clearly shows Onto Graf let to a lower TLX on version, dependencies, type, multi-user type, web
average in all five tasks compared to other two tools support, library support and etc., The result of this
such as OWL2Query and DLQuery, that is, users were survey and analysis provides comprehensive
less frustrated and mentally stressed. That is very understanding of new features that enhance cognitive
likely also an outcome of the reduced time users had to support. Finally, we presented some preliminary
spend for each task. The figure shows that users could results from a comparative evaluation of selected three
solve each task faster using Onto Graf. On average visualization tools. The results are being further
users spent approximately 58.9 % less time with Onto analyzed in order to extract interesting patterns.
Graf and had a 24.9% lower TLX than when using Furthermore, the results of this evaluation are being
OWL2Query and 32.8 % less time with Onto Graf and analyzed with respect to the other two aspects of the
had a 15.9% lower TLX than when using DLQuery. experiment, i.e. the evaluation of the ontology itself
The comparison only shows that Onto Graf is better and a test of the methods users employ for dealing
suited for the use case of DIABETES ontology we with various information retrieval types. This work can
described. DLQuery and OWL2Query are however be extended with other tools/ frameworks for the
much more feature enriched tools which make it complete ontology management operations
difficult to use than Onto Graf for our experiment. We
evaluated only information retrieval process that was VI. REFERENCES
possible with these three tools.  Gomez-perez A Survey on ontology Tools, OntoWeb
deliverable D1.3. http://ontoweb.aifb.uni-
 Guarino N, Giaretta P (1995) Ontologies and
Knowledge bases: towards a terminological
clarification. Towards Very Large Knowledge Bases:
Knowledge Building and Knowledge Sharing, IOS, 25-
 Boinski T, Bundnik L, Jaworska A, Mrozinski J,
Mazurkiewicz, K (2009) OCS-Domain Oriented
Ontology Creation System. Polish Journal of
Environmental Studies. 18:3B. pp 35-38.
 Benjamin B, Emmanuel P, Ilaria L, Gennady L (2011)
OntoTrix: A Hybrid Visualization for Populated
Ontologies. Proceedings of WWW2011, Hyderabad,
 Katifori A, Halatsis C, Lepouras G, Vassilakis C,
Giannopoulou E (2007) Ontology Visualization
Methods - A Survey, ACM Computing Surveys, Vol.
39, Issue 4.
 Kobsa A (2004) User Experiments with Tree
Visualization Systems. In IEEE Symposium on
Information Visualization (INFOVIS'04), 9-16.
 Katifori A, Torou E, Halatsis C, Lepouras G, Vassilakis
C (2006) A Comparative Study of Four Ontology
Visualization Techniques in Protégé: Experiment Setup
and Preliminary Results, URL:http://ieeexplore.ieee.org
 Johnson B, Shneiderman B (1991) Treemaps: a space-
filling approach to the visualisation of hierarchical in-
formation structures. Proc. 2nd Int. IEEE Visualization
Figure 1.TLX and Time comparison for five different tasks Conference, San Diego.
in OntoGraf, DLQuery and OWL2Query  Furnas GW (1986) The FISHEYE view: A new look at
structured files. Proc. of the Conf. on Human Factors in
V. CONCLUSION Computing Systems ACM. pp 16-23.
This paper reported the Performance analysis of  Lamping J, Rao R, Pirolli P (1995) A focus + context
advances of cognitive support in recent ontology Technique based on Hyperbolic Geometry for Visual-
visualization tools. The review includes both research izing Large Hierarchies. ACM Conference on Human
and commercial category tools. Tools of similar Factors in Computing Systems (CHI'95), New York,
purpose are chosen to analyze their features. This work ACM Press. pp 404-408.
36 V. Swaminathan, R. Sivakumar
 Munzner T (1997) H3: Laying Out Large Directed  OWL2Query:
Graphs in 3D Hyperbolic Space. Proc. of the IEEE http://protegewiki.stanford.edu/wiki/OntoGraf
Symp. on Information Visualisation., Phoenix, USA.
 Graham M, Kennedy J, Benyon D (2000) Towards a
Methodology for Developing Visualizations. Int. J. of
Human-Computer Studies 53(5): 789-807.
 North C, Shneiderman B (2000) Snap-together
visualisation: can users construct and operate
coordinated visu-alisations?. Int. J. of Human-Computer
Studies 53: 715-739.
 Risden K, Czerwinski MP, Munzner T, Cook D (2000)
An initial examination of ease of use for 2D and 3D
information visualizations of web content. Int. J. of
Human-Computer Studies 53: 695-714.
 Wills GJ (1997) NicheWorks - Interactive Visualisation
of Very Large Graphs. Proc. Graph Drawing '97, Rome,
Italy, Springer-Verlag. pp 403-414.
 Herman I, Melancon G, Marshall MS (2000) Graph
Visualization and Navigation in Information Visualisa-
tion: a Survey. IEEE Transactions on Visualisation and
Computer Graphics 6(1): 24-43.
 North SC (1995) Incremental layout in DynaDAG.
Proc. of the Symposium on Graph Drawing GD '95,
Springer-Verlag, pp 409-418.
 Eades P (1984) A Heuristic for Graph Drawing.
 Boinski T, Jaworska A, Kleczkowski R, Kunowski P
(2010) Ontology Visualization. Proceedings of the 2nd
International Conference on Information Technology,
 Musen MA (1989) Automated support for building and
extending expert models Machine Learning 4:347 –
 Noy NF, Musen MA (2000) PROMPT: Algorithm and
Tool for Automated Ontology Merging and Alignment.
In: Rosenbloom P, Kautz HA, Porter B, Dechter R,
Sutton R, Mittal V (eds) 17th National Conference on
Artificial Intelligence (AAAI’00). Austin, Texas, pp
 Gennari JH, Musen MA, Fergerson RW, Grosso WE,
Crubezy M, Eriksson H, Noy NF, Tu SW (2003) The
Evolution of Protégé: An Environment for knowledge-
Based Systems Development. International Journal of
Human-Computer Studies 58(1):89-123.
 Friedman – Hill E (2003) Jess in Action: Java Rule-
Based Systems. Manning Publications Company,
 Musen MA, Fergerson RW, Grosso WE, Noy NF,
Grubezy MY, Gennari JH (2000) Component -based
support for building knowledge-acquisition systems.
 Proc. Intelligent Information Processing (IIP 2000)
Conf. Int. Federation for Processing (IFIP), World
Computer Congress (WCC'2000), Beijing, China, pp