Method, device, apparatus and computer readable medium for acquiring images

By extracting the image features of the to-processed image and the reference image and calculating the smoothing parameters, the problem of the color migration method being poor when the color characteristics are large, and the color of the target image is achieved is achieved.

CN112348910BActive Publication Date: 2025-02-11BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011162662.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2025-02-11
Estimated Expiration
2041-02-11

AI Technical Summary

Technical Problem

The existing color migration methods are not good enough when the color characteristics of the to-process image and the reference image are different, resulting in the image color not natural enough after migration.

Method used

By extracting image features of the to-processed image and the reference image, the first type and the second type of image features are obtained, and the smoothing parameters are calculated based on these features, for characterizing the rate of change of feature conversion, thereby generating a target image.

Benefits of technology

In the case of large differences in color characteristics, adjust the migration of color characteristics through smoothing parameters to ensure that the color of the target image is more natural and realistic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348910B_ABST
    Figure CN112348910B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a method, device, electronic device and computer-readable medium for acquiring an image. A specific implementation of the method includes: receiving an image to be processed and a reference image, wherein the image style of the reference image is the target image style of the image to be processed; extracting image features of the image to be processed to obtain first-type image features; extracting image features of the reference image to obtain second-type image features; obtaining a smoothing parameter based on the first-type image features and the second-type image features, wherein the smoothing parameter is used to characterize the rate of change of converting the second-type image features into the first-type image features; generating a target image based on the smoothing parameter, the first-type image features, the second-type image features and the image to be processed. This implementation realizes the migration of image colors, and the image color features can be adjusted by the smoothing parameter, thereby improving the migration effect of the color features and making the image color of the target image more natural.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of image processing, and in particular to a method, apparatus, device, and computer-readable medium for acquiring an image. Background Art

[0002] Image color migration is a research direction in the field of computer vision. Specifically, the color features of the reference image are migrated to the image to be processed to obtain a target image with the color features of the reference image and the shape features of the image to be processed. There are some problems with existing color migration methods. For example, if the color features of the image to be processed and the reference image are very different, the color feature migration effect may not be good enough, resulting in the problem that the color of the migrated image is not natural enough. Summary of the invention

[0003] The content of this disclosure is used to introduce concepts in a brief form, and these concepts will be described in detail in the specific implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection. Some embodiments of the present disclosure propose methods, devices, equipment and computer-readable media for acquiring images to solve the technical problems mentioned in the above background technology section.

[0004] In a first aspect, some embodiments of the present disclosure provide a method for acquiring an image, the method comprising: receiving an image to be processed and a reference image, the image style of the reference image being a target image style of the image to be processed; extracting image features of the image to be processed to obtain first-type image features; extracting image features of the reference image to obtain second-type image features; obtaining a smoothing parameter based on the first-type image features and the second-type image features, the smoothing parameter being used to characterize the rate of change of converting the second-type image features into the first-type image features; and generating a target image based on the smoothing parameter, the first-type image features, the second-type image features and the image to be processed.

[0005] In a second aspect, some embodiments of the present disclosure provide a device for acquiring an image, the device comprising: a receiving unit, configured to receive an image to be processed and a reference image, the image style of the reference image being a target image style of the image to be processed; a first extraction unit, configured to extract image features of the image to be processed to obtain first-type image features; a second extraction unit, configured to extract image features of the reference image to obtain second-type image features; a first generation unit, configured to obtain a smoothing parameter based on the first-type image features and the second-type image features, the smoothing parameter being used to characterize the rate of change of converting the second-type image features into the first-type image features; and a second generation unit, configured to generate a target image based on the smoothing parameter, the first-type image features, the second-type image features and the image to be processed.

[0006] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for acquiring an image as in the first aspect.

[0007] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for acquiring an image according to the first aspect is implemented.

