Standardized process algorithm for electronic drawing of interior design and for improving ai recognition rate
By calculating the scaling ratio, selecting vector information parameters, performing data type conversion and classification processing in the standardized process algorithm of interior design electronic drawings, the problem of information loss and distortion in the preprocessing of the input data of the AI recognition model is solved, and a more efficient and accurate AI recognition effect is achieved.
Patent Information
- Application Number
- PCT/CN2024/080346
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-30
- Filing Date
- 2024-03-06
- Publication Date
- 2025-05-08
AI Technical Summary
In the prior art, when processing vector data of interior design electronic drawings, there are problems of information loss and distortion, especially in the preprocessing of input data of AI recognition models, the highly dependent structural relationship between vector data cannot be effectively considered.
Provide a standardized process algorithm, by calculating the best matching scaling ratio between electronic drawings and A4 standard sizes, selecting appropriate vector information parameters, performing data type conversion and classification processing. For images with low information density, use the custom similarity evaluation function to select the interpolation algorithm for scaling; for images with high information density, use the overlapping sliding window method to uniformly transform to the optimal input size of the AI model.
It effectively reduces information loss and distortion, improves the recognition efficiency and accuracy of the AI recognition model, enhances the processing ability of large-span size data, and ensures the completeness of information.
Smart Images

