CN-122023561-A - House type graph grid vectorization method, device, equipment and storage medium
Abstract
The invention discloses a house type diagram grid vectorization method, device, equipment and storage medium, wherein the method comprises the steps of obtaining a noisy design house type diagram and a vectorization structure description file of a corresponding original house type diagram; extracting the coordinates of mark pixels of image blocks of each space area which are not allowed to be changed from a vectorization structure description file, acquiring a clustering parameter by adopting a clustering parameter acquisition model, clustering, dividing a house type image into a plurality of space area image blocks, removing the space area image blocks which are not allowed to be changed from the space area image blocks, mapping the rest image blocks into single color values, correcting each space area to obtain the coordinates of mark pixels of each corrected space area image block, and integrating the coordinates of the mark pixels of each space area image block which are not allowed to be changed with the coordinates of mark pixels of each corrected space area image block to obtain vectorization data. The invention can realize the vectorization of the house type graph containing noise and special-shaped structures.
Inventors
- ZHU MIAO
- SONG MIAO
Assignees
- 北京楠社科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241106
Claims (12)
- 1. The house type graph grid vectorization method is characterized by comprising the following steps of: acquiring a noise-containing design house type diagram to be vectorized and a vectorized structure description file of an original house type diagram corresponding to the noise-containing design house type diagram; Extracting the coordinates of mark pixel points of each spatial region image block which is not allowed to be changed in house type design from a vectorization structure description file of an original house type diagram, wherein the mark pixel points are pixel points capable of positioning the position of the spatial region image block; Acquiring clustering parameters suitable for a current noisy design house type graph by adopting a trained clustering parameter acquisition model, wherein the clustering parameter acquisition model is specifically a machine learning model; clustering pixel points in the noise-containing design house type graph by adopting the acquired clustering parameters, so that the noise-containing design house type graph is divided into a plurality of space region image blocks, and coordinates and color values of all the pixel points in each space region image block are obtained; removing each spatial region image block which is not allowed to be changed from all spatial region image blocks, and mapping the color values of all pixel points in each remaining spatial region image block into a single color value according to a preset spatial region-color mapping rule, wherein the preset spatial region-color mapping rule is used for indicating the color values corresponding to different spatial regions; correcting each mapped spatial region image block to obtain coordinates of marked pixel points in each corrected spatial region image block; And integrating the coordinates of the marked pixel points of the image blocks of each space area which are not allowed to be changed with the coordinates of the marked pixel points of the image blocks of each space area after correction to obtain vectorized data of the noise-containing design house type diagram.
- 2. The house type graph grid vectorization method of claim 1 further comprising, before the step of acquiring the clustering parameters applicable to the current noisy design house type graph by using the trained clustering parameter acquisition model: preprocessing the noisy design house type diagram, wherein the preprocessing specifically comprises the following steps: Performing size processing on the noise-containing design house type graph to enable the number of rows and the number of columns of pixel points of the noise-containing design house type graph to be equal; noise is reduced on the noise-containing design house type graph after the size processing, and the noise-reduced image is used as a first processing image; Performing edge enhancement on the noise-containing design house type graph after the size processing, and taking the image after the edge enhancement as a second processing image; And calculating the weighted sum of the first processed image and the second processed image to be used as a preprocessed noisy design layout.
- 3. The house type graph grid vectorization method according to claim 1, wherein the training method of the cluster parameter acquisition model comprises the following steps: acquiring a plurality of noisy design house type graphs and corresponding noiseless design house type graphs; Taking the positions of the image blocks of each spatial region in the noise-free design house type diagram as the basis, and taking the image parts of the same position in each noise-containing design house type diagram as the corresponding spatial region image blocks; Taking the color average value of all pixel points in each spatial region image block as a cluster center point in a clustering parameter, taking the number of the spatial region image blocks as the number of clusters in the clustering parameter, and taking the clustering parameter as a label of a corresponding noisy design house type graph; And taking a plurality of noisy design house types and corresponding labels as samples, and inputting the samples into the clustering parameter acquisition model for training to obtain a trained clustering parameter acquisition model.
- 4. The house type map grid vectorization method according to claim 1, wherein the correcting the mapped spatial region image blocks to obtain coordinates of marked pixel points in the corrected spatial region image blocks specifically comprises: acquiring a room door region image block, a window region image block and a non-bearing wall region image block from the mapped space region image blocks; Respectively carrying out thickness correction on the room door region image block, the window region image block and the non-bearing wall region image block to ensure that the thicknesses of the room door region image block, the window region image block and the non-bearing wall region image block are consistent with the thickness of a wall body; And extracting coordinates of the mark pixel points from each corrected space region image block.
- 5. The house type map grid vectorizing method of claim 4 wherein the thickness correction is performed on the room door region image block, the window region image block and the non-bearing wall region image block respectively, specifically comprising: binarizing the noise-containing design house type graph, and obtaining the outer outline of the house in the binarized noise-containing design house type graph, and the outermost edge lines of each room door area image block, each window area image block and each non-bearing wall area image block; Expanding the outermost edge line of each room door region image block, each window region image block and each non-bearing wall region image block inwards by a preset thickness to serve as a primarily corrected room door region image block, a window region image block and a non-bearing wall region image block; Searching the wall body where the primarily corrected room door region image block and the primarily corrected window region image block are located, and correcting the thickness of the room door region image block and the thickness of the primarily corrected window region image block to be consistent with the thickness of the wall body; and judging whether the primarily corrected non-bearing wall area image block is positioned on the outer contour of the house, and if not, correcting the thickness of the non-bearing wall area image block to be a preset non-bearing wall thickness.
- 6. The utility model provides a house type graph grid vectorization device which characterized in that includes: The data acquisition module is used for acquiring the noisy design house type diagram to be vectorized and the vectorized structure description file of the original house type diagram corresponding to the noisy design house type diagram; The first information extraction module is used for extracting the coordinates of the mark pixel points of the image blocks of each space area, which are not allowed to be changed in the house type design, from the vectorization structure description file of the original house type diagram, wherein the mark pixel points are the pixel points capable of locating the positions of the image blocks of the space area; The system comprises a clustering parameter acquisition module, a clustering parameter analysis module and a clustering parameter analysis module, wherein the clustering parameter acquisition module is used for acquiring clustering parameters suitable for a current noisy design house type graph by adopting a trained clustering parameter acquisition model, and the clustering parameter acquisition model is specifically a machine learning model; The clustering module is used for clustering the pixel points in the noise-containing design house type graph by adopting the acquired clustering parameters, so that the noise-containing design house type graph is divided into a plurality of space region image blocks, and coordinates and color values of all the pixel points in each space region image block are obtained; the color mapping module is used for eliminating each spatial region image block which is not allowed to be changed from all the spatial region image blocks, and mapping the color values of all pixel points in each remaining spatial region image block into a single color value according to a preset spatial region-color mapping rule, wherein the preset spatial region-color mapping rule is used for indicating the color values corresponding to different spatial regions; the image block correction module is used for correcting the mapped image blocks of each space region to obtain coordinates of marked pixel points in the corrected image blocks of each space region; and the data integration module is used for integrating the coordinates of the mark pixel points of the image blocks of each space area which are not allowed to be changed with the coordinates of the mark pixel points of the image blocks of each space area after correction to obtain vectorization data of the noisy design layout.
- 7. The household pattern grid vectorization device according to claim 6, wherein the device further comprises a preprocessing module, and the preprocessing module specifically comprises: The size processing unit is used for performing size processing on the noise-containing design house type graph so that the number of rows and the number of columns of pixel points of the noise-containing design house type graph are equal; The noise reduction unit is used for reducing noise of the noise-containing design house type graph after the size processing, and taking the noise-reduced image as a first processed image; The edge enhancement unit is used for carrying out edge enhancement on the noise-containing design house type graph after the size processing, and taking the image after the edge enhancement as a second processed image; and the fusion unit is used for calculating the weighted sum of the first processing image and the second processing image and taking the weighted sum as a preprocessed noisy design layout.
- 8. The house type graph grid vectoring device of claim 6, further comprising a model training module comprising: the sample acquisition unit is used for acquiring a plurality of noisy design house type graphs and corresponding noiseless design house type graphs; The region segmentation unit is used for taking the image part at the same position in each noise-containing design house type diagram as a corresponding space region image block according to the position of each space region image block in the noise-free design house type diagram; The label acquisition unit is used for taking the average value of the colors of all pixel points in each spatial region image block as a cluster center point in the clustering parameter, taking the number of the spatial region image blocks as the number of clusters in the clustering parameter, and taking the clustering parameter as a label of a corresponding noisy design house type graph; The training unit is used for taking the plurality of noisy design house type diagrams and the corresponding labels as samples, inputting the samples into the clustering parameter acquisition model for training, and obtaining a trained clustering parameter acquisition model.
- 9. The household pattern grid vectorization device according to claim 6, wherein the image block correction module specifically comprises: The image block extraction unit is used for obtaining a room door region image block, a window region image block and a non-bearing wall region image block from the mapped space region image blocks; The thickness correction unit is used for respectively correcting the thicknesses of the room door region image block, the window region image block and the non-bearing wall region image block so that the thicknesses of the room door region image block, the window region image block and the non-bearing wall region image block are consistent with the thicknesses of the wall bodies; And the coordinate acquisition unit is used for extracting the coordinates of the mark pixel points from each corrected space region image block.
- 10. The household pattern grid vectorization device according to claim 9, wherein the thickness correction unit specifically comprises: The contour edge extraction subunit is used for binarizing the noise-containing design house type graph, and acquiring the outer contour of the house in the binarized noise-containing design house type graph, and the outermost edge lines of each room door area image block, each window area image block and each non-bearing wall area image block; The primary correction subunit is used for expanding the outermost edge lines of each room door region image block, each window region image block and each non-bearing wall region image block inwards by a preset thickness to serve as a room door region image block, a window region image block and a non-bearing wall region image block after primary correction; the door and window fine correction subunit is used for searching the wall body where the primarily corrected room door region image block and the primarily corrected window region image block are located, and correcting the thickness of the room door region image block and the thickness of the primarily corrected window region image block to be consistent with the thickness of the wall body; and the non-bearing wall fine correction subunit is used for judging whether the primarily corrected non-bearing wall area image block is positioned on the outer contour of the house, and if not, correcting the thickness of the non-bearing wall area image block to be a preset non-bearing wall thickness.
- 11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1-5.
- 12. A computer readable storage medium having stored thereon a computer program/instruction, which when executed by a processor, implements the method of any of claims 1-5.
Description
House type graph grid vectorization method, device, equipment and storage medium Technical Field The present invention relates to graphics processing technologies, and in particular, to a house type graph grid vectorization method, apparatus, device, and storage medium. Background The house type diagram is a top plane space layout diagram of a house, namely a diagram for describing the use function, the corresponding position and the size of each independent space. Indoor design person can reform transform house type basic space earlier when the house is decorated in order to let the house more comfortable and convenient, through the design house type diagram after the designer reforms transform, the user can have clear cognition to the house plane layout after reforming transform. However, the house type graph is a picture format, the picture format belongs to raster data, and the raster data is data organization which represents spatial ground objects or phenomenon distribution in a regular array, and each data in the organization represents non-geometric attribute characteristics of the ground objects or phenomena. Raster data is disadvantageous for subsequent further processing and therefore it is often necessary to vectorize, i.e. convert raster data into vector data representing geographical entities such as points, lines and polygons as precisely as possible by means of registered coordinates. The process of vectorizing the house type graph grid is a process of expressing the house type graph by adopting coordinates and color values of each pixel point. Noise is caused in the processes of uploading, downloading, transmitting and the like of the house type graph, and the vectorization of the house type graph grid containing the noise is more difficult. The existing grid vectorization algorithm is mostly based on non-house type pictures (such as cartoon pictures and the like), the house type pictures are more complex and difficult to adapt, the existing grid vectorization algorithm of the non-house type pictures cannot adapt, and the existing grid vectorization algorithm based on the house type pictures is only applicable to simple rectangular structures and cannot adapt to house type pictures which contain noise and contain special-shaped structures (such as inclined walls, doors and windows). Disclosure of Invention Aiming at the problems existing in the prior art, the invention aims to provide a house type graph grid vectorization method, device and equipment which are applicable to noise and comprise special-shaped structures and a storage medium. In order to achieve the above object, the present invention provides the following technical solutions: A house type graph grid vectorization method comprises the following steps: acquiring a noise-containing design house type diagram to be vectorized and a vectorized structure description file of an original house type diagram corresponding to the noise-containing design house type diagram; Extracting the coordinates of mark pixel points of each spatial region image block which is not allowed to be changed in house type design from a vectorization structure description file of an original house type diagram, wherein the mark pixel points are pixel points capable of positioning the position of the spatial region image block; Acquiring clustering parameters suitable for a current noisy design house type graph by adopting a trained clustering parameter acquisition model, wherein the clustering parameter acquisition model is specifically a machine learning model; clustering pixel points in the noise-containing design house type graph by adopting the acquired clustering parameters, so that the noise-containing design house type graph is divided into a plurality of space region image blocks, and coordinates and color values of all the pixel points in each space region image block are obtained; removing each spatial region image block which is not allowed to be changed from all spatial region image blocks, and mapping the color values of all pixel points in each remaining spatial region image block into a single color value according to a preset spatial region-color mapping rule, wherein the preset spatial region-color mapping rule is used for indicating the color values corresponding to different spatial regions; correcting each mapped spatial region image block to obtain coordinates of marked pixel points in each corrected spatial region image block; And integrating the coordinates of the marked pixel points of the image blocks of each space area which are not allowed to be changed with the coordinates of the marked pixel points of the image blocks of each space area after correction to obtain vectorized data of the noise-containing design house type diagram. Further, before the step of obtaining the clustering parameters applicable to the current noisy design house type graph by using the trained clustering parameter obtaining model, the method further compr