[0008] One of the above-mentioned embodiments of the present disclosure has the following beneficial effects: extracting the first type of image features of the image to be processed and the second type of image features of the reference image can make the subsequent feature migration more accurate. A smoothing parameter is obtained based on the first type of image features and the second type of image features, and the smoothing parameter can be used to characterize the rate of change of converting the second type of image features into the first type of image features. When the color features of the image to be processed and the reference image are significantly different, the migration of the color features can be adjusted by the smoothing parameter, so that the image color of the target image obtained after the color feature migration is more natural. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0010] Figure 1 is a schematic diagram of an application scenario of a method for acquiring an image according to some embodiments of the present disclosure;

[0011] Figure 2 is a flow chart of some embodiments of a method for acquiring an image according to the present disclosure;

[0012] Figure 3 are flow charts of other embodiments of the method for acquiring an image according to the present disclosure;

[0013] Figure 4 are flow charts of still further embodiments of the method for acquiring an image according to the present disclosure;

[0014] Figure 5 is a schematic structural diagram of some embodiments of an apparatus for acquiring an image according to the present disclosure;

[0015] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0019] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0021] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0022] Figure 1 It is a schematic diagram of an application scenario of the method for acquiring an image according to some embodiments of the present disclosure.

[0023] exist Figure 1In the application scenario, first, the electronic device 101 can receive the image to be processed 102 and the reference image 103. Then, the electronic device 101 can extract the first type of image feature 104 of the image to be processed 102 and the second type of image feature 105 of the reference image 103. The first type of image feature 104 can be used to represent the color feature of the image to be processed 102. The second type of image feature 105 can be used to represent the color feature of the reference image 103. The electronic device 101 can process the first type of image feature 104 and the second type of image feature 105, and the obtained smoothing parameter 106 can be (0.5, 0.5). Among them, the first "0.5" in (0.5, 0.5) represents the variance smoothing parameter of the first type of image feature 104 and the second type of image feature 105; the second "0.5" represents the mean smoothing parameter of the first type of image feature 104 and the second type of image feature 105. The smoothing parameter 106 can be used to characterize the change rate of converting the second type of image feature 105 into the first type of image feature 104. The smoothing parameter 106 can control the migration ratio of the color feature, so as to make the color migration of the image more natural. The electronic device 101 can perform matrix operation on the image to be processed 102, the first type of image feature 104, the second type of image feature 105 and the smoothing parameter 106 to obtain the target image 107.

[0024] It should be noted that the electronic device 101 can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0025] It should be understood that Figure 1 The number of electronic devices in the embodiment is only for illustration. Any number of electronic devices may be provided according to implementation requirements.

[0026] Continue to refer Figure 2 , shows a process 200 of some embodiments of the method for acquiring an image according to the present disclosure. The method for acquiring an image comprises the following steps:

[0027] Step 201: receiving an image to be processed and a reference image.

