Image processing method, device and electronic device

By adjusting the brightness value and fusion processing of the image in the electronic device, the problem of poor image display effect when the electronic device highlights the subject is solved, and a more natural and efficient image processing effect is achieved.

CN113487700BActive Publication Date: 2025-02-07VIVO MOBILE COMM CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110692892.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2025-02-07
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

When the electronic device highlights the subject, the image display effect is poor and there are obvious traces of erasing.

Method used

By acquiring the first image including the background area and the target area, it is determined whether a certain condition is met. If it is not met, the target operation is performed, such as reducing the brightness value of the background area or increasing the brightness value of the target area, and then the adjustment is performed. the background and target area, obtain the second image.

Benefits of technology

By adjusting the brightness value, the target area is brighter than the background area, making it easier for users to see the target area visually, improving the image display effect and reducing erasing traces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113487700B_ABST
    Figure CN113487700B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method, device and electronic device, belonging to the field of image processing. The method comprises: obtaining a first image, the first image comprising a background area and a target area; when the first image does not meet a first condition, performing a target operation, the target operation comprising any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; fusing the background area with reduced brightness value and the first area to obtain a second image, the first area being the above-mentioned target area or the target area with increased brightness value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing, and specifically relates to an image processing method, device and electronic equipment. Background Art

[0002] With the development of electronic devices, users can process images through the photo editing function of electronic devices to obtain images with different display effects.

[0003] Currently, after a user takes an image with an electronic device, the user can use a photo editing application to process the image to highlight the subject. The electronic device can usually erase the background to achieve the purpose of highlighting the subject. For example, the electronic device can erase the background through mosaic and other methods.

[0004] However, processing the image in the above manner will cause the image to have obvious erasure marks, resulting in poor display effect of the image. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an image processing method, device and electronic device, which can solve the problem of poor image display effect when the electronic device highlights the display subject.

[0006] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising: acquiring a first image, the first image comprising a background area and a target area; when the first image does not satisfy a first condition, performing a target operation, the target operation comprising any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; fusing the background area with reduced brightness value and the first area to obtain a second image, the first area being the above-mentioned target area or the target area with increased brightness value.

[0007] In a second aspect, an embodiment of the present application provides an image processing device, which includes: an acquisition module, an execution module and a fusion module; the acquisition module is used to acquire a first image, which first image includes a background area and a target area; the execution module is used to perform a target operation when the first image acquired by the acquisition module does not meet a first condition, and the target operation includes any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; the fusion module is used to fuse the background area and the first area after the brightness value is reduced obtained by the execution module to obtain a second image, and the first area is the above-mentioned target area or the target area after the brightness value is increased.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0011] In an embodiment of the present application, the image processing device may first acquire a first image including a background area and a target area; then, the image processing device may perform a target operation when the first image does not meet the first condition, and the target operation includes any of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; finally, the image processing device may fuse the background area with reduced brightness value and the first area to obtain a second image, and the first area is the above-mentioned target area or the target area with increased brightness value. Through the above scheme, after acquiring the first image, the image processing device may first determine whether the first image does not meet the first condition. Then, when determining that the first image does not meet the first condition, the image processing device may perform processing to highlight the subject on the first image, for example, reducing the brightness value of the background area of ​​the first image, that is, increasing the brightness value of the target area in disguise, or increasing the brightness value of the target area and reducing the brightness value of the background area. Finally, the target image processing device may re-fuse the background area with reduced brightness value and the target area, or re-fuse the background area with reduced brightness value and the target area with increased brightness value to obtain the second image. In summary, due to the increase in the brightness value of the target area or the decrease in the brightness value of the background area, the target area will be brighter than the background area, making it easier for the user to see the target area visually. In this way, the second image obtained after adjusting the brightness value can better highlight the subject. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0013] Figure 2 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0014] Figure 3One of the structural schematic diagrams of an electronic device provided in an embodiment of the present application;

[0015] Figure 4 The second structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0017] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. And the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated before and after are in an "or" relationship.

[0018] The image processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0019] Figure 1 A schematic diagram of an image processing method provided in an embodiment of the present application includes steps 201 to 203:

[0020] Step 201: An image processing device acquires a first image.

[0021] The first image includes a background area and a target area.

