Building planning method and system based on color analysis

By collecting RGB image data and converting it into the HSV color space, and using K-means clustering and perceptual hashing algorithms, a building color database is constructed, which solves the problems of subjective error and fragmentation in color analysis and realizes the scientificity and reliability of architectural planning.

CN120929630APending Publication Date: 2025-11-11XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511069301.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In existing technologies, color analysis in architectural planning is greatly affected by subjective factors, lacks accuracy and efficiency, makes it difficult to build a full-domain color database, results in fragmented results, and lacks systematic quantitative content, scientific rigor and reliability.

Method used

By collecting RGB image data and converting it to the HSV color space, the dominant color is extracted using the K-means clustering algorithm, color-derived parameters and similarity are calculated, an architectural color database is constructed, and a perceptual hashing algorithm is used for batch clustering of multiple images.

Benefits of technology

It improves the objectivity and accuracy of color analysis, reduces human error, and builds a full-domain color database based on automated processing, providing a scientific and quantitative basis for color decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929630A_ABST
    Figure CN120929630A_ABST
Patent Text Reader

Abstract

The invention relates to a building planning method and system based on color analysis, and the method comprises the steps: collecting RGB image data of each building under the same environment parameters, converting the RGB image data into an HSV color space, and obtaining the color data and gray data of each pixel point; counting a color data combination proportion, generating a dimension color distribution statistical graph, marking color coordinates with the number of pixel points exceeding a preset value, constructing three-dimensional coordinates through the color data of the pixel points in the image, and clustering to obtain an image main color proportion; calculating color derivative parameters according to the gray data and the color data; obtaining color similarity according to the color data of each image through a perceptual hash algorithm; and building a building color database. By adopting the technical scheme of the invention, the objectivity, accuracy and efficiency of color analysis can be improved, and a scientific building color database is constructed to support planning and decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of architectural design technology, and in particular to an architectural planning method and system based on color analysis. Background Technology

[0002] Color analysis is an important foundation for guiding architectural style design and environmental color control. Its core objectives include recording color phenomena, exploring color rules, and constructing a color evaluation and control system.

[0003] In existing technologies, color analysis typically revolves around three levels: micro, meso, and macro. These include the color representation of building materials, the color composition of individual buildings, and the overall environmental color characteristics. The Munsell color system is commonly used, representing color attributes through hue (H), saturation (S), and value (V), providing a basis for material selection, individual building design, and environmental guidelines. However, these technologies have significant limitations. Firstly, color data processing is heavily influenced by subjective factors. Color block segmentation relies on manual selection, leading to edge errors and area estimation biases. Primary color extraction depends on human experience and lacks an automatic recognition mechanism. Color evaluation relies on architects' subjective judgment and lacks objective verification, easily causing conclusions to deviate from reality. Secondly, the analysis lacks precision and efficiency. Mosaic-style simplification algorithms cannot reflect subtle color differences, especially causing statistical distortion in gradient materials. Furthermore, it is difficult to process multi-source image data in batches and build a comprehensive color database, resulting in fragmented results in large-scale architectural analysis. Consequently, color analysis lacks systematic quantitative content and efficient, accurate processing methods, hindering the scientific rigor and reliability of color application in architectural planning.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a building planning method and system based on color analysis, which can improve the objectivity, accuracy, and efficiency of color analysis and construct a scientific building color database to support planning decisions.

[0006] To achieve the objectives of this application, the following technical solution is provided:

[0007] Firstly, this application provides an architectural planning method based on color analysis, including:

[0008] RGB image data of each building under the same environmental parameters will be collected and converted into HSV color space to obtain the color data and grayscale data of each pixel; the color data is hue value, saturation value and lightness value.

[0009] The proportion of color data combinations is statistically analyzed, a dimensional color distribution statistical chart is generated, and the color coordinates of the number of pixels exceeding a predetermined value are marked. At the same time, a three-dimensional coordinate is constructed using the color data of the pixels in the image, and the proportion of the main color in the image is obtained by clustering.

[0010] Color-derived parameters are calculated based on the grayscale data and the color data; wherein, the color-derived parameters include contrast and image complexity;

[0011] The color similarity is obtained by using a perceptual hash algorithm based on the color data of each image;

[0012] A building color database is constructed based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.

[0013] In one possible implementation, the step of acquiring RGB image data of each building under the same environmental parameters, converting it to the HSV color space, and obtaining the color and grayscale data of each pixel includes:

[0014] RGB images of each building were acquired using image acquisition equipment under the same environmental parameters;

[0015] Upload the RGB image to the Matlab platform;