[0028] In some embodiments, the execution subject of the method of acquiring an image (eg Figure 1The electronic device 101 shown in the figure can receive images via a wired connection or a wireless connection. The above images include images to be processed and reference images. It should be noted that the above wireless connection methods may include but are not limited to 3G / 4G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other wireless connection methods currently known or to be developed in the future.

[0029] In some embodiments, the above-mentioned image to be processed and the reference image can be obtained from an existing public database, or can be taken with a camera. The above-mentioned image to be processed and the reference image can be any image. As an example, the above-mentioned image to be processed can be an image showing a chick, a peacock, a blue sky, etc., and the above-mentioned reference image can be an image showing a forest, a wine bottle, a rainbow, etc. The image style of the reference image can be the target image style of the image to be processed. The target image style can be, for example, a retro style, a nostalgic style, etc.

[0030] Step 202: extract image features of the image to be processed to obtain first type image features.

[0031] In some embodiments, based on the image to be processed in step 201, the execution subject (eg Figure 1 The electronic device shown in the figure) extracts the first type of image features of the above-mentioned image to be processed, and the feature extraction of the image to be processed can be performed through a network model or a feature extraction algorithm. As an example, the network model can be a LeNet network, an AlexNet network, a VGG network, a Nin network, a GooLeNet network, etc. As an example, the feature extraction algorithm can be a scale-invariant features transform algorithm (Scale-invariant features transform), an accelerated robust feature algorithm (Speeded Up RobustFeatures), a directional gradient histogram algorithm (Histogram of Oriented Gradient), and a Gaussian function difference algorithm (Difference of Gaussian). As an example, the first type of image features may include the mean of each channel of the image to be processed and the variance of each channel.

[0032] Step 203: extract image features of the reference image to obtain second type image features.

[0033] In some embodiments, based on the reference image in step 201, the execution subject (eg Figure 1The electronic device shown in the figure) extracts the first type of image features of the above-mentioned reference image, and the reference image can be feature extracted by a network model or a feature extraction algorithm. As an example, the network model can be a LeNet network, an AlexNet network, a VGG network, a Nin network, a GooLeNet network, etc. As an example, the feature extraction algorithm can be a scale-invariant features transform algorithm (Scale-invariant features transform), an accelerated robust features algorithm (Speeded Up Robust Features), a directional gradient histogram algorithm (Histogram of Oriented Gradient), and a Gaussian function difference algorithm (Difference of Gaussian). As an example, the second type of image features may include the mean of each channel of the reference image and the variance of each channel.

[0034] Step 204: Obtain a smoothing parameter according to the first type of image features and the second type of image features.

[0035] In an optional implementation of some embodiments, a variance change rate and a mean change rate are generated according to the first type of image features and the second type of image features; and a smoothing parameter is generated according to the variance change rate and the mean change rate.

[0036] The variance change rate can be obtained by the following steps: for the variance of each channel in the first type of image feature, the difference between the variance and the variance of the corresponding channel in the second type of image feature is calculated, and the ratio of the variance difference to the variance is set as the initial variance change rate of the channel. The initial variance change rates of other channels are obtained in the same way. The initial variance change rate with the smallest value is set as the final variance change rate.

[0037] The mean change rate can be obtained by the following steps: for the mean of each channel in the first type of image feature, calculate the difference between the mean and the mean of the corresponding channel in the second type of image feature, and set the ratio of the mean difference to the mean as the initial mean change rate of the channel. Similarly, the initial mean change rates of other channels are obtained. The initial mean change rate with the smallest value is set as the final mean change rate.

[0038] For example, on channel A, that is, based on the variance of channel A in the first type of image feature, the difference between the variance of channel A in the first type of image feature and the variance of channel A in the second type of image feature is calculated, and the ratio of the variance difference to the variance of channel A in the first type of image feature is set as the variance change rate on channel A. Similarly, the variance change rates of other channels are obtained. The smallest value among the variance change rates of all channels is selected as the final variance change rate. The mean change rate refers to the step of the variance change rate, and the smallest value among the mean change rates of all channels is selected as the final mean change rate. As an example, the mean change rate of each channel can be (0.3, 0.6, 0.7), and the final mean change rate is 0.3. The variance change rate of each channel can be (-0.6, 0.2, 0.3), and the final variance change rate is -0.6.

[0039] In optional implementations of some embodiments, variance smoothing parameters are generated based on a preset variance threshold and variance change rate; mean smoothing parameters are generated based on a preset mean threshold and mean change rate; and smoothing parameters are generated based on the variance smoothing parameters and the mean smoothing parameters.

[0040] As an example, if the variance threshold is less than -0.5 or greater than positive 1, the variance smoothing parameter is 0.5, otherwise the variance smoothing parameter is 0; if the mean threshold is less than -0.1, the mean smoothing parameter is 0.5, otherwise the mean smoothing parameter is 0. If the variance change rate is 0.3 and the mean change rate is -0.3, the variance smoothing parameter is 0 and the mean smoothing parameter is 0.5. Finally, the resulting smoothing parameter is (0, 0.5).

[0041] Step 205: Generate a target image according to the smoothing parameter, the first type image feature, the second type image feature and the image to be processed.

[0042] In some embodiments, the smoothing parameter, the first type of image features, the second type of image features and the image to be processed may be fused by matrix operation to obtain a target image.

[0043] Some embodiments of the present disclosure provide methods that can obtain first-type image features based on the image to be processed. Second-type image features can be obtained based on the reference image. Thus, a smoothing parameter can be obtained based on the first-type image features and the second-type image features. The smoothing parameter is used to characterize the rate of change of converting the second-type image features into the first-type image features. When the color features of the image to be processed and the reference image are significantly different, the migration of the color features can be adjusted by the smoothing parameter so that the image color of the target image obtained after the color feature migration is more natural.

[0044] Further references Figure 3, which shows a process 300 of another embodiment of a method for acquiring an image. The process 300 of the method for acquiring an image comprises the following steps:

[0045] Step 301: receiving an image to be processed and a reference image.

[0046] Step 302: Perform feature processing on the image to be processed through the type channel to obtain a first type of image.

[0047] In some embodiments, the above-mentioned type channels may include at least one of the following: a brightness channel, a first color channel, and a second color channel. As an example, the above-mentioned type channels may be three channels corresponding to the Lab color model, where: L represents the brightness channel, and a and b are two color channels. The colors included in a may range from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value), and the colors included in b may range from bright blue (low brightness value) to gray (medium brightness value) to yellow (high brightness value).

