Image style and color migration generation method based on table diffusion
Through the stable diffusion-based image style and color migration generation method, using technologies such as the YOLO model and Attention mechanism, the problems of high cost and unsatisfactory AI color change in the field of automobile display are solved, and efficient, low-cost and natural automobiles are achieved. Display image generation.
Patent Information
- Application Number
- CN202411229970.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-11-22
AI Technical Summary
In the field of automotive display, the existing technology has high shooting and post-processing costs. The AI color change tool has poor effect, and it is easy to accidentally dye areas that should not be dyed, and the color overflow is severe, which cannot meet the diverse needs of customers.
Using the image style and color migration generation method based on stable diffusion, the YOLO model recognizes and segments components that should not be dyed, such as car lights and license plates, uses the Attention mechanism and SAM segmentation algorithm to ensure accurate color changes, and uses the KMeans algorithm to perform color clustering. and offset calculation to achieve natural color changes.
It greatly reduces the costs of professional photography and post-processing, accurately identify and protect areas that should not be dyed, avoid color spillage, quickly generate diverse car display images, meet customer needs, and achieve efficient, low-cost and natural car displays. Image generation.
Smart Images

Figure CN119006270A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an image generation method, in particular to a stable diffusion-based image style and color migration generation method, belonging to the technical field of image generation and processing. Background Art
[0002] In the field of car display, it takes a lot of money to shoot and display cars. The traditional way is to use professional photographers to take photos of cars, and then use image processing software to process them in the later stage to achieve the ideal display effect. After shooting with a camera, the photos can be input into the computer and modified using the image modification software in the computer to change the contrast, color and other attributes of the photos.
[0003] Stable diffusion is one of the most advanced modes in the Diffusion diffusion model. It uses a more stable, controllable and efficient method to generate high-quality images. It is not only used for image generation, but also widely used in natural language processing, audio and video generation fields.
[0004] However, in actual operation, this method has multiple problems: the shooting cost of professional photographers is high, post-processing is complicated and requires professional skills, and the vehicle colors in 4S stores are incomplete, which cannot meet the diverse needs of customers. There are also some AI color-changing tools on the market, such as AI color-changing technology, which changes the color of the car through algorithms, but the effect is not ideal. Specific problems include: when changing colors, parts that should not be dyed, such as headlights and license plates, will be mistakenly dyed, the overall image effect is unnatural, and color overflow is serious. Due to the high cost of shooting and post-processing, the existing AI color-changing algorithm is not ideal, it is easy to mistakenly dye areas that should not be dyed, the image effect is unnatural after color change, and there is a phenomenon of color overflow. Summary of the invention
[0005] The purpose of this application is to solve the problem of high cost of existing automobile display shooting and post-processing, while improving the effect of AI color change, avoiding the accidental coloring of parts that should not be colored, such as headlights and license plates, during the color change process, thereby achieving more efficient, low-cost and natural automobile display image generation and providing an image style and color migration generation method based on stable diffusion.
[0006] The present application achieves the above-mentioned purpose through the following technical solutions, a method for generating image style and color migration based on stable diffusion, the generation method comprising the following steps:
[0007] (1) Obtaining image information;
[0008] (2) Segmenting image information;
[0009] (3) Change the color of the segmented image area;
[0010] (4) Control the color-changing area;
[0011] (5) Map and cluster the image information;
[0012] (6) Calculate the offset based on the color difference to achieve color change.
[0013] In the technical solution, in the step (1), a photographing device is used to take photos of the car, and photos are taken around the car body and the roof position to obtain an overall photo of the car, and a clear picture of the intersection of the car body and other positions is obtained.
[0014] In the technical solution, the YOLO model is used in step (2) to train the car image, and based on the large amount of stored image data, the components that should not be dyed, such as the headlights, license plates, exhaust pipes, windows, etc., are identified and segmented.
[0015] In the technical solution, in step (2), an intelligent mask is generated to mark all areas to be protected, and the precise segmentation position is determined based on the vehicle body image and the image information of the unprotected area.
[0016] In the technical solution, in the step (2), the image of the intersection of the automobile body and other positions is identified and cut, and the segmentation position of the whole car body photo is identified and corresponded, and the image information of the segmentation position is further refined. By refining the segmentation position, the accuracy of the segmentation line is ensured.
[0017] In the technical solution, the image information acquired in step (2) is stored and backed up, and a large amount of labeled data is used to train the YOLO model to improve the generation accuracy of the intelligent mask.
[0018] In the technical solution, the Attention mechanism is used in step (3) to increase the attention paid to the area to be changed in color.
[0019] In the technical solution, the SAM segmentation algorithm is used in step (4) to identify the main object in the original image, and refine the edge position of the image segmentation to improve the accuracy of the image segmentation, ensuring that only the paint part of the car is changed in color.
[0020] In the technical solution, in step (5), the KMeans algorithm is used to map the pixels of the car image to the RGB three-dimensional space and cluster them, so as to obtain the data information of all the cutting positions of the car image, identify the main color of the original car image, take the main color of the original car image as the reference, and determine the changed color by the difference value with the main color of the original car image.
[0021] In the present technical solution, in step (6), the color shift is calculated by the difference between the target color value and the original color to achieve color change. The image after the color change is extracted and the color is detected, focusing on detecting the color change at the cutting position. After the color is confirmed to be correct, it is uploaded to the terminal.
[0022] The beneficial effects of the present application are: this generation method is suitable for an image color migration generation method, and through an intelligent mask and an AI color change algorithm, and using a large amount of labeled data to train the YOLO model to improve the generation accuracy of the intelligent mask, the cost of professional photography and post-processing can be greatly reduced. By using the YOLO model and the Attention mechanism, the areas that should not be dyed, such as headlights and license plates, can be accurately identified and protected, and the color change area can be accurately controlled to avoid color overflow to the area that should not be dyed. Through the AI color change technology, a variety of car display images can be quickly generated when the vehicle color is incomplete to meet the diverse needs of customers. The entire process is highly automated and does not require a lot of manual intervention, making the generation of car display images more efficient and standardized, providing an efficient, low-cost, and natural-looking car color change method, which solves the problems of high shooting and post-processing costs and unsatisfactory AI color change effects in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of the generation method of this application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] Embodiment 1:
[0026] A method for migrating and generating image styles and colors based on stable diffusion, the method comprising the following steps:
[0027] (1) Obtaining image information;
[0028] (2) Segmenting image information;
[0029] (3) Change the color of the segmented image area;
[0030] (4) Control the color-changing area;
[0031] (5) Map and cluster the image information;
[0032] (6) Calculate the offset based on the color difference to achieve color change.
[0033] In the technical solution, in the step (1), a photographing device is used to take photos of the car, and photos are taken around the car body and the roof position to obtain an overall photo of the car, and a panoramic image of the car is taken. The panoramic image is used to obtain a picture of the intersection of the car body and other positions.
[0034] In the technical solution, the YOLO model is used in step (2) to train the car image, and based on the large amount of stored image data, the components that should not be dyed, such as the headlights, license plates, exhaust pipes, windows, etc., are identified and segmented.
[0035] In the technical solution, in step (2), an intelligent mask is generated to mark all areas to be protected, and the precise segmentation position is determined based on the vehicle body image and the image information of the unprotected area.
[0036] In the technical solution, in the step (2), the image of the intersection of the automobile body and other positions is identified and cut, and the segmentation position of the whole car body photo is identified and corresponded, and the image information of the segmentation position is further refined. By refining the segmentation position, the accuracy of the segmentation line is ensured.
[0037] In the technical solution, the image information acquired in step (2) is stored and backed up, and a large amount of labeled data is used to train the YOLO model to improve the generation accuracy of the intelligent mask.
[0038] In the technical solution, the Attention mechanism is used in step (3) to increase the attention paid to the area to be changed in color.
[0039] In the technical solution, the SAM segmentation algorithm is used in step (4) to identify the main object in the original image, and refine the edge position of the image segmentation to improve the accuracy of the image segmentation, ensuring that only the paint part of the car is changed in color.
[0040] In the technical solution, in step (5), the KMeans algorithm is used to map the pixels of the car image to the RGB three-dimensional space and cluster them, so as to obtain the data information of all the cutting positions of the car image, identify the main color of the original car image, take the main color of the original car image as the reference, and determine the changed color by the difference value with the main color of the original car image.
[0041] In the present technical solution, in step (6), the color shift is calculated by the difference between the target color value and the original color to achieve color change. The image after the color change is extracted and the color is detected, focusing on detecting the color change at the cutting position. After the color is confirmed to be correct, it is uploaded to the terminal.
[0042] The above method is suitable for the generation of image colors. The generated image has a large color difference value and a high generation efficiency.
[0043] Embodiment 2:
[0044] A method for migrating and generating image styles and colors based on stable diffusion, the method comprising the following steps:
[0045] (1) Obtaining image information;
[0046] (2) Segmenting image information;
[0047] (3) Change the color of the segmented image area;
[0048] (4) Control the color-changing area;
[0049] (5) Map and cluster the image information;
[0050] (6) Calculate the offset based on the color difference to achieve color change.
[0051] In the technical solution, in the step (1), a photographing device is used to take photos of the car, and photos are taken around the car body and the roof position to obtain an overall photo of the car, and a clear picture of the intersection of the car body and other positions is obtained.
[0052] In the technical solution, the YOLO model is used in step (2) to train the car image, and based on the large amount of stored image data, the components that should not be dyed, such as the headlights, license plates, exhaust pipes, windows, etc., are identified and segmented.
[0053] In the technical solution, in step (2), an intelligent mask is generated to mark all areas to be protected, and the precise segmentation position is determined based on the vehicle body image and the image information of the unprotected area.
[0054] In the technical solution, in the step (2), the image of the intersection of the automobile body and other positions is identified and cut, and the segmentation position of the whole car body photo is identified and corresponded, and the image information of the segmentation position is further refined. By refining the segmentation position, the accuracy of the segmentation line is ensured.
[0055] In the technical solution, the image information acquired in step (2) is stored and backed up, and a large amount of labeled data is used to train the YOLO model to improve the generation accuracy of the intelligent mask.
[0056] In the technical solution, the Attention mechanism is used in step (3) to increase the attention paid to the area to be changed in color.
[0057] In the technical solution, the SAM segmentation algorithm is used in step (4) to identify the main object in the original image, and refine the edge position of the image segmentation to improve the accuracy of the image segmentation, ensuring that only the paint part of the car is changed in color.
[0058] In the technical solution, in step (5), the KMeans algorithm is used to map the pixels of the car image to the RGB three-dimensional space and cluster them, so as to obtain the data information of all the cutting positions of the car image, identify the main color of the original car image, take the main color of the original car image as the reference, and determine the changed color by the difference value with the main color of the original car image.
[0059] In the present technical solution, in step (6), the color shift is calculated by the difference between the target color value and the original color to achieve color change. The image after the color change is extracted and the color is detected, focusing on detecting the color change at the cutting position. After the color is confirmed to be correct, it is uploaded to the terminal.
[0060] The above method is suitable for the generation of image colors. The color difference value of the generated image is small and the generation efficiency is low.
[0061] It is obvious to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be regarded as limiting the claim to which it relates.
[0062] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A method for transferring and generating image styles and colors based on stable diffusion, characterized in that: The generation method comprises the following steps: (1) Obtaining image information; (2) Segmenting image information; (3) Change the color of the segmented image area; (4) Control the color-changing area; (5) Map and cluster the image information; (6) Calculate the offset based on the color difference to achieve color change.
2. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (1), a photographing device is used to take photos of the car, and photos are taken around the car body and the roof position to obtain an overall photo of the car, and a clear picture of the intersection of the car body and other positions is obtained.
3. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (2), the YOLO model is used to train the car image, and based on the large amount of stored image data, components such as headlights, license plates, exhaust pipes, windows, etc. that should not be dyed are identified and segmented.
4. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (2), an intelligent mask is generated to mark all areas to be protected, and the precise segmentation position is determined based on the vehicle body image and the image information of the non-protected area.
5. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (2), the image of the intersection of the automobile body and other positions is identified and cut, and the segmentation position of the whole vehicle body photo is identified and corresponded, and the image information of the segmentation position is further refined. By refining the segmentation position, the accuracy of the segmentation line is ensured.
6. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (2), the acquired image information is stored and backed up, and a large amount of labeled data is used to train the YOLO model to improve the generation accuracy of the intelligent mask.
7. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (3), an Attention mechanism is used to increase the attention paid to the area to be changed in color.
8. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (4), the SAM segmentation algorithm is used to identify the main object in the original image, and the edge position of the image segmentation is refined to improve the accuracy of the image segmentation, ensuring that only the paint part of the car is changed in color.
9. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (5), the pixels of the car image are mapped to the RGB three-dimensional space and clustered using the KMeans algorithm, data information of all cut positions of the car image is obtained, and the main color of the original car image is identified. The main color of the original car image is used as a reference, and the changed color is determined by the difference value with the main color of the original car image.
10. The image style and color migration generation method based on stable diffusion according to claim 1, characterized in that: In the step (6), the color shift is calculated by the difference between the target color value and the original color to achieve color change. The image after the color change is extracted and the color is detected, focusing on detecting the color change at the cutting position. After the color is confirmed to be correct, it is uploaded to the terminal.
