Image generation method, device, electronic device, and storage medium
By acquiring and processing image information in the electronic device and generating target images matching image features, the problem of limited display screen replacement options in the prior art is solved, and the user experience and picture diversity are improved.
Patent Information
- Application Number
- CN202010112938.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-24
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2040-02-24
AI Technical Summary
The number of display screen replacement options for existing electronic devices is limited and fixed, resulting in poor user experience.
By obtaining the texture and color information of the image information, obtaining the pictures corresponding to the texture information based on the preset mapping relationship, and processing the to-processed pictures based on the color information to generate the target picture so that the generated target picture and the characteristics of the image information are more consistent. Meet the personalized needs of users.
Improve user experience, and by generating target images that match image information features, the diversity and personalized selection of display images are increased.
Smart Images

Figure CN113298896B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic devices, and more specifically, to a method and device for generating an image, an electronic device, and a storage medium. Background Art
[0002] With the development of science and technology, electronic devices are used more and more widely and have more and more functions, becoming one of the necessities in people's daily life. At present, the display screens of electronic devices, such as desktops and wallpapers, can be replaced automatically or according to the user's choice. However, the number of replaceable display screens is small and fixed, the playability is poor, and the user experience is not good. Summary of the invention
[0003] In view of the above problems, the present application proposes a picture generation method, device, electronic device and storage medium to solve the above problems.
[0004] In a first aspect, an embodiment of the present application provides a method for generating an image, which is applied to an electronic device, and the method includes: obtaining image information, extracting texture information of the image information, and extracting color information of the image information; based on a preset mapping relationship, obtaining an image corresponding to the texture information as an image to be processed; and processing the image to be processed based on the color information to generate a target image.
[0005] In a second aspect, an embodiment of the present application provides a picture generating device, which is applied to an electronic device, and the device includes: an image information acquisition module, which is used to acquire image information, extract texture information of the image information, and extract color information of the image information; a to-be-processed picture acquisition module, which is used to acquire a picture corresponding to the texture information as a to-be-processed picture based on a preset mapping relationship; and a target picture generation module, which is used to process the to-be-processed picture based on the color information to generate a target picture.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] The picture generation method, device, electronic device, and storage medium provided in the embodiments of the present application obtain image information, extract texture information and color information of the image information, obtain the picture corresponding to the texture information as the picture to be processed based on the preset mapping relationship, process the picture to be processed based on the color information, and generate the target picture. The present application obtains the picture to be processed through the texture information of the image information, and processes the picture to be processed through the color information of the image information to generate the target picture, so that the generated target picture is more consistent with the characteristics of the image information, meets the personalized needs of the user, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 A schematic diagram showing a flow chart of a method for generating an image provided by an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram showing a flow chart of a method for generating an image provided by another embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram showing a flow chart of a method for generating an image provided by another embodiment of the present application is shown;
[0013] Figure 4 A schematic diagram of an interface of an electronic device provided in an embodiment of the present application is shown;
[0014] Figure 5 This application shows Figure 3 The flowchart of step S303 of the picture generating method shown is as follows;
[0015] Figure 6 Another interface schematic diagram of an electronic device provided in an embodiment of the present application is shown;
[0016] Figure 7 This application shows Figure 3 The flowchart of step S307 of the picture generation method shown in FIG.
[0017] Figure 8 Another interface schematic diagram of an electronic device provided in an embodiment of the present application is shown;
[0018] Fig. 9 A schematic diagram showing a flow chart of a method for generating an image provided by another embodiment of the present application is shown;
[0019] Fig.10 A timing diagram of a picture generation method provided by yet another embodiment of the present application is shown;
[0020] Fig.11 A module block diagram of a picture generating device provided in an embodiment of the present application is shown;
[0021] Fig.12 A block diagram of an electronic device according to an embodiment of the present application for executing the picture generation method according to an embodiment of the present application is shown;
[0022] Fig.13 A storage unit for storing or carrying program codes for implementing the image generation method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0024] Among them, with the development of electronic device technology, more and more electronic devices begin to support the replacement of display screens. For example, more and more electronic devices begin to support the replacement of desktops, wallpapers, themes, etc. However, the inventors found in their research that when an electronic device replaces a display screen, the display screens that can be replaced are pictures stored locally in the electronic device, etc. The number is small and the pictures are fixed, resulting in a poor user experience.
[0025] In view of the above problems, the inventors have discovered after long-term research and proposed the picture generation method, device, electronic device and storage medium provided in the embodiments of the present application, which obtains the image to be processed by the texture information of the image information, and processes the image to be processed by the color information of the image information to generate a target image for the device to replace, so that the generated target image is more consistent with the characteristics of the image information, meets the personalized needs of users, and improves the user experience. Among them, the specific picture generation method is described in detail in the subsequent embodiments.
[0026] See also Figure 1 , Figure 1 The flowchart of the image generation method provided by an embodiment of the present application is shown. The image generation method is used to obtain a to-be-processed image through the texture information of the image information, and to process the to-be-processed image through the color information of the image information to generate a target image, so that the generated target image is more consistent with the characteristics of the image information, meets the personalized needs of the user, and improves the user experience. In a specific embodiment, the image generation method is applied to Fig.11 The picture generating device 200 and the electronic device 100 equipped with the picture generating device 200 are shown in FIG. Fig.12 ). The following will take an electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic device used in this embodiment may include a desktop computer, a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here. Figure 1 The process shown is described in detail, and the image generation method may specifically include the following steps:
[0027] Step S101: acquiring image information, extracting texture information of the image information, and extracting color information of the image information.
[0028] In this embodiment, the electronic device can obtain image information. In some embodiments, the electronic device can obtain image information locally, for example, the electronic device can obtain image information from a local photo album, wherein the image information of the photo album can be obtained by shooting with a camera and saving it in the photo album, or can be obtained by downloading from the network and saving it in the photo album, which is not limited here. In some embodiments, the electronic device can obtain image information from a server, for example, the electronic device can download image information from a server via a data network or a wireless network, which is not limited here. In some embodiments, the electronic device can collect and obtain image information in real time, for example, the electronic device can collect and obtain image information via a camera, which is not limited here. Of course, in this embodiment, the electronic device can also obtain image information in other ways, which will not be repeated here.
[0029] In this embodiment, after acquiring the image information, the electronic device can extract the texture information of the image information. Among them, texture information generally refers to image texture, which is a visual feature that reflects the homogeneous phenomenon in the image, and it reflects the surface structure organization arrangement properties of the object surface with slow changes or periodic changes. Texture has three major characteristics: a certain local sequence is repeated continuously, non-random arrangement, and the texture area is roughly a uniform unity. In some embodiments, after acquiring the image information, the electronic device can extract the texture information of the image information through a statistical method, can extract the texture information of the image information through a geometric method, can extract the texture information of the image information through a model method, can extract the texture information of the image information through a signal processing method, and can also extract the texture information of the image information through a structural method, which is not limited here. As a way, after acquiring the image information, the electronic device can sequentially grayscale the image information, normalize it, and match the SVM model, and then output and obtain the texture information of the image information.
[0030] In this embodiment, after acquiring the image information, the electronic device can extract the color information of the image information, wherein the color information can include red, yellow, green, blue, white, black, etc., which is not limited here. In some embodiments, after acquiring the image information, the electronic device can extract the color information of the image information through a general histogram method, can extract the color information of the image information through a global cumulative histogram method, can extract the color information of the image information through a local cumulative histogram method, can extract the color information of the image information through a statistical feature method of color parameters, can extract the color information of the image information through a first-order matrix and a second-order matrix of the color, can also extract the color information of the image information through a block image based on a wavelet, etc., which is not limited here. As a way, after acquiring the image information, the electronic device can sequentially process the image information through an HSV model conversion process, a color optimization process of the H channel value, and the statistically optimized H channel values, and sort them to obtain the three colors with the most as the color information of the image information.
[0031] In some embodiments, after acquiring image information, the electronic device may first extract texture information of the image information and then extract color information of the image information; may first extract color information of the image information and then extract texture information of the image information; or may simultaneously extract color information and texture information of the image information, which is not limited here.
[0032] Step S102: Based on a preset mapping relationship, a picture corresponding to the texture information is obtained as a picture to be processed.
[0033] In some embodiments, the electronic device may pre-set and store a mapping relationship table as a preset mapping relationship, wherein the preset mapping relationship may include a correspondence between multiple texture information and multiple pictures, and in the preset mapping relationship, multiple texture information and multiple pictures may correspond one-to-one, multiple texture information may correspond to one picture, one texture information may correspond to multiple pictures, etc., which is not limited here.
[0034] For example, as shown in Table 1, the texture information of the image information may include first texture information, second texture information, third texture information and fourth texture information, the multiple pictures may include a first picture, a second picture, a third picture and a fourth picture, and the first texture information corresponds to the first picture, the second texture information corresponds to the second picture, the third texture information corresponds to the third picture, and the fourth texture information corresponds to the fourth picture.
[0035] Table 1
[0036] Texture Information picture First texture information First Picture Second texture information Second picture Third texture information The third picture Fourth texture information Fourth picture
[0037] In some embodiments, after acquiring the texture information of the image information, a picture corresponding to the texture information of the image information can be acquired as a picture to be processed according to a preset mapping relationship. Specifically, after acquiring the texture information of the image information, the texture information of the image information can be compared with multiple texture information in the preset mapping relationship to determine the texture information that matches the texture information of the image information from the multiple texture information in the preset mapping relationship, and then the picture corresponding to the texture information that matches the texture information of the image information in the preset mapping relationship is acquired, and the acquired picture corresponding to the texture information that matches the texture information of the image information is used as the picture to be processed, so that the picture corresponding to the texture information of the image information can be acquired as the picture to be processed. For example, after comparing the texture information of the image information with multiple texture information in the preset mapping relationship, when it is determined that the texture information of the image information matches the first texture information among the multiple texture information, the first picture corresponding to the first texture information in the preset mapping relationship can be acquired, and the first picture is determined as the picture to be processed.
[0038] Step S103: Process the image to be processed based on the color information to generate a target image.
[0039] In this embodiment, after obtaining the image to be processed, the electronic device can process the image to be processed based on the color information extracted from the image information to generate a target image. In some embodiments, the background color of the image to be processed can be replaced with the color information extracted from the image information to generate a target image. For example, if the background color of the image to be processed is yellow and the color information extracted from the image information is blue, the yellow background of the image to be processed can be replaced with a blue background to generate a target image. In some embodiments, the color information extracted from the image information can be added to the foreground image of the image to be processed, and the background color of the image to be processed can be kept unchanged. For example, if the background color of the image to be processed is yellow, the foreground image is a puppy, and the color information extracted from the image information is blue, blue can be added to the puppy of the image to be processed, and the yellow background can be kept unchanged to generate a target image. Of course, in this embodiment, other more ways of processing the image to be processed based on color information can also be included, which will not be repeated here.
[0040] An image generation method provided by an embodiment of the present application obtains image information, extracts texture information and color information of the image information, obtains an image corresponding to the texture information as an image to be processed based on a preset mapping relationship, processes the image to be processed based on the color information, and generates a target image. The present application obtains the image to be processed through the texture information of the image information, and processes the image to be processed through the color information of the image information to generate a target image, so that the generated target image is more consistent with the characteristics of the image information, meets the personalized needs of users, and improves user experience.
[0041] See also Figure 2 , Figure 2 A schematic diagram of a process flow of a method for generating an image according to another embodiment of the present application is shown. The method is applied to the above electronic device. Figure 2 The process shown is described in detail, and the image generation method may specifically include the following steps:
[0042] Step S201: Acquire image information, extract texture information of the image information, and extract color information of the image information.
[0043] For the detailed description of step S201, please refer to step S101, which will not be repeated here.
[0044] Step S202: input the texture information into a trained classification model, and obtain the type of the texture information output by the trained classification model.
[0045] In some embodiments, after extracting the texture information of the image information, the electronic device can input the texture information of the image information into a trained classification model, wherein the trained classification model is obtained through machine learning, specifically, firstly, a training data set is collected, wherein the attributes or features of one type of data in the training data set are different from those of another type of data, and then the neural network is trained and modeled according to a preset algorithm using the collected training data set, thereby summarizing the rules based on the training data set and obtaining a trained classification model. In this embodiment, one type of data in the training data set may include, for example, the texture information of the image information, and another type of data may include, for example, the type of texture information. The types of texture information may include: solid color, grid, complex, etc., which are not limited here.
[0046] In some embodiments, the trained classification model can be pre-trained and stored locally in the electronic device. Based on this, after the electronic device obtains the texture information of the image information, it can directly call the trained classification model locally. For example, it can directly send an instruction to the trained classification model to instruct the trained classification model to read the texture information in the target storage area, or the electronic device can directly input the texture information into the trained classification model stored locally, thereby effectively avoiding the influence of network factors that reduce the speed of inputting texture information into the trained classification model, so as to increase the speed of the trained classification model to obtain texture information and improve the user experience.
[0047] In some embodiments, the trained classification model can also be pre-trained and stored in a server that is in communication with the electronic device. Based on this, after the electronic device obtains the texture information of the image information, it can send instructions to the trained classification model stored in the server through the network to instruct the trained classification model to read the texture information through the network, or the electronic device can send the texture information to the trained classification model stored in the server through the network, thereby reducing the storage space occupied by the electronic device and reducing the impact on the normal operation of the electronic device by storing the trained classification model in the server.
[0048] In some embodiments, the embodiments of the present application also include a training method for the classification model, wherein the training of the classification model can be performed in advance based on an acquired training data set, and subsequently each time the type of texture information is acquired, it can be acquired based on the classification model without the need to train the classification model each time the type of texture information is acquired.
[0049] In an embodiment of the present application, a machine learning algorithm can be used for training the training data set of the electronic device to obtain a classification model. Among them, the machine learning algorithm used may include: neural network, long short-term memory (Long Short-Term Memory, LSTM) network, threshold cycle unit, simple cycle unit, autoencoder, decision tree, random forest, feature mean classification, classification regression tree, hidden Markov, K-nearest neighbor (k-NearestNeighbor, KNN) algorithm, logistic regression model, Bayesian model, Gaussian model and KL divergence (Kullback–Leibler divergence), etc. The specific machine learning algorithm may not be limited.
[0050] The following takes a neural network as an example to illustrate how to train an initial model based on a training data set.
[0051] The texture information of the image information in a set of data in the training data set is used as the input sample (input data) of the neural network, and the type of texture information annotated in a set of data is used as the output sample (output data) of the neural network. The neurons in the input layer are fully connected to the neurons in the hidden layer, and the neurons in the hidden layer are fully connected to the neurons in the output layer, so that potential features of different granularities can be effectively extracted. And the number of hidden layers can be multiple, so that nonlinear relationships can be better fitted, making the preset model obtained by training more accurate.
[0052] It is understandable that the training process of the classification model may be completed by the electronic device or not. When the training process is not completed by the electronic device, the electronic device may only be a direct user or an indirect user.
[0053] In some implementations, the classification model may periodically or irregularly acquire new training data to train and update the classification model.
[0054] Step S203: Based on a preset mapping relationship, a picture corresponding to the type of the texture information is obtained as a picture to be processed.
[0055] In some embodiments, the electronic device may pre-set and store a mapping relationship table as a preset mapping relationship, wherein the preset mapping relationship may include a correspondence between multiple types of texture information and multiple images, and in the preset mapping relationship, multiple types of texture information and multiple images may correspond one-to-one, multiple types of texture information may correspond to one image, one type of texture information may correspond to multiple images, etc., which are not limited here.
[0056] For example, as shown in Table 2, multiple types may include a first type, a second type, a third type and a fourth type, multiple pictures may include a first picture, a second picture, a third picture and a fourth picture, and the first type corresponds to the first picture, the second type corresponds to the second picture, the third type corresponds to the third picture, and the fourth type corresponds to the fourth picture.
[0057] Table 2
[0058] type picture Type I First Picture Type II Second picture The third type The third picture Type 4 Fourth picture
[0059] In some embodiments, after obtaining the type of texture information, a picture corresponding to the type of texture information can be obtained as a picture to be processed according to a preset mapping relationship. Specifically, after obtaining the type of texture information, the type of texture information can be compared with multiple types in the preset mapping relationship to determine a type that matches the type of texture information from multiple types in the preset mapping relationship, and then a picture corresponding to the type that matches the type of texture information in the preset mapping relationship is obtained, and the obtained picture corresponding to the type that matches the type of texture information is used as a picture to be processed, so that the picture corresponding to the texture information can be obtained as a picture to be processed. For example, after comparing the type of texture information with multiple types in the preset mapping relationship, when it is determined that the type of texture information matches a first type among multiple types, a first picture corresponding to the first type in the preset mapping relationship can be obtained, and the first picture can be determined as a picture to be processed.
[0060] Step S204: Process the image to be processed based on the color information to generate a target image.
[0061] The specific description of step S204 can be found in step S103 and will not be repeated here.
[0062] Step S205: acquiring a target display screen based on the target image, and displaying the target display screen on the device to be replaced.
[0063] In this embodiment, after acquiring the target picture, the electronic device can acquire the target display screen based on the target picture. In some embodiments, the target display screen acquired based on the target picture can use the target picture as an element or material, or can be a target picture. Wherein, when the target display screen acquired based on the target picture uses the target picture as an element or material, the target display screen may include multiple elements, and the target picture is a part of the multiple elements. For example, the target display screen may include grassland, cattle, and sheep, and the target picture is a cattle. At this time, the target picture is a part of the elements in the target display screen. Wherein, when the target display screen is a target picture, all the pictures contained in the target display screen are the same as all the pictures contained in the target picture. For example, the target display screen includes cattle, and the target picture is a cattle. At this time, the target display screen is the target picture.
[0064] In this embodiment, after acquiring the target display screen, the electronic device can display the target display screen on the device to be replaced. The device to be replaced can be the electronic device itself, or other electronic devices, which is not limited here.
[0065] In some embodiments, when the device to be replaced is the electronic device itself, the display screen of the electronic device can be directly replaced with the target display screen. For example, if the display screen of the electronic device is the sea and the target display screen is grassland, the display screen of the electronic device can be replaced from the sea to grassland to change the display screen of the electronic device.
[0066] In some embodiments, when the device to be replaced is another electronic device, the electronic device can send the target display screen to the device to be replaced through short-range communication technology to instruct the device to be replaced to display the target display screen. As a method, the electronic device can send the target display screen to the device to be replaced through Bluetooth technology, ZigBee technology, etc. to instruct the device to be replaced to display the target display screen. For example, if the display screen of the other electronic device is the sea and the target display screen is the grassland, the electronic device can send the grassland to the other electronic device to instruct the other electronic device to replace the display screen from the sea to the grassland, so as to change the display screen of the other electronic device.
[0067] In some embodiments, when the device to be replaced is another electronic device, the other electronic device may pre-store multiple pictures to be processed, and the electronic device may send the color parameters RGB of the target display screen to the device to be replaced through short-range communication technology to instruct the device to be replaced to process the picture to be processed based on the received color parameters RGB to obtain the target picture and generate and display the target display screen based on the target picture.
[0068] Another embodiment of the present application provides a method for generating an image, which obtains image information, extracts texture information and color information of the image information, inputs the texture information into a trained classification model, obtains the type of texture information output by the trained classification model, obtains an image corresponding to the type of texture information as an image to be processed based on a preset mapping relationship, processes the image to be processed based on the color information, generates a target image, obtains a target display screen based on the target image, and displays the target display screen on the device to be replaced. Figure 1 The picture generation method shown in the embodiment also obtains the target display screen through the texture information and color information of the image information, so as to display it on the device to be replaced, thereby improving the diversity of the display screen.
[0069] See also Figure 3 , Figure 3 A schematic diagram of a process flow of a method for generating an image provided by another embodiment of the present application is shown. The method is applied to the above electronic device. Figure 3 The process shown is described in detail, and the image generation method may specifically include the following steps:
[0070] Step S301: Acquire image information and display the image information.
[0071] See also Figure 4 , Figure 4 FIG. 1 shows a schematic diagram of an interface of an electronic device provided in an embodiment of the present application. Figure 4 As shown, after acquiring the image information, the electronic device can display the image information, wherein: Figure 4 A in the figure represents displayed image information. The electronic device may display the image information in full screen or in part screen, which is not limited here.
[0072] Step S302: receiving a selection operation acting on the image information.
[0073] In some embodiments, the electronic device may detect a selection operation on the image information during the process of displaying the image information, and when the selection operation on the image information is detected, the selection operation on the image information may be received. In this embodiment, the selection operation on the image information may be triggered by the user's finger, by a stylus, by an external device, etc., which is not limited here. Among them, when the selection operation on the image information is triggered by the user's finger, the selection operation on the image information may include a single-finger click operation, a multi-finger click operation, a single-finger press operation, a multi-finger press operation, a single-finger slide operation, a multi-finger slide operation, etc., which is not limited here.
[0074] Step S303: determining a target image area in the image information based on the selection operation.
[0075] In some embodiments, after receiving a selection operation on the image information, the electronic device may determine a target image area in the image information based on the selection operation, wherein the target image area may be smaller than or equal to the area corresponding to the image information, thereby achieving the purpose of the user selecting a favorite area from the acquired image information.
[0076] See also Figure 5 , Figure 5 This application shows Figure 3 The flowchart of step S303 of the picture generation method shown in FIG. Figure 5 The process shown is described in detail, and the method may specifically include the following steps:
[0077] Step S3031: Generate and display a selection control in the image information.
[0078] See also Figure 6 , Figure 6 FIG. 2 shows another interface schematic diagram of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device may also generate and display a selection control in the image information when starting to display the image information or in the process of displaying the image information, wherein: Figure 6 The B in the figure represents a selection control. The shape of the selection control can be square, rectangular, circular, triangular, etc. The size of the selection control can be large or small. The shape and size of the selection control can be changed as needed during use and are not limited here.
[0079] Step S3032: In response to the dragging operation on the selection control, the area corresponding to the dragged selection control in the image information is used as the target image area.
[0080] In this embodiment, the electronic device can detect a drag operation on the selection control during the process of displaying image information and displaying a selection control in the image information. When a drag operation on the selection control is detected, the electronic device can determine the area in the image information corresponding to the dragged selection control as the target image area in response to the drag operation.
[0081] In some embodiments, when the electronic device generates and displays a selection control in the image information, the selection control may be displayed by default at a preset position in the image information and a preset size of area may be selected. When the default display position of the selection control and the selected area meet the user's requirements, the user may not drag the selection control and use the default selected area of the selection control as the target image area. When the default display position of the selection control and the selected area do not meet the user's requirements, the user may drag the selection control and use the area corresponding to the dragged selection control in the image information as the target image area.
[0082] In some embodiments, when the electronic device generates and displays a selection control in the image information, the image information may be identified, and the display position of the selection control and the selection object of the selection control may be controlled according to the identification result. For example, the image information may be identified to obtain a foreground image in the image information, and the selection control may be controlled to select the foreground image. When the selection object of the selection control meets the user's requirements, the user may not drag the selection control, and use the area corresponding to the selection object of the selection control as the target image area. When the selection object of the selection control does not meet the user's requirements, the user may drag the selection control, and use the area corresponding to the dragged selection control in the image information as the target image area.
[0083] Step S304: extracting texture information of the target image area, and extracting color information of the target image area.
[0084] In some embodiments, the electronic device may obtain the number of types of color information in the image information, and when the number of types of color information is greater than a specified number of types, extract the specified number of types of color information from the image information in descending order of color information.
[0085] Specifically, the electronic device can identify the types of color information in the image information and obtain the number of types in the color information. For example, when the color information in the image information is identified to include red, yellow, green, and blue, the number of types of color information can be determined to be 4. When the color information in the image information is identified to include red, yellow, and green, the number of types of color information can be determined to be 3, etc., which is not limited here. Among them, the electronic device can pre-set and store a specified number of types, and the specified number of types is used as a basis for judging the number of types of color information extracted from the image information. Therefore, in this embodiment, after obtaining the number of types of color information in the image information, the number of types of color information can be compared with the specified number of types to determine whether the number of types of color information is greater than the specified number of types. When the judgment result indicates that the number of types of color information is greater than the specified number of types, it can be considered that there are too many types of colors, and the specified number of types of color information can be extracted from the image information in the order of color information from more to less. When the judgment result indicates that the number of types of color information is not greater than the specified number of types, it can be considered that the color types are appropriate, and the color information can be directly extracted. In some embodiments, the specified number of types can be 3.
[0086] In some embodiments, when the number of types of color information is greater than the specified number of types, the number of pixel points of each color information of the image information can be obtained, and the specified number of color information can be extracted from the image information in order from most to least. For example, when the specified number of types is 3, 3 types of color information can be extracted from the image information in order from most to least.
[0087] In some embodiments, when the number of types of color information is not greater than the specified number of types, the size of the area occupied by each color in the image information can be obtained, and the specified number of color information can be extracted from the image information in order from large to small according to the size of the occupied area. For example, when the specified number of types is 3, 3 types of color information can be extracted from the image information in order from large to small according to the size of the occupied area.
[0088] Step S305: input the texture information into a trained classification model, and obtain the type of the texture information output by the trained classification model.
[0089] Step S306: Based on a preset mapping relationship, a picture corresponding to the type of the texture information is obtained as a picture to be processed.
[0090] For the detailed description of step S305-step S306, please refer to step S202-step S203, which will not be repeated here.
[0091] Step S307: Process the color information based on a color optimization algorithm to obtain target color information.
[0092] In this embodiment, after acquiring the color information of the image information, the electronic device may process the color information based on a color optimization algorithm to obtain target color information, thereby obtaining color information that is better looking than the color information of the image information to improve the display effect.
[0093] In some embodiments, after acquiring the color information of the image information, the electronic device may search a preset color optimization table for a color optimization method corresponding to the color information of the image information, and process the color information based on the color optimization method to obtain the target color information.
[0094] Specifically, the electronic device may pre-set and store a preset color optimization table, which may include a correspondence between multiple color information and multiple color optimization methods, wherein the color information in the preset color optimization table may be a pure color or a combination of multiple colors, and, in the preset color optimization table, multiple color information and multiple color optimization methods may correspond one to one, multiple color information may correspond to one color optimization method, one color information may correspond to multiple color optimization methods, etc., which are not limited here.
[0095] For example, as shown in Table 3, multiple color information may include first color information, second color information, third color information and fourth color information, multiple color optimization methods may include a first color optimization method, a second color optimization method, a third color optimization method and a fourth color optimization method, and the first color information corresponds to the first color optimization method, the second color information corresponds to the second color optimization method, the third color information corresponds to the third color optimization method, and the fourth color information corresponds to the fourth color optimization method.
[0096] Table 3
[0097] Color Information Color Optimization First color information First color optimization method Second color information Second color optimization method Third color information The third color optimization method Fourth color information Fourth color optimization method
[0098] In some embodiments, after obtaining the color information of the image information, the color information of the image information can be compared with multiple color information in a preset color optimization table to determine the color information that matches the color information of the image information from the multiple color information in the preset color optimization table, and then obtain the color optimization method corresponding to the color information that matches the color information of the image information in the preset color optimization table, and determine the color optimization method corresponding to the obtained color information that matches the color information of the image information as the color optimization method corresponding to the color information of the image information. For example, after comparing the color information of the image information with multiple color information in the preset color optimization table, if it is determined that the color information of the image information matches the first color information among the multiple color information, a first color optimization method corresponding to the first color information can be obtained, and the first color optimization method can be determined as the color optimization method corresponding to the color information of the image information.
[0099] In some embodiments, the preset color optimization table may further include a correspondence between multiple color information and multiple optimized color information, wherein, in the preset color optimization table, multiple color information and multiple optimized color information may correspond one to one, multiple color information may correspond to one optimized color information, one color information may correspond to multiple optimized color information, etc., which is not limited here.
[0100] For example, as shown in Table 4, multiple color information may include first color information, second color information, third color information and fourth color information, multiple optimized color information may include fifth color information, sixth color information, seventh color information and eighth color information, and the first color information corresponds to the fifth color information, the second color information corresponds to the sixth color information, the third color information corresponds to the seventh color information, and the fourth color information corresponds to the eighth color information.
[0101] Table 4
[0102] Color Information Optimized color information First color information Fifth color information Second color information Sixth color information Third color information Seventh color information Fourth color information Eighth color information
[0103] In some embodiments, after obtaining the color information of the image information, the color information of the image information can be compared with multiple color information in a preset color optimization table to determine the color information that matches the color information of the image information from the multiple color information in the preset color optimization table, and then obtain the optimized color information corresponding to the color information that matches the color information of the image information in the preset color optimization table, and determine the optimized color information corresponding to the obtained color information that matches the color information of the image information as the optimized color information corresponding to the color information of the image information. For example, after comparing the color information of the image information with multiple color information in the preset color optimization table, if it is determined that the color information of the image information matches the first color information among the multiple color information, the fifth color information corresponding to the first color information can be obtained, and the fifth color information can be determined as the optimized color information corresponding to the color information of the image information.
[0104] See also Figure 7 , Figure 7 This application shows Figure 3 The following is a flow chart of step S307 of the picture generation method. Figure 7 The process shown is described in detail, and the method may specifically include the following steps:
[0105] Step S3071: Obtain the brightness corresponding to the color information.
[0106] In this embodiment, after obtaining the color information of the image information, the electronic device can obtain the brightness corresponding to the color information. In some embodiments, the mean and variance of the image information on the grayscale image can be calculated to obtain the brightness of the color information of the image information, the image information can be controlled to be converted from RGB to HSL or HSV to obtain the brightness of the color information of the image information, the image information can be converted into a grayscale image, and cvAvg is used to calculate the pixel average value as the brightness of the color information of the image information, etc., which are not limited here. Of course, in this embodiment, there can also be other ways to obtain the brightness of the color information of the image information, which will not be repeated here.
[0107] Step S3072: When the brightness is less than the preset brightness, the color information is processed based on the color optimization algorithm to obtain target color information, wherein the corresponding brightness of the target color information is greater than the preset brightness.
[0108] In some embodiments, the electronic device may be pre-set and stored with a preset brightness, which is used as a basis for judging the brightness corresponding to the color information. Therefore, in this embodiment, after obtaining the brightness corresponding to the color information, the brightness corresponding to the color information may be compared with the preset brightness to determine whether the brightness corresponding to the color information is less than the preset brightness, wherein, when the judgment result indicates that the brightness corresponding to the color information is less than the preset brightness, it indicates that the color information is relatively dim and unpleasant, and the color information may be processed based on a color optimization algorithm to obtain target color information with a brightness greater than the preset brightness, thereby obtaining a more pleasing color. wherein, when the judgment result indicates that the brightness corresponding to the color information is not less than the preset brightness, it indicates that the color information is relatively bright and pleasing, and the color information may not be processed.
[0109] Step S308: Process the image to be processed based on the target color information to generate a target image.
[0110] The specific description of step S208 can be found in step S103 and will not be repeated here.
[0111] Step S309: Display multiple target pictures.
[0112] See also Figure 8 , Figure 8 FIG. 2 shows another interface schematic diagram of an electronic device provided in an embodiment of the present application. Figure 8 As shown, when the number of generated target images is multiple, multiple target images can be displayed for the user to select. Figure 7 The C in represents the target image. Figure 8 The number of target images C shown is 5, and the display order, display layout, etc. of the multiple target images are not limited here.
[0113] Step S310: Obtain a selection operation applied to the plurality of target images, and select a target image from the plurality of target images based on the selection operation.
[0114] In some embodiments, the electronic device can detect a selection operation acting on multiple target images during the process of displaying multiple target images. When a selection operation acting on one of the multiple target images is detected, the selection operation acting on the one target image can be obtained, and a target image can be selected and determined from the multiple target images based on the selection operation. In this embodiment, the selection operation acting on multiple target images can be triggered by the user's finger, by a stylus, by an external device, etc., which is not limited here. Among them, when the selection operation acting on multiple target images is triggered by the user's finger, the selection operation acting on multiple target images can include a single-finger click operation, a multi-finger click operation, a single-finger press operation, a multi-finger press operation, a single-finger slide operation, a multi-finger slide operation, etc., which is not limited here.
[0115] Step S311: based on the one target image, a target display screen corresponding to the one target image is obtained, and the target display screen is displayed on the device to be replaced.
[0116] For the detailed description of step S311, please refer to step S205, which will not be repeated here.
[0117] Another embodiment of the present application provides an image generation method, which obtains and displays image information, receives a selection operation acting on the image information, determines a target image area in the image information based on the selection operation, extracts texture information and color information of the target image area, inputs the texture information into a trained classification model, obtains the type of texture information output by the trained classification model, obtains an image corresponding to the type of texture information as a to-be-processed image based on a preset mapping relationship, processes the color information based on a color optimization algorithm to obtain target color information, processes the to-be-processed image based on the target color information, generates a target image, displays multiple target images, obtains a selection operation acting on multiple target images, selects a target image from multiple target images based on the selection operation, obtains a target display screen corresponding to a target image based on the target image, and displays the target display screen on the device to be replaced. Compared to Figure 1 The image generation method shown in this embodiment also determines the target image area based on a selection operation acting on image information, and selects a target image based on a selection operation acting on multiple target images to generate a target display screen, so as to enhance the interaction with the user and improve the user experience.
[0118] See also Fig. 9 , Fig. 9 A schematic diagram of a process flow of a method for generating an image provided by another embodiment of the present application is shown. The method is applied to the above electronic device. Fig. 9The process shown is described in detail, and the image generation method may specifically include the following steps:
[0119] Step S401: Acquire image information, extract texture information of the image information, and extract color information of the image information.
[0120] Step S402: input the texture information into a trained classification model, and obtain the type of the texture information output by the trained classification model.
[0121] Step S403: Based on a preset mapping relationship, a picture corresponding to the type of the texture information is obtained as a picture to be processed.
[0122] For the detailed description of steps S401 to S403, please refer to steps S201 to S203, which will not be repeated here.
[0123] Step S404: setting the path channel of the image to be processed to the color information to generate the target image.
[0124] In some implementations, the image to be processed is an SVG image. After acquiring the image to be processed, the electronic device may set the path channel of the image to be processed to the color information extracted from the image information to generate a target image having texture information and color information similar to the acquired image information.
[0125] In this embodiment, the SVG image may include a primary channel, a secondary channel, and a third channel. In some implementations, the color information may include a primary color (pure color), and may also include a primary color, a secondary color, and a third color. Wherein, when the color information is a pure color, the primary color may be filled in the primary channel of the SVG image, and the secondary channel and the third channel of the SVG image may be filled with the second color after the primary color is converted. As a method, the second color may be obtained by searching the above-mentioned preset color optimization table, which will not be described in detail here. Wherein, when the color information is not a pure color, the primary color may be filled in the primary channel of the SVG image. If the SVG image includes a secondary channel and the color information includes a second color, the second color may be filled in the secondary channel of the SVG image. If the SVG image does not include a secondary channel and / or the color information does not include a second color, the second color is not filled. Similarly, if the SVG image includes a third channel and the color information includes a third color, the third channel of the SVG image may be filled with the third color. If the SVG image does not include a third channel and / or the color information does not include a third color, the third color is not filled.
[0126] Step S405: acquiring a target display screen based on the target image, and sending the target display screen to the wearable device to instruct the wearable device to display the target display screen.
[0127] In some embodiments, the device to be replaced is a wearable device. The electronic device can send the target display screen to the wearable device through short-distance communication technology to instruct the wearable device to display the target display screen. The electronic device can also send the color parameter RGB of the target display screen to the wearable device through short-distance communication technology to instruct the wearable device to process the image to be processed based on the received color parameter RGB to obtain the target image and generate and display the target display screen based on the target image.
[0128] In some embodiments, the wearable device may include a smart watch. After acquiring the target image, the electronic device may acquire the target display screen based on the target image, and send the target display screen to the smart watch to instruct the smart watch to replace the dial with the target display screen. The electronic device may also send the color parameter RGB of the target display screen to the smart watch to instruct the smart watch to process the image to be processed based on the received color parameter RGB to obtain the target image and generate and display the target display screen based on the target image. In some embodiments, when displaying the target display screen, the smart watch may also synthesize information such as the hands, time, and power, which is not limited here.
[0129] Another embodiment of the present application provides a method for generating an image, which obtains image information, extracts texture information and color information of the image information, inputs the texture information into a trained classification model, obtains the type of texture information output by the trained classification model, obtains an image corresponding to the type of texture information as an image to be processed based on a preset mapping relationship, sets the path channel of the image to be processed as color information, generates a target image, obtains a target display screen based on the target image, and sends the target display screen to a wearable device to instruct the wearable device to display the target display screen. Compared to Figure 1 The image generation method shown in the figure, this embodiment also realizes color setting by setting the path channel of the image to be processed to the acquired color information. In addition, this embodiment sends the target display screen to the wearable device for display to enhance the diversity of the display of the wearable device.
[0130] See also Fig.10 , Fig.10 FIG. 1 shows a timing diagram of a method for generating a picture provided by yet another embodiment of the present application. Fig.10 The process shown is described in detail, and the image generation method may specifically include the following steps:
[0131] Step S501: the electronic device acquires image information, extracts texture information of the image information, and extracts color information of the image information.
[0132] Step S502: The electronic device obtains a picture corresponding to the texture information as a picture to be processed based on a preset mapping relationship.
[0133] Step S503: the electronic device processes the image to be processed based on the color information to generate a target image.
[0134] Step S504: the electronic device obtains a target display screen based on the target image, and sends the target display screen to the device to be replaced.
[0135] Step S505: the device to be replaced receives the target display screen and displays the target display screen.
[0136] Yet another embodiment of the present application provides a method for generating an image, in which an electronic device obtains image information, extracts texture information and color information of the image information, obtains an image corresponding to the texture information as an image to be processed based on a preset mapping relationship, processes the image to be processed based on the color information, generates a target image, obtains a target display screen based on the target image, and sends the target display screen to the device to be replaced. The device to be replaced receives the target display screen and displays the target display screen, thereby obtaining the target display screen through the texture information and color information of the image information, so as to display it on the device to be replaced, thereby improving the diversity of the display screen.
[0137] See also Fig.11 , Fig.11 The module block diagram of the image generation device 200 provided in the embodiment of the present application is shown. The image generation device 200 is applied to the above electronic device. Fig.11 The block diagram shown in the figure is used to illustrate that the image generation device 200 includes: an image information acquisition module 210, a to-be-processed image acquisition module 220 and a target image generation module 230, wherein:
[0138] The image information acquisition module 210 is used to acquire image information, extract texture information of the image information, and extract color information of the image information.
[0139] Furthermore, the image information acquisition module 210 includes: an image information display submodule, a selection operation receiving submodule, a target image area determination submodule and an information extraction submodule, wherein:
[0140] The image information display submodule is used to display the image information.
[0141] The selection operation receiving submodule is used to receive the selection operation acting on the image information.
[0142] The target image region determination submodule is used to determine the target image region in the image information based on the selection operation.
[0143] Furthermore, the target image area determination submodule includes: a selection control display unit and a target image area determination unit, wherein:
[0144] A selection control display unit is used to generate and display a selection control in the image information.
[0145] The target image area determination unit is used to respond to the dragging operation on the selection control and use the area corresponding to the dragged selection control in the image information as the target image area.
[0146] The information extraction submodule is used to extract texture information of the target image area and extract color information of the target image area.
[0147] Furthermore, the image information acquisition module 210 includes: a type quantity acquisition submodule and a color information extraction submodule, wherein:
[0148] The type quantity acquisition submodule is used to acquire the number of types of color information in the image information.
[0149] The color information extraction submodule is used to extract the color information of the specified number of types from the image information in descending order of the color information when the number of types of the color information is greater than the specified number of types.
[0150] The to-be-processed picture acquisition module 220 is used to acquire a picture corresponding to the texture information as a to-be-processed picture based on a preset mapping relationship.
[0151] Furthermore, the to-be-processed picture acquisition module 220 includes: a texture information type acquisition submodule and a to-be-processed picture acquisition submodule, wherein:
[0152] The texture information type acquisition submodule is used to input the texture information into a trained classification model and obtain the type of the texture information output by the trained classification model.
[0153] The to-be-processed picture acquisition submodule is used to acquire a picture corresponding to the type of the texture information as the to-be-processed picture based on the preset mapping relationship.
[0154] The target image generation module 230 is used to process the image to be processed based on the color information to generate a target image.
[0155] Furthermore, the target image generation module 230 includes: a target color information acquisition submodule and a first target image generation submodule, wherein:
[0156] The target color information acquisition submodule is used to process the color information based on a color optimization algorithm to obtain target color information.
[0157] Furthermore, the target color information acquisition submodule includes: a color optimization method search unit and a first target color information acquisition unit, wherein:
[0158] The color optimization method search unit is used to search a color optimization method corresponding to the color information from a preset color optimization table.
[0159] The first target color information acquisition unit is used to process the color information based on the color optimization method to obtain target color information.
[0160] Furthermore, the target color acquisition submodule includes: a brightness acquisition unit and a second target color information acquisition unit, wherein:
[0161] The brightness acquisition unit is used to acquire the brightness corresponding to the color information.
[0162] The second target color information acquisition unit is used to process the color information based on the color optimization algorithm to obtain target color information when the brightness is less than the preset brightness, wherein the corresponding brightness of the target color information is greater than the preset brightness.
[0163] The first target image generation submodule is used to process the image to be processed based on the target color information to generate a target image.
[0164] Furthermore, the image to be processed is an SVG image, and the target image generation module includes: a second target image generation submodule, wherein:
[0165] The second target image generation submodule is used to set the path channel of the image to be processed to the color information to generate the target image.
[0166] Furthermore, the image generation device 200 further includes: a target display screen acquisition module, wherein:
[0167] The target display screen acquisition module is used to acquire a target display screen based on the target image, and display the target display screen on the device to be replaced.
[0168] Furthermore, the number of the target images is multiple, and the target display screen acquisition module includes: a target image display submodule, a target image selection submodule and a first screen replacement submodule, wherein:
[0169] The target image display submodule is used to display multiple target images.
[0170] The target image selection submodule is used to obtain a selection operation acting on the multiple target images, and select a target image from the multiple target images based on the selection operation.
[0171] The first screen replacement submodule is used to obtain a target display screen corresponding to the one target picture based on the one target picture, and display the target display screen on the device to be replaced.
[0172] Furthermore, the target display screen acquisition module includes: a target display screen acquisition submodule, wherein:
[0173] The target display screen acquisition submodule is used to acquire a target display screen based on the target image, and send the target display screen to the wearable device to instruct the wearable device to display the target display screen.
[0174] Furthermore, the wearable device includes a smart watch, and the target display screen acquisition submodule includes: a target display screen acquisition unit, wherein:
[0175] The target display screen acquisition unit is used to acquire a target display screen based on the target image, and send the target display screen to the smart watch to instruct the smart watch to use the target display screen as a dial background and display it.
[0176] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0177] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0178] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0179] See also Fig.12, which shows a structural block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0180] Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0181] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0182] See also Fig.13 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0183] The computer readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.
[0184] In summary, the picture generation method, device, electronic device, and storage medium provided in the embodiments of the present application obtain image information, extract texture information and color information of the image information, obtain the picture corresponding to the texture information as the picture to be processed based on the preset mapping relationship, and process the picture to be processed based on the color information to generate a target picture. The present application obtains the picture to be processed through the texture information of the image information, and processes the picture to be processed through the color information of the image information to generate a target picture, so that the generated target picture is more consistent with the characteristics of the image information, meets the personalized needs of users, and improves the user experience.
[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating an image, characterized in that: Applied to electronic equipment, the method comprises: Acquire and display image information; receiving a selection operation acting on the image information; Determining a target image area in the image information based on the selection operation; Extracting texture information of the target image area, and extracting color information of the target image area; Based on a preset mapping relationship, obtaining a picture corresponding to the texture information as a picture to be processed; Processing the image to be processed based on the color information to generate a target image; A target display screen is acquired based on the target image, and the target display screen is sent to a smart watch to instruct the smart watch to display the target display screen as a dial background.
2. The method according to claim 1, characterized in that The obtaining, based on the preset mapping relationship, a picture corresponding to the texture information as a picture to be processed includes: Inputting the texture information into a trained classification model to obtain the type of the texture information output by the trained classification model; Based on the preset mapping relationship, a picture corresponding to the type of the texture information is obtained as the picture to be processed.
3. The method according to claim 1, characterized in that The processing of the to-be-processed picture based on the color information to generate a target picture includes: Processing the color information based on a color optimization algorithm to obtain target color information; The image to be processed is processed based on the target color information to generate a target image.
4. The method according to claim 3, characterized in that The step of processing the color information based on a color optimization algorithm to obtain target color information includes: Searching for a color optimization method corresponding to the color information from a preset color optimization table; The color information is processed based on the color optimization method to obtain target color information.
5. The method according to claim 3, characterized in that: The step of processing the color information based on a color optimization algorithm to obtain target color information includes: Obtaining the brightness corresponding to the color information; When the brightness is less than the preset brightness, the color information is processed based on the color optimization algorithm to obtain target color information, wherein the corresponding brightness of the target color information is greater than the preset brightness.
6. The method according to claim 1, characterized in that The receiving a selection operation acting on the image information, and determining a target image area in the image information based on the selection operation, comprises: Generating and displaying a selection control in the image information; In response to a drag operation on the selection control, an area corresponding to the dragged selection control in the image information is used as the target image area.
7. The method according to claim 1, characterized in that The number of the target pictures is multiple, and the step of acquiring a target display screen based on the target pictures includes: Display multiple target images; Acquire a selection operation acting on the multiple target images, and select a target image from the multiple target images based on the selection operation; A target display screen corresponding to the one target picture is acquired based on the one target picture.
8. The method according to claim 1, characterized in that The step of extracting color information of the image information comprises: Obtaining the number of types of color information in the image information; When the number of types of the color information is greater than the designated number of types, the designated number of types of color information is extracted from the image information in descending order of the color information.
9. The method according to any one of claims 1 to 8, characterized in that: The image to be processed is an SVG image, and the processing of the image to be processed based on the color information to generate a target image includes: The path channel of the image to be processed is set to the color information to generate the target image.
10. A picture generating device, characterized in that: Applied to electronic equipment, the device comprises: An image information acquisition module is used to acquire and display image information; receive a selection operation acting on the image information; determine a target image area in the image information based on the selection operation; extract texture information of the target image area, and extract color information of the target image area; A module for obtaining an image to be processed, used to obtain an image corresponding to the texture information as an image to be processed based on a preset mapping relationship; A target image generation module, used to process the image to be processed based on the color information to generate a target image; The target display screen acquisition module is used to acquire the target display screen based on the target image, and send the target display screen to the smart watch to instruct the smart watch to display the target display screen as the dial background.
11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image-processing method and electronic device
CN105447846A
Multimodal style-transfer network for applying style features from multi-resolution style exemplars to input images
US20180357800A1