[0016] The rgb2hsv function of the Matlab platform is used to convert the image from the RGB color space to the HSV color space and obtain the color data and grayscale data of each pixel.

[0017] In one possible implementation, the steps of statistically analyzing the color data combination ratio, generating a dimensional color distribution statistical chart and marking the color coordinates of pixels exceeding a predetermined value, and simultaneously constructing three-dimensional coordinates using the color data of pixels in the image and clustering to obtain the proportion of the dominant color in the image include:

[0018] The combination ratio of all pixel color data is statistically analyzed to generate color distribution statistics charts in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value, and the color coordinates of the number of pixels exceeding a predetermined value are marked.

[0019] Pixel color data is treated as three-dimensional coordinates. K-means clustering is used to iteratively divide the pixels until the variance is minimized, resulting in K cluster centers, which correspond to the main colors. At the same time, the number of pixels of each main color and its proportion are counted to obtain the proportion of the main color of the image.

[0020] In one possible implementation, the step of statistically analyzing the combined proportions of color data for all pixels, generating a color distribution statistical chart in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value, and marking the color coordinates where the number of pixels exceeds a predetermined value, includes:

[0021] The color data of all pixels in the image are statistically analyzed, and the proportion of the color data combinations is calculated.

[0022] Based on the proportion of the color data combinations, generate color distribution statistics charts in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value;

[0023] When the number of pixels of the same color in an image exceeds a predetermined value, color marking is performed in the color distribution statistics chart.

[0024] In one possible implementation, the step of treating pixel color data as three-dimensional coordinates, using K-means clustering to iteratively divide pixels until the variance is minimized, obtaining K cluster centers to obtain the corresponding dominant color, and simultaneously counting the number and proportion of pixels of each dominant color to obtain the dominant color proportion of the image includes:

[0025] The color data of each pixel in the image is regarded as the three-dimensional spatial coordinates of each pixel;

[0026] The K-means clustering algorithm is used, which iteratively calculates the distance extremum using a function and divides all pixels into K sub-groups to minimize the variance, thus obtaining K cluster centers.

[0027] The three-dimensional spatial coordinates of the cluster centers are mapped to the color data to obtain the main color of the image. The number of pixels and their proportion in each cluster are counted to obtain the proportion of the main color of the image.

[0028] In one possible implementation, the step of calculating the color-derived parameters based on the grayscale data and the color data includes:

[0029] The contrast ratio is calculated using the contrast formula based on the grayscale data.

[0030] The color data is used to calculate the entropy and edge ratio, and the grayscale data is used to calculate the contrast, covariance, and energy.

[0031] The complexity is calculated using a complexity formula based on the selected information entropy, the edge ratio, the contrast, the relevance, and the energy.

[0032] In one possible implementation, the contrast formula is:

[0033] C=∑ δ δ(i,j) 2 P δ (i,j);

[0034] Where δ(i,j) is the absolute value of the gray-level difference between adjacent pixels, P δ (i,j) represents the distribution ratio of pixels with a gray level difference of δ between adjacent pixels;

[0035] The complexity formula is:

[0036] F=A1×S1+A2×S2+A3×S3+A4×S4+A5×S5;

[0037] Where F is the complexity, A1 is the selection information entropy, A2 is the marginal ratio, A3 is the contrast, A4 is the relevance, A5 is the energy, S1 is the first weight coefficient, S2 is the second weight coefficient, S3 is the third weight coefficient, S4 is the fourth weight coefficient, and S5 is the fifth weight coefficient. The specific values ​​of S1-S5 are determined based on the correlation between A1-A5 and complexity.

[0038] In one possible implementation, the step of obtaining color similarity based on the color data of each image using a perceptual hashing algorithm includes:

[0039] The color information of an image is converted into an information fingerprint string using a perceptual hash algorithm; the color information includes: color data, color distribution characteristics, three-dimensional coordinates of the dominant color, and the proportion of the dominant color.

[0040] Compare the information fingerprint strings of two images and calculate the Hamming distance between each pair of images;

[0041] The K-means clustering algorithm is used to cluster the Hamming distance of all image information fingerprints. Images in the same category have similar information fingerprints, and the clustering results of images with similar colors are obtained.

[0042] The color similarity of images of the same type can be obtained using a similarity formula.

[0043] In one possible implementation, the similarity formula is:

[0044]

[0045] Where X represents color similarity, S t S is the Hamming distance between any two images. zX represents the average Hamming distance between images of the same type; where a larger similarity X indicates a higher similarity between the two images.

[0046] Secondly, this application also provides a color analysis-based architectural planning system for executing the aforementioned color analysis-based architectural planning method, the system comprising:

[0047] The image acquisition module is used to acquire RGB image data of each building under the same environmental parameters, convert it into HSV color space, and obtain the color data and grayscale data of each pixel.

[0048] The color analysis module is used to statistically analyze the proportion of the color data combinations, generate a dimensional color distribution statistical chart, and mark the color coordinates of the number of pixels exceeding a predetermined value. It also constructs three-dimensional coordinates through the color data of the pixels in the image and clusters them to obtain the proportion of the main color in the image.

[0049] A derivation calculation module is used to calculate color derivation parameters based on the grayscale data and the color data; wherein, the color derivation parameters include contrast and image complexity;

[0050] The similarity calculation module is used to obtain color similarity based on the color data of each image using a perceptual hash algorithm;

[0051] The result generation module is used to construct an architectural color database based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.

[0052] The technical solution provided in this application may include the following beneficial effects:

[0053] The architectural planning method and system based on color analysis provided in this application can reduce color data deviations caused by manual operation and improve analysis accuracy through standardized image acquisition and automated Matlab processing; it can automatically extract the primary color by relying on the K-means clustering algorithm, replacing manual experience judgment and eliminating subjective errors; it can solve the problem of ambiguous parameter definitions by calculating color-derived parameters through standardized formulas, ensuring that the results are repeatable and comparable; and it can efficiently build a full-domain color database by using the perceptual hashing algorithm to achieve batch clustering of multiple images, avoiding data fragmentation during large-scale analysis, and providing a scientific and quantitative basis for color decision-making in architectural planning.

[0054] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0055] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Obviously, the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0056] Figure 1 A flowchart illustrating a color analysis-based architectural planning method provided in this application embodiment;

[0057] Figure 2 A flowchart illustrating step S100 of a color analysis-based architectural planning method provided in this application embodiment;

[0058] Figure 3 A flowchart illustrating step S200 of a color analysis-based architectural planning method provided in this application embodiment;

[0059] Figure 4 A flowchart illustrating step S300 of a color analysis-based architectural planning method provided in an embodiment of this application;

[0060] Figure 5 A flowchart illustrating step S400 of a color analysis-based architectural planning method provided in this application embodiment;

[0061] Figure 6 This is a structural diagram of a color analysis-based architectural planning system provided in an embodiment of this application. Detailed Implementation

[0062] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0063] This example implementation first provides a color analysis-based building planning method for dynamic interference power management under conditions of sparse feedback and missing observations. (Reference) Figure 1 As shown, the color analysis-based architectural planning method may include the following steps:

[0064] Step S100: Collect RGB image data of each building under the same environmental parameters, convert it into HSV color space, and obtain the color data and grayscale data of each pixel; the color data is hue value, saturation value and brightness value.

[0065] Step S200: Statistically analyze the proportion of color data combinations, generate a dimensional color distribution statistical chart, and mark the color coordinates of colors with a number of pixels exceeding a predetermined value. At the same time, construct three-dimensional coordinates through the color data of pixels in the image, and cluster to obtain the proportion of the main color of the image.

[0066] Step S300: Calculate color-derived parameters based on the grayscale data and the color data; wherein the color-derived parameters include contrast and image complexity.

[0067] Step S400: Obtain color similarity based on the color data of each image using a perceptual hash algorithm.

[0068] Step S500: Construct an architectural color database based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.

[0069] Below, we will refer to Figures 2 to 5 The steps of the color analysis-based architectural planning method described above in this example embodiment will be explained in more detail.

[0070] In step S100, RGB image data of each building under the same environmental parameters are collected and converted into HSV color space to obtain color data and grayscale data of each pixel; the color data are hue value, saturation value and brightness value.

[0071] Understandably, images of buildings and their environment can be acquired using drones equipped with cameras or handheld cameras. Unless the study focuses on the visual color of buildings under specific weather conditions, shooting should be done on overcast days with good air quality to obtain diffused light effects. Shooting time should be between 9:00 AM and 4:00 PM to avoid color temperature changes during sunrise and sunset. White balance should be adjusted on the camera before shooting. When conducting comparative studies on colors in different environments, the weather, time, and equipment used should be identical to ensure consistent color acquisition. The acquired RGB images should then be uploaded to the Matlab platform.

[0072] The rgb2hsv function in Matlab is used to convert the image from the RGB color space to the HSV color space, and the hue (H), saturation (S), and lightness (V) values ​​of each pixel are obtained. The default value range is 0-1. For more intuitive visualization, the value range and division interval are adjusted when performing different statistical analyses.

[0073] In one possible implementation, step S100 may further include the following sub-steps:

[0074] In step S110, RGB images of each building are acquired using an image acquisition device under the same environmental parameters; wherein, the environmental parameters include: shooting weather, shooting time, and shooting device.

