| Buildings are one of the most important basic geographic information in topographic maps.Accurately extracting buildings from multi-source data such as raster maps and remote sensing images is beneficial to urban change analysis and three-dimensional modeling.There are various sources of building contour data.In this paper,aiming at the problems of sawtooth,irregular boundary and inaccurate position of building contour extracted from historical raster map,remote sensing image and Li DAR point cloud data,the building contour optimization method based on main direction and the building contour optimization method based on template matching are studied successively.Among them,the building contour optimization method based on the main direction has the advantages of high accuracy and strong universality;the contour optimization method based on template matching is helpful to solve the problem that the threshold selection is difficult and the special contour is difficult to strong practicability.The main work and achievements of this paper are as follows:(1)The basic theory and method of contour optimization are studied.In this paper,the related theories and methods of building contour optimization are studied and explored,including common contour extraction methods,image corner detection and sorting methods,contour simplification methods,contour regularization methods and contour optimization methods.(2)A contour optimization method based on main direction is designed.Firstly,the improved Douglas-Peucker algorithm is used to simplify the initial contour.Compared with the traditional Douglas-Peucker algorithm,the direct influence of the contour starting and ending points and the simplified threshold in the contour simplification process is reduced,and the accuracy of simplification is effectively improved.Secondly,a contour reconstruction method based on least square method is designed.The accuracy of the contour is improved by linear fitting of the contour boundary points,and the further optimization of the contour is realized.Thirdly,a regularization method for feature edges and feature angles is designed.By calculating and finding the defined feature edges and feature angles and performing regularization processing,the local contour regularity is effectively improved.Then,a right angle method based on the main direction is designed,and the contour is right angled according to the main direction found,which effectively enhances the right angle feature of the whole building contour.Finally,a position precision method based on the maximum area overlap is designed.The error circle is constructed for meshing,and the obtained grid intersection is used to adjust the contour position based on the maximum area overlap to further improve the position accuracy of the contour.(3)Since the contour optimization method based on the main direction cannot be applied to the optimization of special building contours(such as building contours containing arc structures),a contour optimization method based on template matching is designed for this problem.Firstly,the template library of contour matching is constructed.Combining OSM buildings and artificially created vector buildings for target segmentation,image enhancement and other operations,a rich template image containing only a single building is obtained,which fully makes up for the problem of less template types in the traditional template matching method.Then,based on the perceptual hash algorithm,the similarity measure is carried out.By calculating the hash value of the input image and the template image to the Hamming distance,the best template image with the highest similarity is identified.Finally,the corresponding vector contour is obtained based on the coordinate position information of the best template image,and the final optimized contour is obtained by contour matching.(4)Experiments and results analysis were carried out.For the contour optimization method based on the main direction,this paper conducts experiments with three source data respectively.The results show that the method achieves more than 90 % in position similarity,direction similarity,size similarity and shape similarity.Compared with common contour optimization methods,it has higher result accuracy and stronger universality.For the contour optimization method based on template matching,this paper conducts template matching experiments based on simple contour images and special contour images respectively.The Hamming distance values obtained are all less than 15,indicating that the method can be applied to multiple types of building contours.It has strong feasibility and accuracy,and is superior to the traditional template matching method. |