Home decoration image processing method, device, equipment, medium and program product
By segmenting and feature extraction of home decoration images, and using a multi-head self-attention mechanism to process spatial vectors, the problem of low accuracy in analyzing complex home decoration images is solved, efficient acquisition of home decoration layout information is achieved, and the accuracy and accuracy of interior design are improved. efficiency.
Patent Information
- Application Number
- CN202410796872.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-20
AI Technical Summary
Existing technology is difficult to process complex home decoration images, resulting in low accuracy of analysis results and cannot be efficiently applied to interior design.
By performing image segmentation processing on home decoration images, the features of furniture and non-furniture are extracted, the multi-head self-attention mechanism is used to process spatial vectors, furniture style features are obtained, and the images are matched based on the features to obtain home decoration layout information.
It achieves high-precision analysis of complex home decoration images, provides accurate furniture and non-furniture features, and improves the application efficiency of interior design.
Smart Images

Figure CN118365889B
Abstract
Description
Technical Field
[0001] The present application relates to the field of home decoration design technology, and in particular to a home decoration image processing method, device, equipment, medium and program product. Background Art
[0002] The analysis of home decoration images can be applied in interior design. For example, by analyzing some home decoration images, images of similar styles can be obtained, thereby providing users with interior design suggestions.
[0003] The analysis of home decoration images is mostly achieved through traditional image analysis and processing methods. However, since home decoration images generally include multiple objects, building structures, lighting adjustments, etc., traditional image analysis and processing methods are usually difficult to handle complex home decoration image analysis. The home decoration image analysis results obtained in this way are not accurate and cannot be efficiently applied in interior design. Summary of the invention
[0004] The present application provides a home decoration image processing method, device, equipment, medium and program product to solve the problem of low accuracy of home decoration image analysis results.
[0005] In a first aspect, the present application provides a home decoration image processing method, comprising:
[0006] Performing image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image;
[0007] Extracting non-furniture features from the non-furniture segmented image, and extracting furniture features from the furniture segmented image; wherein the non-furniture features at least include color features, and the furniture features at least include furniture style features;
[0008] Matching corresponding non-furniture images based on the non-furniture features, and matching corresponding furniture images based on the furniture features; wherein the furniture images and non-furniture images are used to obtain home decoration layout information;
[0009] Extracting furniture style features from the furniture segmentation image includes:
[0010] Segmenting the furniture segmentation image into at least one image block;
[0011] Extracting the spatial vector of each image block, and performing position encoding on the spatial vector of each image block to obtain the position spatial vector corresponding to each image block;
[0012] The position space vectors corresponding to the image blocks are processed based on multi-head self-attention to obtain furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category for generating the furniture segmentation image.
[0013] In one achievable manner, extracting the spatial vector of each image block includes:
[0014] Flatten each image block into a one-dimensional vector to obtain a one-dimensional vector corresponding to each image block;
[0015] The one-dimensional vectors corresponding to the image blocks are mapped to a high-dimensional embedding space to obtain the space vectors.
[0016] In one achievable manner, performing image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image includes:
[0017] Extracting features from the home decoration image to obtain a target feature image;
[0018] Classifying the feature data of each pixel in the target feature image based on preset categories to obtain the category of each pixel in the home decoration image; wherein the preset categories include furniture categories and non-furniture categories;
[0019] The home decoration image is segmented based on the area where the pixels of the furniture category are located, and the home decoration image is segmented based on the area where the pixels of the non-furniture category are located, and the furniture segmentation image and the non-furniture segmentation image are obtained accordingly.
[0020] In one achievable manner, extracting features from the home decoration image to obtain a target feature image includes:
[0021] Performing encoding processing on the home decoration image to obtain an encoding feature map;
[0022] Decoding the encoded feature map to obtain a decoded feature map;
[0023] The encoding feature map and the decoding feature map are subjected to feature map fusion processing to obtain a target feature image.
[0024] In an implementable manner, the non-furniture segmentation image includes a wall segmentation image and a floor segmentation image, and the non-furniture features include color features; and extracting the non-furniture features from the non-furniture segmentation image includes:
[0025] Performing color clustering processing on the wall segmentation image to obtain wall color features; wherein the wall color features include color distribution and color proportion in the wall segmentation image;
[0026] Performing color clustering processing on the floor segmentation image to obtain floor color features; wherein the floor color features include color distribution and color proportion in the floor segmentation image;
[0027] The wall color feature and the floor color feature are used as color features of the non-furniture segmentation image.
[0028] In an implementable manner, after matching the corresponding non-furniture image based on the non-furniture feature and matching the corresponding furniture image based on the furniture feature, the method further includes:
[0029] The furniture image and the non-furniture image are mapped to a preset three-dimensional room model to obtain a home layout model.
[0030] In a second aspect, the present application provides a home decoration image processing device, comprising: an image segmentation module, for performing image segmentation processing on a home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image;
[0031] A feature extraction module, used to extract non-furniture features in the non-furniture segmentation image, and to extract furniture features in the furniture segmentation image; wherein the non-furniture features at least include color features, and the furniture features at least include furniture style features;
[0032] An image matching module, used to match the corresponding non-furniture images based on the non-furniture features, and to match the corresponding furniture images based on the furniture features; wherein the furniture images and non-furniture images are used to obtain home decoration layout information;
[0033] The feature extraction module comprises:
[0034] An image block acquisition unit, used for segmenting the furniture segmentation image into at least one image block;
[0035] A spatial vector acquisition unit, used to extract the spatial vector of each image block, and perform position encoding on the spatial vector of each image block to obtain a position spatial vector corresponding to each image block;
[0036] A furniture style feature extraction unit is used to process the position space vector corresponding to each image block based on multi-head self-attention to obtain the furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category of the furniture segmentation image.
[0037] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the electronic device executes the home decoration image processing method described in the first aspect.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the home decoration image processing method as described in the first aspect.
[0039] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the home decoration image processing method as described in the first aspect.
[0040] The home decoration image processing method, device, equipment, medium and program product provided by the present application can accurately analyze and process complex home decoration images from the two directions of furniture and non-furniture by segmenting the home decoration image into furniture segmentation images and non-furniture segmentation images, respectively, to obtain high-precision non-furniture features of the non-furniture segmentation images and furniture features of the furniture segmentation images, and specifically propose a method for extracting furniture style features from furniture features, so as to accurately obtain furniture style features, thereby accurately matching corresponding images based on non-furniture features and furniture features, so as to efficiently and accurately obtain home decoration layout information. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 This is an implementation scenario diagram shown for an exemplary embodiment;
[0043] Figure 2 A flow chart of a method for processing home decoration images is shown as an exemplary embodiment;
[0044] Figure 3 is a schematic diagram of a furniture segmentation image shown in an exemplary embodiment;
[0045] Figure 4 The structure diagram of a home decoration image processing device is shown as an exemplary embodiment;
[0046] Figure 5 The present invention is a block diagram of an electronic device showing an exemplary embodiment.
[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0049] Indoor image analysis is crucial in various applications, such as interior design, virtual reality, real estate, and robot navigation. Traditional image analysis and processing methods are usually difficult to handle complex indoor scenes because they usually contain different objects, lighting conditions, and building structures. Based on this, this embodiment provides a home decoration image processing method, device, equipment, medium, and program product that can be used for complex home decoration image analysis with high accuracy.
[0050] The home decoration image processing method provided in this application can be applied to Figure 1 The implementation environment shown is Figure 1 As shown, the implementation environment may include a terminal and a server, and the terminal and the server are communicatively connected.
[0051] Understandably, Figure 1 The number of terminals and servers shown in the figure is 1. In some embodiments, the number of terminals may be one or more. In other embodiments, the number of servers may be one or more.
[0052] In this embodiment, the terminal can receive home decoration images that need to be processed and send the home decoration images to the server, so that the server processes the home decoration images and sends the processing results to the terminal to display the processing results through the visualization structure of the terminal.
[0053] In some embodiments, after acquiring the home decoration image, the server performs image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image; extracts non-furniture features in the non-furniture segmentation image, and extracts furniture features in the furniture segmentation image; wherein the non-furniture features include at least color features, and the furniture features include at least furniture style features; matches the corresponding non-furniture images based on the non-furniture features, and matches the corresponding furniture images based on the furniture features; wherein the furniture images and non-furniture images are used to obtain home decoration layout information; in this process, the furniture style features are extracted in the following manner: the furniture segmentation image is segmented into at least one image block; the spatial vector of each image block is extracted, and the spatial vector of each image block is position-encoded to obtain the position spatial vector corresponding to each image block; the position spatial vector corresponding to each image block is processed based on multi-head self-attention to obtain the furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category for generating the furniture segmentation image.
[0054] Then, the furniture image and the non-furniture image can be sent to the terminal and displayed through the visualization structure of the terminal.
[0055] In some embodiments, the terminal may be a wired terminal or a wireless terminal with a visual structure. In other embodiments, the terminal may be an electronic device with a visual structure such as a mobile phone, a computer, a tablet, or a vehicle-mounted device.
[0056] In some embodiments, the server may be a physical server, a server cluster, a cloud server, etc., and no specific limitation is given here.
[0057] It is understandable that the home image processing device is arranged at Figure 1 The server in the embodiment shown in FIG. Figure 1 The implementation environment shown is only exemplary. In other embodiments, the home decoration image processing method can also be applied to other implementation environments, and the home decoration image processing device can also be set in other structures in other implementation environments. No specific limitations are made here.
[0058] based on Figure 1 In this embodiment, a method for processing home decoration images is proposed, referring to Figure 2 , the home decoration image processing method is applied to Figure 1 The home improvement image processing method includes steps S210 to S250, which are specifically described as follows:
[0059] S210: performing image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image.
[0060] In this embodiment, the home decoration image may be an image that has been preprocessed. In some embodiments, the preprocessing process may include processing such as resizing, normalization, and data enhancement to obtain the home decoration image.
[0061] In some embodiments, the home decoration image may include facilities such as walls, floors, and furniture.
[0062] In one embodiment, by performing semantic segmentation on the home decoration image, at least one furniture segmentation image and at least one non-furniture segmentation image are obtained. The semantic segmentation can be achieved through a neural network, such as a U-Net network (a neural network).
[0063] In this embodiment, it can be achieved in the following ways: extracting features from a home decoration image to obtain a target feature image; classifying feature data of each pixel in the target feature image based on a preset category to obtain a category of each pixel in the home decoration image; wherein the preset category includes a furniture category and a non-furniture category; segmenting the home decoration image based on the area where pixels of the furniture category are located, and segmenting the home decoration image based on the area where pixels of the non-furniture category are located, and accordingly obtaining a furniture segmentation image and a non-furniture segmentation image.
[0064] In one embodiment, a home decoration image I may be input into a neural network (such as U-Net), and the goal of the neural network is to generate a category label map M with the same size as the home decoration image.
[0065] In this embodiment, the target feature image can be obtained in the neural network in the following ways: encoding the home decoration image to obtain a coded feature map; decoding the coded feature map to obtain a decoded feature map; and fusion processing the coded feature map and the decoded feature map to obtain the target feature image.
[0066] The encoder part of the U-Net neural network encodes the home decoration image to obtain an encoded feature map. In one embodiment, the encoder includes multiple convolution and pooling layers for extracting image features; wherein the convolution operation formula in the convolution layer is: Y = X W + b, X represents the input feature map, W represents the convolution kernel, b represents the bias term, and Y represents the output feature map. Represents a convolution operation.
[0067] Then, the encoded feature map can enter the decoder part for decoding to obtain a decoded feature map, and then the encoded feature map and the decoded feature map are fused to obtain a target feature image. In one embodiment, the decoder part of U-Net includes multiple upsampling and convolution layers; the decoder fuses the encoded feature map of the encoder with the decoded feature map of the decoder through skip connections to capture multi-scale contextual information; the upsampling operation can be implemented using transposed convolution or bilinear interpolation.
[0068] After obtaining the target feature map, the output layer of U-Net uses a 1x1 convolution operation to map the target feature map to the preset category, and applies the pixel-level Softmax activation function to obtain the category probability distribution of each pixel in the home improvement image, that is, to obtain the category label map.
[0069] The calculation method of the Softmax activation function in this embodiment is:
[0070] Softmax(x i ) = exp(x i) / Σ(exp(x j ))
[0071] Among them, x i represents the raw score of the i-th preset category, Σ(exp(x j )) is the sum of the index scores of all preset categories.
[0072] In this embodiment, the U-Net network used to obtain the category of each pixel in the home decoration image can calculate the difference between the true category distribution and the predicted category distribution by using the cross entropy loss as the loss function. The cross entropy loss CE(y true , y pred ) is calculated as:
[0073] CE(y true , y pred ) = - Σy true_i log(y pred_i ))
[0074] Among them, y true_i Represents the value of the i-th pixel in the true probability distribution, y pred_i Represents the value of the i-th pixel in the predicted probability distribution, y true represents the true probability, y predrepresents the predicted probability; the loss function is calculated at the pixel level and then summed or averaged over the entire home improvement image.
[0075] During the use or training of the U-Net network, the loss function is optimized through a gradient descent algorithm (such as SGD, Adam, etc.), and the U-Net model is trained to generate accurate pixel-level category labels.
[0076] After obtaining the category of each pixel in the home decoration image, the home decoration image can be segmented based on the category, that is, corresponding areas of pixels of the same category in the home decoration image are extracted to form a segmented image of the corresponding category.
[0077] The home decoration image is segmented based on the area where the pixels of the furniture category are located, and a furniture segmentation image is obtained; the home decoration image is segmented based on the area where the pixels of the non-furniture category are located, and a non-furniture segmentation image is obtained accordingly.
[0078] like Figure 3 , is a furniture segmentation image obtained by segmenting the area where the pixels of the furniture category of the home decoration image are located in one embodiment, wherein the portion framed by the closed dotted line is the area where the pixels of the furniture category are located, and the portion not framed by the closed dotted line is the area where the pixels of other categories are located. Figure 3 It is not drawn in the figure, but it should be understood that in the segmented image, the area where the pixels of other categories are located has no content, or can be regarded as a pure black part (the subsequent color feature extraction of the furniture segmentation image will not extract the black information of this area), while the area where the pixels of the furniture category are located is the original content of the corresponding area in the home decoration image.
[0079] S230: extracting non-furniture features from the non-furniture segmentation image, and extracting furniture features from the furniture segmentation image, wherein the furniture features at least include furniture style features.
[0080] In this embodiment, the non-furniture features include at least color features, and the furniture features include at least furniture style features.
[0081] For the non-furniture segmented image, only the color features of the non-furniture segmented image may be extracted. Of course, in some embodiments, the style features of the non-furniture segmented image may also be extracted.
[0082] In one embodiment, the non-furniture category may include multiple subcategories, and one category may correspond to one variety, such as a wall subcategory and a floor subcategory, and of course a ceiling subcategory, etc., and no specific limitation is made here.
[0083] For different subcategories, when performing image segmentation, non-furniture segmentation images of corresponding subcategories can be obtained. For example, the non-furniture segmentation images include wall segmentation images corresponding to the wall subcategory and floor segmentation images corresponding to the floor subcategory.
[0084] In one embodiment, when extracting non-furniture features in the non-furniture segmented images, color features should be extracted for each subcategory of the non-furniture segmented images. The color features may include color distribution and color proportion in the segmented images.
[0085] In one embodiment, the non-furniture segmentation image includes a wall segmentation image corresponding to a wall subcategory and a floor segmentation image corresponding to a floor subcategory, and color clustering processing is performed on the wall segmentation image to obtain wall color features; wherein the wall color features include the color distribution and color proportion in the wall segmentation image; color clustering processing is performed on the floor segmentation image to obtain floor color features; wherein the floor color features include the color distribution and color proportion in the floor segmentation image; the wall color features and the floor color features are used as color features of the non-furniture segmentation image.
[0086] In this embodiment, color clustering processing is performed on the non-furniture segmented image, including: using color space conversion, clustering, and neighbor pixel calculation methods to extract all color components in an image and their proportions. These color features provide valuable information about the main color, color distribution, and color relationship in the image, which can be used to understand the overall color scheme and atmosphere of the interior space.
[0087] Table 1 below shows partial color feature information obtained after color feature extraction is performed on a non-furniture segmentation image in one embodiment.
[0088] Table 1
[0089]
[0090] In some embodiments, furniture features may also include color features, that is, color features are extracted from the furniture segmentation image. The method for extracting color features from the furniture segmentation image can refer to the method for extracting color features from non-furniture features, which will not be repeated here.
[0091] In some embodiments, furniture style features of the furniture segmentation image may be extracted through a style extraction network.
[0092] In one embodiment, if Figure 2 As shown, in step S230, the furniture style features in the furniture segmentation image are extracted, including steps S231 to S233, which are described in detail as follows:
[0093] Step S231: Segment the furniture segmentation image into at least one image block.
[0094] This embodiment proposes a method for extracting furniture color features, which can be implemented through a style extraction network, such as a vision transformer network (a type of neural network).
[0095] In some embodiments, the style extraction network segments the furniture segmentation image into at least one image block of the same size, such as 16x16 pixels. The image blocks are regarded as elements in a sequence. For a furniture image of size HxW, the number of segmented image blocks is (H / 16) x (W / 16).
[0096] Step S232: extracting the spatial vector of each image block, and performing position encoding on the spatial vector of each image block to obtain the position spatial vector corresponding to each image block.
[0097] In this embodiment, each image block is flattened into a one-dimensional vector to obtain a one-dimensional vector corresponding to each image block; and the one-dimensional vector corresponding to each image block is mapped to a high-dimensional embedding space to obtain a spatial vector.
[0098] Each image block is flattened into a one-dimensional vector and mapped to a high-dimensional embedding space. After flattening, the dimension of each image block is Cx16x16, where C is the number of image channels. Then it is mapped to a D-dimensional embedding space through a linear transformation. The following is how the space vector is obtained:
[0099] X j = Linear(P j )
[0100] Among them, P j is the one-dimensional vector of the j-th image block, X i is the corresponding space vector, and Linear is the linear function.
[0101] In order for the style extraction network to understand the relative position relationship between image patches, position encoding needs to be added, which is achieved by adding a fixed position vector to each spatial vector:
[0102] X j ' =X j + Pos j
[0103] Among them, Pos j is the position code of the jth image block, X j ' It is the space vector after adding the position encoding, that is, the position space vector.
[0104] Step S233: Based on multi-head self-attention, the position space vector corresponding to each image block is processed to obtain the furniture style features of the furniture segmentation image.
[0105] In this embodiment, the encoder in the style extraction network receives the position space vector and processes it based on multi-head self-attention to obtain the furniture style features, wherein the furniture style features are features of the style category for generating the furniture segmentation image, that is, the furniture style features can output the style category of the segmentation image through the classification structure of the style extraction network, but the furniture style features in this embodiment are data input to the classification structure, rather than data output by the classification structure.
[0106] The encoder consists of multiple layers of Transformer layers, each of which contains a Multi-Head Self-Attention module and a Feed-Forward Neural Network module.
[0107] Multi-head self-attention: The multi-head self-attention module allows the model to learn the global features of the input sequence at different positions and in different representation subspaces. The self-attention mechanism can be implemented by calculating the query, key, and value vectors.
[0108] Q = W q X j '
[0109] K = W k X j '
[0110] V = W v X j '
[0111] Attention(Q, K, V) = softmax(Q K^T / sqrt(d k )) V
[0112] Among them, Q is Query, K is Key, V is Value, and W is q , W k and W v is the learnable weight matrix, d kis the dimension of Q and K vectors, the softmax function normalizes the attention weights so that their sum is 1, K^T is the transposed matrix of K, and Attention is the attention mechanism.
[0113] In this embodiment, after passing through several Transformer encoder layers, the final feature vector is sent to a fully connected layer (classification structure) of a style classifier, and the cross entropy loss is calculated with the true label, so that the style extraction network can be trained and optimized. The cross entropy loss function calculates the difference between the model predicted probability distribution and the true probability distribution, and uses the gradient descent algorithm for optimization. During the training process, the style extraction network will learn how to perform global self-attention operations on the input image to capture long-range dependencies and local image features to obtain accurate furniture style features.
[0114] It can be understood that, in addition to furniture style features and color features, furniture features may also include shape features, material features, usage features, comprehensive features, etc., wherein shape features are reflected in the shape of the furniture (shapes include rectangle, square, circle, ellipse, etc.), material features are reflected in the material of the furniture, usage features are reflected in the type of furniture (such as bed, table, chair, etc.), and comprehensive features are reflected in the fusion of shape, style, material, and usage features (excluding color). The specific acquisition of furniture features can be determined according to needs. In some embodiments, if the need is only to determine furniture images of similar / same style and similar / same color, then the style features and color features can be obtained. If the need is to determine furniture images of similar / same material, similar / same color, and similar / same style, then the furniture features include material features, furniture style features, and color features, which are confirmed according to the furniture image needs to be determined.
[0115] S250: Matching corresponding non-furniture images based on non-furniture features, and matching corresponding furniture images based on furniture features.
[0116] Furniture images and non-furniture images are used to obtain home layout information.
[0117] In this embodiment, after obtaining the non-furniture features, the non-furniture images can be matched in the image database. The non-furniture features of the non-furniture images are highly similar to the non-furniture features of the non-furniture segmented images, that is, the color features of the non-furniture images and the non-furniture segmented images are highly similar (such as similar color distribution, similar color proportions, etc.). This process can be achieved through an image processing neural network.
[0118] In another embodiment, the furniture image can also be matched in the image database through the furniture features. The color features of the furniture image and the furniture segmentation image are highly similar / identical, and the furniture style features of the two are similar. This process can also be achieved through image processing neural networks.
[0119] Of course, if the furniture features also include shape features, material features, etc., the matched furniture image is an image with high similarity / identical color features, high similarity / identical shape features, high similarity / identical material features, and high similarity / identical style features as the furniture segmented image.
[0120] In some embodiments, some furniture images with high similarity are obtained through furniture feature matching. Of course, one or more images with the highest similarity can be determined as the final furniture image based on the similarity between the features of the matched images and the furniture features.
[0121] In this embodiment, after the furniture image and the non-furniture image are obtained, the furniture image and the non-furniture image may be mapped to a preset three-dimensional room model to obtain a home decoration layout model.
[0122] In this embodiment, the three-dimensional room model may include areas such as bedrooms, kitchens, and living rooms. Based on the furniture image and non-furniture image, a home decoration layout model with similar furniture style and color to the furniture segmentation image and similar color to the non-furniture segmentation image can be generated in the three-dimensional room model. Of course, if the furniture features have features other than color features and furniture style features, the obtained home decoration layout model also has home decoration effects determined by the corresponding features, such as material features, then the furniture material in the home decoration layout model is similar or the same as the furniture image material.
[0123] In this embodiment, the user can select a home decoration image, and then obtain a furniture image and a non-furniture image based on the home decoration image, thereby generating a home decoration layout model that meets the user's preferences and requirements based on the furniture image and the non-furniture image.
[0124] The home decoration image processing method proposed in this embodiment recommends complementary furniture or non-furniture based on the color scheme and style of the home decoration image, thereby facilitating interior design tasks; it can also estimate the real estate value of a property by analyzing the internal condition, layout and design; improve the performance of the robot navigation algorithm by providing a more accurate representation of the indoor environment; enhance the virtual reality experience by generating a more realistic and immersive three-dimensional model of the indoor space; assist in energy management and smart home automation by assisting in the analysis of lighting conditions, occupancy and usage patterns in the indoor environment; the indoor image analysis method can be further improved by combining additional features or techniques, such as object detection, depth estimation or three-dimensional reconstruction.
[0125] In some embodiments, a generative model can be used to generate an interior effect model based on the home decoration image processing results by entering corresponding text on the user interface, for example: I want a Japanese-style bedroom with cool colors.
[0126] The home decoration image processing in this embodiment can ultimately obtain the design information of the ceiling, floor, wall and furniture (table, chair), and the design information includes furniture style (material, purpose and shape, etc.) and color information.
[0127] After obtaining the design information, it is mapped to the three-dimensional model. The user selects the floor plan, which can be a CAD drawing. The drawing is parsed into a vectorized format, and the structure of the room is presented in three dimensions (i.e., a preset three-dimensional room model is obtained). Based on the design information (furniture images and non-furniture images), the design of non-furniture and furniture in the preset three-dimensional room model is determined, for example: where to place the bed and the layout of the furniture.
[0128] In this solution, by dividing the home decoration image into furniture type areas and non-furniture type areas, feature extraction is performed on the furniture type and non-furniture type areas respectively, so that complex home decoration images can be processed to obtain accurate non-furniture type color features and furniture type color and furniture style features, so that similar images can be matched based on the furniture type features and non-furniture type features, thereby realizing home decoration layout efficiently and accurately; this process can be used for complex home decoration image analysis by processing different objects separately, with high accuracy, and can be efficiently applied to interior design.
[0129] Figure 4 FIG. 4 is a structural diagram of a home decoration image processing device shown in an exemplary embodiment. The home decoration image processing device 400 includes:
[0130] An image segmentation module 410 is used to perform image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image;
[0131] The feature extraction module 430 is used to extract non-furniture features in the non-furniture segmentation image and to extract furniture features in the furniture segmentation image; wherein the non-furniture features at least include color features, and the furniture features at least include: furniture style features and / or color features;
[0132] The image matching module 450 is used to match the corresponding non-furniture image based on the non-furniture feature, and to match the corresponding furniture image based on the furniture feature; wherein the furniture image and the non-furniture image are used to obtain the home decoration layout information; the furniture feature includes the furniture style feature; the feature extraction module 430 includes:
[0133] An image block acquisition unit 431 is used to segment the furniture segmentation image into at least one image block;
[0134] A spatial vector acquisition unit 432 is used to extract the spatial vector of each image block, and perform position encoding on the spatial vector of each image block to obtain the position spatial vector corresponding to each image block;
[0135] The furniture style feature extraction unit 433 is used to process the position space vector corresponding to each image block based on multi-head self-attention to obtain the furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category for generating the furniture segmentation image.
[0136] In one possible implementation, the space vector acquisition unit includes:
[0137] A one-dimensional vector acquisition section is used to flatten each image block into a one-dimensional vector to obtain a one-dimensional vector corresponding to each image block;
[0138] The position encoding section is used to map the one-dimensional vector corresponding to each image block to a high-dimensional embedding space to obtain a spatial vector.
[0139] In one possible implementation, the image segmentation module includes:
[0140] A target feature image acquisition unit is used to extract features from the home decoration image to obtain a target feature image;
[0141] A classification unit, for classifying feature data of each pixel in the target feature map based on a preset category to obtain a category of each pixel in the home decoration image; wherein the preset category includes a furniture category and a non-furniture category;
[0142] The image segmentation unit is used to segment the home decoration image based on the area where the pixels of the furniture category are located, and to segment the home decoration image based on the area where the pixels of the non-furniture category are located, and accordingly obtain a furniture segmentation image and a non-furniture segmentation image.
[0143] In one possible implementation, the target feature image acquisition unit includes:
[0144] The coding section is used to encode the home decoration image to obtain a coding feature map;
[0145] The decoding section is used to decode the encoded feature map to obtain a decoded feature map;
[0146] The feature fusion module is used to perform feature map fusion processing on the encoding feature map and the decoding feature map to obtain the target feature image.
[0147] In an implementable manner, the non-furniture segmentation image includes a wall segmentation image and a floor segmentation image, and the non-furniture features include color features; and the feature extraction module includes:
[0148] The second color feature extraction unit is used to perform color clustering processing on the wall segmentation image to obtain wall color features; wherein the wall color features include color distribution and color proportion in the wall segmentation image;
[0149] The first color feature extraction unit is used to perform color clustering processing on the floor segmentation image to obtain floor color features; wherein the floor color features include color distribution and color proportion in the floor segmentation image;
[0150] The color feature acquisition unit is used to use the wall color features and the floor color features as the color features of the non-furniture segmentation image.
[0151] In one possible implementation, the home decoration image processing device further includes:
[0152] The model generation module is used to map furniture images and non-furniture images to a preset three-dimensional room model to obtain a home decoration layout model.
[0153] The home decoration image processing device provided in this embodiment can be used to execute the above-mentioned home decoration image processing method. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0154] Figure 5 A block diagram of an electronic device is shown as an exemplary embodiment. Figure 5 The electronic device 500 may include: a processor 51 and a memory 52, wherein the processor 51 and the memory 52 can communicate; illustratively, the processor 51 and the memory 52 communicate via a communication bus 53, the memory 52 is used to store instructions, and the processor 51 is used to call the instructions in the memory to execute the home decoration image processing method shown in any of the above method embodiments.
[0155] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0156] The present application provides a computer-readable storage medium, on which computer-executable instructions are stored; when the computer-executable instructions are executed by a processor, they are used to implement a home decoration image processing method as described in any of the above embodiments.
[0157] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned home decoration image processing method is implemented.
[0158] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0159] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for processing home decoration images, characterized in that: include: Performing image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image; Extracting non-furniture features from the non-furniture segmented image, and extracting furniture features from the furniture segmented image; wherein the non-furniture features at least include color features, and the furniture features at least include furniture style features; Matching corresponding non-furniture images based on the non-furniture features, and matching corresponding furniture images based on the furniture features; wherein the furniture images and non-furniture images are used to obtain home decoration layout information; Extracting furniture style features from the furniture segmentation image includes: Segmenting the furniture segmentation image into at least one image block; Flatten each image block into a one-dimensional vector to obtain a one-dimensional vector corresponding to each image block; Mapping the one-dimensional vectors corresponding to the image blocks to a high-dimensional embedding space to obtain the spatial vectors of the image blocks; Performing position encoding on the spatial vectors of each image block to obtain a position spatial vector corresponding to each image block; The position space vectors corresponding to the image blocks are processed based on multi-head self-attention to obtain furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category for generating the furniture segmentation image.
2. The method according to claim 1, characterized in that The performing image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image includes: Extracting features from the home decoration image to obtain a target feature image; Classifying the feature data of each pixel in the target feature image based on preset categories to obtain the category of each pixel in the home decoration image; wherein the preset categories include furniture categories and non-furniture categories; The home decoration image is segmented based on the area where the pixels of the furniture category are located, and the home decoration image is segmented based on the area where the pixels of the non-furniture category are located, and the furniture segmentation image and the non-furniture segmentation image are obtained accordingly.
3. The method according to claim 2, characterized in that The step of extracting features from the home decoration image to obtain a target feature image includes: Performing encoding processing on the home decoration image to obtain an encoding feature map; Decoding the encoded feature map to obtain a decoded feature map; The encoding feature map and the decoding feature map are subjected to feature map fusion processing to obtain a target feature image.
4. The method according to claim 1, characterized in that: The non-furniture segmentation image includes a wall segmentation image and a floor segmentation image, and the non-furniture features include color features; The extracting of non-furniture features from the non-furniture segmented image includes: Performing color clustering processing on the wall segmentation image to obtain wall color features; wherein the wall color features include color distribution and color proportion in the wall segmentation image; Performing color clustering processing on the floor segmentation image to obtain floor color features; wherein the floor color features include color distribution and color proportion in the floor segmentation image; The wall color feature and the floor color feature are used as color features of the non-furniture segmentation image.
5. The method according to claim 1, characterized in that After matching the corresponding non-furniture images based on the non-furniture features and matching the corresponding furniture images based on the furniture features, the method further includes: The furniture image and the non-furniture image are mapped to a preset three-dimensional room model to obtain a home layout model.
6. A home decoration image processing device, characterized in that: include: An image segmentation module, used to perform image segmentation processing on the home decoration image to obtain at least one furniture segmentation image and at least one non-furniture segmentation image; A feature extraction module, used to extract non-furniture features in the non-furniture segmentation image, and to extract furniture features in the furniture segmentation image; wherein the non-furniture features at least include color features, and the furniture features at least include furniture style features; An image matching module, used to match the corresponding non-furniture images based on the non-furniture features, and to match the corresponding furniture images based on the furniture features; wherein the furniture images and non-furniture images are used to obtain home decoration layout information; The feature extraction module comprises: An image block acquisition unit, used for segmenting the furniture segmentation image into at least one image block; A spatial vector acquisition unit, used to flatten each image block into a one-dimensional vector to obtain a one-dimensional vector corresponding to each image block; map the one-dimensional vector corresponding to each image block to a high-dimensional embedding space to obtain a spatial vector of each image block; perform position encoding on the spatial vector of each image block to obtain a position spatial vector corresponding to each image block; A furniture style feature extraction unit is used to process the position space vector corresponding to each image block based on multi-head self-attention to obtain the furniture style features of the furniture segmentation image; wherein the furniture style features are features of the style category of the furniture segmentation image.
7. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the electronic device executes the home decoration image processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the home decoration image processing method according to any one of claims 1 to 5 when executed by a processor.
9. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the home decoration image processing method as claimed in any one of claims 1 to 5.