[0048] Step 303: Obtain a first type mean and a first type variance according to the mean and variance of each channel parameter in the type channel of the first type image.

[0049] In some embodiments, as an example, the type channel may be a Lab color channel, and the means of the three channel parameters L, a, and b in the first type image are calculated respectively, and the first type mean corresponding to the Lab color channel may be [83, 196, 61]. Among them, "83" corresponds to the mean of the L channel parameter; "196" corresponds to the mean of the a channel parameter; and "61" corresponds to the mean of the b channel parameter. Then, the variances of the three channel parameters L, a, and b in the first type image are calculated respectively, and the first type variance corresponding to the Lab color channel may be [13, 21, 23].

[0050] Step 304: Generate a first type of image feature according to the first type mean and the first type variance.

[0051] In some embodiments, as an example, the first type mean may be [53, 136, 62], and the first type variance may be [20, 31, 14]. The first type mean is integrated into a vector (53, 136, 62), and the first type variance is integrated into a vector (20, 31, 14). The above two sets of vectors are used as the first type of image features.

[0052] Step 305: extract image features of the reference image to obtain second type image features.

[0053] Step 306: Obtain a smoothing parameter according to the first type of image features and the second type of image features.

[0054] Step 307: Generate a target image according to the smoothing parameter, the first type image feature, the second type image feature and the image to be processed.

[0055] In some embodiments, the specific implementation of steps 301, 305, 306, and 307 and the technical effects thereof can be referred to in Figure 2 Steps 201, 203, 204, and 205 in the corresponding embodiments are not described in detail here.

[0056] from Figure 3 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3 The process 300 of the method for acquiring an image in some corresponding embodiments embodies the step of extracting the first type of image features. The first type of image features are determined by the first type mean and the first type variance obtained by the image to be processed through the type channel. Thus, the image features under the type channel can be obtained, and the color features of the image to be processed can be extracted more accurately.

[0057] Further references Figure 4 , which shows a process 400 of another embodiment of a method for acquiring an image. The process 400 of the method for acquiring an image comprises the following steps:

[0058] Step 401: receiving an image to be processed and a reference image.

[0059] Step 402: extract image features of the image to be processed to obtain first type image features.

[0060] Step 403: Perform feature processing on the reference image through the type channel to obtain a second type image.

[0061] In some embodiments, the above-mentioned type channels may include at least one of the following: a brightness channel, a first color channel, and a second color channel. As an example, the above-mentioned type channels may be three channels corresponding to the Lab color model, where: L represents the brightness channel, and a and b are two color channels. The colors included in a may range from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value), and the colors included in b may range from bright blue (low brightness value) to gray (medium brightness value) to yellow (high brightness value).

[0062] Step 404: Obtain a second type mean and a second type variance according to the mean and variance of each channel parameter in the type channel of the second type image.