[0075] Understandably, choosing a cloudy, diffused lighting environment can reduce color reflection deviations caused by direct strong light. Fixing the shooting time from 9 am to 4 pm can avoid the impact of drastic color temperature changes during sunrise and sunset on color acquisition. Adjusting the camera's white balance ensures that the color benchmark is consistent in different scenes, providing standardized raw data for subsequent analysis.

[0076] In step S120, the RGB image is uploaded to the Matlab platform.

[0077] It should be noted that the Matlab platform has efficient image processing and matrix operation capabilities, supports batch import of image data and calling built-in functions for color space conversion, providing stable technical support for subsequent pixel-level color analysis and algorithm calculations.

[0078] In step S130, the image is converted from the RGB color space to the HSV color space using the rgb2hsv function of the Matlab platform, and the color data and grayscale data of each pixel are obtained.

[0079] It should be noted that the RGB to HSV color space conversion can separate the brightness and saturation characteristics of colors, which is more in line with the human eye's perception of color; the simultaneous extraction of grayscale data provides a basis for subsequent contrast calculation and texture feature analysis, realizing the synergistic use of color and grayscale information.

[0080] In step S200, the proportion of color data combinations is statistically analyzed, a dimensional color distribution statistical chart is generated, and the color coordinates of pixels with a number exceeding a predetermined value are marked. At the same time, three-dimensional coordinates are constructed using the color data of pixels in the image, and the proportion of the main color in the image is obtained by clustering.

[0081] Understandably, this involves statistically analyzing all pixels in the image, calculating the percentage of pixels in each H, S, V combination, and generating a color distribution chart in HS, HV, and SV dimensions. Simultaneously, to better represent the proportion of different colors in the building and environment, the color classification can be reduced by mapping H / S / V values ​​to integers between 1 and 10, resulting in 10 × 10 × 10 = 1000 colors. Colors where the number of pixels of the same color exceeds a certain number or proportion are statistically analyzed and represented on color coordinates. Each point in the chart represents the appearance of that color in the environment, reflecting the colors and color groups present in the building and environment. Using the K-means clustering algorithm, the H / S / V parameters of each pixel in the image are treated as the pixel's coordinates in three-dimensional space. Iterative calculations using a function to find the extreme distance are performed to divide the pixels into K clusters to minimize the variance, ultimately obtaining K cluster centers. The H / S / V coordinates corresponding to the cluster centers can be considered the dominant color of the image. By classifying all pixels according to this clustering method, the number of pixels and their proportion in each cluster are statistically obtained, which is the proportion of each main color.

[0082] In one possible implementation, step S200 may further include the following sub-steps:

[0083] In step S210, the combination ratio of the color data of all pixels is counted, and a color distribution statistical chart is generated in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value. The color coordinates of the number of pixels exceeding a predetermined value are marked.

[0084] Understandably, generating multi-dimensional color distribution statistics can intuitively present the correlation characteristics of hue, saturation, and brightness. Marking the coordinates of frequently occurring colors can quickly locate the dominant colors and color groups in the environment, providing a visual basis for identifying architectural color preferences.

[0085] Furthermore, step S210 may also include the following sub-steps:

[0086] In step S211, the color data of all pixels in the image are statistically analyzed, and the proportion of the color data combination is calculated.

[0087] It should be noted that to calculate the proportion of color combinations of all pixels, it is necessary to traverse the H / S / V values ​​of each pixel in the image. By counting and calculating the proportion, the frequency of occurrence of different colors is quantified, providing an accurate statistical basis for subsequent primary color extraction and complexity analysis.

[0088] In step S212, based on the proportion of the color data combination, a color distribution statistical chart is generated in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value.

[0089] It should be noted that the distribution charts of hue-saturation, hue-brightness, and saturation-brightness respectively reflect the relationship between color hue and vividness, brightness and darkness, and vividness and brightness and darkness, comprehensively revealing the distribution characteristics of image colors.

[0090] In step S213, when the number of pixels of the same color in the image exceeds a predetermined value, color marking is performed in the color distribution statistics chart.

[0091] Optionally, the color data values ​​can be mapped to integers between 1 and 10.

[0092] It should be noted that mapping H / S / V values ​​to integers from 1 to 10 simplifies color classification and reduces the interference of subtle color differences on statistical results; color annotation for pixels exceeding predetermined values ​​can highlight colors that account for a significant proportion in the environment, making it easier to quickly identify core color features.

[0093] In step S220, the pixel color data is regarded as three-dimensional coordinates, and K-means clustering is used to iteratively divide the pixels until the variance is minimized, thereby obtaining K cluster centers and corresponding to the main color. At the same time, the number of pixels of each main color and the proportion are counted to obtain the proportion of the main color of the image.