Figure CN2024080346_08052025_PF_FP_ABST
Abstract
Description
Standardized process algorithm for interior design electronic drawings to improve AI recognition rate Technical Field
[0001] The present invention relates to the technical field of vector data primitive recognition and structural analysis of home decoration design drawings. Specifically, it relates to a standardized process algorithm for interior design electronic drawings for improving AI recognition rate, and in particular to an algorithm for the standardized process of preprocessing vector data input to an artificial intelligence (AI) recognition model. Background Art
[0002] With the development of artificial intelligence technology, intelligent recognition models are being applied in various fields. In the field of home improvement, since design drawings are basically vector data, vector data needs to be converted when using mature AI models. Vector data is composed of simple line segments and has simple basic features, but home improvement design drawing data has highly dependent structural relationships. For the input data of the recognition model, there are currently some pre-processing methods for pixel images, but these methods have the following difficulties in processing vector data:
[0003] 1) Simple and rough scaling will destroy and lose most of the basic features of the straight line;
[0004] 2) Ordinary input data processing methods do not take into account the highly dependent structural relationships between vector data.
[0005] Therefore, studying the algorithm of the standardized process of general residential interior design electronic drawings is not only conducive to improving the recognition rate of the AI recognition model, but also has important theoretical and practical significance for the preprocessing process of vector data when inputting the AI recognition model.
[0006] Summary of the Invention
[0007] The present invention aims to reduce information loss and distortion of vector data in the input data preprocessing process of traditional AI recognition models and improve the recognition efficiency of AI recognition models by providing a standardized process algorithm for electronic drawings of residential interior design. During AI recognition, the scaling ratio that best matches the A4 standard size can be calculated based on the actual size and aspect ratio of the electronic drawing; different vector information parameters are selected based on the scaling ratio and the richness of vector information, and data type conversion is performed after central template matching; images with different information richness are classified and processed based on different images and vector information richness: images with low information density are scaled using a custom similarity standard and a suitable interpolation algorithm; images with high information density are cropped using an overlapping sliding window method to uniformly transform to the optimal input size of the AI model, thereby achieving complete preservation of vector information and improving the recognition efficiency of AI components.
[0008] To achieve the above objectives, the present invention provides a standardized process algorithm for improving AI recognition rate of interior design electronic drawings, which includes performing the following steps after obtaining vector data of interior design electronic drawings, wherein the main components of the vector data are multiple different types of primitives:
[0009] Step 1: Based on the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size. This includes matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results.
[0010] Step 2: Based on the obtained scaling ratio and the richness of the vector information, select the preset vector information parameters, perform data type conversion through central template matching, and convert the vector data image into a pixel image;
[0011] Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into high information density image and low information density image based on the vector information richness;
[0012] Step 4: For images with low information density, the self-defined similarity evaluation function is used to adaptively select the interpolation algorithm for scaling; for images with high information density, the overlapping sliding window method is used for cropping;
[0013] Step 5: Transform the processed images uniformly to the input size required by the AI recognition model.
[0014] In one embodiment of the present invention, in the process of calculating the long and short side scaling ratios in step 1, the calculation process of the long and short side scaling ratios is specifically as follows:
[0015] Long side scaling ratio S L The long side of the vector data is divided evenly by the long side of the A4 standard template;
[0016] Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template;
[0017] Select the maximum scaling ratio as the final scaling ratio S = Max (S L , S S ).
[0018] In one embodiment of the present invention, the center template matching process in step 2 includes rotation determination, center positioning, and edge filling performed in sequence, wherein:
[0019] Rotation judgment is to determine whether rotation is required. The specific judgment process is as follows:
[0020] Match the long side of the vector data with the long side, and the short side with the short side of the A4 standard template size respectively. Define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required. Otherwise, no rotation is required.
[0021] The specific process of center positioning is as follows:
[0022] After scaling the original vector data after rotation according to the scaling ratio calculated in step 1, the matrix centers of the scaled vector data and the A4 standard template are calculated and aligned with each other.
[0023] The specific process of edge filling is as follows:
[0024] After alignment, calculate the matching between the long side and the long side, and the short side and the short side respectively:
[0025] If there is a perfect match, the vector data is directly filled into the A4 standard template;
[0026] Otherwise, calculate the margins on the long and short sides of the center-aligned vector data and the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the margin position with the cropped background image.
[0027] In one embodiment of the present invention, the image information degree calculation performed on the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is:
[0028] Where i represents the gray value of any pixel, j represents the gray mean of the pixel’s neighborhood, f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the gray value at the pixel position and the gray distribution of its surrounding pixels.
[0029] In one embodiment of the present invention, the interpolation algorithm in step 4 includes: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation.
[0030] In one embodiment of the present invention, the specific process of adaptively selecting an interpolation algorithm for scaling processing using a user-defined similarity evaluation function in step 4 is as follows:
[0031] Use different difference algorithms to generate multiple scaled images for any low information density image;
[0032] A custom similarity evaluation function is used to calculate the similarity between the low information density image and each scaled image generated by it;
[0033] The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.
[0034] In one embodiment of the present invention, in step 4, the custom similarity in the custom similarity evaluation function is composed of a universal image quality index (UQI) function for representing local similarity and a structural similarity (SSIM) function for representing overall structural similarity, wherein the structural similarity (SSIM) function is:
[0035] In the formula, x and y represent two images, μ x 、μ y Represents the mean of the two images x and y, δ x , δ y Represents the standard deviation of the two images x and y, δ xy Represents the covariance of images x and y, C1 and C2 are constants to maintain stability;
[0036] Among them, the image universal quality index (UQI) function is:
[0037] In the formula, x and y represent two images, and the mean of the two images x and y is They are:
[0038] The variance of the two images x and y They are:
[0039] In one embodiment of the present invention, in step 4, performing the cropping process using the overlapping sliding window method specifically includes:
[0040] Set the starting point coordinates of the sliding window to the upper left corner of the image;
[0041] Set the overlap rate of sliding window cropping to 0.25;
[0042] The sliding direction is from left to right and from top to bottom, and the end coordinates of the last cropping window that slides to the rightmost and bottommost positions are aligned with the end coordinates of the image.
[0043] Slide the cropped data and store the mapping coordinates corresponding to each cropped image as the index coordinates for restoring the recognition results; generate a sliding number weight matrix as the restoration weight of the structure analysis structure.
[0044] In one embodiment of the present invention, the input size in step 5 is determined as follows:
[0045] Select the default input data size for the AI recognition model;
[0046] Then select the two sizes of 1024 and 2048;
[0047] These three sizes are passed through the preset training set, validation set and test set, and the most appropriate size is selected as the final size based on the optimal evaluation results.
[0048] The standardized process algorithm for interior design electronic drawings disclosed in this invention for improving AI recognition rate has the following advantages and beneficial effects compared with the existing technology:
[0049] 1) By calculating the scaling ratio and determining the degree of vector information, the size range of input data is expanded, and the AI recognition model's ability to process large-span data is improved;
[0050] 2) The central template matching method in data type conversion ensures the centering of the input data, enhancing the stability of the AI recognition model's recognition effect;
[0051] 3) By dividing the input data into two types, low information density and high information density, and processing the two types of data differently, the recognition efficiency and accuracy of the AI recognition model are improved;
[0052] 4) Through a customized similarity evaluation method, an adaptive scaling and interpolation algorithm is selected for images with low information density to ensure the integrity of the information. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] FIG1 is a schematic diagram of a flow chart of an embodiment of the present invention;
[0055] FIG2 is a schematic diagram of central template matching according to an embodiment of the present invention;
[0056] FIG3 is a schematic diagram of overlapping sliding windows according to an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.
[0058] The present invention will be described in further detail below with reference to embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto. Since the present invention relates to the field of home decoration design drawings, the graphic primitives referred to herein are graphic elements stored in vector drawings, such as polylines, polygons, blocks, arcs, text, and annotations.
[0059] Figure 1 is a flow chart of an embodiment of the present invention. As shown in Figure 1, this embodiment provides a standardized process algorithm for interior design electronic drawings for improving AI recognition rate, which mainly includes two parts: scaling and matching of data conversion and classification processing of data preprocessing. The following is further detailed in conjunction with the accompanying drawings and specific implementation methods. For ease of understanding, in an example, taking common residential interior design electronic drawing vector data as an example, the above-mentioned scaling and matching and classification preprocessing are explained.
[0060] The standardized process algorithm of this embodiment includes performing the following steps after obtaining vector data of an electronic drawing of a residential interior design, wherein the main components of the vector data are a variety of different types of primitives:
[0061] Step 1: Based on the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size. This includes matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results.
[0062] In this embodiment, in the process of calculating the long and short side scaling ratios in step 1, since the size of the vector data is larger than the A4 standard size in most cases, the calculation process of the long and short side scaling ratios is specifically as follows:
[0063] Long side scaling ratio S L The long side of the vector data is divided evenly by the long side of the A4 standard template;
[0064] Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template;
[0065] In this way, the scaling ratio represents the multiple by which the size of the vector data needs to be reduced to the A4 standard size. To ensure the integrity of the data information, the maximum scaling ratio is selected as the final scaling ratio S=Max(S L, S S ).
[0066] In this embodiment, the pixel size of the electronic drawing vector data is 4800*3600 as an example. The pixel size of the A4 standard template with a resolution of 300 pixels / inch is 2479*3508. At this time, the long side of the original electronic drawing vector data is 4800 and the short side is 3600. The long side of the A4 standard template is 3508 and the short side is 3508. The long side scaling ratio is: The short side scaling ratio is: The overall scaling ratio can be obtained as follows: S = Max (S L , S S )=1.46, so 1.46 is used as the above-mentioned long and short side scaling ratio.
[0067] Step 2: Based on the obtained scaling ratio and vector information richness, select different preset vector information parameters and perform data type conversion through central template matching to convert the vector data image into a pixel image, for example, converting DWG format data into PNG image format data. The information richness of the vector data is directly determined by the number of primitives. The more primitives there are, the richer the vector data information.
[0068] In this embodiment, the richness of the vector information is determined by the number of primitives detected in the original vector data, and different preset vector information parameters are selected corresponding to the scaling ratio. Specifically, there are four cases:
[0069] 1) When the zoom ratio is large and the vector information is rich, it indicates that the vector data is a relatively complex large-scale drawing. In this case, in order to avoid destroying the original drawing data information, it is necessary to select a smaller preset vector information parameter;
[0070] 2) When the scaling ratio is large and the vector information is small, it indicates that the vector data is a relatively simple large-scale drawing. In this case, in order to preserve the integrity of the information during subsequent scaling processing, a larger preset vector information parameter can be selected;
[0071] 3) When the scaling ratio is small and the vector information is rich, it indicates that the vector data is a relatively complex small-size drawing. In order to avoid destroying the original drawing data information, it is necessary to select a smaller preset vector information parameter;
[0072] 4) When the zoom ratio is small and the vector information is small, it indicates that the vector data at this time is a relatively simple small-sized drawing. In order to preserve the integrity of the information during subsequent zoom processing, a larger preset vector information parameter can be selected.
[0073] In this embodiment, the center template matching process in step 2 includes rotation determination, center positioning, and edge filling performed in sequence, wherein:
[0074] Rotation judgment is to determine whether rotation is required. The specific judgment process is as follows:
[0075] Match the long side and short side of the vector data and the A4 standard template size respectively, and define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required, otherwise no rotation is required; according to the principle of symmetry, the angle between the short side of the vector data and the short side of the A4 standard template should also be consistent with the rotation angle.
[0076] From the long and short side matching process in step 1, it can be seen that if the long and short sides of the vector image form a vertical intersection with the long and short sides of the A4 standard size, it is necessary to first determine whether rotation is required during the center template matching. If necessary, rotate it first before performing subsequent operations.
[0077] The specific process of center positioning is as follows:
[0078] After scaling the original vector data after rotation according to the scaling ratio calculated in step 1, the matrix centers of the scaled vector data and the A4 standard template are calculated and aligned with each other.
[0079] Edge filling is to crop the background image outside the overall outline of the original vector data. The cropping size is the maximum complete length and width size recognized, and the cropped background image is filled into the unused part after scaling to ensure the consistency of information features after data conversion. The specific process is as follows:
[0080] After alignment, calculate the matching between the long side and the long side, and the short side and the short side respectively:
[0081] If there is a perfect match, the vector data is directly filled into the A4 standard template;
[0082] Otherwise, calculate the margins on the long and short sides of the center-aligned vector data and the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the margin position with the cropped background image.
[0083] FIG2 is a schematic diagram of center template matching according to an embodiment of the present invention. As shown in FIG2 , this embodiment further illustrates step 2 using the electronic drawing vector data having a pixel size of 4800*3600 as an example. Based on the previously calculated overall scaling ratio of 1.46, the scaled vector image size is calculated to be 3288*2466, which, after rotation, is 2466*3288. This is then aligned with the A4 standard template pixel size of 2479*3508 for center matching. Since both the original drawing and the A4 standard template are rectangular, i.e., symmetrical about their centerlines, the total short side margin is 2479-2466=13, and the short side margin on a single side is 13 / 2=6.5. Similarly, the long side margin on a single side is calculated to be (3508-3288) / 2=110.
[0084] Through the above steps, the number and position of the graphic elements in the original drawing vector data can be counted and calculated, the richness of the vector information and the coordinate range of the background image can be determined, and the vector parameters can be determined according to the richness of the vector; then, according to the coordinate range of the background image, the background image is cropped out, and the cropped background image is filled into the remaining area after scaling and rotation; then the vector image can be converted into a pixel image.
[0085] Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into high information density image and low information density image based on the vector information richness;
[0086] In this embodiment, the image information degree calculation performed on the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is:
[0087] Where i represents the grayscale value of any pixel (0≤i≤255), j represents the grayscale mean of the pixel neighborhood (0≤j≤255), f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the grayscale value at the pixel position and the grayscale distribution of its surrounding pixels.
[0088] Step 4: For images with low information density, the self-defined similarity evaluation function is used to adaptively select the interpolation algorithm for scaling; for images with high information density, the overlapping sliding window method is used for cropping;
[0089] In this embodiment, in step 4, the interpolation algorithms include: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation. These scaling interpolation algorithms can be called through the interpolation algorithm parameters of the scaling function in the OpenCV tool library, specifically:
[0090] Nearest neighbor interpolation:
[0091] Nearest_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,inter polation=INTER_NEAREST)
[0092] Linear interpolation (default):
[0093] Linear_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_LINEAR)
[0094] Areal interpolation:
[0095] Area_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_AREA)
[0096] Cubic spline interpolation:
[0097] Cubic_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_CUBIC)
[0098] The interpolation parameter represents the interpolation algorithm type, or interpolation method. The default is linear interpolation. The interpolation method can be set to the following values:
[0099] INTER_NEAREST: Nearest neighbor interpolation
[0100] INTER_LINEAR: Linear interpolation (default)
[0101] INTER_AREA: Area interpolation
[0102] INTER_CUBIC: 4*4 pixel area cubic spline interpolation
[0103] In this embodiment, the specific process of adaptively selecting an interpolation algorithm for scaling processing using a custom similarity evaluation function in step 4 is as follows:
[0104] Use different difference algorithms to generate multiple scaled images for any low information density image;
[0105] A custom similarity evaluation function is used to calculate the similarity between the low information density image and each scaled image generated by it;
[0106] The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.
[0107] In addition, in order to ensure an unchanged scale characteristic, the scale factor calculation method in step 1 and the center template matching method in step 2 may also be used for processing.
[0108] In this embodiment, in step 4, the custom similarity in the custom similarity evaluation function is composed of a Universal Quality Image Index (UQI) function for representing local similarity and a Structural Similarity Index (SSIM) function for representing overall structural similarity, wherein the SSIM function is:
[0109] In the formula, x and y represent two images, μ x 、μ y Represents the mean of the two images x and y, δ x , δ y Represents the standard deviation of the two images x and y, δ xy Represents the covariance of images x and y, C1 and C2 are constants to maintain stability;
[0110] Among them, the image universal quality index (UQI) function is:
[0111] In the formula, x and y represent two images, and the mean of the two images x and y is They are:
[0112] The variance of the two images x and y They are:
[0113] In this embodiment, in step 4, the cropping process using the overlapping sliding window method specifically includes:
[0114] Set the starting point of the sliding window to the upper left corner of the image, which is also the origin of the image's common coordinate system.
[0115] The overlapping ratio of the sliding window cropping is set to 0.25, where the sliding overlapping ratio specifically represents the proportion of the same data between the previous cropped image and the next cropped image. For details, see Figure 3, which is a schematic diagram of overlapping sliding windows according to one embodiment of the present invention. The purpose of sliding cropping data is to eliminate edge effects that may occur during model inference.
[0116] The sliding direction is from left to right and from top to bottom. When sliding to the rightmost and bottommost points, it is highly likely that the corresponding sliding overlap ratio cannot be satisfied simultaneously within the coordinate range of the original image data. Therefore, the coordinates of the end points (the rightmost and bottommost points) should be used as the end coordinates of the sliding window. That is, the end coordinates of the last cropping window that slides to the rightmost and bottommost points should be aligned with the end coordinates of the image.
[0117] Slide the cropped data and store the mapping coordinates corresponding to each cropped image, such as the starting pixel coordinates, as the index coordinates for restoring the recognition results; generate a sliding number weight matrix as the restoration weight of the structure analysis structure.
[0118] Among them, the above-mentioned sliding window size can be the optimal input size in the AI recognition model experiment. The optimal input size can be obtained from the evaluation results of the actual experiment. By saving the index coordinates and weight matrix of each sliding window, the prediction results of the AI recognition model can be restored to the original data coordinates.
[0119] Step 5: Transform the processed different images uniformly to the input size required by the AI recognition model.
[0120] In this embodiment, the input size in step 5 is determined as follows:
[0121] Select the default input data size for the AI recognition model;
[0122] Then choose 1024 and 2048 sizes. 1024 and 2048 are chosen based on the fact that the default input size of most AI recognition models is 256, 512, and other powers of 2. 2048 is also the power of 2 closest to the A4 standard size, which can input a larger data range into the AI recognition model, thereby enhancing the stability of the inference results. 1024 is the next-level size data set to balance GPU resources.
[0123] These three sizes are subjected to a preset training set, a validation set, and a test set, and the most appropriate size is selected as the final size based on the optimal evaluation result. The evaluation method can adopt any existing method, and the present invention is not limited to it.
[0124] After the above steps, the data input to the AI recognition model will be of uniform size, allowing for batch processing based on hardware performance to improve processing efficiency. The above-mentioned electronic drawing standardization process algorithm preserves the original information characteristics to the greatest extent possible, improving the AI recognition model's recognition rate while also enhancing the model's reasoning capabilities.
[0125] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0126] Those skilled in the art will appreciate that the modules in the apparatuses of the embodiments may be distributed in the apparatuses of the embodiments as described in the embodiments, or may be located in one or more apparatuses different from the embodiments with corresponding changes. The modules in the above embodiments may be combined into one module or further divided into multiple sub-modules.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A standardized process algorithm for improving AI recognition rate of interior design electronic drawings, comprising the following steps after obtaining vector data of interior design electronic drawings, wherein the main components of the vector data are a plurality of different types of primitives, characterized in that: Step 1: According to the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size, specifically including matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results; Step 2: According to the obtained scaling ratio and the richness of the vector information, select the preset vector information parameters, perform data type conversion through central template matching, and convert the vector data image into a pixel image; Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into a high information density image and a low information density image in combination with the vector information richness; Step 4: For images with low information density, the interpolation algorithm is adaptively selected for scaling by using a custom similarity evaluation function; for images with high information density, the overlapping sliding window method is used for cropping; Step 5: Transform the processed images uniformly to the input size required by the AI recognition model.
2. According to claim 1, the standardized process algorithm for interior design electronic drawings for improving AI recognition rate is characterized in that: In the process of calculating the long and short side scaling ratio in step 1, the calculation process of the long and short side scaling ratio is specifically as follows: Long side scaling ratio S L The long side of the vector data is divided by the long side of the A4 standard template; Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template; Select the maximum scaling ratio as the final scaling ratio S = Max (S L , S S ).
3. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The center template matching process of step 2 includes rotation judgment, center positioning and edge filling performed in sequence, wherein: Rotation judgment is to judge whether rotation is needed. The specific judgment process is as follows: Match the long side and the short side of the vector data and the A4 standard template size respectively, and define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required, otherwise no rotation is required; The specific process of center positioning is as follows: After scaling the original vector data after rotation judgment according to the scaling ratio calculated in step 1, the scaled vector data and the matrix center of the A4 standard template are calculated respectively, and the two are aligned and matched; The specific process of edge filling is as follows: After alignment and matching, calculate the matching between the long sides and the short sides of the two: If there is a complete match, the vector data is directly filled into the A4 standard template; Otherwise, calculate the margins on the long and short sides of the vector data after center alignment and matching with the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the cropped background image to the margin position.
4. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The image information degree calculation of the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is: Where i represents the gray value of any pixel, j represents the gray mean of the pixel neighborhood, f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the gray value at the pixel position and the gray distribution of its surrounding pixels.
5. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The interpolation algorithms in step 4 include: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation.
6. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 5 is characterized in that: In step 4, the specific process of adaptively selecting the interpolation algorithm for scaling processing through the customized similarity evaluation function is as follows: Use different difference algorithms to generate multiple scaled images for any image with low information density; A custom similarity evaluation function is used to calculate the similarity between the low information density image and each of the scaled images generated by it; The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.
7. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 6 is characterized in that: In step 4, the custom similarity in the custom similarity evaluation function is composed of a general image quality index function for representing local similarity and a structural similarity function for representing overall structural similarity, wherein the structural similarity function is: In the formula, x and y represent two images, μ x , μ y Respectively represent the mean of the two images x and y, δ x ,δ y Respectively represent the standard deviation of the two images x and y, δ xy represents the covariance of images x and y, C1 and C2 are constants to maintain stability; Among them, the general image quality index function is: In the formula, x and y represent two images, and the mean of the two images x and y is They are: Variance of two images x and y They are:
8. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: In step 4, the cropping process using the overlapping sliding window method specifically includes: Set the starting point coordinate of the sliding window to the upper left corner of the image; Set the overlap rate of sliding window cropping to 0.25; The sliding directions are from left to right and from top to bottom, and the end coordinates of the last cropping window that slides to the rightmost and bottommost are aligned with the end coordinates of the image; The sliding cropping data is stored, and the mapping coordinates corresponding to each cropped image are stored at the same time as the index coordinates for restoring the recognition results, and a sliding number weight matrix is generated as the restoration weight of the structure parsing structure.
9. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The input size of step 5 is determined as follows: Select the default input data size for the AI recognition model; Then select the two sizes of 1024 and 2048; These three sizes are passed through the preset training set, validation set and test set, and the most appropriate size is selected as the final size based on the best evaluation result.
Citation Information
Patent Citations
Method for automatically correcting satellite borne optical remote sensing image based on vector base map matching
CN106920235A
Construction drawing review-based vector drawing compiling method and system
CN112419208A
Target identification self-evaluation method based on structural similarity
CN114283296A
Drawing feature and number matching method, system, equipment and medium
CN116206320A
System and method for the scaling of image streams that use motion vectors
US6075906A
Cited By
Intelligent house type image recognition method and device based on image recognition
CN120726641A
Processing system for processing multi-modal electric power engineering drawing data
CN121147207A