Commodity poster typesetting method and device based on AI technology and medium
By using image segmentation algorithms and mask image technology, key positions are automatically identified and layout scores are calculated, solving the problem of low efficiency in traditional poster layout and achieving a reasonable layout of poster elements and improved visual effects.
Patent Information
- Application Number
- CN202510626967.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional poster layout methods are inefficient, labor-intensive, and difficult to ensure consistent poster styles. Existing AIGC-generated posters lack reasonable layout and cannot meet the rapidly changing market demands.
By using image segmentation algorithms to identify key locations, generating a mask image and calculating layout scores, the optimal template is selected, and the intelligent layout of poster elements is automatically completed.
This resulted in a reasonable layout of poster elements and a good visual effect, improving the efficiency and quality of poster production.
Smart Images

Figure CN120976367A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of image processing and artificial intelligence technology, and particularly relates to a commodity poster layout method and device based on AI technology and a storage medium. BACKGROUND
[0002] In today's e-commerce and advertising industry, the demand for commodity poster production is huge. The traditional poster layout method mainly relies on manual operation, and designers need to spend a lot of time and effort to determine the positions and layouts of various elements (such as product pictures, main titles, subtitles, logos, selling points, etc.) in the poster. This method is not only inefficient and costly, but also has large differences in aesthetic and layout style between different designers, making it difficult to ensure the consistency and standardization of the poster style.
[0003] With the development of AIGC (artificial intelligence generated content) technology, a large number of commodity posters can be quickly generated, but these generated posters often lack reasonable layout. The existing layout technology cannot well adapt to the poster generated by AIGC, and it is difficult to automatically and efficiently complete the intelligent layout of the poster elements, and it cannot meet the rapidly changing market demand. SUMMARY
[0004] In view of the technical defects mentioned in the background art, the purpose of the embodiments of the present application is to provide a commodity poster layout method and device based on AI technology and a storage medium.
[0005] To achieve the above-mentioned purpose, in a first aspect, the embodiments of the present application provide a commodity poster layout method based on AI technology, comprising:
[0006] The key position of the commodity poster is identified by using an image segmentation algorithm to obtain the commodity position information and the fixed element position information in the poster;
[0007] A mask graph is generated based on the commodity position information and the fixed element position information in the poster; the mask graph contains a reserved area;
[0008] A plurality of poster element placement templates are generated according to a preset rule; the preset rule includes the placement positions of a plurality of poster elements, and the plurality of poster elements include a main title, a subtitle, a logo and a selling point;
[0009] Based on the reserved area of the mask graph, an optimal template is selected from the plurality of poster element placement templates;
[0010] Based on the layout of the optimal template, a plurality of poster elements are placed in the corresponding positions in the poster graph, and the intelligent layout of the commodity poster is completed.
[0011] As a specific implementation manner of the application, the optimal template is selected from the plurality of poster element placement templates based on a reserved area of a mask graph, specifically:
[0012] For each poster element placement template, a layout score is calculated based on two key factors of image complexity and reserved area overlap degree; wherein the reserved area overlap degree is related to the mask graph;
[0013] According to the layout score, the poster element placement template with the highest layout score is selected as the optimal template.
[0014] As a specific implementation manner of the application, the calculation of the layout score is specifically:
[0015] For each poster element placement template, the image complexity of each element placement area is calculated based on a gray level co-occurrence matrix;
[0016] The overlap of each poster element placement template with the reserved area in the mask graph is evaluated to obtain the reserved area overlap degree;
[0017] The layout score is calculated according to the image complexity and the reserved area overlap degree.
[0018] In a second aspect, an embodiment of the application provides a commodity poster layout device based on AI technology, comprising:
[0019] An image preprocessing and key position recognition unit is configured to recognize key positions of a commodity poster image by using an image segmentation algorithm to obtain commodity position information and fixed element position information in the poster;
[0020] A mask graph generation unit is configured to generate a mask graph based on the commodity position information and the fixed element position information in the poster; the mask graph contains a reserved area;
[0021] A template generation unit is configured to generate a plurality of poster element placement templates according to a preset rule; the preset rule includes placement positions of a plurality of poster elements, and the plurality of poster elements include a main title, a subtitle, a logo and a selling point;
[0022] A template selection unit is configured to select an optimal template from the plurality of poster element placement templates based on a reserved area of a mask graph;
[0023] A layout unit is configured to place a plurality of poster elements in corresponding positions in a poster image based on a layout of the optimal template, and complete intelligent layout of a commodity poster.
[0024] Further, the commodity poster layout device further comprises:
[0025] A score calculation unit is configured to place a template for each poster element and calculate a layout score based on two key factors, image complexity and overlap with a reserved area; wherein the overlap with the reserved area is related to a mask image.
[0026] The template selection unit is configured to sort the templates according to the layout scores and select the template with the highest layout score as the optimal template.
[0027] In a third aspect, the embodiments of the present application further provide another AI technology-based poster layout device for commodities, which comprises a processor, an input device, an output device and a memory, and the processor, the input device, the output device and the memory are connected to each other, wherein the memory is configured to store a computer program, the computer program comprises program instructions, and the processor is configured to invoke the program instructions to execute the method of the first aspect.
[0028] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, the computer program comprises program instructions, and the program instructions, when executed by a processor, cause the processor to execute the method of the first aspect.
[0029] The AI technology-based poster layout scheme for commodities provided by the embodiments of the present application can ensure that the finally generated poster element layout is reasonable and has good visual effect, and improves the efficiency and quality of poster production. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description.
[0031] Figure 1 is a flowchart of the AI technology-based poster layout method for commodities provided by the embodiments of the present application;
[0032] Figure 2 is another flowchart of the method;
[0033] Figure 3 is a structural diagram of the AI technology-based poster layout device for commodities provided by the embodiments of the present application;
[0034] Figure 4 is Figure 3 is another structural diagram of the device. DETAILED DESCRIPTION
[0035] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are some of the embodiments of the present application but not all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative effort should fall within the protection scope of the present application.
[0036] It should be understood that the terms "comprising" and "including" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0037] Please refer to Figure 1 and Figure 2 The AI technology-based commodity poster layout method provided by the embodiments of the present application comprises:
[0038] S1, image preprocessing and key position identification: using an image segmentation algorithm to identify the key positions of a commodity poster image to obtain commodity position information and fixed element position information in the poster.
[0039] Specifically, assuming that there is a commodity poster image generated by AIGC, an image segmentation algorithm (such as BiRefNet) is used to accurately identify the commodity poster image to obtain the position of the commodity in the poster image and determine the area position of the fixed elements (such as specific decorative pictures) in the poster image.
[0040] S2, mask image generation: generating a mask image based on the commodity position information and the fixed element position information in the poster.
[0041] Specifically, based on the aforementioned position information, a mask image containing a reserved area is generated, which clearly identifies the area in the poster that is not suitable for placing other poster elements.
[0042] S3, template generation: generating a plurality of poster element placement templates according to preset rules.
[0043] For example, template one places the logo in the upper left corner of the poster, the main title and the subtitle are centered, and the selling points are arranged vertically on the right side of the commodity; template two places the logo in the upper right corner, the main title is on the top and the subtitle is on the bottom, and the selling points surround the commodity.
[0044] S4, layout score calculation: calculating the image complexity of each element placement area based on a gray level co-occurrence matrix, and evaluating the overlap of the template and the reserved area in the mask image, and comprehensively calculating the layout score of each template.
[0045] Specifically, for each template, a layout score is calculated based on two key factors, image complexity and overlap degree with the reserved area. The image complexity is measured by the statistical features of the gray level co-occurrence matrix (GLCM) of the area, and the overlap degree is used to evaluate the overlap between the template position and the reserved area in the mask image. The layout score of the template is related to the image complexity and the overlap degree. The lower the image complexity and the less the overlap with the reserved area, the higher the score.
[0046] wherein the layout score of each template is calculated based on the image complexity and the overlap degree, specifically, the image complexity score and the overlap degree score are weighted and added, and then the result is normalized to 0 to 100 to obtain the final layout score of each template.
[0047] For example, after calculation, the image complexity score of template one is high (indicating that the image texture of the area is simple), the overlap degree with the reserved area is low, and the final layout score is 85; the image complexity score of template two is low, and there is a certain overlap with the reserved area, and the layout score is 70.
[0048] S5, sorting and template selection: sorting according to the layout score, and selecting the poster element with the highest layout score to place the template as the optimal template.
[0049] Specifically, the layout scores of the calculated templates are sorted, and the optimal template with the highest score is selected.
[0050] S6, layout implementation: based on the layout of the optimal template, the multiple poster elements are placed in the corresponding positions of the poster image to complete the intelligent layout of the product poster.
[0051] For example, according to the layout of template one, the main title, subtitle, logo and selling point elements of the product poster are accurately placed in the corresponding positions of the poster image to complete the intelligent layout of the poster.
[0052] From the above description, it can be seen that the product poster layout scheme based on AI technology provided by the embodiment of the application can ensure that the final generated product poster element layout is reasonable and has good visual effect, thereby improving the efficiency and quality of poster production.
[0053] Based on the same inventive concept, the application provides a product poster layout device based on AI technology, as shown in Figure 3 The device comprises:
[0054] An image preprocessing and key position recognition unit is configured to recognize key positions of a product poster image based on an image segmentation algorithm to obtain product position information and fixed element position information in the poster; wherein the product poster image is generated based on AIGC.
[0055] The mask image generation unit is used to generate a mask image based on the product location information and the location information of fixed elements in the poster; the mask image contains reserved areas and clearly marks the areas in the poster that are not suitable for placing other poster elements;
[0056] The template generation unit is used to generate multiple poster element placement templates according to preset rules; the preset rules include the placement positions of multiple poster elements, and the multiple poster elements include a main title, a subtitle, a logo, and selling points;
[0057] The score calculation unit is used to place templates for each poster element and calculate the layout score based on two key factors: image complexity and overlap with the reserved area; wherein, the overlap of the reserved area is related to the mask image;
[0058] The template selection unit is used to select the optimal template from multiple poster element placement templates based on the reserved area of the mask image; specifically, it sorts the poster elements according to the layout score and selects the poster element placement template with the highest layout score as the optimal template.
[0059] The layout unit is used to place multiple poster elements in the corresponding positions in the poster image based on the layout of the optimal template, thereby completing the intelligent layout of the product poster.
[0060] Specifically, the fraction calculation unit is used for:
[0061] For each poster element placement template, the image complexity of each element placement area is calculated based on the gray-level co-occurrence matrix.
[0062] Evaluate the overlap between the placement template of each poster element and the reserved area in the mask image to obtain the degree of overlap of the reserved area;
[0063] The layout score is calculated based on the image complexity and the degree of overlap of the retained areas.
[0064] It should be noted that the specific workflow of this embodiment is described in the foregoing method embodiment section, and will not be repeated here.
[0065] Furthermore, another embodiment of the present invention also provides a product poster layout device based on AI technology. For example... Figure 4 As shown, the device may include one or more processors 101, one or more input devices 102, one or more output devices 103, and a memory 104, wherein the processors 101, input devices 102, output devices 103, and memory 104 are interconnected via a bus 105. The memory 104 is used to store a computer program, the computer program including program instructions, and the processor 101 is configured to invoke the program instructions to execute the method described in the above-described method embodiment.
[0066] It should be understood that, in the embodiments of the present application, the processor 101 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0067] The input device 102 can include a keyboard, etc., and the output device 103 can include a display (LCD, etc.), a speaker, etc.
[0068] The memory 104 can include a read-only memory and a random access memory, and provide instructions and data for the processor 101. A portion of the memory 104 can also include a non-volatile random access memory. For example, the memory 104 can also store device type information.
[0069] In specific implementations, the processor 101, the input device 102 and the output device 103 described in the embodiments of the present application can perform the implementation described in the embodiments of the commodity poster layout method based on AI technology provided by the embodiments of the present application, and will not be described here.
[0070] Correspondingly, the embodiments of the present application provide a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions are executed by a processor to implement a commodity poster layout method based on AI technology.
[0071] The computer readable storage medium can be an internal storage unit of the system, such as a hard disk or a memory of the system. The computer readable storage medium can also be an external storage device of the system, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the system. The computer readable storage medium is used to store the computer program and other programs and data required by the system. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.
[0072] Those skilled in the art can understand that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0073] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are only schematic. The division of the units is only a logical function division. In actual implementation, another division manner can be used, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can also be electrical, mechanical or other forms of connection.
[0074] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application.
[0075] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0076] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0077] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A product poster layout method based on AI technology, characterized in that, The method comprises the following steps: key position recognition is performed on the commodity poster image by using an image segmentation algorithm to obtain commodity position information and fixed element position information in the poster; a mask image is generated based on the commodity position information and the fixed element position information in the poster; the mask image contains a reserved area; a plurality of poster element placement templates are generated according to a preset rule; the preset rule includes placement positions of a plurality of poster elements, and the plurality of poster elements include a main title, a subtitle, a logo and a selling point; an optimal template is selected from the plurality of poster element placement templates based on the reserved area of the mask image; a plurality of poster elements are placed in corresponding positions in the poster image based on the layout of the optimal template, and intelligent layout of the commodity poster is completed.
2. The merchandise poster layout method of claim 1, wherein, The commodity poster image is generated based on AIGC; and the mask image clearly identifies an area in the poster that is not suitable for placing other poster elements.
3. The merchandise poster layout method of claim 1, wherein, The optimal template is selected from the plurality of poster element placement templates based on the reserved area of the mask image, specifically as follows: For each poster element placement template, a layout score is calculated based on two key factors of image complexity and reserved area overlap; the reserved area overlap is related to the mask image; The layout score is sorted, and the poster element placement template with the highest layout score is selected as the optimal template.
4. The merchandise poster layout method of claim 3, wherein, The layout score is calculated specifically as follows: For each poster element placement template, the image complexity of each element placement area is calculated based on a gray level co-occurrence matrix; The overlap of each poster element placement template with the reserved area of the mask image is evaluated to obtain a reserved area overlap; The layout score is calculated based on the image complexity and the reserved area overlap. 5.A device for AI-based layout of a commercial poster, characterized by comprising: The method comprises the following steps: An image preprocessing and key position recognition unit is configured to perform key position recognition on a commodity poster image by using an image segmentation algorithm to obtain commodity position information and fixed element position information in the poster; A mask image generation unit is configured to generate a mask image based on the commodity position information and the fixed element position information in the poster; the mask image contains a reserved area; A template generation unit is configured to generate a plurality of poster element placement templates according to a preset rule; The preset rule includes placement positions of a plurality of poster elements, and the plurality of poster elements include a main title, a subtitle, a logo and a selling point; A template selection unit is configured to select an optimal template from the plurality of poster element placement templates based on the reserved area of the mask image; A layout unit is configured to place a plurality of poster elements in corresponding positions in the poster image based on the layout of the optimal template, and complete intelligent layout of the commodity poster.
6. The merchandise poster layout device of claim 5, wherein, The commodity poster image is generated based on AIGC; and the mask image clearly identifies an area in the poster that is not suitable for placing other poster elements.
7. The merchandise poster layout device of claim 5, wherein, The commodity poster layout device further comprises: A score calculation unit is configured to calculate a layout score for each poster element placement template based on two key factors of image complexity and reserved area overlap; the reserved area overlap is related to the mask image; The template selection unit is configured to sort the layout scores and select the poster element placement template with the highest layout score as the optimal template.
8. The merchandise poster layout device of claim 7, wherein, The score calculation unit is specifically configured to: A template is placed for each poster element, and the image complexity of each element placement area is calculated based on a gray level co-occurrence matrix; The coincidence of each poster element placement template with the reserved area in the mask image is evaluated to obtain a reserved area coincidence degree; A layout score is calculated according to the image complexity and the reserved area coincidence degree.
9. A product poster layout device based on AI technology, characterized in that, The computer readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the processor executes the method according to any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the processor executes the method according to any one of claims 1-4.