[0063] In some embodiments, as an example, the type channel may be a Lab color channel, and the means of the three channel parameters L, a, and b in the second type image are calculated respectively, and the second type mean corresponding to the Lab color channel may be [63, 156, 31]. Then, the variances of the three channel parameters L, a, and b in the second type image are calculated respectively, and the first type variance corresponding to the Lab color channel may be [23, 22, 34].

[0064] Step 405: Generate a second type of image feature according to the second type mean and the second type variance.

[0065] In some embodiments, as an example, the second type mean may be [51, 126, 82], and the second type variance may be [11, 32, 34]. The second type mean is integrated into a vector (51, 126, 82), and the second type variance is integrated into a vector (11, 32, 34). The above two sets of vectors are used as the first type of image features.

[0066] Step 406: Obtain a smoothing parameter according to the first type of image features and the second type of image features.

[0067] Step 407: Generate a target image according to the smoothing parameter, the first type image feature, the second type image feature and the image to be processed.

[0068] In some embodiments, the specific implementation of steps 401, 402, 406, and 407 and the technical effects thereof can be referred to in Figure 2 Steps 201, 202, 204, and 205 in the corresponding embodiments are not described in detail here.

[0069] from Figure 4 It can be seen that Figure 3 Compared with the description of some corresponding embodiments, Figure 4 The process 400 of the method for acquiring an image in some corresponding embodiments embodies the step of extracting the second type image feature. The second type image feature is determined by the second type mean and the second type variance obtained by the reference image through the type channel. Thus, the image feature under the type channel can be obtained, and the color feature of the reference image can be extracted more accurately.

[0070] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a device for acquiring an image. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0071] like Figure 5As shown, in some embodiments, the device 500 for acquiring an image includes: a receiving unit 501, configured to receive an image to be processed and a reference image, the image style of the reference image being the target image style of the image to be processed; a first extraction unit 502, configured to extract image features of the image to be processed to obtain first-type image features; a second extraction unit 503, configured to extract image features of the reference image to obtain second-type image features; a first generation unit 504, configured to obtain a smoothing parameter based on the first-type image features and the second-type image features, the smoothing parameter being used to characterize the rate of change of converting the second-type image features into the first-type image features; a second generation unit 505, configured to generate a target image based on the smoothing parameter, the first-type image features, the second-type image features and the image to be processed.

[0072] In an optional implementation of some embodiments, the first extraction unit 502 is further configured to: perform feature processing on the image to be processed through a type channel to obtain a first type image, the type channel including at least one of the following: a brightness channel, a first color channel, and a second color channel; obtain a first type mean and a first type variance based on the mean and variance of each channel parameter in the type channel of the first type image; generate a first type image feature based on the first type mean and the first type variance.

[0073] In an optional implementation of some embodiments, the second extraction unit 503 is further configured to: perform feature processing on the reference image through a type channel to obtain a second type image; obtain a second type mean and a second type variance based on the mean and variance of each channel parameter in the type channel of the second type image; and generate second type image features based on the second type mean and the second type variance.

[0074] In an optional implementation of some embodiments, the first generating unit 504 is further configured to: generate a variance change rate and a mean change rate according to the first type of image features and the second type of image features; and generate a smoothing parameter according to the variance change rate and the mean change rate.

[0075] In an optional implementation of some embodiments, the first generating unit 504 is further configured to: generate a variance smoothing parameter based on a preset variance threshold and a variance change rate; generate a mean smoothing parameter based on a preset mean threshold and a mean change rate; generate a smoothing parameter based on the variance smoothing parameter and the mean smoothing parameter.

[0076] It is understood that the storage units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0077] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0078] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0079] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0080] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0081] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0082] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0083] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: receives an image to be processed and a type image, the image style of the type image being the target image style of the image to be processed; extracts first type image features and second type image features of the type image; fuses the first type image features with the image to be processed to obtain a first image; fuses the second type image features with the image to be processed to obtain a second image; fuses the first image and the second image by adjusting the weights to obtain a target image of the target image style.