[0022] In the embodiment of the present application, the first image may be an image captured by a camera of the image processing device, an image in a local buffer of the image processing device, an image downloaded by the image processing device, or any possible image, which is not limited in the embodiment of the present application. Exemplarily, in the case where the first image is an image captured by a camera of the image processing device, the first image may be a preview image or a captured image, which is not limited in the embodiment of the present application.

[0023] Exemplarily, the above-mentioned target area may include a target object, and the target object may be a person, a plant, an electrical appliance, etc., which is not limited in the embodiment of the present application.

[0024] Optionally, the image processing device can distinguish the first image to obtain the background area and the target area. Exemplarily, the image processing device can perform saliency detection on the image to distinguish the area where the main object is located (ie, the target area) and the background area in the image.

[0025] For example, the image processing device can use the open source pooling-based salient object detection (PoolNet) to perform saliency detection on the image, and obtain a mask based on the result of PoolNet. The image processing device can distinguish the main object (which can be referred to as the subject, i.e., the target area mentioned above) and the background (i.e., the background area mentioned above) in the image according to the mask. Then, the image processing device can use a large radius filter to perform image blurring on the output mask to soften the edge and obtain a soft edge mask.

[0026] It should be noted that the above-mentioned PoolNet detection and the process of using a large radius filter to blur the output mask to soften the edge can refer to the relevant technology and will not be repeated here.

[0027] Step 202: When the first image does not satisfy the first condition, the image processing apparatus performs a target operation.

[0028] The target operation includes any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area.

[0029] It should be noted that the brightness value in the embodiment of the present application can also be called a pixel value.

[0030] Optionally, in an embodiment of the present application, the first condition includes any one of the following: the difference between the average brightness of the target area and the average brightness of the background area is greater than or equal to a first threshold, and the average brightness of the background area is less than or equal to a second threshold.

[0031] In the embodiment of the present application, the image processing device can determine whether the first image satisfies the first condition, thereby determining whether it is necessary to perform a subject highlighting operation on the first image.

[0032] It should be noted that, when the first image satisfies the first condition, the image processing device may deem that the first image does not need to perform a subject highlighting operation. In this case, the image processing device may not perform any processing on the first image.

[0033] For example, the image processing device can calculate the average brightness of the subject and the background according to the soft edge mask. If the average brightness of the background is much smaller than the average brightness of the subject, such as a difference of 60, it means that the subject is sufficiently prominent. Or if the background brightness is extremely dark, such as the average brightness of the background is less than 30, the image processing device may not perform any processing on the first image. Otherwise, the image processing device may perform the target operation, that is, may perform the subject-highlighting operation on the first image.

[0034] Optionally, in an embodiment of the present application, the above-mentioned increasing the brightness value of the target area may specifically include the following steps: based on the original brightness value of each first pixel in the target area, non-linearly increasing the brightness value of each first pixel.

[0035] In an example, increasing the brightness value of the target area can be achieved by increasing the brightness value of the first image.

[0036] Exemplarily, the specific process of increasing the brightness value of each first pixel in the target area may be as follows:

[0037] Exemplarily, the image processing device may normalize the original image by dividing each pixel value by 255. Then, the image processing device may increase the brightness value of each first pixel point in the target area according to the following formula (1) and formula (2):

[0038]

[0039]

[0040] Among them, I p Represents the brightness value matrix of the image after the brightness value is increased. Input represents the brightness value matrix of the input original image (including the target area and the background area). The value is between 0 and 255. It represents the brightness value matrix output after the original image is normalized, with a value between 0 and 1. img_gray represents the image grayscale operation, and x represents the intermediate variable matrix.

[0041] It should be noted that the closer the value of a pixel in x is to 1, the darker the pixel is, and the closer the value of the pixel is to 0, the brighter the pixel is. When the pixel in x is equal to 0 or equal to 1, the output I p is equal to the normalized brightness matrix of the original image, that is,

[0042] It should be noted that when x is between 0 and 1, 4*(x-0.5) 2The value of is also between 0 and 1, so that the brightness values ​​of the normalized original image input, except for the brightness values ​​corresponding to the darkest points (i.e., pixels with brightness values ​​of 0) and the brightest points (i.e., pixels with brightness values ​​of 1), are divided by 4*(x-0.5). 2 After that, the value will increase nonlinearly. Therefore, the output I p Except for the brightness values ​​corresponding to the darkest point and the brightest point, all other values ​​increase nonlinearly, which is equivalent to nonlinearly enhancing the brightness of the image, that is, the image becomes brighter.