[0094] Understandably, K-means clustering aggregates pixels of similar colors through iterative optimization. The goal of minimizing variance ensures that the cluster centers can accurately represent the same type of color features, while the statistics of the proportion of dominant colors quantify the visual weight of each dominant color in the image, thus achieving objective extraction of color features.

[0095] Furthermore, step S220 may also include the following sub-steps:

[0096] In step S221, the color data of each pixel in the image is regarded as the three-dimensional spatial coordinates of each pixel.

[0097] It should be noted that by treating the H / S / V parameters as three-dimensional coordinates, color features can be transformed into a spatial geometry problem. By calculating the spatial distance between pixels, color similarity can be measured, providing a quantitative basis for clustering algorithms to classify color categories.

[0098] In step S222, the K-means clustering algorithm is used. Iterative calculations are performed by finding the extreme value of the distance using a function, and all pixels are divided into K groups to minimize the variance, thus obtaining K cluster centers.

[0099] It should be noted that the distance extremum iterative operation of the function continuously adjusts the position of the cluster center to minimize the sum of the distances from the center to the same type of pixel. The setting of the K value needs to be combined with the color richness of the image. Generally, the optimal number of clusters is determined by the elbow method to balance accuracy and efficiency.

[0100] In step S223, the three-dimensional spatial coordinates of the cluster center are mapped to the color data to obtain the main color of the image, and the number of pixels and their proportion in each cluster are counted to obtain the proportion of the main color of the image.

[0101] It should be noted that the H / S / V coordinates corresponding to the cluster centers, after color mapping, become the primary color of the image. The pixel proportion of this primary color directly reflects the importance of the color in visual perception, providing a quantitative reference for the application of primary colors and the formulation of color guidelines.

[0102] In step S300, color-derived parameters are calculated based on the grayscale data and the color data.

[0103] It should be noted that the selection information entropy is used to represent the types and proportions of colors; the edge ratio is used to represent the proportion of pixels with significant color changes and strong contrast; and the gray-level co-occurrence matrix is ​​used to extract texture, and contrast, correlation, and energy are calculated after normalization to represent the distribution of colors in space. The selection information entropy, edge ratio, and contrast factor are positively correlated, while the correlation and energy factors are negatively correlated. Here, a simplified approach is taken, assigning each factor a weight of ±1 to calculate the complexity.

[0104] In one possible implementation, step S300 may include the following sub-steps:

[0105] In step S310, the contrast ratio is calculated based on the grayscale data using a contrast formula.

[0106] Furthermore, the contrast formula is:

[0107] C=∑ δ δ(i,j) 2 P δ (i,j);

[0108] Where δ(i,j) is the absolute value of the gray-level difference between adjacent pixels, P δ (i,j) represents the pixel distribution ratio where the gray level difference between adjacent pixels is δ.

[0109] It should be noted that the contrast formula quantifies the degree of difference in brightness and darkness in an image by accumulating the product of the square of the gray level difference between adjacent pixels and the corresponding distribution ratio. The larger the value, the stronger the contrast between light and dark colors in the image and the more distinct the visual hierarchy.

[0110] In step S320, the selection information entropy and edge ratio are calculated based on the color data, and the contrast, correlation and energy are calculated based on the grayscale data.

[0111] Furthermore, information entropy is chosen to express the types and proportions of colors, reflecting the richness and randomness of color distribution. Based on the results of color statistical analysis, the color categories in the image are determined, and the pixel count of each color is counted. The information entropy formula is used to calculate the color categories. The larger the value, the richer the color types and the more uneven the distribution.

[0112] The formula for selecting information entropy is:

[0113]

[0114] Where A1 is the selection information entropy, p p denoted as the percentage of pixels for each color, where 'a' is the color category number and 'n' is the total number of color categories.

[0115] The edge ratio expresses the proportion of pixels with significant color changes and strong contrast, reflecting the clarity of color boundaries. Edge detection is performed on the preprocessed image to count the number of edge pixels with significant color changes. The proportion of edge pixels to total pixels is calculated using the edge ratio formula. The larger the value, the more intense the color transition.

[0116] The formula for the edge ratio is:

[0117]

[0118] Where A2 is the edge ratio, N edge N represents the number of edge pixels where the color changes significantly. total This represents the total number of pixels in the image.