[0084] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0085] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0086] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a first extraction unit, a second extraction unit, a first generation unit, and a second generation unit. The names of these units do not constitute limitations on the units themselves in some cases, for example, the receiving unit may also be described as a "unit for receiving an image to be processed and a reference image".

[0087] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0088] According to one or more embodiments of the present disclosure, a method for acquiring an image is provided, comprising: receiving an image to be processed and a reference image, wherein the image style of the reference image is a target image style of the image to be processed; extracting image features of the image to be processed to obtain first-type image features; extracting image features of the reference image to obtain second-type image features; obtaining a smoothing parameter based on the first-type image features and the second-type image features, wherein the smoothing parameter is used to characterize the rate of change of converting the second-type image features into the first-type image features; and generating a target image based on the smoothing parameter, the first-type image features, the second-type image features, and the image to be processed.

[0089] According to one or more embodiments of the present disclosure, image features of an image to be processed are extracted to obtain first-type image features, including: performing feature processing on the image to be processed through a type channel to obtain a first-type image, the type channel including at least one of the following: a brightness channel, a first color channel, and a second color channel; obtaining a first-type mean and a first-type variance based on the mean and variance of each channel parameter in the type channel of the first-type image; generating first-type image features based on the first-type mean and the first-type variance.

[0090] According to one or more embodiments of the present disclosure, image features of a reference image are extracted to obtain second-type image features, including: performing feature processing on the reference image through a type channel to obtain a second-type image; obtaining a second-type mean and a second-type variance based on the mean and variance of each channel parameter in the type channel of the second-type image; and generating second-type image features based on the second-type mean and the second-type variance.

[0091] According to one or more embodiments of the present disclosure, a smoothing parameter is obtained according to the first type of image features and the second type of image features, including: generating a variance change rate and a mean change rate according to the first type of image features and the second type of image features; generating a smoothing parameter according to the variance change rate and the mean change rate.

[0092] According to one or more embodiments of the present disclosure, smoothing parameters are generated according to the variance change rate and the mean change rate, including: generating variance smoothing parameters according to a preset variance threshold and variance change rate; generating mean smoothing parameters according to a preset mean threshold and mean change rate; generating smoothing parameters according to the variance smoothing parameters and the mean smoothing parameters.

[0093] According to one or more embodiments of the present disclosure, there is provided a device for acquiring an image, comprising: a receiving unit, configured to receive an image to be processed and a reference image, the image style of the reference image being a target image style of the image to be processed; a first extraction unit, configured to extract image features of the image to be processed to obtain first-type image features; a second extraction unit, configured to extract image features of the reference image to obtain second-type image features; a first generation unit, configured to obtain a smoothing parameter based on the first-type image features and the second-type image features, the smoothing parameter being used to characterize the rate of change of converting the second-type image features into the first-type image features; and a second generation unit, configured to generate a target image based on the smoothing parameter, the first-type image features, the second-type image features and the image to be processed.

[0094] According to one or more embodiments of the present disclosure, the first extraction unit is further configured to: perform feature processing on the image to be processed through a type channel to obtain a first type image, the type channel including at least one of the following: a brightness channel, a first color channel, and a second color channel; obtain a first type mean and a first type variance based on the mean and variance of each channel parameter in the type channel of the first type image; generate a first type image feature based on the first type mean and the first type variance.

[0095] According to one or more embodiments of the present disclosure, the second extraction unit is further configured to: perform feature processing on the reference image through a type channel to obtain a second type image; obtain a second type mean and a second type variance based on the mean and variance of each channel parameter in the type channel of the second type image; and generate second type image features based on the second type mean and the second type variance.

[0096] According to one or more embodiments of the present disclosure, the first generating unit is further configured to: generate variance change rate and mean change rate according to the first type of image features and the second type of image features; generate a smoothing parameter according to the variance change rate and the mean change rate.

[0097] According to one or more embodiments of the present disclosure, the first generating unit is further configured to: generate a variance smoothing parameter based on a preset variance threshold and a variance change rate; generate a mean smoothing parameter based on a preset mean threshold and a mean change rate; generate a smoothing parameter based on the variance smoothing parameter and the mean smoothing parameter.

