A method and device for synthesizing a dish display image, a storage medium, and a computing device
By selecting matching reference pictures and synthetic materials from the dish gallery, combining preset synthesis templates and rules, high-quality dish display pictures are generated, which solves the problem that takeaway merchants cannot accurately display the inconsistent quality and style of the dishes, and improves the user's ordering experience.
Patent Information
- Application Number
- CN202210041039.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-14
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-01-14
AI Technical Summary
Due to technical limitations or low shooting quality, takeaway merchants are unable to accurately display the quality of dishes, resulting in a decrease in user interest in choosing. Moreover, merchants take pictures themselves and easily lead to inconsistent styles, affecting user experience.
Provide a method for synthesis of dish display pictures. By selecting matching reference pictures from the dish gallery for image processing, selecting synthetic materials based on the feature information of the target dish, and integrating the main image and materials of the dish using preset synthesis templates and rules to generate high-quality dish display pictures.
There is no need for merchants to take pictures manually, and simple operations generate dishes display pictures that meet their needs, improving the quality and uniformity of dishes display, thereby improving users' ordering experience.
Smart Images

Figure CN114419200B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method and device for synthesizing a dish display picture, a storage medium, and a computing device. Background Art
[0002] Takeout has become the dining method of choice for most users due to its convenience. Takeout merchants display different types of dishes to users through the takeout platform for users to choose from. For some takeout merchants, they may not be able to take photos of their own dishes, or the photos they take may be of low quality due to problems with their shooting technology, and they cannot accurately convey the quality of the dishes themselves, thus failing to attract users' interest. Moreover, if merchants take their own photos, it is easy for the styles of the dishes to be uneven, and it is impossible to have a complete set of product photos. The ordering pages of the same merchant will be inconsistent, which will affect the user's ordering experience. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a method and apparatus for synthesizing a dish display image, a storage medium, and a computing device that overcome the above problems or at least partially solve the above problems.
[0004] According to a first aspect of an embodiment of the present invention, a method for synthesizing a dish display image is provided, the method comprising:
[0005] In response to a request for synthesizing a dish display image of at least one target dish sent by the merchant, at least one dish reference image matching the at least one target dish is selected from a dish image library, and image processing is performed on the dish reference image to obtain a main dish image;
[0006] Acquire dish feature information corresponding to the target dish, and select at least one synthetic material matching the target dish according to the dish feature information;
[0007] Obtaining a display image synthesis template and a display image synthesis rule corresponding to the display image synthesis template;
[0008] The dish main image and the synthetic material are integrated using the display image synthesis rule to obtain a dish display image corresponding to the target dish.
[0009] In another optional embodiment, the acquiring dish feature information corresponding to the target dish, and selecting at least one synthetic material matching the target dish according to the dish feature information includes:
[0010] Parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish; wherein the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish;
[0011] At least one synthetic material matching the target dish is selected from a pre-constructed material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
[0012] In another optional embodiment, the obtaining of the display image synthesis template and the display image synthesis rule corresponding to the display image synthesis template includes:
[0013] Selecting a display image synthesis template for synthesizing a dish display image corresponding to the target dish from among a plurality of preset display image synthesis reference template targets;
[0014] Obtain the display image synthesis rule set corresponding to the display image synthesis template.
[0015] In another optional embodiment, the step of integrating the main dish image and the synthetic material by using the display image synthesis rule to obtain a dish display image corresponding to the target dish includes:
[0016] Identify multiple layers and layer layout information included in the presentation graph synthesis rule, wherein the layer layout information includes layer material type, layer position relationship, and layer order;
[0017] The dish main body image and the synthetic material are integrated according to the layer and the layer layout information to obtain a dish display image corresponding to the target dish.
[0018] In another optional embodiment, performing image processing on the dish reference image to obtain the dish main image includes:
[0019] Identify a dish body and a corresponding dish body edge in the dish reference image, and cut out the dish reference image based on the dish body edge to obtain a corresponding dish body image;
[0020] Adjust the main image of the dish to a set size.
[0021] In another optional embodiment, before selecting at least one dish reference image matching the target dish from the dish image library, the method further includes:
[0022] Get multiple pictures of dishes corresponding to different types of dishes and different shooting angles;
[0023] Establishing a machine learning model for image classification, using the machine learning model to perform feature learning on any of the dish images, and adding a feature label for characterizing the corresponding features of the dish image to each of the dish images;
[0024] A dish reference picture for synthesizing a dish display picture is selected from the plurality of dish pictures according to a preset picture screening rule, so as to construct a dish picture library based on the dish reference pictures.
[0025] In another optional embodiment, the selecting a dish reference picture for synthesizing a dish display picture from the plurality of dish pictures according to a preset picture screening rule includes:
[0026] For any of the dish images, obtaining a preset image screening rule that matches the feature tag according to the feature tag of the dish image;
[0027] According to the picture screening rule, a dish display picture for synthesizing a dish category corresponding to the category label is selected from the multiple dish pictures.
[0028] According to a second aspect of an embodiment of the present invention, a device for synthesizing a dish display image is provided, the device comprising:
[0029] A picture selection module, used to select at least one dish reference picture matching at least one target dish from the dish picture library, and perform image processing on the dish reference picture to obtain a main dish picture;
[0030] A material selection module, used to obtain dish feature information corresponding to the target dish, and select at least one synthetic material matching the target dish according to the dish feature information;
[0031] A template acquisition module, used to acquire a display image synthesis template and a display image synthesis rule corresponding to the display image synthesis template;
[0032] A synthesis module is used to integrate the main dish image and the synthesis material by using the display image synthesis rule to obtain a dish display image corresponding to the target dish.
[0033] In another optional embodiment, the material selection module is further used to:
[0034] Parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish; wherein the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish;
[0035] At least one synthetic material matching the target dish is selected from a pre-constructed material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
[0036] In another optional embodiment, the template acquisition module is further used for:
[0037] Selecting a display image synthesis template for synthesizing a dish display image corresponding to the target dish from among a plurality of preset display image synthesis reference template targets;
[0038] Obtain the display image synthesis rule set corresponding to the display image synthesis template.
[0039] In another optional embodiment, the synthesis module is further used for:
[0040] Identify multiple layers and layer layout information included in the presentation graph synthesis rule, wherein the layer layout information includes layer material type, layer position relationship, and layer order;
[0041] The dish main body image and the synthetic material are integrated according to the layer and the layer layout information to obtain a dish display image corresponding to the target dish.
[0042] In another optional embodiment, the picture selection module is further used for:
[0043] Identify a dish body and a corresponding dish body edge in the dish reference image, and cut out the dish reference image based on the dish body edge to obtain a corresponding dish body image;
[0044] Adjust the main image of the dish to a set size.
[0045] In another optional embodiment, the device further comprises a gallery building module;
[0046] The picture library building module is used to obtain multiple pictures of dishes corresponding to different types of dishes and different shooting angles;
[0047] Establishing a machine learning model for image classification, using the machine learning model to perform feature learning on any of the dish images, and adding a feature label for characterizing the corresponding features of the dish image to each of the dish images;
[0048] A dish reference picture for synthesizing a dish display picture is selected from the plurality of dish pictures according to a preset picture screening rule, so as to construct a dish picture library based on the dish reference pictures.
[0049] In another optional embodiment, the gallery building module is further used for:
[0050] For any of the dish images, obtaining a preset image screening rule that matches the feature tag according to the feature tag of the dish image;
[0051] According to the picture screening rule, a dish display picture for synthesizing a dish category corresponding to the category label is selected from the multiple dish pictures.
[0052] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute any one of the methods described in the first aspect.
[0053] According to a fourth aspect of an embodiment of the present invention, a computing device is further provided, the computing device comprising a processor and a memory:
[0054] The memory is used to store program code and transmit the program code to the processor;
[0055] The processor is used to execute the method described in any one of the first aspects according to the instructions in the program code.
[0056] The embodiment of the present invention provides a method and device for synthesizing a dish display image, a storage medium, and a computing device. In the method provided by the embodiment of the present invention, after receiving a dish display image synthesis request submitted by a merchant, the dish reference image selected from the dish image library can be processed to obtain a dish main image and synthesis materials for synthesizing the dish display image, and then the dish display image that meets the merchant's needs can be synthesized using an existing synthesis template. The method provided by the embodiment of the present invention does not require merchants to manually take pictures of dishes. Only simple operations are required for the platform to generate the required dish display images for the merchant. In addition, merchants can obtain a set of dish images and unify the ordering page through the method provided by this embodiment, thereby effectively improving the user's ordering experience.
[0057] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.
[0058] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0060] Figure 1 A schematic diagram of a method for synthesizing a dish display image according to an embodiment of the present invention is shown;
[0061] Figure 2A to Figure 2FA schematic diagram of a reference template for synthesizing a presentation image according to an embodiment of the present invention is shown;
[0062] Figure 3 A schematic diagram of a method for synthesizing a dish display image according to another embodiment of the present invention is shown;
[0063] Figure 4 A schematic diagram of the structure of a synthesis device for a dish display image according to an embodiment of the present invention is shown;
[0064] Figure 5 A schematic diagram showing the structure of a synthesis device for a dish display image according to another embodiment of the present invention
[0065] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0066] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0067] Figure 1 A schematic diagram of a method for synthesizing a dish display image according to an embodiment of the present invention is shown. Figure 1 It can be seen that the method for synthesizing a dish display image provided in an embodiment of the present invention may include at least the following steps S101 to S104, and can be applied to a food delivery platform or other online platforms that provide dish transactions. The dishes in this embodiment refer to various categories of food including but not limited to stir-fried dishes, soups, cold dishes, barbecues, steamed dishes, and the like.
[0068] S101, in response to a request for synthesis of a dish display image of at least one target dish sent by a merchant, at least one dish reference image matching at least one target dish is selected from a dish image library, and image processing is performed on the dish reference image to obtain a main dish image.
[0069] The merchant end in this embodiment can be a takeaway platform or a merchant end of other trading platforms that can provide dishes for sale. When any merchant needs the platform to provide a dish display picture, a request can be submitted to the platform. Optionally, the merchant end is associated with a terminal device such as a mobile phone or a tablet computer. By setting a platform-related application on the terminal device, the application has a corresponding functional module and an interface for information transmission with the platform. The terminal device can submit a request for synthesizing a dish display picture to the platform through the interface. In actual applications, when the merchant end submits an application to the platform, it can carry the name of the target dish that needs to synthesize the dish display picture, at least one side dish contained in the dish, or other dish feature information, and the dish name or other dish feature information can be sent to the platform by keyword input or voice input.
[0070] After the platform receives the request from the merchant side, it can respond to the request for synthesizing the display image of at least one target dish sent by the merchant side, and select at least one dish reference image that matches at least one target dish from the dish image library. The dish image library in this embodiment is a pre-created dish image library containing pictures related to various types of dishes. For the merchant side of the takeaway platform, after any merchant enters the takeaway platform, a dish image synthesis request can be submitted through the application corresponding to the takeaway platform. For example, the name of the target dish that needs to be synthesized can be input as dish feature information through keywords or voice input, such as fish-flavored pork shreds, spicy chicken, etc.; the side dishes included in the target dish can also be input as dish feature information through keywords or voice input. After the platform receives the dish image synthesis request carrying the dish feature information corresponding to the above-mentioned target dish, at least one dish reference image that matches the target dish can be selected from the pre-created dish image library.
[0071] In this embodiment, the pictures in the dish gallery may contain some other unnecessary objects besides the dishes themselves. Therefore, after selecting the reference picture from the dish gallery, the selected dish reference picture can be further processed to obtain the main picture of the dish. Optionally, the dish body and the corresponding dish body edge in the dish reference picture can be identified, and the dish reference picture can be cropped based on the dish body edge to obtain the corresponding dish body picture; and the dish body picture can be adjusted to a set size. In other words, in this embodiment, the dish reference picture can be cut out and the dish body picture can be obtained by automatic cropping or scaling.
[0072] Matting is to accurately segment the target area from the image. In this embodiment, it is mainly the main body of the dish in the dish image. When the method provided in this embodiment is used to matte the dish image, it can be implemented using a model framework composed of a coarse mask estimation network (MPN), a quality unification network (QUN) and a precise alpha matte estimation network (MRN). Among them, the MPN network is used to estimate coarse semantic information (coarse mask), and is trained together with coarse annotated data and fine annotated data. QUN is a quality unified network, which is used to standardize the quality of the coarse mask. QUN can unify the quality of the coarse mask output by MPN. The MRN network inputs the coarse mask normalized by YTO and QUN, estimates the precise alpha matte, and is trained using precise annotated data.
[0073] The method provided by the embodiment of the present invention can provide the necessary dish body for the synthesized dish display image by processing the dish reference image selected from the dish library, and can adapt to the preset synthesis template by adjusting the dish body image to a set size.
[0074] S102, obtaining dish feature information corresponding to the target dish, and selecting at least one synthetic material matching the target dish according to the dish feature information.
[0075] Optionally, the above-mentioned step S102 of acquiring dish feature information corresponding to the target dish, and selecting at least one synthetic material matching the target dish according to the dish feature information may include the following steps A1 to A2.
[0076] A1, parse the dish display picture synthesis request to obtain the dish feature information corresponding to the target dish. For the target dish that needs to synthesize the dish display picture, it is also necessary to identify the dish type corresponding to the target dish, such as Chinese food, Western food, soups and other different types of food. The above embodiment mentioned that the merchant end can send a dish picture synthesis request carrying the dish name of the target dish or the dish feature information such as the type of side dishes contained. Therefore, the dish feature information corresponding to the target dish can be obtained by parsing the dish display picture synthesis request. In this embodiment, the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish. The cuisine can be such as Chinese food, Western food, Japanese food, etc. The category can be stir-fry, soup, hot pot barbecue, salad light food, dessert, etc. The matched tableware can include tableware such as chopsticks, spoons, forks, etc. In addition, the dish feature information can also include information such as at least one side dish corresponding to the target dish.
[0077] A2, selecting at least one synthetic material matching the target dish from a pre-built material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
[0078] Foreground decorations are related materials used for decoration in the dish display image, which can include tableware and decorative plants; for example, tableware of different materials, sizes, and colors, such as wooden chopsticks, wooden spoons, knives, forks, and dinner plates, etc., and can also include decorative plants such as green leafy vegetables, colored peppers, onions, and mint leaves. The background image is a flat background for placing dinner plates, such as tablecloths and desktops of different colors. For example, if the target dish is Western food, you can choose cutlery and fork tableware. If it is soup, the corresponding tableware is a soup spoon, and the decoration is small plants such as mint leaves and coriander. If the target dish is a spicy dish, the foreground decoration can be peppers, etc.
[0079] S103, obtaining a presentation image synthesis template and a presentation image synthesis rule corresponding to the presentation image synthesis template.
[0080] When synthesizing the dish display image corresponding to the target dish, different synthesis templates can also be pre-set. The synthesis template in this embodiment is used to synthesize the dish display image according to different dish main body images and synthesis materials. In addition, synthesis rules are set in different synthesis templates. Optionally, the above step S103 of obtaining the display image synthesis template and the display image synthesis rules set corresponding to the display image synthesis template can include the following steps B1 to B2.
[0081] B1, select a display image synthesis template for synthesizing a dish display image corresponding to a target dish from among a plurality of preset display image synthesis reference template targets. In this embodiment, a plurality of display image synthesis templates may be preset, and different display image synthesis templates may require different numbers of synthesis materials, types of synthesis materials, and positional relationships between synthesis materials and the main dish image. Figure 2A to Figure 2F A schematic diagram of a display image synthesis reference template according to an embodiment of the present invention is shown. In actual applications, other forms of display image synthesis templates can also be designed, and the embodiment of the present invention does not limit this. When selecting a display image synthesis template for synthesizing a dish display image corresponding to a target dish from multiple pre-set display image synthesis reference template targets, it can be automatically selected according to the dish characteristics corresponding to the target dish, or multiple display image synthesis templates can be pushed to a terminal device associated with the merchant side and selected by the merchant side. Of course, in addition to the above introduction, the display image synthesis template can also be a custom setting of the merchant side, for example, the number of synthesis materials and the type of synthesis materials required for customization. It should be noted that the sizes of the corresponding layers of the dish main body images in different display image synthesis reference templates are the same, and the layer sizes of the same type of synthesis materials are the same.
[0082] B2, obtain the display image synthesis rules set corresponding to the display image synthesis template. As described above, different display image synthesis templates can be set with different synthesis rules, such as the number of synthesis materials required, the type of synthesis materials, the position relationship between the synthesis materials and the main dish image, and the layer order relationship. Figure 2A The display image synthesis template shown may include a main image of a dish, and a desktop as a background image, with material 1 and material 2 as foreground decorations, wherein material 1 may be peppers, and material 2 may be green vegetable leaves.
[0083] S104, integrating the main dish image and the synthesis material using the display image synthesis rule to obtain a dish display image corresponding to the target dish.
[0084] After selecting the display image synthesis template, the main dish image and the synthesis material can be integrated using the synthesis rule corresponding to the selected display image synthesis template to obtain the dish display image corresponding to the target dish. Optionally, multiple layers and layer layout information included in the display image synthesis rule can be identified; then the main dish image and the synthesis material are integrated according to the layers and layer layout information to obtain the dish display image corresponding to the target dish.
[0085] In this embodiment, the layer layout information includes the layer material type, layer position relationship and layer order. Therefore, after obtaining the main dish image and the synthetic material, the main dish layer and the synthetic material layer can be determined from the main dish image and the synthetic material according to the multiple layers included in the synthesis rule. Optionally, assuming that there is one main dish image selected, the selected main dish image can be directly used as the main dish layer; similarly, assuming that the number of selected synthetic materials is the same as the number of material layers required for the dish image synthesis template, the selected synthetic materials can be directly used to determine the synthetic material layers required for the synthetic dish display image according to the layer material types corresponding to each layer.
[0086] In actual applications, multiple dish main body images and multiple synthetic materials may be selected in the above steps S101 to S102. Optionally, the dish main body layer and the synthetic material layer may be selected from the multiple dish main body images and multiple synthetic materials according to the first feature corresponding to each dish main body image and the second feature corresponding to each synthetic material. Among them, the first feature corresponding to each dish main body image and the second feature corresponding to each synthetic material may include color features, type features or other features. Optionally, the number of dish main body images and synthetic materials can be compared first, and the dish main body layer and the synthetic material layer can be screened according to the comparison result. For example, if the number of dish main body images is greater than the number of synthetic materials, the synthetic material layer is first selected from the multiple synthetic materials according to the second feature corresponding to each synthetic material, and then the dish main body layer is selected in combination with the first feature corresponding to each dish main body image and the selected synthetic material layer. On the contrary, if the number of main dish images is less than the number of synthetic materials, the main dish layer is first selected based on the first feature corresponding to each main dish image and the selected synthetic material layer, and then the synthetic material layer is selected from multiple synthetic materials based on the second feature corresponding to each synthetic material and the selected main dish layer. For example, if the main dish image contains a red pepper element, then other elements except the red pepper element can be selected from multiple synthetic materials. The method provided in this embodiment can select the main dish layer and the synthetic material layer that are ultimately used to synthesize the dish display image in combination with the respective features of the main dish image and the synthetic material, so that the effect of the final generated dish display image can be more beautiful.
[0087] The above embodiment introduces a method for synthesizing a dish display image for a single target dish. In actual applications, the synthesis of multiple dish display images for a set of dishes can also be provided for the same merchant. When synthesizing multiple dish display images, the features corresponding to the selected dish main images and synthesized materials corresponding to all target dishes can be uniformly selected, or the features of the dish main images and synthesized materials of the synthesized dish display images can be referred to for the selection of subsequent dish main images and synthesized materials for other dish display images to be synthesized, thereby ensuring that the same merchant has a complete set of dish display images and a unified ordering page to enhance the ordering experience.
[0088] The above step S101 mentioned that at least one dish reference image matching the target dish is selected from the dish image library. Optionally, a dish image library needs to be created in advance. The implementation method can refer to the following steps C1 to C3.
[0089] C1, obtain multiple pictures of dishes corresponding to different types of dishes and different shooting angles. For example, top views, oblique views, and plan views of different dishes can be obtained. The dishes in this embodiment include but are not limited to desserts, soups, salads, light meals, Western food, Chinese food, Japanese food, and the like.
[0090] C2, establish a machine learning model for image classification, use the machine learning model to learn the features of any dish image, and add a feature label for each dish image to characterize the corresponding features of the dish image. In this embodiment, a machine learning model for image classification can also be established. The machine learning model is based on a neural network to establish a machine learning model. After training the machine learning model with batches of image data, a machine learning model trained to a convergent state is obtained, wherein the input data of the machine learning model is the dish image, and the output data includes the feature label corresponding to the dish image. The feature label may include a dish type label, an ingredient label, a color label, and the like for characterizing the dish corresponding to the dish image and the dish features.
[0091] C3, selecting a dish reference picture for synthesizing a dish display picture from multiple dish pictures according to a preset picture screening rule, so as to construct a dish picture library based on the dish reference picture.
[0092] In this embodiment, the image filtering rules corresponding to different types of dishes are different. Optionally, for any dish picture, a pre-set image filtering rule matching the feature tag is obtained based on the feature tag of the dish picture; and a dish display picture for synthesizing the dish category corresponding to the type tag is selected from multiple dish pictures based on the image filtering rule.
[0093] For example, the image filtering rules for dishes on plates or tableware may include: pictures taken from a bird's-eye or side-view angle; the image filtering rules for desserts or dishes with stacked ingredients may include: pictures taken from a side-view angle; the image filtering rules for dishes such as tea, bread, and desserts may include: pictures taken from a straight-on angle. In addition to the above, all image filtering rules may also include: the main body of the dish is complete, the main body of the dish may include food and containers that are in direct contact with the food, and the trays and tablecloths under the containers are not within the main body of the dish; the background is simple, and all objects other than a clear single main body, such as the background tabletop, tablecloth, and ingredients, auxiliary materials, tableware and other decorations used to create an atmosphere are deleted; the edges of the main body of the dish are clear, and there is no contact between the edges of the main body of the dish.
[0094] The method provided in this embodiment adaptively determines the corresponding image screening rules through the features corresponding to the dish images, so as to select matching dish images according to the features of different dishes, so that the dish images stored in the dish gallery can be used after simple processing.
[0095] The synthesis method of the dish display image mentioned in the above embodiment is described in detail below through a specific embodiment. Figure 3 A schematic diagram of a method for synthesizing a dish display image according to another embodiment of the present invention is shown. Figure 3It can be seen that the method for synthesizing a dish display image provided by the embodiment of the present invention may at least include the following steps S301 to S307.
[0096] S301, obtaining multiple pictures of dishes corresponding to different types of dishes and different shooting angles, adding feature labels using a machine learning model, selecting a dish reference picture for synthesizing a dish display picture, and constructing a dish picture library. The dishes in this embodiment include but are not limited to desserts, soups, salads, light meals, Western food, Chinese food, Japanese food, etc., corresponding to pictures of dishes at different angles such as top view, oblique view, and plan view.
[0097] S302, in response to a request for synthesizing a dish display image of at least one target dish sent by the merchant, selecting at least one dish reference image matching the at least one target dish from the dish image library. The merchant can initiate a request for synthesizing a dish display image of at least one target dish to the platform through a terminal device, and can input key information such as the name of the target dish or side dishes.
[0098] S303, identifying the dish body and the corresponding dish body edge in the dish reference image, cutting out the dish reference image to obtain the corresponding dish body image, and adjusting it to a set size. The set size is the size corresponding to the dish body layer required in the dish image synthesis template.
[0099] S304, parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish.
[0100] S305, selecting at least one synthetic material matching the target dish from the pre-built material library according to the dish feature information. The merchant end can send a dish image synthesis request carrying dish feature information such as the dish name of the target dish or the type of side dishes included, so that the dish feature information corresponding to the target dish can be obtained by parsing the dish display image synthesis request.
[0101] S306, selecting a display image synthesis template for synthesizing a dish display image corresponding to the target dish from among the pre-set multiple display image synthesis reference template targets. When selecting a display image synthesis template, it can be adaptively selected according to the types of dishes corresponding to the target dish, or the merchant can select from multiple display image synthesis reference templates.
[0102] S307, using the display image synthesis rule corresponding to the display image synthesis template to integrate the main dish image and the synthesis material, to obtain the dish display image corresponding to the target dish. Optionally, multiple layers and layer layout information included in the display image synthesis rule can be identified; at the same time, the dish main body layer and the synthesis material layer are determined from the main dish image and the synthesis material according to the multiple layers included in the synthesis rule, and then the main dish image and the synthesis material are integrated according to the layer and layer layout information to obtain the dish display image corresponding to the target dish.
[0103] Based on the same inventive concept, the embodiment of the present invention also provides a device for synthesizing a dish display image, such as Figure 4 As shown, the synthesis device of the dish display picture may include: a picture selection module 410, a material selection module 420, a template acquisition module 430 and a synthesis module 440.
[0104] The picture selection module 410 is used to select at least one dish reference picture matching at least one target dish from the dish picture library, and perform image processing on the dish reference picture to obtain a main dish picture;
[0105] The material selection module 420 is used to obtain the dish feature information corresponding to the target dish, and select at least one synthetic material matching the target dish according to the dish feature information;
[0106] The template acquisition module 430 is used to acquire the display image synthesis template and the display image synthesis rule set corresponding to the display image synthesis template;
[0107] The synthesis module 440 is used to integrate the main dish image and the synthesis material by using the display image synthesis rules to obtain the dish display image corresponding to the target dish.
[0108] In an optional embodiment of the present invention, the material selection module 420 is further used for:
[0109] Parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish; wherein the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish;
[0110] At least one synthetic material matching the target dish is selected from a pre-constructed material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
[0111] In an optional embodiment of the present invention, the template acquisition module 430 is further used for:
[0112] Selecting a display image synthesis template for synthesizing a dish display image corresponding to a target dish from among a plurality of preset display image synthesis reference template targets;
[0113] Get the display image synthesis rules corresponding to the display image synthesis template.
[0114] In an optional embodiment of the present invention, the synthesis module 440 is further configured to:
[0115] Identify multiple layers and layer layout information included in the presentation image synthesis rule, where the layer layout information includes layer material type, layer position relationship, and layer order;
[0116] The main dish image and the synthetic material are integrated according to the layers and layer layout information to obtain the dish display image corresponding to the target dish.
[0117] In an optional embodiment of the present invention, the picture selection module 410 is further used for:
[0118] Identify the dish body and the corresponding dish body edge in the dish reference image, and crop the dish reference image based on the dish body edge to obtain the corresponding dish body image;
[0119] Adjust the main image of the dish to the set size.
[0120] In an optional embodiment of the present invention, Figure 5 As shown, the dish display picture synthesis device may further include a picture library establishment module 450;
[0121] A picture library building module 450 is used to obtain a plurality of pictures of dishes corresponding to different types of dishes and different shooting angles;
[0122] Establish a machine learning model for image classification, use the machine learning model to learn the features of any dish image, and add a feature label for each dish image to characterize the corresponding features of the dish image;
[0123] Dish reference images for synthesizing dish display images are selected from multiple dish images according to preset image screening rules, so as to construct a dish image library based on the dish reference images.
[0124] In an optional embodiment of the present invention, the gallery building module 450 may also be used to:
[0125] For any dish image, obtain a pre-set image filtering rule that matches the feature tag according to the feature tag of the dish image;
[0126] According to the image screening rules, a dish display image corresponding to the dish category of the category label is selected from multiple dish images.
[0127] It should be noted that for other corresponding descriptions of the functional units involved in the device provided in the embodiment of the present application, reference can be made to the corresponding descriptions of the above-mentioned method embodiment, which will not be repeated here.
[0128] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method for synthesizing a dish display image described in the above embodiment.
[0129] The embodiment of the present invention also provides a computing device, such as Figure 6As shown, the computing device includes a communication bus, a processor, a memory and a communication interface, and may also include an input / output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the method of the above embodiment.
[0130] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.
[0131] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
[0132] Those skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions to enable a computing device (such as 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 invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
[0133] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the methods described in the embodiments of the present invention.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.
Claims
1. A method for synthesizing a dish display image, characterized in that: The method comprises: In response to a request for synthesizing a dish display image of at least one target dish sent by the merchant, at least one dish reference image matching the at least one target dish is selected from a dish image library, and image processing is performed on the dish reference image to obtain a main dish image; Acquire dish feature information corresponding to the target dish, and select at least one synthetic material matching the target dish according to the dish feature information; Obtaining a display image synthesis template and a display image synthesis rule corresponding to the display image synthesis template; The dish main image and the synthetic material are integrated using the display image synthesis rule to obtain a dish display image corresponding to the target dish.
2. The method according to claim 1, characterized in that The acquiring dish feature information corresponding to the target dish, and selecting at least one synthetic material matching the target dish according to the dish feature information comprises: Parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish; wherein the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish; At least one synthetic material matching the target dish is selected from a pre-constructed material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
3. The method according to claim 1, characterized in that: The obtaining of the display image synthesis template and the display image synthesis rule corresponding to the display image synthesis template include: Selecting a display image synthesis template for synthesizing a dish display image corresponding to the target dish from among a plurality of preset display image synthesis reference template targets; Obtain the display image synthesis rule set corresponding to the display image synthesis template.
4. The method according to claim 1, characterized in that: The step of integrating the main dish image and the synthetic material by using the display image synthesis rule to obtain the dish display image corresponding to the target dish includes: Identify multiple layers and layer layout information included in the presentation graph synthesis rule, wherein the layer layout information includes layer material type, layer position relationship, and layer order; The dish main body image and the synthetic material are integrated according to the layer and the layer layout information to obtain a dish display image corresponding to the target dish.
5. The method according to any one of claims 1 to 4, characterized in that The performing image processing on the dish reference image to obtain the dish main image comprises: Identify a dish body and a corresponding dish body edge in the dish reference image, and cut out the dish reference image based on the dish body edge to obtain a corresponding dish body image; Adjust the main image of the dish to a set size.
6. The method according to any one of claims 1 to 4, characterized in that Before selecting at least one dish reference image matching the target dish from the dish image library, the method further includes: Get multiple pictures of dishes corresponding to different types of dishes and different shooting angles; Establishing a machine learning model for image classification, using the machine learning model to perform feature learning on any of the dish images, and adding a feature label for characterizing the corresponding features of the dish image to each of the dish images; A dish reference picture for synthesizing a dish display picture is selected from the plurality of dish pictures according to a preset picture screening rule, so as to construct a dish picture library based on the dish reference pictures.
7. The method according to claim 6, characterized in that The selecting of a dish reference picture for synthesizing a dish display picture from the plurality of dish pictures according to a preset picture screening rule includes: For any of the dish images, obtaining a preset image screening rule that matches the feature tag according to the feature tag of the dish image; According to the picture screening rule, a dish display picture for synthesizing a dish category corresponding to the category label is selected from the multiple dish pictures.
8. A device for synthesizing a dish display image, characterized in that: The device comprises: A picture selection module, used to select at least one dish reference picture matching at least one target dish from the dish picture library, and perform image processing on the dish reference picture to obtain a main dish picture; A material selection module, used to obtain dish feature information corresponding to the target dish, and select at least one synthetic material matching the target dish according to the dish feature information; A template acquisition module, used to acquire a display image synthesis template and a display image synthesis rule corresponding to the display image synthesis template; A synthesis module is used to integrate the main dish image and the synthesis material by using the display image synthesis rule to obtain a dish display image corresponding to the target dish.
9. The device according to claim 8, characterized in that The material selection module is also used for: Parsing the dish display image synthesis request to obtain dish feature information corresponding to the target dish; wherein the dish feature information includes at least one of the cuisine, category, taste, and matched tableware corresponding to the target dish; At least one synthetic material matching the target dish is selected from a pre-constructed material library according to the dish feature information; wherein the synthetic material includes a foreground decoration and / or a background image.
10. The device according to claim 8, characterized in that The template acquisition module is also used for: Selecting a display image synthesis template for synthesizing a dish display image corresponding to the target dish from among a plurality of preset display image synthesis reference template targets; Obtain the display image synthesis rule set corresponding to the display image synthesis template.
11. The device according to claim 8, characterized in that The synthesis module is also used for: Identify multiple layers and layer layout information included in the presentation graph synthesis rule, wherein the layer layout information includes layer material type, layer position relationship, and layer order; The dish main body image and the synthetic material are integrated according to the layer and the layer layout information to obtain a dish display image corresponding to the target dish.
12. The device according to any one of claims 8 to 11, characterized in that The picture selection module is also used for: Identify a dish body and a corresponding dish body edge in the dish reference image, and cut out the dish reference image based on the dish body edge to obtain a corresponding dish body image; Adjust the main image of the dish to a set size.
13. The device according to any one of claims 8 to 11, characterized in that The device also includes a gallery building module; The picture library building module is used to obtain multiple pictures of dishes corresponding to different types of dishes and different shooting angles; Establishing a machine learning model for image classification, using the machine learning model to perform feature learning on any of the dish images, and adding a feature label for characterizing the corresponding features of the dish image to each of the dish images; A dish reference picture for synthesizing a dish display picture is selected from the plurality of dish pictures according to a preset picture screening rule, so as to construct a dish picture library based on the dish reference pictures.
14. The device according to claim 13, characterized in that The picture library building module is also used for: For any of the dish images, obtaining a preset image screening rule that matches the feature tag according to the feature tag of the dish image; According to the picture screening rule, a dish display picture for synthesizing a dish category corresponding to the category label is selected from the multiple dish pictures.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the method according to any one of claims 1 to 7.
16. A computing device, characterized in that: The computing device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to the instructions in the program code.
Citation Information
Patent Citations
Method and device for generating vegetable information and electronic device
CN109446915A
Advertisement picture generation method and device and storage medium
CN110827373A