[0043] In this way, the image processing device can increase the brightness of the entire image and maintain the contrast of the entire image while keeping the brightness values ​​corresponding to the darkest and brightest points of the image (including the target area) unchanged.

[0044] Optionally, in an embodiment of the present application, the above-mentioned reduction of the brightness value of the background area may specifically include the following steps: based on the original brightness value of each second pixel in the background area, non-linearly reducing the brightness value of each second pixel.

[0045] In an example, reducing the brightness value of the target area can be achieved by reducing the brightness value of the first image.

[0046] Exemplarily, the specific process of reducing the brightness value of each second pixel in the background area may be as follows:

[0047] Exemplarily, the image processing device may normalize the brightness value matrix of the background area by dividing each pixel value by 255. Then, the image processing device may calculate the brightness value of each second pixel point in the background area according to the following formula (3) and formula (4):

[0048]

[0049]

[0050] Among them, I b represents the brightness value matrix of the image after the brightness value is reduced, and y represents the intermediate gray matrix.

[0051] It should be noted that the closer the value of a pixel in y is to 1, the brighter the pixel is, and the closer the value of the pixel is to 0, the darker the pixel is. When the pixel in y is equal to 0 or equal to 1, the output I b is equal to the normalized brightness matrix of the original image, that is,

[0052] It should be noted that when y is between 0 and 1, 4*(y-0.5) 2The value of is also between 0 and 1, so that the brightness values ​​of the normalized original image input, except for the brightness values ​​corresponding to the darkest points (i.e., pixels with brightness values ​​of 0) and the brightest points (i.e., pixels with brightness values ​​of 1), are multiplied by 4*(y-0.5). 2 After that, the value will decrease nonlinearly. Therefore, the output I b Except for the brightness values ​​corresponding to the darkest point and the brightest point, all other values ​​decrease nonlinearly, which is equivalent to reducing the brightness of the image nonlinearly, that is, the image becomes darker.

[0053] In this way, the image processing device can reduce the brightness of the entire image and maintain the contrast of the entire image while keeping the brightness values ​​corresponding to the extremely dark points and extremely bright points of the image (including the background area) unchanged.

[0054] Optionally, the image processing device may actively execute step 202 or passively execute step 202, which is not limited in the embodiment of the present application.

[0055] In an example, when the image processing device actively executes step 202 , the image processing device may directly execute step 202 after acquiring the first image.

[0056] In the second example, when the image processing device passively executes step 202 , the image processing device may determine whether a first input from a user is received after acquiring the first image, and execute step 202 after receiving the first input from the user.

[0057] Exemplarily, the first input mentioned above can be: a click input of the user on the screen, or a voice command input by the user, or a specific gesture input by the user. The specific one can be determined according to actual usage requirements, and the embodiments of the present application are not limited to this.

[0058] The specific gesture in the embodiment of the present application can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture; the click input in the embodiment of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input.

[0059] It should be noted that, when the target operation is to increase the brightness value of the target area and decrease the brightness value of the background area, there is no obvious order in which the image processing device increases the brightness value of the target area and decreases the brightness value of the background area. For example, the image processing device may decrease the brightness value of the background area after increasing the brightness value of the target area, or may decrease the brightness value of the background area before increasing the brightness value of the target area, or may decrease the brightness value of the background area while increasing the brightness value of the target area, and the embodiments of the present application do not limit this.

[0060] Step 203: The image processing device fuses the background area with reduced brightness and the first area to obtain a second image.

[0061] The first area mentioned above is the target area or the target area after the brightness value is increased.

[0062] Exemplarily, the background area and the first area after the brightness value is reduced in the above step 203 can be understood as: the fusion of the background area after the brightness value is reduced and the target area after the brightness is increased, or the fusion of the target area and the background area after the brightness is reduced.

[0063] In the embodiment of the present application, the background area and the target area fused by the image processing device are related to the above-mentioned target operation. Exemplarily, when the above-mentioned target operation is to reduce the brightness value of the above-mentioned background area, the image processing device fuses the target area and the background area after the brightness is reduced; when the above-mentioned target operation is to increase the brightness value of the above-mentioned target area and reduce the brightness value of the above-mentioned background area, the image processing device fuses the background area after the brightness is reduced and the target area after the brightness is increased.

[0064] In an example, the above-mentioned fusion of the background area with reduced brightness and the target area with increased brightness can be achieved by fusing the first image with reduced brightness and the first image with increased brightness.