[0098] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A method for acquiring an image, comprising: Receiving an image to be processed and a reference image, wherein the image style of the reference image is a target image style of the image to be processed; Extracting image features of the image to be processed to obtain first type image features; Extracting image features of the reference image to obtain second type image features; Obtaining a smoothing parameter according to the first type of image features and the second type of image features, wherein the smoothing parameter is used to characterize a rate of change of converting the second type of image features into the first type of image features; Generate a target image according to the smoothing parameter, the first type of image features, the second type of image features and the image to be processed; The smoothing parameter is obtained according to the variance change rate and the mean change rate, and specifically includes: Generate a variance smoothing parameter according to a preset variance threshold and the variance change rate; Generate a mean smoothing parameter according to a preset mean threshold and the mean change rate; A smoothing parameter is generated according to the variance smoothing parameter and the mean smoothing parameter.

2. The method according to claim 1, wherein: The step of extracting the image features of the image to be processed to obtain the first type of image features includes: Performing feature processing on the image to be processed through a type channel to obtain a first type image, wherein the type channel includes at least one of the following: a brightness channel, a first color channel, and a second color channel; Obtaining a first type mean and a first type variance according to a mean and a variance of each channel parameter in the type channel of the first type image; The first type of image features is generated according to the first type mean and the first type variance.

3. The method according to claim 2, wherein: The step of extracting the image features of the reference image to obtain the second type of image features includes: Performing feature processing on the reference image through the type channel to obtain a second type image; Obtaining a second type mean and a second type variance according to a mean and a variance of each channel parameter in the type channel of the second type image; The second type of image feature is generated according to the second type mean and the second type variance.

4. The method according to claim 3, wherein: The obtaining of the smoothing parameter according to the first type of image features and the second type of image features comprises: Generate a variance change rate and a mean change rate according to the first type of image features and the second type of image features; A smoothing parameter is generated according to the variance change rate and the mean change rate.

5. A device for acquiring an image, comprising: A receiving unit is configured to receive an image to be processed and a reference image, wherein the image style of the reference image is a target image style of the image to be processed; A first extraction unit is configured to extract image features of the image to be processed to obtain first type image features; A second extraction unit is configured to extract image features of the reference image to obtain second type image features; a first generating unit, configured to obtain a smoothing parameter according to the first type of image features and the second type of image features, wherein the smoothing parameter is used to characterize a rate of change of converting the second type of image features into the first type of image features; A second generating unit is configured to generate a target image according to the smoothing parameter, the first type of image features, the second type of image features and the image to be processed; The smoothing parameter is obtained according to the variance change rate and the mean change rate, and the first generating unit is further configured to: Generate a variance smoothing parameter according to a preset variance threshold and the variance change rate; Generate a mean smoothing parameter according to a preset mean threshold and the mean change rate; A smoothing parameter is generated according to the variance smoothing parameter and the mean smoothing parameter.

6. The device for acquiring an image according to claim 5, wherein: The first extraction unit is further configured to: Performing feature processing on the image to be processed through a type channel to obtain a first type image, wherein the type channel includes at least one of the following: a brightness channel, a first color channel, and a second color channel; Obtaining a first type mean and a first type variance according to a mean and a variance of each channel parameter in the type channel of the first type image; The first type of image features is generated according to the first type mean and the first type variance.

7. The device for acquiring an image according to claim 6, wherein: The second extraction unit is further configured to: Performing feature processing on the reference image through the type channel to obtain a second type image; Obtaining a second type mean and a second type variance according to a mean and a variance of each channel parameter in the type channel of the second type image; The second type of image feature is generated according to the second type mean and the second type variance.

8. The device for acquiring an image according to claim 7, wherein: The first generating unit is further configured to: Generate a variance change rate and a mean change rate according to the first type of image features and the second type of image features; A smoothing parameter is generated according to the variance change rate and the mean change rate.

9. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Face changing method and device and electronic equipment

    CN111627076A

  • Image processing method and device, computer readable medium and terminal equipment

    CN111652830A