[0119] Contrast reflects the degree of difference in grayscale values. Based on the grayscale co-occurrence matrix (GLCM), it expresses the non-uniformity of color distribution. The GLCM is constructed by statistically analyzing the frequency of grayscale value combinations of adjacent pixels at fixed distances and directions in the image, normalizing the GLCM, obtaining the probability of each grayscale combination, and calculating the contrast using the contrast formula. The larger the value, the more obvious the grayscale difference in the image and the more uneven the color distribution.

[0120] The contrast formula is:

[0121] A3=∑ i,j (ij) 2 ·P(i,j);

[0122] Where A3 represents the contrast, P(i,j) represents the probability of each grayscale combination, and i and j represent the grayscale values.

[0123] Correlation reflects the correlation between gray values ​​of adjacent pixels. It is extracted based on the gray-level co-occurrence matrix and expresses the continuity of color distribution. Based on the same gray-level co-occurrence matrix and normalized probability, the mean and standard deviation of gray values ​​are calculated. The correlation is calculated using the correlation formula. The closer the value is to 1, the stronger the correlation between gray values ​​of adjacent pixels and the more continuous the color distribution.

[0124] The correlation formula is:

[0125]

[0126] Where A4 represents the relevance, μ i With μ j σ is the grayscale mean. i With σ j is the standard deviation of the grayscale mean.

[0127] Energy reflects the uniformity and regularity of texture. Based on gray-level co-occurrence matrix extraction, it expresses the regularity of color distribution. Using the same gray-level co-occurrence matrix and normalized probabilities, the energy formula is applied for calculation. A larger value indicates a more concentrated gray-level distribution and a more uniform and regular color texture. The energy formula is:

[0128] A5=∑ i,j [P(i,j)] 2 .

[0129] In step S330, the complexity is calculated using a complexity formula based on the selected information entropy, the edge ratio, the contrast, the relevance, and the energy.

[0130] Furthermore, the complexity formula is:

[0131] F=A1×S1+A2×S2+A3×S3+A4×S4+A5×S5;

[0132] Where F is the complexity, A1 is the selection information entropy, A2 is the marginal ratio, A3 is the contrast, A4 is the relevance, A5 is the energy, S1 is the first weight coefficient, S2 is the second weight coefficient, S3 is the third weight coefficient, S4 is the fourth weight coefficient, and S5 is the fifth weight coefficient. The specific values ​​of S1-S5 are determined based on the correlation between A1-A5 and complexity.

[0133] It should be noted that information entropy and edge ratio are calculated based on color data, reflecting color diversity and boundary clarity respectively; contrast, correlation, and energy are extracted based on the gray-level co-occurrence matrix, quantifying the uniformity and correlation of color space distribution through texture features, and constructing a complexity evaluation system in multiple dimensions.

[0134] Optionally, the specific values ​​of S1-S5 can be determined by normalizing A1-A5 and calculating the contrast, analyzing the correlation between A1-A5 and the contrast factor. Currently, it is selected that information entropy, edge ratio and contrast factor are positively correlated, and correlation degree and energy factor are negatively correlated. The complexity is obtained by simplifying the process and assigning them weights of ±1 respectively.

[0135] In step S400, color similarity is obtained based on the color data of each image using a perceptual hash algorithm.

[0136] It should be noted that the perceptual hashing algorithm converts the color information of each image into an information fingerprint string, and then calculates the Hamming distance between each pair of images. The closer the distance, the more similar the two images are in color. Similarly, the K-means clustering algorithm is used to cluster the Hamming distances of all image information fingerprints. Images in the same category have similar information fingerprints, and can be considered to be more similar in color.

[0137] In one possible implementation, step S400 may include the following sub-steps:

[0138] In step S410, the color information of the image is converted into an information fingerprint string using a perceptual hash algorithm; the color information includes: color data, color distribution features, three-dimensional coordinates of the primary color, and the proportion of the primary color.

[0139] It should be noted that color information, including pixel-level H / S / V data, multi-dimensional color distribution features, and the three-dimensional coordinates and proportion of the dominant color, together constitutes the core color fingerprint of an image. The perceptual hash algorithm simplifies these features and converts them into fixed-length binary strings, thereby compressing and standardizing color information, making it suitable for efficient similarity comparison and batch image clustering.

[0140] In step S420, the information fingerprint strings of the two images are compared, and the Hamming distance between the two images is calculated.

[0141] Understandably, Hamming distance transforms the similarity of image color features into a quantifiable value by comparing the number of differing bits in the information fingerprint string, providing a unified comparison standard for subsequent clustering and similarity calculation. The smaller the distance, the higher the degree of overlap in color features.

[0142] In step S430, the K-means clustering algorithm is used to cluster the Hamming distance of all image information fingerprints. Images in the same type have similar information fingerprints, and the clustering results of images with similar colors are obtained.