[0065] Optionally, in the embodiment of the present application, when the first area is a target area with an increased brightness value, the method may further include the following step 204:

[0066] Step 204: The image processing device obtains mask information of the first image according to the first image.

[0067] The mask information is used to indicate the target area and the background area.

[0068] For example, the image processing device can use the above-mentioned open source PoolNet to perform saliency detection on the image to obtain a mask (i.e., the above-mentioned mask information), and the image processing device can distinguish the main object (which can be referred to as the subject) and the background in the image according to the mask. Then, the image processing device can use a large radius filter to perform image blur processing on the output mask to soften the edge and obtain a soft edge mask.

[0069] Based on the above step 204, the above step 203 may specifically include the following steps A1 to A3:

[0070] Step A1: The image processing device obtains a background ratio image based on the background area with reduced brightness and the first image, and obtains a target ratio image based on the target area with increased brightness and the first image.

[0071] It should be noted that the image processing device can obtain the brightness value matrix of the background ratio image by dividing the brightness value matrix of the first image after the brightness value is reduced by the brightness value matrix of the first image. The image processing device can obtain the brightness value matrix of the background ratio image by dividing the brightness value matrix of the first image after the brightness value is increased by the brightness value matrix of the first image.

[0072] Step A2: The image processing device fuses the background ratio image and the target ratio image according to the mask information to obtain a target brightness image.

[0073] Step A3: The image processing device obtains a second image according to the target brightness image and the first image.

[0074] In an example, the image processing device may divide the brightness value matrix of the target brightness image by the brightness value matrix of the first image, and then multiply the result by 255 to obtain the brightness value matrix of the second image.

[0075] Exemplarily, the specific fusion process may be as follows:

[0076] First, the image processing device may normalize the original image. The specific formula (5) may be expressed as:

[0077]

[0078] Among them, input represents the brightness value matrix of the input original image, I input_normal Represents the original image after normalization.

[0079] Secondly, the image processing device can divide the target area after the brightness value is increased by the original image, and intercept it according to the first preset interval. It should be noted that interception can prevent brightness overflow. For example, when brightening, the value can be intercepted to between 1 and 4. In practice, a brightness difference of 4 times is large enough. The specific formula (6) can be expressed as:

[0080]

[0081] Among them, clip represents the interception operation, H p The brightness value matrix of the image after the brightness value is increased is divided by the original image (ie the target ratio image mentioned above).

[0082] Exemplarily, the image processing device may divide the background area after the brightness value is reduced by the original image, and cut it according to the second preset interval. For example, it may be cut between 0 and 1. The specific formula (7) can be expressed as:

[0083]

[0084] Among them, clip represents the interception operation, H b It represents the brightness value matrix after the image with reduced brightness value is divided by the original image (ie the background ratio image mentioned above).

[0085] Then, the image processing device can obtain a brightness image (i.e., the target intensity image) fused between the target area and the background area by using the α fusion method according to the above soft edge mask value. The specific formula (8) can be expressed as:

[0086] H fusion =H p *mask+H b *(1-mask) (8)

[0087] Among them, H fusion The brightness value matrix of the brightness map of the target area and the background area.

[0088] Next, the image processing device can obtain the final fused brightness image (i.e., the second image) according to formula (9). The specific formula (9) can be expressed as:

[0089] I output =(I input_normal *H fusion ) clip(0-1) *255 (9)

[0090] Among them, clip represents the interception operation, I output Represents the brightness value matrix of the output fused brightness map (i.e., the second image).

[0091] In this way, the image processing device can achieve better brightness transition for the edge areas of the target area and the background area while maintaining the brightness change trend of the original image. Compared with the Poisson algorithm and other conventional fusion algorithms, the fusion is performed directly based on the original image, which is more natural and efficient.

[0092] It should be noted that, when the image processing device is a network device, the image processing device may process the fused image I output Return to the mobile device to facilitate the user to proceed to the next step.

[0093] Optionally, in the embodiment of the present application, before executing the target operation in step 202, the method may further include the following step 205:

[0094] Step 205: When the first image does not satisfy the first condition, the image processing device determines whether the target area satisfies the second condition.

[0095] The second condition is that the average brightness of the target area is less than or equal to a third threshold (eg, 128).

[0096] It should be noted that, when the target area satisfies the second condition, the image processing device may increase the brightness value of the target area, and when the target area satisfies the second condition, the image processing device may not process the target area.

