1. An image processing method comprising: detecting edge information from an input image; identifying a plurality of lines from the edge information; dividing the input image into a plurality of areas based on relative locations of the plurality of identified lines; calculating a similarity between adjacent areas of the plurality of divided areas; detecting boundaries between adjacent areas as line segments partitioning the adjacent areas based on a degree of dissimilarity of the adjacent areas, wherein each of the line segments is at least a portion of the plurality of lines; and connecting the line segments forming the boundaries and generating a connected shape using the boundaries.