[0143] Understandably, when using the K-means clustering algorithm to cluster Hamming distance, iterative optimization groups the image information fingerprints with smaller Hamming distances into the same category, minimizing the differences in information fingerprints between images of the same category. This enables images with similar color features to be automatically grouped into one category, laying the foundation for subsequent calculation of color similarity between images of the same type.

[0144] In step S440, the color similarity of images of the same type is obtained by using a similarity formula.

[0145] Furthermore, the similarity formula is as follows:

[0146]

[0147] Where X represents color similarity, S t S is the Hamming distance between any two images. z X represents the average Hamming distance between images of the same type; where a larger similarity X indicates a higher similarity between the two images.

[0148] It is understandable that Hamming distance clustering can group images with similar color features into the same category. The average Hamming distance within a category reflects the color consistency within the group. Combining the information fingerprint length normalization to calculate the similarity makes the result fall in the [0,1] interval, which makes it easy to intuitively judge the degree of similarity of image colors.

[0149] In one possible implementation, step S500 generates a report on the primary color and its proportion, and outputs color contrast and complexity indicators. From this, architects can roughly grasp the degree of uniformity in the architectural style, establish an architectural color database, provide color selection basis for architectural planning, and are of great significance for planners to grasp the overall visual characteristics of the environment and the application of materials.

[0150] Furthermore, this example embodiment also provides a color analysis-based architectural planning system for executing the aforementioned color analysis-based architectural planning method. (Reference) Figure 6 As shown, the system may include...

[0151] The image acquisition module is used to acquire RGB image data of each building under the same environmental parameters, convert it into HSV color space, and obtain the color data and grayscale data of each pixel.

[0152] The color analysis module is used to statistically analyze the proportion of the color data combinations, generate a dimensional color distribution statistical chart, and mark the color coordinates of the number of pixels exceeding a predetermined value. It also constructs three-dimensional coordinates through the color data of the pixels in the image and clusters them to obtain the proportion of the main color in the image.

[0153] A derivation calculation module is used to calculate color derivation parameters based on the grayscale data and the color data; wherein, the color derivation parameters include contrast and image complexity;

[0154] The similarity calculation module is used to obtain color similarity based on the color data of each image using a perceptual hash algorithm;

[0155] The result generation module is used to construct an architectural color database based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.

[0156] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

[0157] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them.

[0158] Please do not limit yourself to the exact structure described above and illustrated in the accompanying drawings; this cannot be considered as such.

[0159] The specific implementation of this application is limited to these descriptions. For those familiar with the technical field to which this application pertains...

[0160] For technical personnel, various changes and modifications made without departing from the concept of this application are...

[0161] All forms should be considered to fall within the scope of protection of this application.

Claims

1. A building planning method based on color analysis, characterized in that, include: Collect RGB image data of each building under the same environmental parameters, convert it into HSV color space, and obtain the color data and grayscale data of each pixel; The color data consists of hue, saturation, and lightness values. The proportion of color data combinations is statistically analyzed, a dimensional color distribution statistical chart is generated, and the color coordinates of the number of pixels exceeding a predetermined value are marked. At the same time, a three-dimensional coordinate is constructed using the color data of the pixels in the image, and the proportion of the main color in the image is obtained by clustering. Color-derived parameters are calculated based on the grayscale data and the color data; wherein, the color-derived parameters include contrast and image complexity; The color similarity is obtained by using a perceptual hash algorithm based on the color data of each image; A building color database is constructed based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.

2. The architectural planning method based on color analysis according to claim 1, characterized in that, The steps of collecting RGB image data of each building under the same environmental parameters, converting it to HSV color space, and obtaining the color and grayscale data of each pixel include: RGB images of each building were acquired using image acquisition equipment under the same environmental parameters; Upload the RGB image to the Matlab platform; The rgb2hsv function of the Matlab platform is used to convert the image from the RGB color space to the HSV color space and obtain the color data and grayscale data of each pixel.

3. The architectural planning method based on color analysis according to claim 1, characterized in that, The steps of generating a dimensional color distribution statistical chart by statistically analyzing the proportion of color data combinations, marking the color coordinates of pixels exceeding a predetermined value, constructing three-dimensional coordinates using the color data of pixels in the image, and clustering to obtain the proportion of the dominant color in the image include: The combination ratio of all pixel color data is statistically analyzed to generate color distribution statistics charts in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value, and the color coordinates of the number of pixels exceeding a predetermined value are marked. Pixel color data is treated as three-dimensional coordinates. K-means clustering is used to iteratively divide the pixels until the variance is minimized, resulting in K cluster centers, which correspond to the main colors. At the same time, the number of pixels of each main color and its proportion are counted to obtain the proportion of the main color of the image.

