Image processing method, device and equipment, readable storage medium and program product
By acquiring and adjusting image control parameters, processing images, and combining adjustments and to-process images, the problem of insufficient expression of target images in the prior art is solved, and higher expression and effect satisfaction are achieved.
Patent Information
- Application Number
- CN202411287185.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-06
AI Technical Summary
The target images generated by the existing image processing methods are poor in expressiveness and cannot meet the effect requirements of different application requirements.
By acquiring the image control parameters of the to-process image, including color control parameters and special effect range parameters, adjusting the pixel information of the to-process image, combining the adjustment image and the to-process image, the target image is generated to present a specific effect.
It enhances the expressiveness of the target image, can generate target images with different effects according to application needs, and improves the viewing and user experience of the target image.
Smart Images

Figure CN119094670A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, in particular to the field of image processing technology, and specifically to an image processing method, apparatus, device, readable storage medium and program product. Background Art
[0002] Image processing methods refer to methods that use computers to analyze and process original images to obtain target images with special effects. Different image processing methods can make the target image contain different special effects (for example: relief effect, oil painting effect, grayscale effect, etc.).
[0003] At present, the image processing methods are relatively simple, and the generated target images have poor expressiveness and cannot meet application requirements well. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, apparatus, device, readable storage medium and program product, which can determine a target image presenting a target special effect based on special effect range parameters and color control parameters, thereby enhancing the expressiveness of the target image and better meeting application requirements.
[0005] On the one hand, an embodiment of the present application provides an image processing method, the image processing method comprising:
[0006] Acquire image control parameters of the image to be processed, wherein the image control parameters include color control parameters and special effect range parameters;
[0007] Adjusting pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein the pixel information of the pixel point presenting the target special effect in the adjusted image matches the color control parameter;
[0008] The adjusted image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
[0009] Accordingly, an embodiment of the present application provides an image processing device, the image processing device comprising:
[0010] An acquisition unit, used for acquiring image control parameters of the image to be processed, wherein the image control parameters include color control parameters and special effect range parameters;
[0011] an adjusting unit, configured to adjust pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein the pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter;
[0012] The processing unit is used to perform combined processing on the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
[0013] Accordingly, an embodiment of the present application provides a computer device, the computer device comprising:
[0014] a processor suitable for implementing a computer program;
[0015] A computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned image processing method.
[0016] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned image processing method.
[0017] Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above-mentioned image processing method.
[0018] In the present application, the image processing device can obtain the image control parameters of the image to be processed, and the image control parameters may include color control parameters and special effect range parameters; the image to be processed can be adjusted according to the color control parameters and special effect range parameters to obtain an adjusted image, and a target image presenting a target special effect can be determined according to the adjusted image. Through the image processing method provided by the embodiment of the present application, an adjusted image can be determined according to the color control parameters and special effect range parameters, and a target image can be determined according to the adjusted image, so that the target effect presented by the target image matches the color control parameters and special effect range parameters, so that the target image can better meet the application requirements; the adjusted image and the image to be processed can be combined to obtain a target image, thereby enhancing the expressiveness of the target image and improving the viewing effect of the target special effect presented by the target image. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 is a schematic diagram of the system architecture of an image processing system provided in an embodiment of the present application;
[0021] Figure 2 It is a flowchart of an image processing method provided in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a method for determining image control parameters provided in an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of an image to be processed provided in an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of adjusting an image provided by an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of a blurred image determination method provided in an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of a blurred image provided by an embodiment of the present application;
[0027] Figure 8 is a flowchart of another image processing method provided in an embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of a brightness compression image provided by an embodiment of the present application;
[0029] Fig.10 is a schematic diagram of a combined image provided in an embodiment of the present application;
[0030] Fig.11 is a schematic diagram of a rotationally blurred combined image provided by an embodiment of the present application;
[0031] Fig.12 is a schematic diagram of a noise combination image provided by an embodiment of the present application;
[0032] Fig.13 is a schematic diagram of a target image provided in an embodiment of the present application;
[0033] Fig.14 is a schematic diagram of an image processing method provided in an embodiment of the present application;
[0034] Fig.15 is a structural block diagram of an image processing device provided in an embodiment of the present application;
[0035] Fig.16 It is a structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] It should be noted that the descriptions of "first", "second", etc. involved in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0038] Image processing methods can process original images to obtain target images, which can present special effects (e.g., relief effects, grayscale effects, etc.). However, image processing methods are usually relatively simple, and the target images obtained by processing have poor expressiveness and cannot present different effects according to different application requirements.
[0039] Based on this, the embodiment of the present application provides an image processing method, which can obtain image control parameters of the image to be processed, and the image control parameters include color control parameters and special effect range parameters; according to the special effect range parameters and color control parameters, the pixel information of each pixel point in the image to be processed is adjusted to obtain an adjusted image, and the pixel information of the pixel points presenting the target special effect in the adjusted image matches the color control parameters; the adjusted image and the image to be processed are combined and processed to obtain a target image corresponding to the image to be processed, and the target image is used to present the target special effect. Through the method provided in the embodiment of the present application, a target image presenting the target special effect can be obtained, the expressiveness of the target image can be improved, and the application requirements can also be better met.
[0040] The architecture of the image processing system provided in the embodiments of the present application will be introduced below in conjunction with the accompanying drawings.
[0041] See also Figure 1 , which is a schematic diagram of the system architecture of an image processing system provided in an embodiment of the present application, the image processing system includes a terminal device 101, an image processing device 102 and a database 103, and the image processing device 102 can exchange data with the terminal device 101 and the database 103. Among them:
[0042] The terminal device 101 can interact with the business object, can send the image to be processed and the image control parameters to the image processing device 102, and can also receive the target image sent by the image processing device 102. The terminal device 101 can generate the image to be processed (for example: the terminal device 101 generates the image to be processed using the image generation component), and can also obtain the image to be processed (for example: receiving the image to be processed sent by other devices, or obtaining the image to be processed from the database corresponding to the terminal device). The terminal device 101 can be a handheld device with image display function and communication function (such as a smart phone, tablet computer), a computing device (such as a personal computer (Personal Computer, PC), a vehicle terminal, an intelligent voice interaction device, a wearable device or other intelligent device, etc., but is not limited to this.
[0043] The image processing device 102 can receive the image to be processed and the image control parameters sent by the terminal device 101, and process the image to be processed to obtain a target image presenting the target special effect. The image processing device 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0044] The database 103 is used to store relevant data of the image processing device 102, such as target images, image control parameters, etc. The database 103 can be a local database in the image processing device 102, or a cloud database associated with the image processing device 102 (i.e., a database deployed in the cloud). Specifically, it can be deployed based on any of private clouds, public clouds, hybrid clouds, edge clouds, etc., so that the cloud database focuses on different functions. For example, for a database deployed in a private cloud, the basic cloud hardware is the user's personal equipment, and it focuses more on serving a small number of users, while a database deployed in a public cloud is deployed based on a cloud platform provided by a third party, which allows the data stored in the database to be shared. The data of any user can be stored in the database, and any user can also use the data in the database.
[0045] The following will explain in detail Figure 1 The working principle of the image processing system shown:
[0046] The business object can interact with the terminal device 101, and the terminal device 101 can generate image processing request information, which can carry the image to be processed. The terminal device 101 can send the image processing request information to the image processing device 102, and the image processing device 102 responds to the image processing request information and sends image processing response information to the terminal device 101. The terminal device 101 displays the image processing interface according to the image processing response information, and the image processing interface can include a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control.
[0047] The terminal device 101 can determine the color control parameter and the special effect range parameter in response to the sliding operation of the slider control in the image processing interface by the business object, and the color control parameter can include a saturation parameter, a hue parameter, and a brightness parameter. The terminal device 101 can send the color control parameter and the special effect range parameter to the image processing device 102.
[0048] The image processing device 102 can obtain the image control parameters of the image to be processed, which may include color control parameters and special effect range parameters; adjust the pixel information of each pixel in the image to be processed according to the special effect range parameters and the color control parameters to obtain an adjusted image, and the pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameters; combine the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present the target special effect. The image processing device 102 can store the image to be processed, the image control parameters and the target image in the database 103, or send the target image to the terminal device 101, and the terminal device 101 can display the target image in the image processing interface. Through the image processing method provided in the embodiment of the present application, a target image presenting the target special effect can be obtained, the expressiveness of the target image can be improved, and the application requirements can be better met.
[0049] It is to be understood that the schematic diagram of the image processing system described in the embodiment of the present application is to more clearly illustrate the image processing method of the embodiment of the present application, and does not constitute a limitation on the image processing method provided in the embodiment of the present application. For example, the image processing method provided in the embodiment of the present application can be performed by the image processing device 102, and can also be performed by other devices that are different from the image processing device 102 and can communicate with the terminal device 101 and the database 103. It is known to those skilled in the art that Figure 1 The number of terminal devices 101, image processing devices 102, and databases 103 is merely illustrative. Any number of devices may be configured according to business implementation requirements. Moreover, with the evolution of system architecture and the emergence of new business scenarios, the image processing method provided in the embodiment of the present application is also applicable to similar technical problems.
[0050] It should be noted that the collection and processing of relevant data in this application (for example, images to be processed, image control parameters) should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0051] See also Figure 2 , Figure 2 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application. The image processing method can be implemented by the above-mentioned image processing device 102, or by other devices that can implement the image processing method. The following takes the image processing method implemented by the above-mentioned image processing device 102 as an example for explanation. The flow chart of the image processing method provided in an embodiment of the present application includes but is not limited to:
[0052] S201. Obtain image control parameters of an image to be processed, where the image control parameters include color control parameters and special effect range parameters.
[0053] In an embodiment of the present application, an image processing device may obtain image control parameters of an image to be processed, and the image control parameters may include color control parameters and special effect range parameters, and the image control parameters are used to determine a target image that presents a target special effect. The color control parameters in the image control parameters are used to indicate the color of the target special effect presented by the target image, and the special effect range parameters in the image control parameters are used to indicate the pixel points in the target image that present the target special effect. Different color control parameters and special effect range parameters can cause the target image to present different target special effects (for example, different special effect colors or different special effect presentation ranges).
[0054] It should be noted that the image processing device can also obtain the image to be processed. The image to be processed and the image control parameters of the image to be processed can be sent by a device communicating with the image processing device, or can be stored in a database associated with the image processing device.
[0055] S202. Adjust pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter.
[0056] In an embodiment of the present application, the image to be processed includes pixel information of multiple pixel points. The image processing device can adjust the pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image. The pixel information of the pixel points presenting the target special effect in the adjusted image matches the color control parameter, that is, the color of the pixel points presenting the target special effect in the adjusted image matches the color control parameter.
[0057] In one embodiment, the color control parameters may include a saturation parameter, a hue parameter, and a brightness parameter; the pixel information of each pixel point in the image to be processed is adjusted according to the special effect range parameters and the color control parameters to obtain the adjusted image. The specific implementation method may be: determining the special effect color parameters according to the saturation parameter, the hue parameter, and the brightness parameter; adjusting the pixel information of each pixel point in the image to be processed according to the special effect range parameters and the special effect color parameters to obtain the adjusted image.
[0058] The saturation parameter can be expressed as adjustable_saturation, the hue parameter can be expressed as adjustable_hue, and the lightness parameter can be expressed as adjustable_lightness. The image processing device can determine the special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter, and the special effect color parameter indicates the color of the target special effect presented by the target image. The image processing device can adjust the pixel information of each pixel in the image to be processed according to the special effect range parameter and the special effect color parameter to obtain an adjusted image. The method of determining the special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter, and determining the target image according to the special effect color parameter can more intuitively reflect the relationship between the color control parameter and the target special effect presented by the target image, that is, when a parameter in the color control parameter changes, the target special effect presented by the target image also changes accordingly, and the change of the target special effect presented by the target image is more obvious. If the color control parameter is input by the business object, the method provided in the embodiment of the present application can help the business object understand the relationship between the color control parameter and the target special effect presented by the target image, thereby effectively improving the user experience of the business object.
[0059] In one embodiment, the specific implementation method of determining the special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter can be: obtaining the saturation threshold of the saturation parameter, the hue threshold of the hue parameter and the lightness threshold of the lightness parameter; generating three-dimensional feature parameters according to the saturation parameter, the hue parameter, the lightness parameter, the saturation threshold, the hue threshold and the lightness threshold; performing dimension conversion processing on the three-dimensional feature parameters to obtain four-dimensional feature parameters, and determining the four-dimensional feature parameters as special effect color parameters. The saturation threshold of the saturation parameter (adjustable_saturation) can be (0-100), the hue threshold of the hue parameter (adjustable_hue) can be (0-360), and the lightness threshold of the lightness parameter (adjustable_lightness) can be (0-100), then the method for determining the three-dimensional feature parameters can be shown in the following formula (1):
[0060] vec3 controlColor=vec3(H / 360.0,S / 100.0,L / 100.0) (1)
[0061] In the above formula (1), vec3 represents a three-dimensional value, controlColor represents a three-dimensional feature parameter, H represents a hue parameter, S represents a saturation parameter, and L represents a lightness parameter. The three-dimensional feature parameter is expressed based on the HSL color model. In order to facilitate subsequent calculations, the three-dimensional feature parameter can be dimensionally converted to obtain a four-dimensional feature parameter. The four-dimensional feature parameter is expressed based on the RGBA color model. The method for determining the four-dimensional feature parameter can be shown in the following formula (2):
[0062] vec4 rgba=vec4(hsl2rgb(controlColor),1.0) (2)
[0063] In the above formula 2, vec4 represents a four-dimensional value, rgba represents a four-dimensional feature parameter, hsl2rgb represents information of the HSL mode converted into information of the RGBA color mode, and controlColor represents a three-dimensional feature parameter. The four-dimensional feature parameter can be determined as a special effect color parameter.
[0064] In one embodiment, the image processing method provided by the present application may also include the following steps: receiving image processing request information sent by a terminal device, the image processing request information carrying the image to be processed; the image processing device can receive the image processing request information sent by the terminal device, thereby obtaining the image to be processed.
[0065] In response to image processing request information, image processing response information is sent to the terminal device, and the image processing response information is used to control the terminal device to display an image processing interface, and the image processing interface includes a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control; the image processing device can send the image processing response information to the endpoint device, and the terminal device can display the image processing interface based on the image processing response information, and the image processing interface may include a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control.
[0066] Receive color control parameters and special effect range parameters sent by a terminal device, where the saturation parameter in the color control parameters is determined by the terminal device in response to a sliding operation on a saturation slider control in an image processing interface, the hue parameter in the color control parameters is determined by the terminal device in response to a sliding operation on a hue slider control in the image processing interface, the brightness parameter in the color control parameters is determined by the terminal device in response to a sliding operation on a brightness slider control in the image processing interface, and the special effect range parameter is determined by the terminal device in response to a sliding operation on a special effect range slider control in the image processing interface; the image processing device can obtain the color control parameters and special effect range parameters sent by the terminal device.
[0067] An image processing device can receive multiple sets of image control parameters for the same image to be processed, for example: a terminal device sends image processing request information to the image processing device, the image processing device sends image processing response information to the terminal device, the terminal device displays an image processing interface, the terminal device determines color control parameters and special effect range parameters based on a sliding operation on a slider control in the image processing interface, and sends the color control parameters and special effect range parameters to the image processing device; the image processing device can determine a target image based on the color control parameters, special effect range parameters and the image to be processed, and send the target image to the terminal device, and the terminal device displays the target image on the image processing interface; the terminal device receives a sliding operation on the slider control in the image processing interface again, and determines new color control parameters and new special effect range parameters, the terminal device can send the new color control parameters and new special effect range parameters to the image processing device, so that the image processing device processes the image to be processed according to the new color control parameters and new special effect range parameters to obtain a new target image.
[0068] In some scenarios, the image processing device may determine the default values corresponding to the slider controls in the image processing interface, and when the terminal device displays the slider controls in the image processing interface, the slider controls may be at the positions corresponding to the default values. For example, the default value of the special effect range parameter (adjustable_range) may be 50, the default value of the hue parameter (adjustable_hue) may be 245, the default value of the saturation parameter (adjustable_saturation) may be 100, and the default value of the lightness parameter (adjustable_lightness) may be 100.
[0069] It should be noted that the image processing method provided in the present application can generate a target image presenting a luminous special effect, or a target image presenting a background special effect of a target color. The image processing device can directly generate a target image presenting a luminous special effect and a target image presenting a background special effect of a target color according to the received color control parameters and special effect range parameters, and can also generate a target image presenting a special effect of a specified type according to demand. Specifically, the image processing interface of the terminal device may also include a special effect type selection control, and the special effect type selection control is used to determine the special effect type parameter, and the special effect type parameter is used to indicate the type of special effect presented by the generated target image (the special effect type can be a luminous special effect or a background special effect). The terminal device can send color control parameters, special effect range parameters, and special effect type parameters to the image processing device. The image processing device can generate a target image presenting a special effect of a specified type according to the special effect type parameters.
[0070] See also Figure 3 , which is a schematic diagram of a method for determining image control parameters provided in an embodiment of the present application. Figure 3 The terminal device can correspond to the above Figure 1 The terminal device 101 in the image processing device may correspond to the above Figure 1 The terminal device can send an image processing request message carrying the image to be processed to the image processing device, and the image processing device sends an image processing response message to the terminal device. The terminal device can display an image processing interface (such as Figure 3). The image processing interface includes the image to be processed, the saturation slider control, the hue slider control, the brightness slider control and the special effect range slider control, wherein the numerical sliding range of the saturation slider control is (0-100), and the numerical value corresponding to the current position is 90; the numerical sliding range of the hue slider control is (0-360), and the numerical value corresponding to the current position is 245; the numerical sliding range of the brightness slider control is (0-100), and the numerical value corresponding to the current position is 90; the numerical sliding range of the special effect range slider control is (0-100), and the numerical value corresponding to the current position is 50. The business object can slide the slider control in the image processing interface. The terminal device can determine the saturation parameter, brightness parameter, hue parameter and special effect range parameter according to the sliding operation of each slider control in the image processing interface, and send these parameters to the image processing device. The image processing device can process the image to be processed according to these parameters to obtain a target image presenting the target special effect. The terminal device can display Figure 3 In the image processing interface shown, the business object can adjust the parameters according to the slider control in the image processing interface, so as to adjust the special effect range of the target image and the color presented by the special effect, which can make the image more beautiful. The method provided by the embodiment of the present application can effectively meet the application needs, enhance the expressiveness of the target image, and improve the user experience.
[0071] In one embodiment, the specific implementation method of adjusting the pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain the adjusted image may be:
[0072] According to the special effect range parameter and the pixel information of each pixel in the image to be processed in the preset channel, the label of each pixel in the image to be processed is determined, and the label is used to indicate whether the corresponding pixel is a special effect pixel, and the special effect pixel is used to present the target special effect; the preset channel can be the B channel of the four channels R, G, B, and A included in the RGBA color mode of the pixel, or it can be other channels. The image processing device can determine the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed in the B channel (that is, the value corresponding to the B channel), and the label is used to indicate whether the pixel is a special effect pixel. For example: the label of the special effect pixel can indicate that the label value is "1", and the label of the non-special effect pixel can indicate that the label value is "0"; for another example: the label of the special effect pixel can indicate that the label value is greater than or equal to "0", and the label of the non-special effect pixel can indicate that the label value is less than "0", and the label value can be represented by alphaWeight.
[0073] The pixel information of each pixel in the image to be processed is processed using the label of each pixel in the image to be processed to obtain a label image; the pixel information of the special effect pixel in the label image matches the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel in the label image is set to the preset pixel information; the image processing device can process the pixel information of each pixel in the image to be processed according to the label of each pixel in the image to be processed to obtain a label image, the pixel information of the special effect pixel in the label image matches the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel in the label image is set to the preset pixel information, and the preset pixel information can be (0, 0, 0, 1), or can be adjusted appropriately according to application requirements. The method for determining the pixel information of each pixel in the label image can be shown in the following formula (3):
[0074] vec4 tempVal=srcImg*alphaWeight (3)
[0075] In the above formula (3), srcImg represents the pixel information of the first pixel in the image to be processed, and the first pixel can be any pixel in the image to be processed, alphaWeight represents the label value of the label of the first pixel, and tempVal represents the pixel information of the pixel corresponding to the first pixel in the label image. It should be noted that the pixel information of the pixel is expressed based on the RGBA color mode, and the pixel value of each channel of the pixel is between 0 and 1. For example: the pixel information of the first pixel is (0.3, 0.9, 0.6, 1). If the value of alphaWeight is 0, tempVal can be determined to be (0, 0, 0, 1). If the value of alphaWeight is 1, tempVal can be determined to be (0.3, 0.9, 0.6, 1).
[0076] The pixel information of each pixel point in the label image is color-adjusted according to the color control parameter to obtain an adjusted image; the image processing device can determine the special effect color parameter according to the color control parameter, and perform color adjustment on the pixel information of each pixel point in the label image according to the special effect color parameter to obtain an adjusted image. The method for determining the pixel information of each pixel point in the adjusted image can be shown in the following formula (4):
[0077] vec4 result1=tempVal*rgba(4)
[0078] In the above formula (4), rgba represents a special effect color parameter, which can be determined according to the color control parameter, which can be determined according to the method shown in the above formula (2), tempVal represents the pixel information of any pixel in the label image, and result1 represents the pixel information of any pixel in the adjusted image. For example: rgba is (0, 0.12, 0.85, 1), if tempVal is (0, 0, 0, 1), then result1 can be determined to be (0, 0, 0, 1), if tempVal is (0.3, 0.9, 0.6, 1), then result1 can be determined to be (0, 0.108, 0.51, 1). Through the method provided in the embodiment of the present application, the special effect range parameter can be used to determine the special effect pixel points and non-special effect pixel points in the image to be processed, and the pixel information of the special effect pixel points can be adjusted according to the color control parameter, so that the special effect pixel points present the color indicated by the color control parameter.
[0079] See also Figure 4 , which is a schematic diagram of an image to be processed provided in an embodiment of the present application. Figure 4 An image to be processed is shown, which includes pixel A1 and pixel B1. It is assumed that the pixel information of pixel A1 is (0.5, 0.9, 0.6, 1), and the pixel information of pixel B1 is (0.1, 0.2, 0.9, 1). The image processing device can obtain special effect range parameters and color control parameters, and determine the labels of each pixel in the image to be processed according to the special effect range parameters and the pixel information of each pixel in the image to be processed in a preset channel (for example, channel B). The label can indicate whether the corresponding pixel is a special effect pixel, and the special effect pixel is used to present the target special effect. The image processing device can determine that the label corresponding to pixel A1 indicates "pixel A1 is a non-special effect pixel", and the label value is 0; the label corresponding to pixel B1 indicates "pixel B1 is a special effect pixel", and the label value is 1.
[0080] The image processing device can use the labels of each pixel in the image to be processed to process the pixel information of each pixel in the image to be processed to obtain a label image. The method for determining the pixel information of each pixel in the label image can be as shown in the above formula (3). The image processing device can perform color adjustment processing on the pixel information of each pixel in the label image according to the color control parameter to obtain an adjusted image. Figure 5 , which is a schematic diagram of adjusting an image provided in an embodiment of the present application. Figure 5 The adjusted image includes pixel A2 and pixel B2, and pixel A2 and pixel B2 are Figure 4 The position of pixel A1 in matches, and pixel B2 matches Figure 4The position of pixel B1 in the image is matched, the pixel information of pixel A2 is (0, 0, 0, 1), and the pixel information of pixel B2 is (0.01, 0.16, 0.81, 1). By using the method provided in the embodiment of the present application, an adjusted image can be obtained, and special effect pixels and non-special effect pixels can be determined, which is conducive to further processing of the adjusted image to obtain a target image presenting the target special effect.
[0081] In one embodiment, a specific implementation method of determining the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed in a preset channel may be:
[0082] According to the pixel information of the target pixel in the image to be processed in the preset channel, and the special effect upper limit parameter and the special effect lower limit parameter indicated by the special effect range parameter, the weight of the target pixel is obtained, and the target pixel is any pixel in the image to be processed; the image processing device can determine the special effect upper limit parameter and the special effect lower limit parameter according to the special effect range parameter, and the method for determining the special effect upper limit parameter and the special effect lower limit parameter can be shown in the following formula (5) and formula (6):
[0083] float _in=min (adjustable_range*0.01,0.75) (5)
[0084] float _out=max (adjustable_range*0.01,0.75) (6)
[0085] In the above formula (5), float indicates that the data type is a floating point number, _in indicates the special effect lower limit parameter, adjustable_range indicates the special effect range parameter, and min(x, y) indicates taking the smaller value of x and y; in formula (6), _out indicates the special effect lower limit parameter, and max(x, y) indicates taking the larger value of x and y. For any pixel point (i.e., target pixel point) in the image to be processed, the method for determining the weight of the target pixel point can be shown in the following formula (7):
[0086] alphaWeight=(srcImg.b-_in) / (_out-_in) (7)
[0087] In the above formula (7), alphaWeight represents the weight of the target pixel, srcImg.b represents the pixel information of the B channel of the target pixel, _in represents the lower limit parameter of the special effect, and _out represents the upper limit parameter of the special effect.
[0088] The weight of the target pixel is normalized to obtain the label of the target pixel; the image processing device can normalize the weight of the target pixel to obtain the label of the target pixel, for example: the label of the pixel whose weight is greater than or equal to 0 is determined as "non-special effect pixel", and the label value corresponding to the label is determined to be 0; the label of the pixel whose weight is less than 0 is determined as "special effect pixel", and the label value corresponding to the label is determined to be 1. In some cases, the image processing device can directly determine the weight of the target pixel as the label value corresponding to the label of the target pixel. Through the method provided in the embodiment of the present application, the special effect pixels and non-special effect pixels in the image to be processed can be determined according to the special effect range parameters, which is conducive to subsequent processing to obtain the target image presenting the target special effect.
[0089] S203: Combining the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, wherein the target image is used to present a target special effect.
[0090] In an embodiment of the present application, the image processing device can combine the adjustment image and the image to be processed to obtain a target image of the image object to be processed, and the target image is used to present the target special effect. The target special effect can be a luminous special effect or a background special effect of a target color, and the target color is determined according to the color control parameter. When the target special effect is a luminous special effect, the image processing device can perform a blur process on the adjustment image to obtain a blurred image, and perform a combination process of pixel information on the blurred image and the image to be processed to obtain a target image corresponding to the image to be processed. When the target special effect is a background special effect of a target color, the image processing device can perform a combination process of pixel information on the adjustment image and the image to be processed to obtain a target image corresponding to the image to be processed. Through the method provided in the embodiment of the present application, a target image presenting a target special effect can be generated based on the adjustment image, which is conducive to meeting the application requirements of the business object and improving the user experience. In addition, the method provided in the present application can also generate different target special effects, enrich the types of special effects, and improve the viewing quality of the image.
[0091] In one embodiment, the adjusted image includes non-special effect pixels and special effect pixels, and the adjusted image and the image to be processed are combined and processed to obtain a target image corresponding to the image to be processed. The specific implementation method can be: determine the pixel information of any special effect pixel in the adjusted image as the pixel information of the corresponding pixel in the target image corresponding to the image to be processed; determine the original pixel in the image to be processed corresponding to the non-special effect pixel in the adjusted image; determine the pixel information of the original pixel in the image to be processed as the pixel information of the corresponding pixel in the target image corresponding to the image to be processed. The target image is used to present a background special effect of a target color, and the target color is determined according to the color control parameters.
[0092] Specifically, the adjusted image includes non-special effect pixels and special effect pixels, wherein the pixel information of the non-special effect pixels is obtained by adjusting the preset pixel information according to the color control parameters, so the pixel information of different non-special effect pixels in the adjusted image is the same; the pixel information of the special effect pixels is determined according to the color control parameters for the pixel information of the corresponding pixels in the processed image, so the pixel information of different special effect pixels may be different. The special effect pixels in the adjusted image are mainly located in the background position of the image.
[0093] The image processing device can determine the pixel information of any special effect pixel in the adjusted image as the pixel information of the corresponding pixel in the target image, and determine the original pixel in the image to be processed that corresponds to the non-special effect pixel in the adjusted image (i.e., the position of the pixel corresponds). The image processing device can determine the pixel information of the original pixel in the image to be processed as the pixel information of the corresponding pixel in the target image, so that the pixels at the background position in the target image present the target color determined according to the color control parameters, while the pixels at other positions present the color in the image to be processed, thereby making the target image present the background special effect of the target color. Figure 4 and Figure 5 For example, the image processing device is based on Figure 4 The image to be processed and Figure 5 The adjusted image shown in the figure determines the target image, which includes pixel point A3 and pixel point B3, and the pixel information of pixel point A3 is the same as Figure 4 The pixel information of pixel A1 is the same as that of pixel B3. Figure 5 The pixel information of pixel point B2 is the same. Through the method provided in the embodiment of the present application, a target image with background special effects showing a target color can be generated, which effectively enriches the types of image special effects and is conducive to meeting application requirements.
[0094] It should be noted that the method for determining the target image based on the adjustment image and the image to be processed described in the above embodiment is only a feasible implementation method. In actual application, the method for determining the target image (the target image presents the background effect of the target color) based on the adjustment image and the image to be processed can also be to combine the pixel information of any pixel in the adjustment image with the pixel information of the corresponding pixel in the image to be processed to obtain the target image, or other methods can be used.
[0095] In one embodiment, a specific implementation method of combining the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed may be: sampling the adjusted image to obtain N sampled images, where N is a positive integer; blurring the N sampled images to obtain N blurred sampled images; restoring the N blurred sampled images to obtain N restored images; performing weighted operations on the N restored images to obtain a blurred image; and combining the blurred image and the image to be processed to obtain a target image corresponding to the image to be processed, where the target image is used to present a luminous special effect.
[0096] Specifically, the image processing device may perform N sampling processes on the adjusted image to obtain N sampled images, where N is a positive integer. The image processing device may perform blur processing on the N sampled images respectively to obtain N blurred sampled images, and then perform image restoration processing on the N blurred sampled images to obtain N restored images, where the image size of the restored image is the same as the image size of the adjusted image. The image processing device may perform weighted operations on the N restored images to obtain a blurred image, which has a blur effect. The image processing device may perform combined processing on the blurred image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present a luminous special effect. It should be noted that in some cases, in order to meet the needs of subsequent image processing methods, the adjusted image may be color adjusted to obtain a new adjusted image, for example: the pixel information of specific pixels in the adjusted image (i.e., the pixel information is close to white) is color adjusted so that the pixel information of these pixels is close to black, to obtain a new adjusted image, and the new adjusted image is subsequently blurred to obtain a blurred image. This method can be beneficial for subsequent processing steps to more clearly distinguish between special effect pixels and non-special effect pixels. Through the method provided in the embodiment of the present application, a blurred image with a blurring effect can be obtained, and a target image presenting a luminous special effect can be determined based on the blurred image and the image to be processed, thereby effectively enriching the types of image special effects and obtaining a target image with better expressiveness to meet application requirements.
[0097] In one embodiment, a specific implementation method of sampling the adjusted image to obtain N sampled images may be: obtaining N downsampling parameters; downsampling the adjusted image according to the N downsampling parameters to obtain N sampled images, wherein the image size of the sampled images matches the corresponding downsampling parameters, and the image size of the sampled images is different from the image size of the adjusted image.
[0098] Specifically, the image processing device can obtain N downsampling parameters, which can be the same or different. After determining the downsampling parameters, the image processing device can perform downsampling processing on the adjusted image according to the downsampling parameters to obtain N sampled images, and the image size of the sampled images can be smaller than the image size of the adjusted image. For example, the image processing device can obtain 5 downsampling parameters x1 to x5, where x1=2 2 , x2=2 3 , x3=2 4 , x4=2 5 , x5=2 6 , the adjusted image is downsampled according to the five downsampling parameters to obtain five sampled images, and the image size of the sampled image corresponding to the downsampling parameter x1 is 1 / 4 of the image size of the adjusted image, the image size of the sampled image corresponding to the downsampling parameter x2 is 1 / 8 of the image size of the adjusted image, and the image sizes of the sampled images corresponding to other downsampling parameters are determined by similar methods. Through the method provided in the embodiment of the present application, multiple sampled images with different image sizes can be obtained, which is beneficial to reduce the amount of calculation and improve processing efficiency when the sampled images are subsequently blurred.
[0099] In one embodiment, a specific implementation method of performing blur processing on N sampled images to obtain N blurred sampled images may be: for any sampled image among the N sampled images, obtaining blur parameters corresponding to any sampled image; performing image blur processing on any sampled image according to the blur parameters corresponding to any sampled image, to obtain a blurred sampled image corresponding to any sampled image.
[0100] The image processing device can obtain the blur parameters corresponding to the sampled image, and perform image blur processing on the sampled image based on the blur parameters. The image blur processing method can be a Gaussian blur method or other image blur methods. The blur parameters corresponding to the N blurred sampled images can be the same or different. For example: there are 5 sampled images, and the image sizes of the 5 sampled images decrease successively. The image processing device can use the Gaussian blur method and a unified blur parameter to blur the 5 sampled images respectively. Since the smaller the image size of the blurred sampled image, the greater the blur degree, 5 blurred sampled images with different blur degrees can be obtained, which is conducive to obtaining a blurred image with better expressiveness based on the blurred sampled images with different blur degrees.
[0101] Since the method provided by the present application performs downsampling processing on the adjusted image to obtain N sampled images, and the image sizes of the N sampled images are all smaller than the image size of the adjusted image, the time consumed when blurring the sampled images is less than the time consumed when blurring the adjusted image directly. In addition, the method provided by the present application generates multiple adopted images, blurs the multiple sampled images separately, and then integrates the multiple blurred sampled images to obtain the final blurred image, thereby making the blur effect of the blurred image more vivid and more expressive.
[0102] In one embodiment, a specific implementation method of performing image restoration processing on N fuzzy sampling images to obtain N restored images may be: for any fuzzy sampling image among the N fuzzy sampling images, performing image restoration processing on any fuzzy sampling image to obtain a restored image corresponding to any fuzzy sampling image, wherein the image size of the restored image is the same as the image size of the adjusted image.
[0103] The image processing device can perform image restoration processing on the N blurred sampled images respectively to obtain N restored images with the same size as the adjusted image. For example: the image processing device performs downsampling processing on the adjusted image to obtain a sampled image, and the image size of the sampled image is 1 / 4 of the adjusted image; performs Gaussian blur processing on the sampled image to obtain a blurred sampled image, and then performs restoration processing on the blurred sampled image to obtain a restored image, and the restored image is an image with a blurred effect and an image size that is the same as the image size of the adjusted image.
[0104] In one embodiment, the N restored images include a first restored image and a second restored image, the first restored image may be any one of the N restored images, the second restored image includes the remaining restored images of the N restored images except the first restored image, and the image size of the restored image is the same as the image size of the adjusted image; then a specific implementation method of performing a weighted operation on the N restored images to obtain a blurred image may be: for any pixel point in the first restored image, according to the pixel information of any pixel point in the first restored image and the pixel information of the corresponding pixel point in each second restored image, the weighted pixel information of any pixel point in the first restored image is obtained; and according to the weighted pixel information of each pixel point in the first restored image, a blurred image is generated.
[0105] Specifically, the first restored image may be any one of the N restored images. For any pixel in the first restored image, the image processing device may determine the pixel information of any pixel in the first restored image and the pixel information of the corresponding pixel in the second restored image that matches the any pixel. The weighted pixel information of any pixel in the first restored image may be determined according to the pixel information of the any pixel, the pixel information of the corresponding pixel and the weight data corresponding to each restored image, and then the blurred image may be determined. The method for determining the pixel information of any pixel in the blurred image may be as shown in the following equations (8) and (9):
[0106] vce4 Pixel=(k1*Pi1+k2*Pi2+…+k N *Pi N ) / sum (8)
[0107]
[0108] In the above formulas (8) and (9), Pixel represents the pixel information of any pixel in the blurred image, k represents the image weight data of the restored image, and Pi represents the pixel information of the pixel at the corresponding position in the corresponding restored image. It should be noted that the image weight data of each restored image can be adaptively adjusted according to application requirements. For example: if there are 5 restored images, the image weight data of these 5 restored images can be 1.0, 0.12, 0.15, 0.19, and 0.22, respectively. Through the method provided in the embodiment of the present application, a blurred image with a blur effect can be obtained, which is conducive to the subsequent determination of a target image with a luminous effect based on the blurred image.
[0109] See also Figure 6 , which is a schematic diagram of a blurred image determination method provided by an embodiment of the present application. The image processing device can perform multiple downsampling processes on the adjusted image to obtain N sampled images, Figure 6 There are 5 sample images in Figure 5 The adjusted image shown is downsampled), and Figure 6 The image size of the sampled image is smaller than the image size of the adjusted image. The image processing device can perform blur processing on the five sampled images respectively to obtain five blurred sampled images. Since the image sizes of the five sampled images are different, the blurring degrees of the five blurred sampled images are different. The image processing device can perform restoration processing on the five blurred sampled images to obtain five restored images, and the image size of the restored images is the same as the image size of the adjusted image.
[0110] The image processing device can determine the image weight data corresponding to the five restored images respectively; the image processing device can determine the pixel information of the pixel points at the corresponding positions in the blurred image according to the pixel information of the pixel points at the corresponding positions in the five restored images (i.e., the pixel points at the same positions in different restored images) and the image weight data of each restored image, thereby obtaining a blurred image. Figure 7 , which is a schematic diagram of a blurred image provided by an embodiment of the present application. Figure 5 The sample image shown in FIG. 1 is subjected to the image processing method provided in the embodiment of the present application to obtain the following Figure 7 The blurred image shown. Through the method provided in the embodiment of the present application, a blurred image with better expressiveness can be obtained, which is conducive to obtaining a target image with better expressiveness in the subsequent process. At the same time, the downsampled image can be blurred, which can effectively reduce the amount of image processing calculations and help improve the overall efficiency of the image processing method.
[0111] Through the image processing method provided in the embodiment of the present application, special effect pixels and non-special effect pixels can be determined from the image to be processed based on the special effect range parameters, which is conducive to the subsequent generation of a target image with a target special effect. The special effect color parameters can be determined according to the saturation parameters, the hue parameters and the brightness parameters, so that the color of the target special effect of the target image matches the special effect color parameters, thereby making the image processing method have good versatility; the terminal device can obtain image control parameters through the slider control, which is conducive to improving the user experience; a target image with a background special effect of the target color or a target image with a luminous special effect can be generated, which effectively enriches the types of image special effects and meets application requirements; when generating a target image with a luminous special effect, the adjusted image can be downsampled and the downsampled image can be blurred, which is conducive to obtaining a blurred image with good expressiveness. At the same time, the calculation amount of image blurring can be effectively reduced, thereby improving the overall efficiency of image processing.
[0112] See also Figure 8 , Figure 8 1 is a flow chart of another image processing method provided in an embodiment of the present application. The image processing method can be implemented by the above-mentioned image processing device 102, or by other devices that can implement the image processing method. The following takes the image processing method implemented by the above-mentioned image processing device 102, and the special effect presented by the target image is a luminous special effect as an example for explanation. The process of the image processing method provided in the embodiment of the present application includes but is not limited to:
[0113] S801. Obtain image control parameters of an image to be processed, where the image control parameters include color control parameters and special effect range parameters.
[0114] In the embodiment of the present application, the image processing device can obtain image control parameters of the image to be processed, and the image control parameters may include color control parameters and special effect range parameters, and the image control parameters are used to determine the target image presenting the target special effect. The color control parameter in the image control parameters is used to indicate the color of the target special effect presented by the target image, and the special effect range parameter in the image control parameters is used to indicate the range of pixels presenting the target special effect in the target image.
[0115] S802. Adjust pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter.
[0116] In the embodiment of the present application, the image to be processed includes pixel information of multiple pixels, and the image processing device can adjust the pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, in which the pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter, that is, the color of the pixel presenting the target special effect in the adjusted image matches the color control parameter. The method of determining the adjustment image can be the process described in step S202 in the above embodiment.
[0117] S803: blur the adjusted image to obtain a blurred image, and perform brightness mapping on pixel information of each pixel in the blurred image to obtain brightness data of each pixel in the blurred image.
[0118] In the embodiment of the present application, in order to generate a target image presenting a luminous special effect, the image processing device may perform blur processing on the adjusted image to obtain a blurred image, and the method for determining the blurred image may be the process described in step S203 in the above embodiment. After the image processing device determines the blurred image, it may perform brightness mapping processing on the pixel information of each pixel in the blurred image to obtain the brightness data of each pixel in the blurred image. The method for determining the brightness data of the pixel may be as shown in the following formulas (10) and (11):
[0119] float L=dot(c,0.2126,0.7152,0.0722) (10)
[0120] c = bloom.rgb (11)
[0121] In the above formula (10) and formula (11), bloom represents a blurred image, c represents pixel information of any pixel in the blurred image, L represents the brightness data of the pixel indicated by c, and dot represents dot product. Through the method provided in the embodiment of the present application, the brightness data of each pixel in the blurred image can be obtained, which is conducive to the subsequent determination of a target image presenting a luminous effect based on the brightness data.
[0122] S804, desaturating the pixel information of each pixel in the blurred image to obtain the desaturated pixel information of each pixel in the blurred image, and generating a brightness compressed image according to the pixel information, brightness data and desaturated pixel information of each pixel in the blurred image.
[0123] In the embodiment of the present application, in order to ensure the expressiveness of the target image and avoid the target image being too saturated, the image processing device can desaturate the pixel information of each pixel in the blurred image to obtain the desaturated pixel information of each pixel in the blurred image. The image processing device can also generate a brightness compressed image based on the pixel information, brightness data and desaturation information of each pixel in the blurred image. Among them, the method for determining the desaturated pixel information of the pixel in the blurred image can be shown as follows (12):
[0124] vec3 tc=c / (c+(1.0,1.0,1.0)) (12)
[0125] In the above formula (12), c represents the pixel information of any pixel in the blurred image, and tc represents the desaturated pixel information of the pixel. It can be seen from formula (12) that the saturation of the pixel information indicated by tc is usually lower than the saturation of the pixel information indicated by c. Through the method provided in the embodiment of the present application, the desaturated pixel information of each pixel in the blurred image can be obtained, which can effectively avoid color oversaturation, thereby helping to improve the expressiveness and appreciation of the target image.
[0126] In one embodiment, a specific implementation method of generating a brightness compression image based on pixel information, brightness data and desaturated pixel information of each pixel in a blurred image may be: for any pixel in the blurred image, a tone compression process is performed on the pixel information and brightness data of any pixel in the blurred image to obtain compressed pixel information of any pixel in the blurred image; a mixed process is performed on the compressed pixel information and desaturated pixel information of any pixel in the blurred image to obtain mixed pixel information of any pixel in the blurred image; and a brightness compression image is generated based on the mixed pixel information corresponding to each pixel in the blurred image. The method of generating a brightness compression image may be shown in the following formula (13):
[0127] result3=mix(c / (L+1.0),tc,tc) (13)
[0128] In the above formula (13), result3 represents the brightness compression image, c represents the pixel information of any pixel in the blurred image, c / (L+1.0) represents the compressed pixel information of any pixel in the blurred image, tc represents the desaturated pixel information of any pixel in the blurred image, L represents the brightness data of any pixel in the blurred image, and mix(x, y, z) is equivalent to x*(1-z)+y*z. The method shown in formula (13) indicates that c is adjusted. If tc is small, the pixel information of the corresponding pixel in the brightness compression image can match c. If tc is large, the pixel information of the corresponding pixel in the brightness compression image can match tc. It should be noted that c and tc are both three-dimensional data, and both only contain data of three dimensions of R, G, and B in the RGBA color mode. The data of the three dimensions of R, G, and B in the pixel information of each pixel in result3 can be determined by the method shown in formula (13), and the data of the alpha dimension can be determined according to the data of the alpha dimension in the pixel information of each pixel in the blurred image, or can be determined according to other methods.
[0129] See also Fig. 9 , which is a schematic diagram of a brightness compression image provided by an embodiment of the present application. Figure 7 The blurred image is subjected to the image processing method provided by the embodiment of the present application, and the following can be obtained: Fig. 9 The method provided in the embodiment of the present application can realize brightness compression of blurred images, avoid oversaturation, and facilitate the subsequent generation of target images with high expressiveness and appreciation.
[0130] S805: Combine the brightness compressed image and the image to be processed to obtain a combined image.
[0131] In the embodiment of the present application, the image processing device can combine the brightness compressed image and the image to be processed to obtain a combined image. The combination processing method can be shown in the following formula (14):
[0132] result4=srcImg / (vce4(1.0,1.0,1.0,1.0)-result3) (14)
[0133] In the above formula (14), result4 represents the combined image, srcImg represents the image to be processed, and result3 represents the brightness compressed image. Fig.10 , which is a schematic diagram of a combined image provided by an embodiment of the present application. Fig. 9The luminance compressed image and Figure 4 The image to be processed is combined and processed as shown in Fig.10 Combined image shown.
[0134] S806: Perform image special effects processing on the combined image to obtain a target image corresponding to the image to be processed.
[0135] In the embodiment of the present application, the image processing device can perform image special effects processing on the combined image to further enhance the image expressiveness and obtain a target image corresponding to the image to be processed.
[0136] In one embodiment, the specific implementation method of performing image special effects processing on the combined image to obtain the target image corresponding to the image to be processed may be: performing at least one of rotation blur processing, noise addition processing and overall blur processing on the combined image to obtain the target image corresponding to the image to be processed. The image processing device may perform one or more of rotation blur processing, noise addition processing and overall blur processing on the combined image to obtain the target image corresponding to the image to be processed. For example: the image processing device may perform rotation blur processing on the combined image to obtain a rotation blurred combined image. Rotation blur processing may be a method of blurring an image based on a rotation center parameter, a rotation radius parameter and a rotation arc parameter. Please refer to Fig.11 , which is a schematic diagram of a rotationally blurred combined image provided by an embodiment of the present application. Fig.10 The combined image is subjected to rotation blur processing, and the following can be obtained: Fig.11 The rotation blurred composite image shown.
[0137] The image processing device can add noise to the rotational blurred composite image to obtain a noise composite image. Noise usually refers to the pixels or pixel blocks in the image that cause visual effects. The methods of adding noise can include Gaussian noise method, Poisson noise method, etc. The Gaussian noise method is to add a noise that obeys Gaussian distribution to the image. The degree of noise can be controlled by adjusting the size of the standard deviation of the Gaussian distribution. The larger the standard deviation, the more noise there is in the image. See Fig.12 , which is a schematic diagram of a noise combination image provided by an embodiment of the present application. Fig.11 The rotational blurred combined image is processed by adding noise, and the following can be obtained: Fig.12 The noise composite image shown.
[0138] The image processing device can perform overall blur processing on the noise combination image to obtain the target image of the image to be processed. The overall blur processing method can be a Gaussian blur processing method or other blur processing methods. The Gaussian blur processing method can effectively reduce image noise and reduce the level of detail, making the blurred image smoother and more aesthetically pleasing. Fig.13 , which is a schematic diagram of a target image provided by an embodiment of the present application. Fig.12 The noise combination image is subjected to overall fuzzy processing, and the following can be obtained: Fig.13 The target image shown. It should be noted that the embodiment of the present application only provides a feasible implementation method for generating a target image. In actual application, the steps and sequence of image special effects processing can be adaptively adjusted according to application requirements. For example, the image processing device can also perform overall blur processing on the combined image, and then add noise processing to the overall blurred image to obtain the target image corresponding to the image to be processed. The method provided in the embodiment of the present application can make the target special effects of the target image more expressive and ornamental.
[0139] See also Fig.14 , which is a schematic diagram of an image processing method provided in an embodiment of the present application. Fig.14 The image processing method shown may include the following steps: S1401, obtaining image control parameters of the image to be processed; the image processing device may obtain the image control parameters of the image to be processed, the image control parameters may include color control parameters and special effect range parameters, wherein the color control parameters may include saturation parameters, hue parameters and brightness parameters, and the image control parameters may be determined by the terminal device through a sliding operation on the slider control. S1402, determining the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed; the label may be used to indicate whether the corresponding pixel is a special effect pixel. S1403, using the label of each pixel in the image to be processed to process the pixel information of each pixel in the image to be processed, and obtain a label image; the image processing device may process the pixel information of each pixel in the image to be processed, and obtain a label image, the pixel information of the special effect pixel in the label image matches the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel is set to the preset pixel information.
[0140] S1404. Perform color adjustment processing on the pixel information of each pixel in the label image according to the color control parameters to obtain an adjusted image; the image processing device can determine the special effect color parameters according to the color control parameters, and perform color adjustment processing on the pixel information of each pixel in the label image according to the special effect color parameters to obtain an adjusted image. If a target image presenting a luminous special effect needs to be generated, steps S1405-S1407 can be executed; if a target image presenting a background special effect of a target color needs to be generated, step S1408 can be executed. S1405. Perform sampling processing on the adjusted image to obtain N sampled images, and perform blur processing on the N sampled images to obtain N blurred sampled images; the image processing device can perform multiple downsampling processing on the adjusted image according to the sampling parameters to obtain N sampled images (N is a positive integer), and then perform blur processing on each sampled image to obtain N blurred sampled images. S1406. Perform image restoration processing on the N fuzzy sampled images to obtain N restored images, and perform weighted operation on the N restored images to obtain a fuzzy image; the image processing device can restore the fuzzy sampled images to obtain restored images, and obtain a fuzzy image based on the restored images, and the fuzzy image has better expressiveness.
[0141] S1407. Combine the blurred image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present a luminous special effect; the image processing device can adjust the brightness of the blurred image to obtain a brightness compressed image to avoid oversaturation, and combine the brightness compressed image and the image to be processed to obtain a combined image; the combined image can also be further processed to obtain a target image that presents a luminous special effect and has good expressiveness.
[0142] S1408. Combine and process the adjusted image and the image to be processed to obtain a target image, which is used to present the background special effects of the target color; the image processing device can determine the pixel information of any special effect pixel point in the adjusted image as the pixel information of the corresponding pixel point in the target image corresponding to the image to be processed; determine the original pixel points in the image to be processed that correspond to the non-special effect pixel points in the adjusted image, and determine the pixel information of the original pixel points in the image to be processed as the pixel information of the corresponding pixel points in the target image corresponding to the image to be processed, and the target image is used to present the background special effects of the target color.
[0143] The image processing method provided in the embodiment of the present application can determine the special effect pixels and non-special effect pixels from the image to be processed based on the special effect range parameters, and can determine the special effect color parameters according to the saturation parameters, hue parameters and brightness parameters, so that the color of the target special effect of the target image matches the special effect color parameters, thereby making the image processing method have good versatility; the terminal device can obtain the image control parameters through the slider control, which is conducive to improving the user experience; when generating a target image presenting a luminous special effect, the adjusted image can be downsampled and the downsampled image can be blurred, which is conducive to obtaining a blurred image with good expressiveness, and at the same time can effectively reduce the amount of calculation of the image blur processing and improve the overall efficiency of image processing; the blurred image can be desaturated to effectively avoid oversaturation; the combined image can be further processed with image special effects (such as rotation blur processing, noise addition processing, overall blur processing, etc.), so that the blurred image presenting special effects is more expressive and ornamental; a target image presenting a luminous special effect or a background special effect of the target color can be generated, which enriches the types of image special effects, meets application requirements, and improves the user experience.
[0144] See also Fig.15 , Fig.15 This is a structural block diagram of an image processing device provided in an embodiment of the present application. The image processing device can be set in the computer device provided in an embodiment of the present application, and the computer device can be the above-mentioned Figure 1 An image processing device 102 is shown in the image processing system. Fig.15 The image processing device shown may be a computer program running in a computer device, and the image processing device may be used to execute Figure 2 or Figure 8 Part or all of the steps in the embodiment of the image processing method shown. Fig.15 , the image processing device may include the following units:
[0145] An acquisition unit 1501 is used to acquire image control parameters of an image to be processed, wherein the image control parameters include color control parameters and special effect range parameters;
[0146] An adjusting unit 1502 is used to adjust the pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein the pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter;
[0147] The processing unit 1503 is used to perform combined processing on the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
[0148] In one embodiment, the color control parameters include a saturation parameter, a hue parameter, and a lightness parameter; the adjustment unit 1502 is used to adjust the pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter, and when the adjusted image is obtained, specifically to perform the following steps:
[0149] Determine a special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter;
[0150] The pixel information of each pixel point in the image to be processed is adjusted according to the special effect range parameter and the special effect color parameter to obtain an adjusted image.
[0151] In one embodiment, the adjustment unit 1502 is used to determine the special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter, and is specifically used to perform the following steps:
[0152] Obtaining a saturation threshold of the saturation parameter, a hue threshold of the hue parameter, and a brightness threshold of the brightness parameter;
[0153] Generate a three-dimensional feature parameter according to the saturation parameter, the hue parameter, the lightness parameter, the saturation threshold, the hue threshold and the lightness threshold;
[0154] The three-dimensional feature parameters are dimensionally converted to obtain four-dimensional feature parameters, and the four-dimensional feature parameters are determined as special effect color parameters.
[0155] In one embodiment, the adjustment unit 1502 is used to adjust the pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter, and when the adjusted image is obtained, specifically performs the following steps:
[0156] Determine, according to the special effect range parameter and the pixel information of each pixel in the image to be processed in a preset channel, a label of each pixel in the image to be processed, wherein the label is used to indicate whether the corresponding pixel is a special effect pixel, and the special effect pixel is used to present a target special effect;
[0157] The pixel information of each pixel in the image to be processed is processed using the label of each pixel in the image to be processed to obtain a label image; the pixel information of the special effect pixel in the label image is matched with the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel in the label image is set as the preset pixel information;
[0158] Color adjustment processing is performed on pixel information of each pixel point in the label image according to the color control parameter to obtain the adjusted image.
[0159] In one embodiment, the adjustment unit 1502 is used to determine the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed in the preset channel, and is specifically used to perform the following steps:
[0160] According to the pixel information of the target pixel in the image to be processed in the preset channel, and the special effect upper limit parameter and the special effect lower limit parameter indicated by the special effect range parameter, the weight of the target pixel is obtained, and the target pixel is any pixel in the image to be processed;
[0161] The weight of the target pixel is normalized to obtain a label of the target pixel.
[0162] In one embodiment, the adjusted image includes non-special effect pixels and special effect pixels, and the processing unit 1503 is used to combine the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, specifically for:
[0163] Determine the pixel information of any special effect pixel point in the adjusted image as the pixel information of the corresponding pixel point in the target image corresponding to the image to be processed;
[0164] Determine original pixel points in the image to be processed corresponding to non-special effect pixel points in the adjusted image;
[0165] The pixel information of the original pixel in the image to be processed is determined as the pixel information of the corresponding pixel in the target image corresponding to the image to be processed. The target image is used to present a background effect of a target color, and the target color is determined according to the color control parameter.
[0166] In one embodiment, the processing unit 1503 is used to perform the following steps when combining the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed:
[0167] Sampling the adjusted image to obtain N sampled images, where N is a positive integer;
[0168] Performing fuzzy processing on the N sampled images to obtain N fuzzy sampled images;
[0169] Performing image restoration processing on the N fuzzy sampled images to obtain N restored images;
[0170] Performing a weighted operation on the N restored images to obtain a blurred image;
[0171] The blurred image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a luminous special effect.
[0172] In one embodiment, the processing unit 1503 is used to perform sampling processing on the adjusted image to obtain N sampled images, and is specifically used to perform the following steps:
[0173] Get N downsampling parameters;
[0174] The adjusted image is downsampled according to the N downsampling parameters to obtain N sampled images, the image size of the sampled images matches the corresponding downsampling parameters, and the image size of the sampled images is different from the image size of the adjusted image.
[0175] In one embodiment, the N restored images include a first restored image and a second restored image, the second restored image includes the remaining restored images of the N restored images except the first restored image, and the image size of the restored image is the same as the image size of the adjusted image; the processing unit 1503 is used to perform a weighted operation on the N restored images to obtain a blurred image, specifically for performing the following steps:
[0176] For any pixel point in the first restored image, according to the pixel information of any pixel point in the first restored image and the pixel information of the corresponding pixel points in each second restored image, obtaining weighted pixel information of any pixel point in the first restored image;
[0177] The blurred image is generated according to weighted pixel information of each pixel in the first restored image.
[0178] In one embodiment, the processing unit 1503 is used to perform the following steps when combining the blurred image and the image to be processed to obtain the target image corresponding to the image to be processed:
[0179] Performing brightness mapping processing on pixel information of each pixel point in the blurred image to obtain brightness data of each pixel point in the blurred image;
[0180] Performing desaturation processing on pixel information of each pixel point in the blurred image to obtain desaturated pixel information of each pixel point in the blurred image;
[0181] Generate a brightness compression image according to pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image;
[0182] Combining the brightness compressed image and the image to be processed to obtain a combined image;
[0183] Perform image special effects processing on the combined image to obtain a target image corresponding to the image to be processed.
[0184] In one embodiment, the processing unit 1503 is used to generate a brightness compression image according to the pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image, and is specifically used to perform the following steps:
[0185] For any pixel point in the blurred image, performing tone compression processing on pixel information and brightness data of any pixel point in the blurred image to obtain compressed pixel information of any pixel point in the blurred image;
[0186] Mixing the compressed pixel information and the desaturated pixel information of any pixel in the blurred image to obtain mixed pixel information of any pixel in the blurred image;
[0187] The brightness compression image is generated according to mixed pixel information corresponding to each pixel point in the blurred image.
[0188] In one embodiment, the processing unit 1503 is used to perform image special effects processing on the combined image to obtain a target image corresponding to the image to be processed, and is specifically used to perform the following steps:
[0189] The combined image is subjected to at least one of rotation blur processing, noise adding processing and overall blur processing to obtain a target image corresponding to the image to be processed.
[0190] In one embodiment, the processing unit 1503 is further configured to perform the following steps:
[0191] Receiving image processing request information sent by a terminal device, wherein the image processing request information carries the image to be processed;
[0192] In response to the image processing request information, sending image processing response information to the terminal device, the image processing response information is used to control the terminal device to display an image processing interface, the image processing interface includes a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control;
[0193] Receive color control parameters and special effect range parameters sent by the terminal device, the saturation parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the saturation slider control in the image processing interface, the hue parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the hue slider control in the image processing interface, the brightness parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the brightness slider control in the image processing interface, and the special effect range parameter is determined by the terminal device in response to a sliding operation on the special effect range slider control in the image processing interface.
[0194] Fig.15 The various units in the image processing device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can also be split into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the image processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0195] In one embodiment, the program can be executed by running on a general-purpose computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 8 A computer program for each step involved in part or all of the method shown in the figure is used to construct a computer program for each step involved in part or all of the method shown in the figure. Fig.15 The image processing apparatus shown in and the image processing method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0196] The image processing device provided in the embodiment of the present application can determine the special effect pixels and non-special effect pixels from the image to be processed based on the special effect range parameters, and can determine the special effect color parameters according to the saturation parameters, hue parameters and brightness parameters, so that the color of the target special effect of the target image matches the special effect color parameters, thereby making the image processing method have good versatility; the terminal device can obtain the image control parameters through the slider control, which is conducive to improving the user experience; when generating a target image presenting a luminous special effect, the adjusted image can be downsampled and the downsampled image can be blurred, which is conducive to obtaining a blurred image with good expressiveness, and at the same time can effectively reduce the amount of calculation of the image blur processing and improve the overall efficiency of image processing; the blurred image can be desaturated to effectively avoid oversaturation; the combined image can be further processed with image special effects (such as rotation blur processing, noise addition processing, overall blur processing, etc.), so that the blurred image with the target special effect is more expressive and ornamental; a target image presenting a luminous special effect or a background special effect of the target color can be generated, which enriches the types of image special effects, meets application requirements, and improves the user experience.
[0197] Based on the above method and device embodiments, the present application embodiment provides a computer device. Fig.16 , Fig.16 A structural block diagram of a computer device provided in an embodiment of the present application. Fig.16 The computer device shown can be the above Figure 1 The image processing device 102 in FIG. Fig.16 The computer device shown includes at least a processor 1601, an input interface 1602, an output interface 1603, and a computer-readable storage medium 1604. The processor 1601, the input interface 1602, the output interface 1603, and the computer-readable storage medium 1604 may be connected via a bus or other means.
[0198] The computer-readable storage medium 1604 may be stored in a memory of a computer device. The computer-readable storage medium 1604 is used to store a computer program. The computer program includes program instructions. The processor 1601 is used to execute the computer program stored in the computer-readable storage medium 1604. The processor 1601 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing a computer program, and is specifically suitable for loading and executing a computer program to implement a corresponding method flow or a corresponding function.
[0199] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, a computer program suitable for being loaded and executed by a processor is also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0200] In a specific implementation, the processor 1601 may load and execute a computer program stored in the computer-readable storage medium 1604 to implement the above-mentioned Figure 2 or Figure 8 In a specific implementation, the computer program in the computer-readable storage medium 1604 is loaded by the processor 1601 and executes the following steps:
[0201] Acquire image control parameters of the image to be processed, the image control parameters including color control parameters and special effect range parameters; adjust pixel information of each pixel point in the image to be processed according to the special effect range parameters and the color control parameters to obtain an adjusted image, wherein the pixel information of the pixel points presenting the target special effect in the adjusted image matches the color control parameters;
[0202] The adjusted image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
[0203] In one embodiment, the color control parameters include a saturation parameter, a hue parameter, and a lightness parameter; the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to adjust the pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter, and when the adjusted image is obtained, it is specifically used to perform the following steps:
[0204] Determine a special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter;
[0205] The pixel information of each pixel point in the image to be processed is adjusted according to the special effect range parameter and the special effect color parameter to obtain an adjusted image.
[0206] In one embodiment, when the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to determine the special effect color parameter according to the saturation parameter, the hue parameter, and the lightness parameter, it is specifically used to perform the following steps:
[0207] Obtaining a saturation threshold of the saturation parameter, a hue threshold of the hue parameter, and a brightness threshold of the brightness parameter;
[0208] Generate a three-dimensional feature parameter according to the saturation parameter, the hue parameter, the lightness parameter, the saturation threshold, the hue threshold and the lightness threshold;
[0209] The three-dimensional feature parameters are dimensionally converted to obtain four-dimensional feature parameters, and the four-dimensional feature parameters are determined as special effect color parameters.
[0210] In one embodiment, the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to adjust the pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter, and when the adjusted image is obtained, it is specifically used to perform the following steps:
[0211] Determine, according to the special effect range parameter and the pixel information of each pixel in the image to be processed in a preset channel, a label of each pixel in the image to be processed, wherein the label is used to indicate whether the corresponding pixel is a special effect pixel, and the special effect pixel is used to present a target special effect;
[0212] The pixel information of each pixel in the image to be processed is processed using the label of each pixel in the image to be processed to obtain a label image; the pixel information of the special effect pixel in the label image is matched with the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel in the label image is set as the preset pixel information;
[0213] Color adjustment processing is performed on pixel information of each pixel point in the label image according to the color control parameter to obtain the adjusted image.
[0214] In one embodiment, when the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to determine the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed in the preset channel, it is specifically used to perform the following steps:
[0215] According to the pixel information of the target pixel in the image to be processed in the preset channel, and the special effect upper limit parameter and the special effect lower limit parameter indicated by the special effect range parameter, the weight of the target pixel is obtained, and the target pixel is any pixel in the image to be processed;
[0216] The weight of the target pixel is normalized to obtain a label of the target pixel.
[0217] In one embodiment, the adjusted image includes non-special effect pixels and special effect pixels, and the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform combined processing on the adjusted image and the image to be processed, and when a target image corresponding to the image to be processed is obtained, the computer program is specifically used to perform the following steps:
[0218] Determine the pixel information of any special effect pixel point in the adjusted image as the pixel information of the corresponding pixel point in the target image corresponding to the image to be processed;
[0219] Determine original pixel points in the image to be processed corresponding to non-special effect pixel points in the adjusted image;
[0220] The pixel information of the original pixel in the image to be processed is determined as the pixel information of the corresponding pixel in the target image corresponding to the image to be processed. The target image is used to present a background effect of a target color, and the target color is determined according to the color control parameter.
[0221] In one embodiment, the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform combined processing on the adjusted image and the image to be processed, and when a target image corresponding to the image to be processed is obtained, the computer program is specifically used to perform the following steps:
[0222] Sampling the adjusted image to obtain N sampled images, where N is a positive integer;
[0223] Performing fuzzy processing on the N sampled images to obtain N fuzzy sampled images;
[0224] Performing image restoration processing on the N fuzzy sampled images to obtain N restored images;
[0225] Performing a weighted operation on the N restored images to obtain a blurred image;
[0226] The blurred image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a luminous special effect.
[0227] In one embodiment, the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform sampling processing on the adjusted image to obtain N sampled images, specifically for performing the following steps:
[0228] Get N downsampling parameters;
[0229] The adjusted image is downsampled according to the N downsampling parameters to obtain N sampled images, the image size of the sampled images matches the corresponding downsampling parameters, and the image size of the sampled images is different from the image size of the adjusted image.
[0230] In one embodiment, the N restored images include a first restored image and a second restored image, the second restored image includes the remaining restored images of the N restored images except the first restored image, and the image size of the restored image is the same as the image size of the adjusted image; the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform a weighted operation on the N restored images to obtain a blurred image, specifically for executing the following steps:
[0231] For any pixel point in the first restored image, according to the pixel information of any pixel point in the first restored image and the pixel information of the corresponding pixel points in each second restored image, obtaining weighted pixel information of any pixel point in the first restored image;
[0232] The blurred image is generated according to weighted pixel information of each pixel in the first restored image.
[0233] In one embodiment, the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform combined processing on the blurred image and the image to be processed, and when a target image corresponding to the image to be processed is obtained, the computer program is specifically used to perform the following steps:
[0234] Performing brightness mapping processing on pixel information of each pixel point in the blurred image to obtain brightness data of each pixel point in the blurred image;
[0235] Performing desaturation processing on pixel information of each pixel point in the blurred image to obtain desaturated pixel information of each pixel point in the blurred image;
[0236] Generate a brightness compression image according to pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image;
[0237] Combining the brightness compressed image and the image to be processed to obtain a combined image;
[0238] Perform image special effects processing on the combined image to obtain a target image corresponding to the image to be processed.
[0239] In one embodiment, when the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to generate a brightness compressed image according to the pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image, it is specifically used to perform the following steps:
[0240] For any pixel point in the blurred image, performing tone compression processing on pixel information and brightness data of any pixel point in the blurred image to obtain compressed pixel information of any pixel point in the blurred image;
[0241] Mixing the compressed pixel information and the desaturated pixel information of any pixel in the blurred image to obtain mixed pixel information of any pixel in the blurred image;
[0242] The brightness compression image is generated according to mixed pixel information corresponding to each pixel point in the blurred image.
[0243] In one embodiment, the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601 to perform image special effects processing on the combined image, and when a target image corresponding to the image to be processed is obtained, the computer program is specifically used to perform the following steps:
[0244] The combined image is subjected to at least one of rotation blur processing, noise adding processing and overall blur processing to obtain a target image corresponding to the image to be processed.
[0245] In one embodiment, when the computer program in the computer-readable storage medium 1604 is loaded and executed by the processor 1601, it is also used to perform the following steps:
[0246] Receiving image processing request information sent by a terminal device, wherein the image processing request information carries the image to be processed;
[0247] In response to the image processing request information, sending image processing response information to the terminal device, the image processing response information is used to control the terminal device to display an image processing interface, the image processing interface includes a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control;
[0248] Receive color control parameters and special effect range parameters sent by the terminal device, the saturation parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the saturation slider control in the image processing interface, the hue parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the hue slider control in the image processing interface, the brightness parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the brightness slider control in the image processing interface, and the special effect range parameter is determined by the terminal device in response to a sliding operation on the special effect range slider control in the image processing interface.
[0249] The computer device provided in the embodiment of the present application can determine the special effect pixels and non-special effect pixels from the image to be processed based on the special effect range parameters, and can determine the special effect color parameters according to the saturation parameters, hue parameters and brightness parameters, so that the color of the target special effect of the target image matches the special effect color parameters, thereby making the image processing method have good versatility; the terminal device can obtain the image control parameters through the slider control, which is conducive to improving the user experience; when generating a target image presenting a luminous special effect, the adjusted image can be downsampled and the downsampled image can be blurred, which is conducive to obtaining a blurred image with good expressiveness, and at the same time can effectively reduce the amount of calculation of the image blur processing and improve the overall efficiency of image processing; the blurred image can be desaturated to effectively avoid oversaturation; the combined image can be further processed with image special effects (such as rotation blur processing, noise addition processing, overall blur processing, etc.), so that the blurred image with the target special effect is more expressive and ornamental; a target image presenting a luminous special effect or a background special effect of the target color can be generated, which enriches the types of image special effects, meets application requirements, and improves the user experience.
[0250] The embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed on a computer device, the computer device executes the steps in the method embodiments of the present application to implement the image processing method provided by the embodiment of the present application. The specific implementation method can be referred to the above description, which will not be repeated here.
[0251] The embodiment of the present application also provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device executes the steps in the various method embodiments of the present application to implement the image processing method provided by the embodiment of the present application. The specific implementation method can be referred to the above description, which will not be repeated here.
[0252] It is appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technical objects can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit containing the function of the module or unit.
[0253] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted by a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0254] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field within the technical scope disclosed in the present application can be easily thought of for changes or replacements, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire image control parameters of the image to be processed, wherein the image control parameters include color control parameters and special effect range parameters; Adjusting pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein the pixel information of the pixel point presenting the target special effect in the adjusted image matches the color control parameter; The adjusted image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
2. The method according to claim 1, characterized in that The color control parameters include saturation parameter, hue parameter and brightness parameter; The step of adjusting pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image includes: Determine a special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter; The pixel information of each pixel point in the image to be processed is adjusted according to the special effect range parameter and the special effect color parameter to obtain an adjusted image.
3. The method according to claim 2, characterized in that Determining the special effect color parameter according to the saturation parameter, the hue parameter and the lightness parameter includes: Obtaining a saturation threshold of the saturation parameter, a hue threshold of the hue parameter, and a brightness threshold of the brightness parameter; Generate a three-dimensional feature parameter according to the saturation parameter, the hue parameter, the lightness parameter, the saturation threshold, the hue threshold and the lightness threshold; The three-dimensional feature parameters are dimensionally converted to obtain four-dimensional feature parameters, and the four-dimensional feature parameters are determined as special effect color parameters.
4. The method according to any one of claims 1 to 3, characterized in that: The step of adjusting pixel information of each pixel point in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image includes: Determine, according to the special effect range parameter and the pixel information of each pixel in the image to be processed in a preset channel, a label of each pixel in the image to be processed, wherein the label is used to indicate whether the corresponding pixel is a special effect pixel, and the special effect pixel is used to present a target special effect; The pixel information of each pixel in the image to be processed is processed using the label of each pixel in the image to be processed to obtain a label image; the pixel information of the special effect pixel in the label image is matched with the pixel information of the corresponding pixel in the image to be processed, and the pixel information of the non-special effect pixel in the label image is set as the preset pixel information; Color adjustment processing is performed on pixel information of each pixel point in the label image according to the color control parameter to obtain the adjusted image.
5. The method according to claim 4, characterized in that Determining the label of each pixel in the image to be processed according to the special effect range parameter and the pixel information of each pixel in the image to be processed in a preset channel includes: According to the pixel information of the target pixel in the image to be processed in the preset channel, and the special effect upper limit parameter and the special effect lower limit parameter indicated by the special effect range parameter, the weight of the target pixel is obtained, and the target pixel is any pixel in the image to be processed; The weight of the target pixel is normalized to obtain a label of the target pixel.
6. The method according to claim 4, characterized in that The adjusted image includes non-special effect pixels and special effect pixels, and the combined processing of the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed includes: Determine the pixel information of any special effect pixel point in the adjusted image as the pixel information of the corresponding pixel point in the target image corresponding to the image to be processed; Determine original pixel points in the image to be processed corresponding to non-special effect pixel points in the adjusted image; The pixel information of the original pixel in the image to be processed is determined as the pixel information of the corresponding pixel in the target image corresponding to the image to be processed. The target image is used to present a background effect of a target color, and the target color is determined according to the color control parameter.
7. The method according to any one of claims 1 to 3, characterized in that: The combining and processing the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed includes: Sampling the adjusted image to obtain N sampled images, where N is a positive integer; Performing fuzzy processing on the N sampled images to obtain N fuzzy sampled images; Performing image restoration processing on the N fuzzy sampled images to obtain N restored images; Performing a weighted operation on the N restored images to obtain a blurred image; The blurred image and the image to be processed are combined to obtain a target image corresponding to the image to be processed, and the target image is used to present a luminous special effect.
8. The method according to claim 7, characterized in that The step of sampling the adjusted image to obtain N sampled images includes: Get N downsampling parameters; The adjusted image is downsampled according to the N downsampling parameters to obtain N sampled images, the image size of the sampled images matches the corresponding downsampling parameters, and the image size of the sampled images is different from the image size of the adjusted image.
9. The method according to claim 7, characterized in that The N restored images include a first restored image and a second restored image, the second restored image includes the remaining restored images of the N restored images except the first restored image, and the image size of the restored image is the same as the image size of the adjusted image; The step of performing a weighted operation on the N restored images to obtain a blurred image includes: For any pixel point in the first restored image, according to the pixel information of any pixel point in the first restored image and the pixel information of the corresponding pixel points in each second restored image, obtaining weighted pixel information of any pixel point in the first restored image; The blurred image is generated according to weighted pixel information of each pixel in the first restored image.
10. The method according to claim 7, characterized in that The combining and processing the blurred image and the image to be processed to obtain a target image corresponding to the image to be processed includes: Performing brightness mapping processing on pixel information of each pixel point in the blurred image to obtain brightness data of each pixel point in the blurred image; Performing desaturation processing on pixel information of each pixel point in the blurred image to obtain desaturated pixel information of each pixel point in the blurred image; Generate a brightness compression image according to pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image; Combining the brightness compressed image and the image to be processed to obtain a combined image; Perform image special effects processing on the combined image to obtain a target image corresponding to the image to be processed.
11. The method according to claim 10, characterized in that The step of generating a brightness compressed image according to pixel information, brightness data and desaturated pixel information of each pixel point in the blurred image comprises: For any pixel point in the blurred image, performing tone compression processing on pixel information and brightness data of any pixel point in the blurred image to obtain compressed pixel information of any pixel point in the blurred image; Mixing the compressed pixel information and the desaturated pixel information of any pixel in the blurred image to obtain mixed pixel information of any pixel in the blurred image; The brightness compression image is generated according to mixed pixel information corresponding to each pixel point in the blurred image.
12. The method according to claim 10, characterized in that The performing image special effects processing on the combined image to obtain a target image corresponding to the image to be processed includes: The combined image is subjected to at least one of rotation blur processing, noise adding processing and overall blur processing to obtain a target image corresponding to the image to be processed.
13. The method according to claim 2 or 3, characterized in that: The method further comprises: Receiving image processing request information sent by a terminal device, wherein the image processing request information carries the image to be processed; In response to the image processing request information, sending image processing response information to the terminal device, the image processing response information is used to control the terminal device to display an image processing interface, the image processing interface includes a saturation slider control, a hue slider control, a brightness slider control, and a special effect range slider control; Receive color control parameters and special effect range parameters sent by the terminal device, the saturation parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the saturation slider control in the image processing interface, the hue parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the hue slider control in the image processing interface, the brightness parameter in the color control parameters is determined by the terminal device in response to a sliding operation on the brightness slider control in the image processing interface, and the special effect range parameter is determined by the terminal device in response to a sliding operation on the special effect range slider control in the image processing interface.
14. An image processing device, characterized in that: include: An acquisition unit, used for acquiring image control parameters of the image to be processed, wherein the image control parameters include color control parameters and special effect range parameters; an adjusting unit, configured to adjust pixel information of each pixel in the image to be processed according to the special effect range parameter and the color control parameter to obtain an adjusted image, wherein the pixel information of the pixel presenting the target special effect in the adjusted image matches the color control parameter; The processing unit is used to perform combined processing on the adjusted image and the image to be processed to obtain a target image corresponding to the image to be processed, and the target image is used to present a target special effect.
15. A computer device, characterized in that: The computer device comprises: a processor suitable for implementing a computer program; A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by the processor and implementing the image processing method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and implementing the image processing method according to any one of claims 1 to 13.
17. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 13 is implemented.