[0097] Optionally, in the embodiment of the present application, the image processing device may determine a specific target operation according to whether the target area satisfies the second condition, which may include at least the following two situations.

[0098] In the first case:

[0099] Exemplarily, based on step 205, the execution of the target operation in step 202 may specifically include the following step 202a:

[0100] Step 202a: When the target area satisfies the second condition, the image processing apparatus increases the brightness value of the target area and decreases the brightness value of the background area.

[0101] Based on step 202a, the above step 203 may specifically include the following step 203a:

[0102] Step 203a: The image processing device fuses the target area with increased brightness value and the background area with decreased brightness value to obtain a second image.

[0103] In an example, the above step 203a can be implemented by fusing the first image with increased brightness value and the first image with decreased brightness value. It should be noted that the specific fusing process can refer to the above-mentioned process of fusing the first image with increased brightness value and the first image with decreased brightness value by the image processing device, which will not be described in detail here.

[0104] In the second case:

[0105] Exemplarily, based on step 205, the execution of the target operation in step 202 may specifically include the following step 202b:

[0106] Step 202b: When the target area does not satisfy the second condition, the image processing apparatus reduces the brightness value of the background area.

[0107] Based on step 202b, the above step 203 may specifically include the following step 203b:

[0108] Step 203b: The image processing device fuses the target area with the background area with reduced brightness to obtain a second image.

[0109] Exemplarily, the above step 203b can be implemented by fusing the first image with the first image with reduced brightness. It should be noted that the specific fusing process can refer to the above-mentioned process of fusing the first image with increased brightness and the first image with reduced brightness by the image processing device, which will not be described in detail here.

[0110] In the image processing method provided by the embodiment of the present application, the image processing device may first acquire a first image including a background area and a target area; then, the image processing device may perform a target operation when the first image does not meet the first condition, and the target operation includes any of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; finally, the image processing device may fuse the background area with reduced brightness value and the first area to obtain a second image, and the first area is the above-mentioned target area or the target area with increased brightness value. Through the above scheme, after acquiring the first image, the image processing device may first determine whether the first image does not meet the first condition. Then, when determining that the first image does not meet the first condition, the image processing device may perform processing to highlight the subject on the first image, for example, reducing the brightness value of the background area of ​​the first image, that is, increasing the brightness value of the target area in disguise, or increasing the brightness value of the target area and reducing the brightness value of the background area. Finally, the target image processing device may re-fuse the background area with reduced brightness value and the target area, or re-fuse the background area with reduced brightness value and the target area with increased brightness value to obtain the second image. In summary, due to the increase in the brightness value of the target area or the decrease in the brightness value of the background area, the target area will be brighter than the background area, making it easier for the user to see the target area visually. In this way, the second image obtained after adjusting the brightness value can better highlight the subject.

[0111] It should be noted that the image processing method provided in the embodiment of the present application can be executed by an image processing device or a control module in the image processing device for executing the image processing method. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.

[0112] Figure 2 A possible structural diagram of an image processing device provided in an embodiment of the present application is as follows: Figure 2 As shown, the image processing device 300 includes: an acquisition module 301, an execution module 302 and a fusion module 303, wherein: the acquisition module 301 is used to acquire a first image, and the first image includes a background area and a target area; the execution module 302 is used to perform a target operation when the first image acquired by the acquisition module 301 does not meet a first condition, and the target operation includes any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; the fusion module 303 is used to fuse the background area with the reduced brightness value obtained by the execution module 302 and the first area to obtain a second image, and the first area is the above-mentioned target area or the target area with the increased brightness value.

[0113] Optionally, the first area is a target area after the brightness value is increased; the acquisition module 301 is also used to acquire mask information of the first image based on the first image, and the mask information is used to indicate the target area and the background area; the execution module 302 is also used to obtain a background ratio image based on the background area after the brightness value is reduced and the first image, and to obtain a target ratio image based on the target area after the brightness value is increased and the first image; the fusion module 303 is specifically used to fuse the background ratio image and the target ratio image obtained by the execution module 302 according to the mask information obtained by the acquisition module 301 to obtain a target brightness image; the execution module 302 is also used to obtain a second image based on the target brightness image obtained by the fusion module 302 and the first image.

