Tuyển tập Hội nghị Khoa học thường niên năm 2019 ISBN 978 604 82 2981 8 180 CLUSTERING ALGORITHM FOR RECOGNITION OF COMPUTER AIDED DESIGN IMAGES Nguyễn Văn Nam Thuyloi University 1 INTRODUCTION Comput[.]
Trang 1CLUSTERING ALGORITHM FOR RECOGNITION OF
COMPUTER AIDED DESIGN IMAGES
Nguyễn Văn Nam
Thuyloi University
1 INTRODUCTION
Computer Aided Design (CAD) images are
technical drawings that are frequently used in
engineering domains In mechanical factories,
CAD drawings must be converted to the
corresponding Computer Numerical Control
(CNC) machine commands for cutting material
Most CAD software can automatically
effectuate this conversion for CAD files
However, the transformation of scanned CAD
images are currently done by human beings
Most recent recognition methods based on deep
neural networks are not efficient enough since
the CAD objects are too small and noisy In this
paper, we rely on old but efficient DBSCAN
clustering algorithm which produces more than
90% accuracy for cad recognition To the best
of our knowledge, this is the first to address
this problem
Figure 1 Real 3D object and its four 2D
projections
Given only four 2D projections of a 3D object as in Fig 1, an engineer needs to recognize the details of the CAD drawings including projections (front, rear, left, right, top, down), line (solid, dotted, distance), circle (semi-circle, disk), arcs, text boxes,
He then draws a flattening image corresponding to the real object as can be seen in Fig.2 (below) This last CAD file can then be converted to CNC commands
Figure 2 Flattening CAD image
2 RESEARCH METHOD
Figure 3 Scanned CAD Drawing
Trang 2As in Fig 3, a cad drawing includes a
rectangle bounding box, a section of notes
which is placed at a side of the bounding box,
a text box describing the material type of the
object, several cad projections demonstrating
the detail shape, size of the object viewed
from at most six directions: top, down, left,
right, front, rear
A projection in a CAD drawing consists of
distance lines, alignment lines, textboxes, a
closed contour of the whole object and some
circles, disks, boxes inside the closed
contour The closed contour may be as
simple as rectangles, polygons, circles or any
more complex combinations of them Since
the final CAD image contains only closed
contours, we will describe our method to
extract this contour in every projections and
then link them together
As previous analysis, the cad drawing
images can be clustered in to distinguished
regions This leads us to use some clustering
algorithms in machine learning K-Means
[1] is a partitioning spatial clustering method
which regroups pixels with the nearest mean
K-Means segments data space into Voronoi
cells This method cannot be applied in this
case since the largest rectangle bounding box
will be the only one K-Means partition
Ward [2] is a hierarchical clustering
algorithm This is bottom-up algorithm which
merges small groups in to bigger ones based
on some agglomerative criteria Once more,
the largest rectangle bounds the whole image
so Ward will consider it at the only partition
DBSCAN [3] is a density-based clustering
method This extract low- and high-density
clusters Therefore, it can find clusters of
arbitrary shapes especially closed form
contours provided their points are close
enough to their neighbors DBSCAN defines
core points and outliers The formers must
form a group of at least minPts points which
the distance between one point to its closest
one in the same group is less than eps The
latter are all the remaining points
The DBSCAN algorithm can be seen as in
Fig 4
Figure 4 DBSCAN clustering algorithm
The algorithm starts from any unvisited
point p in the data space and find all points that are reachable to p One-point q is reachable to p if there is a path from p to q
where all points in the path are close enough
(compared to eps) to the previous one If the
number of reachable points are at least
minPts then a new cluster is recorded and its
points are labelled Otherwise, they are outliers
D ={ p}
eps, minPts cluster = []
Any unlabeled p
in D
N
Y
Find all points reachable to p in D based on eps
At least minPts found?
Record new cluster and label its points
N Begin
End
Y
Trang 3Based on DBSCAN clustering, our cad
recognition method includes the five steps
The first is to extract the outer and notes
partition Secondly, cad projections are
partitioned Third step aims to remove all
distance lines, alignment lines Next, the
largest contour of the object in each
projection will be revealed Finally, all the
largest contours of projections are linked
together to shape the flattening image
3 RESEARCH RESULTS
The method is testified with 20 random
cad drawing images of 300dpi eps and
minPts are chosen as 7 and 10,
correspondingly 90% of the cases produce
accurate results to extract rectangle bounding
box and notes This is because some notes are
placed far from the bounding box and some
are too close to the projections 98% of
projection partitioning are correct Some
errors are due to the fact that small
projections may have links to their bigger
demonstrations After removing all the line
and distance lines, nearly 100% of largest
contour are extracted from projections
Figure 5 The front projection
Figure 8 Final flattenning result image
Figs 5, 6, 7, 8 show the results of our methods for the cad drawing in Fig 1
4 CONCLUSION
In this paper, we target the problem of cad drawing recognition The method is based on DBSCAN clustering algorithm This produces excellent experiment results with more than 90% of clustering accuracy for 20 random cad drawings In the future, we continue with recognition of small CAD items like small circles, disks
5 REFERENCES
k-means clustering algorithm JSTOR: Applied Statistics, 28, 100 108.
Grouping to Optimize an Objective Function”, Journal of the American
[3] Martin Ester, Hans-Peter Kriegel, Jörg Sander, and Xiaowei Xu 1996 A density-based algorithm for discovering clusters a density-based algorithm for discovering clusters in large spatial databases with noise (KDD'96), Evangelos Simoudis, Jiawei Han, and Usama Fayyad (Eds.)
AAAI Press 226-231
Figure 7 The rear and left (right) projections
Figure 6 Top (down) projections