4. The architectural planning method based on color analysis according to claim 3, characterized in that, The steps of statistically analyzing the combined proportions of color data for all pixels, generating color distribution charts in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value, and marking the color coordinates where the number of pixels exceeds a predetermined value, include: The color data of all pixels in the image are statistically analyzed, and the proportion of the color data combinations is calculated. Based on the proportion of the color data combinations, generate color distribution statistics charts in the dimensions of hue value-saturation value, hue value-brightness value, and saturation value-brightness value; When the number of pixels of the same color in an image exceeds a predetermined value, color marking is performed in the color distribution statistics chart.

5. The architectural planning method based on color analysis according to claim 3, characterized in that, The steps of treating pixel color data as three-dimensional coordinates, using K-means clustering to iteratively divide pixels until the variance is minimized, obtaining K cluster centers to obtain the corresponding main colors, and simultaneously counting the number and proportion of pixels of each main color to obtain the proportion of the main color in the image include: The color data of each pixel in the image is regarded as the three-dimensional spatial coordinates of each pixel; The K-means clustering algorithm is used, which iteratively calculates the distance extremum using a function and divides all pixels into K sub-groups to minimize the variance, thus obtaining K cluster centers. The three-dimensional spatial coordinates of the cluster centers are mapped to the color data to obtain the main color of the image. The number of pixels and their proportion in each cluster are counted to obtain the proportion of the main color of the image.

6. The architectural planning method based on color analysis according to claim 1, characterized in that, The step of calculating color-derived parameters based on the grayscale data and the color data includes: The contrast ratio is calculated using the contrast formula based on the grayscale data. The selection information entropy and edge ratio are calculated based on the color data, and the contrast, correlation and energy are calculated based on the grayscale data. The complexity is calculated using a complexity formula based on the selected information entropy, the edge ratio, the contrast, the relevance, and the energy.

7. The architectural planning method based on color analysis according to claim 6, characterized in that, The contrast ratio formula is: C=∑ δ δ(i,j) 2 P δ (i,j); Where δ(i,j) is the absolute value of the gray-level difference between adjacent pixels, P δ (i,j) represents the distribution ratio of pixels with a gray level difference of δ between adjacent pixels; The complexity formula is: F=A1×S1+A2×S2+A3×S3+A4×S4+A5×S5; Where F is the complexity, A1 is the selection information entropy, A2 is the marginal ratio, A3 is the contrast, A4 is the relevance, A5 is the energy, S1 is the first weight coefficient, S2 is the second weight coefficient, S3 is the third weight coefficient, S4 is the fourth weight coefficient, and S5 is the fifth weight coefficient. The specific values ​​of S1-S5 are determined based on the correlation between A1-A5 and complexity.

8. The architectural planning method based on color analysis according to claim 1, characterized in that, The step of obtaining color similarity based on the color data of each image using a perceptual hash algorithm includes: The color information of an image is converted into an information fingerprint string using a perceptual hash algorithm; the color information includes: color data, color distribution characteristics, three-dimensional coordinates of the dominant color, and the proportion of the dominant color. Compare the information fingerprint strings of two images and calculate the Hamming distance between each pair of images; The K-means clustering algorithm is used to cluster the Hamming distance of all image information fingerprints. Images in the same category have similar information fingerprints, and the clustering results of images with similar colors are obtained. The color similarity of images of the same type can be obtained using a similarity formula.

9. The architectural planning method based on color analysis according to claim 8, characterized in that, The similarity formula is: Where X represents color similarity, S t S is the Hamming distance between any two images. z X represents the average Hamming distance between images of the same type; where a larger similarity X indicates a higher similarity between the two images.

10. A building planning system based on color analysis, characterized in that, The system is used to execute the color analysis-based architectural planning method as described in any one of claims 1 to 9, the system comprising: The image acquisition module is used to acquire RGB image data of each building under the same environmental parameters, convert it into HSV color space, and obtain the color data and grayscale data of each pixel. The color analysis module is used to statistically analyze the proportion of the color data combinations, generate a dimensional color distribution statistical chart, and mark the color coordinates of the number of pixels exceeding a predetermined value. It also constructs three-dimensional coordinates through the color data of the pixels in the image and clusters them to obtain the proportion of the main color in the image. A derivation calculation module is used to calculate color derivation parameters based on the grayscale data and the color data; wherein, the color derivation parameters include contrast and image complexity; The similarity calculation module is used to obtain color similarity based on the color data of each image using a perceptual hash algorithm; The result generation module is used to construct an architectural color database based on the color distribution statistics, the proportion of the main color in the image, the color derivative parameters, and the color similarity.