[0114] Optionally, the first condition includes any one of the following: a difference between a brightness mean of the target area and a brightness mean of the background area is greater than or equal to a first threshold, and the brightness mean of the background area is less than or equal to a second threshold.

[0115] Alternatively, if Figure 2 As shown, the image processing device 300 also includes: a determination module 304; the determination module 304 is used to determine whether the target area meets the second condition when the first image acquired by the acquisition module 301 does not meet the first condition, and the second condition is that the brightness mean of the target area is less than or equal to the third threshold value; the execution module 302 is specifically used to increase the brightness value of the target area and reduce the brightness value of the background area when the determination module 304 determines that the target area meets the second condition; and reduce the brightness value of the background area when the determination module 304 determines that the target area does not meet the second condition; a fusion module 303 is specifically used to fuse the target area with the background area after the brightness value is reduced.

[0116] It should be noted that if Figure 2 As shown, the modules that must be included in the image processing device 300 are indicated by solid-line boxes, such as the acquisition module 301 ; the modules that may or may not be included in the image processing device 300 are indicated by dotted-line boxes, such as the determination module 304 .

[0117] The image processing device provided in the embodiment of the present application can first acquire a first image including a background area and a target area; then, the image processing device can perform a target operation when the first image does not meet the first condition, and the target operation includes any of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; finally, the image processing device can fuse the background area with reduced brightness value and the first area to obtain a second image, and the first area is the above-mentioned target area or the target area with increased brightness value. Through the above scheme, after acquiring the first image, the image processing device can first determine whether the first image does not meet the first condition. Then, when determining that the first image does not meet the first condition, the image processing device can perform processing to highlight the subject on the first image, for example, reducing the brightness value of the background area of ​​the first image, that is, increasing the brightness value of the target area in disguise, or increasing the brightness value of the target area and reducing the brightness value of the background area. Finally, the target image processing device can re-fuse the background area with reduced brightness value and the target area, or re-fuse the background area with reduced brightness value and the target area with increased brightness value to obtain the second image. In summary, due to the increase in the brightness value of the target area or the decrease in the brightness value of the background area, the target area will be brighter than the background area, making it easier for the user to see the target area visually. In this way, the second image obtained after adjusting the brightness value can better highlight the subject.

[0118] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0119] The image processing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0120] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0121] The image processing device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0122] Optional, such as Figure 3 As shown, an embodiment of the present application also provides an electronic device 400, including a processor 401, a memory 402, and a program or instruction stored in the memory 402 and executable on the processor 401. When the program or instruction is executed by the processor 401, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0123] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0124] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0125] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0126] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0127] Among them, the input unit 104 is used to obtain a first image, which includes a background area and a target area; the processor 110 is used to perform a target operation when the first image obtained by the input unit 104 does not meet the first condition, and the target operation includes any one of the following: reducing the brightness value of the background area; increasing the brightness value of the target area and reducing the brightness value of the background area; and fusing the background area with reduced brightness value and the first area to obtain a second image, wherein the first area is the above-mentioned target area or the target area with increased brightness value.

[0128] Optionally, the first area is a target area after the brightness value is increased; the processor 110 is further used to obtain mask information of the first image based on the first image, and the mask information is used to indicate the target area and the background area; and to obtain a background ratio image based on the background area after the brightness value is reduced and the first image, and to obtain a target ratio image based on the target area after the brightness value is increased and the first image; and to fuse the background ratio image and the target ratio image according to the mask information to obtain a target brightness image; and to obtain a second image based on the target brightness image and the first image.

[0129] Optionally, the first condition includes any one of the following: a difference between a brightness mean of the target area and a brightness mean of the background area is greater than or equal to a first threshold, and the brightness mean of the background area is less than or equal to a second threshold.

[0130] Optionally, the processor 110 is also used to determine whether the target area satisfies a second condition when the first image acquired by the input unit 104 does not satisfy the first condition, wherein the second condition is that the average brightness of the target area is less than or equal to a third threshold; and when the target area satisfies the second condition, increase the brightness value of the target area and reduce the brightness value of the background area; when the target area does not satisfy the second condition, reduce the brightness value of the background area.

[0131] The electronic device provided in the embodiment of the present application can first acquire a first image including a background area and a target area; then, the electronic device can perform a target operation when the first image does not meet the first condition, and the target operation includes any of the following: reducing the brightness value of the background area; increasing the brightness value of the target area, and reducing the brightness value of the background area; finally, the electronic device can fuse the background area with reduced brightness value and the first area to obtain a second image, and the first area is the above-mentioned target area or the target area with increased brightness value. Through the above scheme, after acquiring the first image, the electronic device can first determine whether the first image does not meet the first condition. Then, when the electronic device determines that the first image does not meet the first condition, the first image can be processed to highlight the subject, for example, reducing the brightness value of the background area of ​​the first image, that is, increasing the brightness value of the target area in disguise, or increasing the brightness value of the target area and reducing the brightness value of the background area. Finally, the electronic device can re-fuse the background area and the target area after the brightness value is reduced, or re-fuse the background area after the brightness value is reduced and the target area after the brightness value is increased to obtain the second image. In summary, due to the increase in the brightness value of the target area or the decrease in the brightness value of the background area, the target area will be brighter than the background area, making it easier for the user to see the target area visually. In this way, the second image obtained after adjusting the brightness value can better highlight the subject.

[0132] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0133] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 109 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 110 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.

[0134] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0135] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0136] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0137] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0138] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0140] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a first image, wherein the first image includes a background area and a target area; When the first image does not satisfy the first condition, performing a target operation, wherein the target operation is to increase the brightness value of the target area and decrease the brightness value of the background area; fusing the background area with reduced brightness and the first area to obtain a second image; The first area is the target area after the brightness value is increased; the method further includes: Acquire mask information of the first image according to the first image, where the mask information is used to indicate the target area and the background area; The fusing the background area with reduced brightness and the first area to obtain a second image comprises: Obtaining a background ratio image based on the background area with reduced brightness and the first image, and obtaining a target ratio image based on the target area with increased brightness and the first image; According to the mask information, the background ratio image and the target ratio image are fused to obtain a target brightness image; A second image is obtained according to the target brightness image and the first image.

2. The method according to claim 1, characterized in that The first condition includes any one of the following items: the difference between the brightness mean of the target area and the brightness mean of the background area is greater than or equal to a first threshold, and the brightness mean of the background area is less than or equal to a second threshold.

3. The method according to any one of claims 1 or 2, characterized in that: Before performing the target operation, the method further includes: In the case that the first image does not satisfy the first condition, determining whether the target area satisfies a second condition, where the second condition is that the average brightness of the target area is less than or equal to a third threshold; The executing target operation includes: When the target area satisfies the second condition, increasing the brightness value of the target area and decreasing the brightness value of the background area; When the target area does not satisfy the second condition, the brightness value of the background area is reduced.

4. An image processing device, characterized in that: The image processing device comprises: an acquisition module, an execution module and a fusion module; The acquisition module is used to acquire a first image, wherein the first image includes a background area and a target area; The execution module is used to perform a target operation when the first image acquired by the acquisition module does not meet a first condition, wherein the target operation is to increase the brightness value of the target area and reduce the brightness value of the background area; The fusion module is used to fuse the background area with reduced brightness obtained by the execution module and the first area to obtain a second image; The first area is the target area after the brightness value is increased; The acquisition module is further used to acquire mask information of the first image according to the first image, wherein the mask information is used to indicate the target area and the background area; The execution module is further used to obtain a background ratio image based on the background area with reduced brightness and the first image, and to obtain a target ratio image based on the target area with increased brightness and the first image; The fusion module is specifically configured to fuse the background ratio image and the target ratio image obtained by the execution module according to the mask information obtained by the acquisition module to obtain a target brightness image; The execution module is further used to obtain a second image according to the target brightness image obtained by the fusion module and the first image.

5. The image processing device according to claim 4, characterized in that: The first condition includes any one of the following items: the difference between the brightness mean of the target area and the brightness mean of the background area is greater than or equal to a first threshold, and the brightness mean of the background area is less than or equal to a second threshold.

6. The image processing device according to any one of claims 4 or 5, characterized in that: The image processing device further includes: a determination module; The determination module is used to determine whether the target area meets a second condition when the first image acquired by the acquisition module does not meet a first condition, and the second condition is that the average brightness of the target area is less than or equal to a third threshold; The execution module is specifically used to increase the brightness value of the target area and reduce the brightness value of the background area when the determination module determines that the target area satisfies the second condition; and to reduce the brightness value of the background area when the determination module determines that the target area does not satisfy the second condition.

7. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method as claimed in any one of claims 1 to 3.

8. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the image processing method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Image processing method and apparatus, electronic device, computer readable storage medium

    CN108734676A