Image processing method, electronic equipment and computer readable storage medium
By generating a solid color second image for light compensation, the image quality problem under dark light or overexposure conditions is solved, lighting consistency is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411325845.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art images taken under dark or overexposure conditions are subject to light compensation, which can easily lead to the disappearance of text content or bright spots, making it difficult to improve image quality.
By generating a solid color second image for light compensation, the original image is compensated with light, ensuring that the illumination of the target image is consistent, and adapting to various shooting light conditions.
It effectively solves the impact of dark light areas, overexposure areas or bright spots on image content, improves the light compensation effect of images shot under various shooting lights, and improves the user experience.
Smart Images

Figure CN119136060A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and more specifically, to an image processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of computer technology, users can take photos, record videos, broadcast live, and start video conferences anytime and anywhere. However, the quality of images captured by various shooting methods will be affected by the shooting light. For example, it is difficult to see the text content in images captured under poor shooting light, and even if the above images are processed, various problems will occur. For example, after enhancing an image captured under dark light conditions, the text content will disappear, and after enhancing an image captured under overexposure conditions, obvious bright spots will appear. Summary of the invention
[0003] In view of this, the present disclosure provides an image processing method, an electronic device, and a computer-readable storage medium to improve the illumination compensation effect of an original image captured under shooting light.
[0004] One aspect of the present disclosure provides an image processing method, including: generating a second image for illumination compensation based on an original image and a first image corresponding to the original image, wherein the first image is a pure color image; and performing illumination compensation on the original image using the second image to obtain a target image with consistent illumination.
[0005] Another aspect of the present disclosure provides an electronic device, including: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned image processing method.
[0006] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0007] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the above method when executed.
[0008] In the embodiment of the present disclosure, a second image for lighting supplement is generated based on the original image and the first image, and then the second image is used to perform lighting compensation on the original image, so that the lighting of the target image remains consistent, thereby solving the influence of the dark light area, overexposed area or bright spot in the original image on the image content, and improving the lighting compensation effect of the original image shot under a variety of shooting lights. In addition, since the first image in the embodiment of the present disclosure is a pure color image corresponding to the original image, for the original image shot under a variety of shooting lights, when the second image is used to perform lighting compensation on the original image to obtain the target image, the lighting of the target image can be adapted to the original image, thereby improving the lighting compensation effect of the original image shot under a variety of shooting lights, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0010] Figure 1 An exemplary system architecture for an image processing method and apparatus to which the present disclosure may be applied is schematically shown;
[0011] Figure 2 The flowchart of the image processing method according to the embodiment of the present disclosure is schematically shown;
[0012] Figure 3 The flowchart of generating a second image for illumination compensation according to an embodiment of the present disclosure is schematically shown.
[0013] Figure 4 The schematic diagram schematically shows the effect of performing illumination compensation on a whiteboard image using a specific embodiment of the present disclosure.
[0014] Figure 5 The flowchart for determining the first image according to an embodiment of the present disclosure is schematically shown.
[0015] Figure 6 The flowchart of an image processing method according to another embodiment of the present disclosure is schematically shown.
[0016] Figure 7 The flowchart of whiteboard image processing according to a specific embodiment of the present disclosure is schematically shown.
[0017] Figure 8 The schematic diagram schematically shows the effect of performing illumination compensation and enhancement on a whiteboard image according to a specific embodiment of the present disclosure.
[0018] Fig. 9 The block diagram schematically shows an image processing apparatus according to an embodiment of the present disclosure.
[0019] Fig.10 A block diagram of an electronic device suitable for an image processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0020] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0021] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0022] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0023] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0024] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.
[0025] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0026] Figure 1 The exemplary system architecture 100 for image processing method and apparatus of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0027] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101 , a second terminal device 102 , and a server 103 .
[0028] The first terminal device 101 and the second terminal device 102 may be a variety of electronic devices that support shooting functions, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, cameras, shooting watches, gimbals with shooting functions, and the like.
[0029] The user can use the first terminal device 101 and the second terminal device 102 to interact with the server 103 through the network to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101 and the second terminal device 102, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, shooting applications, image processing applications, etc. (only for example).
[0030] In an illustrative embodiment, the first terminal device 101 may be installed on a pan-tilt head, and a user may control the pan-tilt head to capture original images, record videos, start a video conference or live broadcast, etc. through the first terminal device 101 .
[0031] Optionally, the image processing method of the embodiment of the present disclosure can be implemented by the first terminal device 101 and the second terminal device 102. For example, the first terminal device 101 and the second terminal device 102 obtain an original image, and generate a second image for illumination compensation based on the original image and a first image corresponding to the original image, wherein the first image is a pure color image; and the illumination compensation is performed on the original image using the second image to obtain a target image with consistent illumination.
[0032] Optionally, the image processing method of the embodiment of the present disclosure can also be implemented by the server 103. For example, the first terminal device 101 and the second terminal device 102 obtain the original image and send the original image to the server 103. The server 103 generates a second image for illumination compensation based on the original image and the first image corresponding to the original image, where the first image is a pure color image; the second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination. The server 103 can also return the illumination-compensated target image to the first terminal device 101 and the second terminal device 102 to display it to the user.
[0033] It should be understood that Figure 1The number of terminal devices and servers in the embodiment is only for illustration. Any number of terminal devices and servers may be provided according to implementation requirements.
[0034] Figure 2 The flowchart of the image processing method according to the embodiment of the present disclosure is schematically shown.
[0035] like Figure 2 As shown, in one embodiment 200, the method includes steps S210 to S220.
[0036] In step S210, a second image for illumination compensation is generated according to an original image and a first image corresponding to the original image, wherein the first image is a pure color image.
[0037] Specifically, the original image may be an image that has not been subjected to illumination compensation. In a specific embodiment, the original image may be directly obtained through a terminal device having a shooting function. For example, the original image may be an image shot under a variety of shooting lights, an image at a certain moment in a video, or a real-time image obtained during a video conference or live broadcast. In another embodiment, the original image may also be an image that has undergone other image processing, such as resizing, denoising, etc., but has not been subjected to illumination compensation.
[0038] The first image corresponding to the original image can be understood as the first image that matches the original image. For example, multiple original images can match the same first image, and one original image can also match one first image. The first image is a pure color image, that is, the pixel values and illumination values of each pixel in the first image are the same. The illumination value includes: brightness value and / or contrast value, and the brightness value and contrast value can be determined by the pixel value (R, G, B) of the image.
[0039] In one embodiment, the second image includes multiple illumination values, which are respectively used to perform illumination compensation on each pixel in the original image. For example, one illumination value among the multiple illumination values is used to perform illumination compensation on one pixel or multiple pixels in the original image. It should be noted that since the second image is generated based on the original image and the first image, and the first image is a pure color image, when one illumination value is used to perform illumination compensation on multiple pixels, it means that the illumination values of the compensated pixels in the original image are consistent.
[0040] In an embodiment of the present disclosure, the second image for illumination compensation may be generated by performing image processing on the original image and the first image. For example, the second image may be generated according to the difference in illumination values between the original image and the first image.
[0041] In step S220, the second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination.
[0042] Specifically, the second image is used for illumination compensation, and therefore, at least one illumination value in the second image can be used to perform illumination compensation on each pixel in the original image. In some embodiments, the second image can be used to perform illumination compensation on each pixel in the original image at the same time, or multiple illumination values in the second image can be used to perform illumination compensation on some pixels in the original image respectively. For example, the second image can be superimposed on the original image to perform illumination compensation on each pixel in the original image.
[0043] In this embodiment, the illumination is consistent, that is, the illumination value is the same.
[0044] In an embodiment of the present disclosure, a second image for illumination compensation is generated based on an original image and a first image corresponding to the original image; the second image is used to perform illumination compensation on the original image so that the illumination of the target image remains consistent, thereby solving the technical problem that the image content is affected by various shooting lights in the original image, enhancing the dark areas, overexposed areas or bright spots in the original image, and improving the illumination compensation effect of the original image shot under various shooting lights. In addition, since the first image in the embodiment of the present disclosure is a pure color image corresponding to the original image, for the original image shot under various shooting lights, when the second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination, the illumination of each pixel can be adapted to the original image, thereby improving the illumination compensation effect of the original image shot under various shooting lights and enhancing the user experience.
[0045] In a specific embodiment, operation S220 includes: using the second image to perform illumination compensation on the original image to obtain a target image with the same illumination value for each pixel in the background area, where the illumination value includes: brightness value and / or contrast value.
[0046] The original image includes a background area and foreground content. When the second image is used to compensate the original image, illumination compensation can be performed on the foreground content and the background area at the same time, so that the illumination values of each pixel in the background area in the target image are the same, and the illumination values of each pixel in the background area are the same as the illumination values of the first image. The illumination values of each pixel in the foreground content in the target image can be the same or different, but the illumination values of each pixel in the foreground content are usually different from the illumination values of the background area to prevent the foreground content in the target image from disappearing.
[0047] For example, for the original image with black text on a white background, the foreground content is black text, the background area is white background, and the first image is a pure white image. Due to the light problem during shooting, the illumination values of multiple pixels on the white background are different. In fact, the illumination values of multiple pixels on the white background are all the illumination values corresponding to "white". Therefore, by using the second image to perform illumination compensation on the original image with black text on a white background, the illumination values of each pixel on the white background in the target image can be compensated to the illumination value corresponding to "white", but the illumination values of each pixel on the black text cannot be compensated to the illumination value corresponding to "white", which will cause the black text in the target image to disappear. In addition, the illumination values of each pixel on the black text can be the same, such as the illumination value corresponding to "black". Alternatively, for colored text on a white background, the illumination values of each pixel on the colored text in the target image are different.
[0048] The process of step S210 in the above real-time operation will be further described below.
[0049] In a specific embodiment, with respect to step S210, generating a second image for illumination compensation based on an original image and a first image corresponding to the original image includes: generating a second image for illumination compensation based on an illumination value difference of each pixel point between the original image and the first image.
[0050] In this embodiment, the first image is a pure color image, so each pixel in the original image can be compared with each pixel at a corresponding position in the first image to obtain the difference in illumination value of each pixel. Then, based on the difference in illumination value of each pixel, a second image for illumination compensation is generated.
[0051] Since the illumination value can be determined based on the pixel value, the illumination value difference can be reflected by the pixel value difference. A second image for illumination compensation can be generated based on the pixel value difference between each pixel point between the original image and the first image, so that the second image can be used to perform illumination compensation on the original image to obtain a target image with consistent illumination.
[0052] Figure 3 The flowchart of generating a second image for illumination compensation according to an embodiment of the present disclosure is schematically shown.
[0053] In a specific embodiment 300 , generating a second image for illumination compensation according to illumination differences of each pixel between an original image and a first image includes steps S311 and S312 .
[0054] In step S311, a difference is made between the pixel value of each pixel point in the first image and the pixel value of the corresponding pixel point in the original image to obtain a difference map representing the difference in illumination value.
[0055] Specifically, the pixel value of each pixel in the original image can be used to calculate the illumination value at the position of each pixel, and the first image is a pure color image in which the pixel value and illumination value of each pixel are the same. Therefore, by subtracting the pixel value of each pixel in the first image from the pixel value of the corresponding pixel in the original image, a differential image representing the difference in illumination values can be obtained.
[0056] The original image and the first image are of the same size, so each pixel in the first image can correspond to each pixel in the original image one by one. Subtraction can be understood as subtracting the pixel value of each pixel in the original image from the pixel value of each pixel in the first image. In the obtained differential image, the pixel values of each pixel may be the same or different. For example, when the shooting light of each pixel in the original image is the same, the first image is subtracted from the original image, and the pixel values of each pixel in the differential image are the same. When there are differences in the shooting light of each pixel in the original image, the first image is subtracted from the original image, and the pixel values of each pixel in the differential image are different.
[0057] In step S312, image processing is performed on the difference image to generate a second image after the foreground content is removed.
[0058] Specifically, the original image includes foreground content and background area. The difference operation in step S311 does not distinguish between the background area and the foreground content. After obtaining the difference image, the difference image can be processed to generate a second image after removing the foreground content, so as to avoid the subsequent step S220 using the second image to compensate for the illumination of the original image without affecting the display effect of the foreground content in the original image.
[0059] In some embodiments, the foreground content can be used as noise content, and the difference image can be subjected to denoising to obtain a second image after the foreground content is removed. In other embodiments, a variety of segmentation algorithms can be used to segment the foreground content in the difference image to obtain a second image after the foreground content is removed. In still other embodiments, the foreground content in the difference image can be overwritten to obtain a second image after the foreground content is removed.
[0060] The embodiments of the present disclosure obtain a differential map representing the difference in illumination values by performing pixel difference operations, and then perform image processing on the differential map to generate a second image after removing the foreground content. This ensures that when the second image after removing the foreground content is used to perform illumination compensation on the original image, different illumination compensation is performed on the background area and the foreground content to avoid affecting the foreground content and improve the display effect of the target image after illumination compensation.
[0061] According to an embodiment of the present disclosure, the foreground content includes at least one of the following: text, graphics. It is understandable that for text and graphics in the shape of lines, the ratio of the number of pixels of the line strokes to the total number of pixels in the area occupied by the entire text and image is usually small. Therefore, the image after the existing illumination compensation operation may not display the text and graphics in the shape of lines, or may be missing some lines, resulting in poor illumination compensation effect.
[0062] The embodiments of the present disclosure adopt the above-mentioned image processing method to generate a second image with line-shaped foreground content such as text and graphics removed, and use the second image with line-shaped foreground content removed to perform illumination compensation on each pixel in the original image, so that the illumination value of the background area in the target image is consistent, but does not affect the line-shaped foreground content, thereby improving the illumination compensation effect of the original image with line-shaped foreground content.
[0063] In a specific embodiment, for step S312, image processing is performed on the difference image to generate a second image after removing the foreground content, including: filtering the difference image based on a target blur kernel to obtain the second image after removing the foreground content, and the size of the target blur kernel is positively correlated with the size of the original image.
[0064] Specifically, a linear filtering method may be used to filter the difference image using a blur kernel to obtain a second image after the foreground content is removed.
[0065] In this embodiment, certain requirements are imposed on the blur kernel used in the linear filter, that is, the difference image is filtered using the target blur kernel.
[0066] The target blur kernel can be understood as a filter window used in linear filtering. The target blur kernel is slid to perform filtering operations on different regions in the difference image. The size of the target blur kernel is related to the receptive field of the filtering operation. A larger blur kernel can extract features of larger sizes, and a smaller blur kernel can extract features of smaller sizes.
[0067] For example, for linear-shaped text and images, a larger target blur kernel can be used to remove the foreground content of this feature.
[0068] In the embodiment of the present disclosure, the original image has a large selection space, such as the original image can have a variety of sizes, for example, the size of the original image can be 1242x1660 pixels, 1125x633 pixels, etc.
[0069] Therefore, the size of the target blur kernel is positively correlated with the size of the original image, so that the filtering process can be applied to original images of various sizes, improving the applicability of illumination compensation for original images of various sizes, while ensuring the illumination compensation effect, greatly improving the user experience.
[0070] For example, the target blur kernel size can be h*w / 3000, where h and w are the height and width of the original image, respectively, so as to adapt to original images of different sizes.
[0071] In addition, other filtering methods can be used to filter the difference image to obtain a second image after removing the foreground content. Specifically, the filtering process includes at least one of the following: median filtering, average filtering, amplitude filtering, sliding filtering, Gaussian filtering, bilateral filtering, etc. Alternatively, the filtering process can also be a combination of at least one of the above filtering methods. In this embodiment, the foreground content is used as noise content and is removed by filtering.
[0072] By filtering the difference image to remove the foreground content, the second image after the foreground content is removed can distinguish the foreground content and the background of the linear shape, which helps to improve the illumination compensation effect of the original image using the second image after the foreground content is removed.
[0073] In an exemplary embodiment, the original image is a whiteboard image with writing traces, and the first image is a pure white image with the same background color as the whiteboard.
[0074] In this embodiment, the image processing method for the whiteboard image includes: generating a second image for illumination compensation based on the pure white image and the whiteboard image; using the second image to perform illumination compensation on the whiteboard image to obtain a target image with writing traces and the same illumination value for each pixel of the whiteboard.
[0075] Specifically, the size of the pure white image is consistent with the size of the whiteboard image. The pixel value of each pixel in the pure white image and the pixel value of the corresponding pixel in the whiteboard image can be subtracted to obtain a differential image representing the difference in pixel values; the writing marks in the differential image are removed to obtain a second image after the writing marks are removed.
[0076] The method of performing subtraction between the pure white image and the whiteboard image in the embodiment of the present disclosure refers to the above embodiment and will not be described in detail here.
[0077] Figure 4 The schematic diagram schematically shows the effect of performing illumination compensation on a whiteboard image using a specific embodiment of the present disclosure. Figure 4 There are four pictures in total, including image (a) to image (d).
[0078] For example, image (a) is a whiteboard image with black text on a white background. There are two obvious bright spots in the upper right corner of image (a). Compared with the writing traces in other areas without bright spots, the writing traces covered by the bright spot area are not very clear. Image (b) is a difference image obtained by subtracting a pure white image with pixel values of 255 from image (a), and image (c) is a second image after filtering image (b) and removing the writing traces. It can be seen in image (c) that the corresponding position of the bright spot area is significantly different from other areas, that is, the second image includes at least two pixel values / illumination values (the pixel values / illumination values corresponding to the bright spot and other areas, respectively). Image (d) is the target image obtained after using image (c) to perform illumination compensation on each pixel in image (a). In image (d), the bright spots in image (a) have been removed, and the writing trace "VP" covered by the bright spots has also been restored.
[0079] For whiteboard images captured under various shooting lights, when the second image is used to perform illumination compensation on the whiteboard image to obtain a target image with consistent illumination, the illumination value of each pixel point (including the bright spot area) in the whiteboard area in the target image can be adapted to the original image, that is, white, and the black writing traces in the target image are also enhanced compared to the original image. Therefore, the embodiments of the present disclosure can improve the illumination compensation effect of whiteboard images captured under various shooting lights and enhance the user experience.
[0080] It should be noted that the above only takes the original image as a whiteboard image with writing traces as an example, but is not limited to the above scenario.
[0081] For example, the original image may be a photograph of a paper document, which includes multiple texts, with the foreground content being texts, and the first image corresponding to the paper document photo may also be a pure white image. Subtract the pixel value of each pixel in the pure white image from the pixel value of the corresponding pixel in the paper document photo to obtain a differential image; remove the text in the differential image to obtain a second image after the text is removed; and then use the second image to perform illumination compensation on the paper document photo to obtain a paper document photo with the same illumination value for the blank area of the white paper (i.e., the background area).
[0082] For another example, the original image may be a blackboard image with chalk writing traces on the blackboard, the foreground content is the chalk writing traces, and the first image corresponding to the blackboard image is a pure black image with a pixel value of 0. The image processing method is similar to that of the above-mentioned whiteboard image and will not be repeated here.
[0083] According to an embodiment of the present disclosure, the first image used in step S210 corresponds to the original image and can be obtained in at least one of the following ways: determining the first image corresponding to the original image based on interaction; determining the first image based on the color features of the original image.
[0084] Specifically, the interaction includes but is not limited to: various interactions with the terminal device through voice, touch screen, input, etc., and touch and button control with the gimbal.
[0085] For example, after the original image is obtained, the original image and the first image selection prompt are displayed to the user so that the user can select the first image corresponding to the original image through interaction.
[0086] Considering that illumination compensation for the original image needs to ensure that the foreground content is clearly identifiable in the target image, the color features of the original image may refer to the color features of the original image as a whole, or the color features of the background area of the original image, so as to distinguish the foreground content from the background area.
[0087] The embodiments of the present disclosure determine the first image through the color features of the interactive or original image, and can generate a second image for each original image using the first image corresponding thereto, and then use the second image to perform illumination compensation on the original image to obtain a target image with consistent illumination. Since the illumination value of each pixel in the target image is compensated to the illumination value of the first image, and the first image corresponds to the original image, the illumination compensation effect of the target image is applicable to the current original image, which can better improve the illumination compensation effect of multiple original images and improve the user experience.
[0088] Figure 5 The flowchart for determining the first image according to an embodiment of the present disclosure is schematically shown.
[0089] In one embodiment 500, determining the first image based on the color characteristics of the original image includes step S510 and step S520.
[0090] Step S510, calculating the pixel average value of each pixel in the original image.
[0091] Step S520: determine the standard color segment where the pixel average value is located, and determine the first image based on the standard color segment.
[0092] When the foreground content in the original image is a line shape such as text or graphics, the pixel average value of each pixel in the original image can reflect the color characteristics of the background area of the original image. This is because the number of pixels in the line shape is much smaller than the number of pixels in the background. Therefore, the pixel average value of each pixel is the color characteristic of the background area. For other types of original images, the pixel average value of each pixel is the color characteristic of the entire original image.
[0093] The pixel value of each pixel in the original image may be affected by the shooting light and may deviate. Figure 4Taking the images (a) and (d) in the embodiment as examples, the background of image (a) appears to be a white board to the naked eye, and the pixel value of white is 255. However, due to the influence of the shooting light, the pixel value of the background in image (a) is not 255, but other pixel values close to white, such as 230, and the calculated pixel average value is also not 255.
[0094] Therefore, after determining the pixel average value of the original image, the pixel value of the standard color segment where the pixel average value is located is used as the pixel value of the first image to generate a pure color first image with the same size as the original image. If the pixel average value of each pixel in the original image is 234, the standard color segment where it is located is white, so a pure white image with a pixel value of 255 for each pixel can be generated.
[0095] The embodiments of the present disclosure calculate the pixel average value of each pixel in the original image and determine the first image based on the standard color segment where the pixel average value is located. It is able to determine the first image that best matches the original image so that the target image viewed by the user's naked eye is closer to the original image and the foreground content is clearer, thereby improving the effect of lighting compensation and enhancing the user experience.
[0096] In actual application, for real-time scenarios such as live broadcasts and online meetings, the original image is a real-time image, and it is difficult to determine the first image corresponding to each frame of the real-time image in advance based on interaction or real-time interaction.
[0097] Therefore, in some embodiments, the original image is a real-time image collected during the live broadcast process, and the image processing method includes: determining a first image corresponding to the real-time image based on the color characteristics of the real-time image, and generating a second image for lighting compensation based on the real-time image and the first image corresponding to the real-time image; using the second image to perform lighting compensation on the real-time image to obtain a target live broadcast image with consistent lighting, and displaying the target live broadcast image.
[0098] Specifically, the pixel average value of each pixel in the real-time image can be calculated, the standard color segment where the pixel average value is located can be determined, and the first image corresponding to the real-time image can be determined based on the standard color segment; a second image for illumination compensation can be generated based on the real-time image and the first image corresponding to the real-time image; the real-time image can be illuminated using the second image to obtain a target live image with the same illumination value for each pixel in the background area, and the target live image can be displayed. Therefore, this embodiment can automatically perform illumination compensation on the real-time image in real time, and display the target live image with the same illumination value to the user, thereby improving the user experience.
[0099] In some embodiments, for step S220, the second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination, including: adding the pixel value of each pixel in the second image to the pixel value of the corresponding pixel in the original image to obtain the target image.
[0100] The size of the second image is the same as that of the original image. The pixel value of each pixel in the second image can be used to perform differential illumination compensation on each pixel in the original image, so as to compensate each pixel in the background area to the illumination value / pixel value of the first image.
[0101] In summary, in various embodiments, illumination compensation can be performed on the original image through step S210 and step S220 to obtain a target image with consistent illumination.
[0102] In other embodiments, other image processing may be performed on the target image. Figure 6 The flowchart of an image processing method according to another embodiment of the present disclosure is schematically shown.
[0103] like Figure 6 The illustrated embodiment 600 includes steps S610 to S630.
[0104] In step S610, a second image for illumination compensation is generated according to an original image and a first image corresponding to the original image, wherein the first image is a pure color image.
[0105] In step S620, the second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination.
[0106] In step S630, the target image is enhanced.
[0107] In this embodiment, step S610 and step S620 are similar to step S210 and step S220, and are not described in detail herein.
[0108] Specifically, the target image is an image after illumination compensation is performed on the original image. In addition to illumination compensation on the original image, various image processing, such as enhancement processing, can be performed on the target image through step S630 to enhance the foreground content in the target image and improve the user experience.
[0109] Specifically, the enhancement processing in step S630 includes at least one of the following: contrast transformation, sharpening. Contrast transformation includes increasing contrast, decreasing contrast, or adjusting contrast to a predetermined contrast value. In some embodiments, the preferred contrast value can be determined by pre-implementation.
[0110] Sharpening includes but is not limited to: adjusting sharpening parameters, adjusting sharpening radius, adjusting sharpening filters and other processes.
[0111] The enhancement processing in the embodiments of the present disclosure includes but is not limited to a single enhancement processing or a combination of enhancement processing such as contrast transformation and sharpening, and may also include other image processing that can improve the clarity of foreground content, so as to further improve the clarity of foreground content in the target image with consistent illumination. For example, a variety of artificial intelligence algorithms such as convolutional neural network models, codec models, and deep network models may also be used for image enhancement.
[0112] The embodiments of the present disclosure can further improve the clarity of foreground content on a target image with consistent lighting by performing enhancement processing on the target image, thereby improving user experience.
[0113] In a specific embodiment, the original image is a whiteboard image with writing marks. The writing marks in the whiteboard image are usually foreground content in the shape of lines such as strokes and graphics. The number of pixels with writing marks in the entire whiteboard image is relatively small. Therefore, after generating a target image with consistent lighting according to steps S610 to S620, the contrast of the target image can be transformed to enhance the writing marks in the details so that users can more easily recognize the writing marks. Furthermore, the target image after the contrast is transformed is sharpened to focus on the edges of the writing marks, improve the clarity or focal length of the writing marks in the image, make the color of the writing marks in the target image more vivid, improve the image processing effect, and facilitate user recognition.
[0114] In order to more easily understand the present disclosure, a whiteboard image will be taken as an example below. Figure 7 and Figure 8 A specific embodiment is further described.
[0115] Figure 7 The flowchart of whiteboard image processing according to a specific embodiment of the present disclosure is schematically shown. Figure 8 The schematic diagram schematically shows the effect of performing illumination compensation and enhancement on a whiteboard image according to a specific embodiment of the present disclosure. Figure 8 There are six images in total, including images (a) to (f), each corresponding to Figure 7 The image after a step of processing.
[0116] Step 1: For the whiteboard image 701 , firstly create a pure white image 702 with the same size as the whiteboard image 701 , and use the pure white image 702 as the first image corresponding to the whiteboard image 701 . Figure 8 The image (a) in FIG. 7 is the whiteboard image 701 .
[0117] Step 2: Subtract the pure white image 702 and the whiteboard image 701 pixel by pixel to obtain a difference image 703 for illumination compensation. Figure 8The image (b) in FIG. 7 is the difference image 703 .
[0118] Step 3: Use the target blur kernel to perform median filtering on the difference image 703 obtained in step 2.
[0119] Because the writing traces in the whiteboard image 701 are all text in the shape of lines, the text will disappear after the difference image 703 is median filtered using a large blur kernel, and a second image 704 without text can be obtained. The size of the blur kernel is linearly related to the size of the whiteboard image 701. In this embodiment, the size of the large blur kernel is h*w / 3000, which is adaptive to whiteboard images 701 of different sizes. Figure 8 The image (c) in FIG. 7 is the second image 704 without text.
[0120] Step 4: Superimpose the second image 704 obtained in step 3 and the whiteboard image 701 to obtain a target image 705 with consistent illumination in the whiteboard area. Figure 8 The image (d) in FIG. 7 is the target image 705 . As shown in the image (d), the bright spots in the whiteboard image 701 are also removed.
[0121] Step 5: After that, image enhancement is performed on the target image 705 obtained in step 4 to obtain an enhanced image, such as Figure 8 Image in (e).
[0122] Step 6: Finally, the image obtained in step 5 is adjusted in contrast and sharpening in sequence to obtain an enhanced image 706 with a stable enhancement effect, such as Figure 8 Image in (f).
[0123] Through the image processing method of the embodiment of the present disclosure, the illumination of each original image can be compensated to the illumination value of the first image, and the compensation benchmark of each pixel point of the whiteboard is consistent. Therefore, no matter what kind of changes occur in the original illumination in the environment, resulting in various defects (bright spots, dark light) in the original image, the target image after the illumination compensation of each pixel point is consistent can remove the defects without affecting the foreground content of other areas, thereby enhancing the effect of illumination compensation.
[0124] In a specific embodiment, the image processing method also includes: for each original image in the same video, based on the first image corresponding to the video and each original image, generating a second image for lighting compensation of each original image, so as to use each second image to perform lighting compensation on each original image respectively, and obtain a target video with consistent lighting.
[0125] In actual applications, the shooting light will not only affect the shooting quality of the original image, such as bright spots and dark spots in the original image, but also affect the overall shooting quality and user experience of the video. For example, the shooting light suddenly changes at a certain moment in the video, making the lighting of the same pixel point inconsistent in the first and second half of the video, such as the change in the lighting value, which affects the user experience.
[0126] Therefore, the disclosed embodiment generates a second image for illumination compensation of each original image in the same video based on the same first image corresponding to the video and each original image. Specifically, for each original image, the pixel value of each pixel point in the first image corresponding to the video and the pixel value of the corresponding pixel point in the original image can be subtracted to obtain a differential image, and the differential image is processed to generate a second image corresponding to each original image after removing the foreground content. Then, the second image corresponding to each original image is used to perform illumination compensation on the corresponding original image to obtain a target image with consistent illumination.
[0127] After performing illumination compensation on each original image, each target image may be combined into a target video according to the shooting order of each original image in the video.
[0128] In a specific embodiment, the illumination values of each pixel point in the background area of the multiple target images are consistent.
[0129] In some embodiments, the same image enhancement process may be performed on each target image, and the target images after image enhancement may be combined into a target video.
[0130] For example, still using the whiteboard image as an example, Figure 7 The whiteboard image in the video can be an image of any frame in the video. The original images in the same video use the same pure white image 702 and perform the same processing, such as illumination compensation and image enhancement in steps 2 to 6. Since each whiteboard image is compensated to the 255 pixel value of the pure white image and the compensated background is consistent, no matter how the original shooting light in the environment changes, the illumination compensation effect of each original image in the video remains consistent, thereby improving the user experience.
[0131] In a specific embodiment, the method may include: determining a first image corresponding to each original image in the video; and determining a first image corresponding to the video from the first images corresponding to each original image.
[0132] For example, the first image corresponding to each original image may be determined based on multiple interactions, and the first image corresponding to the video may be determined from the first images corresponding to each original image. Alternatively, the first image corresponding to each original image may be determined based on one interaction, in which case the first images corresponding to each original image are the same, that is, the first image corresponding to the video.
[0133] Alternatively, the first image corresponding to each original image may be determined according to the color feature of each original image, and then the first image corresponding to the video may be selected from the first images corresponding to each original image.
[0134] In an illustrative embodiment, a first image may be randomly determined from the first images corresponding to the original images as the first image corresponding to the video. Alternatively, the first image corresponding to the video may be determined from the first images corresponding to the original images according to the color features of the original images. Alternatively, the first images corresponding to the original images may be fused into a first image, and the fused first image may be used as the first image corresponding to the video. Alternatively, the first image corresponding to the video may be determined from the first images corresponding to the original images according to the shooting position of the original images in the video.
[0135] For example, for a video recording the increase of writing marks on a whiteboard, as time goes by, the writing marks on the whiteboard in the video will continue to increase, and the number of pixels of the writing marks in the original image will gradually increase, which may cause the first image corresponding to the original image at different shooting times of the video to be too different. For example, at the beginning of the video, the first image corresponding to the whiteboard image recording a blank whiteboard is a pure white image; at the end of the video, the first image corresponding to the whiteboard image recording a full whiteboard is a pure black image, and it is difficult to distinguish the black writing marks on the whiteboard.
[0136] Therefore, for a video with added writing traces, the first image corresponding to the original image at the beginning of the video is determined as the first image corresponding to the video, so as to avoid affecting the writing traces in the target video after illumination compensation.
[0137] Alternatively, for a video recording the reduction of writing marks, such as a video of erasing writing marks on a whiteboard, a first image corresponding to the original image at the end of the video may be determined as the first image corresponding to the video.
[0138] Alternatively, the original image with the least amount of writing traces may be determined from the original images, and the first image corresponding to the original image with the least amount of writing traces may be determined as the first image corresponding to the video.
[0139] Similarly, determining the original image with the least amount of writing traces and the first image corresponding to the original image at the end of the video as the first image corresponding to the video can also avoid affecting the writing traces in the target video after illumination compensation.
[0140] The embodiments of the present disclosure provide an image processing method that can adapt to original images of various shooting lights. No matter whether the surrounding shooting light is too dark or overexposed, or the shooting light changes suddenly, it will not affect the result after illumination compensation, so as to provide users with a better user experience.
[0141] For images or videos with document-type contents such as text and graphics as foreground content, the above-mentioned image processing method can avoid various problems such as the disappearance of text content information after image processing due to dark light and the appearance of obvious bright spots after image processing due to overexposure. It improves the applicability and lighting compensation effect of images and videos under various shooting lights and improves user experience.
[0142] Fig. 9 The block diagram schematically shows an image processing apparatus according to an embodiment of the present disclosure.
[0143] like Fig. 9 As shown, the image processing apparatus 900 includes a generating module 910 and a compensating module 920 .
[0144] The generating module 910 is used to generate a second image for illumination compensation according to the original image and a first image corresponding to the original image, wherein the first image is a pure color image.
[0145] The compensation module 920 is used to perform illumination compensation on the original image using the second image to obtain a target image with consistent illumination.
[0146] In one embodiment, the compensation module 920 includes a first compensation submodule for performing illumination compensation on the original image using the second image to obtain a target image with the same illumination value for each pixel in the background area, where the illumination value includes: brightness value and / or contrast value.
[0147] In one embodiment, the generating module 910 includes a generating submodule, which is used to generate a second image for illumination compensation according to the difference in pixel value of each pixel point between the original image and the first image.
[0148] In one embodiment, the size of the first image is consistent with the size of the original image. The generation submodule includes a first generation unit and a second generation unit.
[0149] The first generating unit is used to perform a difference between the pixel value of each pixel point in the first image and the pixel value of the corresponding pixel point in the original image to obtain a difference map representing the illumination difference.
[0150] The second generating unit is used to perform image processing on the difference image to generate a second image with the foreground content removed.
[0151] In one embodiment, the foreground content includes at least one of the following: text, graphics.
[0152] In one embodiment, the second generating unit further includes a first filtering subunit, which is used to perform filtering processing on the difference image to obtain a second image after removing the foreground content.
[0153] In one embodiment, the second generation unit further includes a second filtering subunit for filtering the difference image based on a target blur kernel to obtain a second image after removing the foreground content, and the size of the target blur kernel is positively correlated with the size of the original image.
[0154] In one embodiment, the original image is a whiteboard image with writing traces, and the first image is a pure white image with the same background color as the whiteboard. The image processing device 900 includes a whiteboard image generation module and a whiteboard image compensation module.
[0155] The whiteboard image generation module is used to generate a second image for illumination compensation according to the pure white image and the whiteboard image.
[0156] The whiteboard image compensation module is used to use the second image to perform illumination compensation on each pixel in the whiteboard image to obtain a target image with writing traces and the same illumination value for each pixel of the whiteboard.
[0157] In one embodiment, the size of the pure white image is consistent with the size of the whiteboard image. The whiteboard image compensation module includes a third generation unit and a fourth generation unit.
[0158] The third generating unit is used to perform a difference between the pixel value of each pixel point in the pure white image and the pixel value of the corresponding pixel point in the whiteboard image to obtain a difference map representing the difference in pixel values.
[0159] The fourth generating unit is used to remove the writing traces in the difference image to obtain a second image after the writing traces are removed.
[0160] In one embodiment, the first image is obtained by at least one of the following methods: determining the first image corresponding to the original image based on interaction; determining the first image based on color features of the original image.
[0161] For example, the image processing device 900 further includes a first determining module and / or a second determining module.
[0162] The first determination module is used to determine a first image corresponding to the original image based on the interaction.
[0163] The second determination module is used to determine the first image based on the color feature of the original image.
[0164] In one embodiment, the second determination module includes a pixel calculation submodule and a first determination submodule.
[0165] The pixel calculation submodule is used to calculate the pixel average value of each pixel in the original image.
[0166] The first determination submodule is used to determine the standard color segment where the pixel average value is located, and determine the first image based on the standard color segment.
[0167] In one embodiment, the original image is a real-time image collected during the live broadcast process, and the image processing device 900 includes a real-time image generation module and a real-time image compensation module.
[0168] The real-time image generation module is used to determine a first image corresponding to the real-time image based on the color characteristics of the real-time image, and to generate a second image for illumination compensation according to the real-time image and the first image corresponding to the real-time image.
[0169] The real-time image compensation module is used to use the second image to perform illumination compensation on the real-time image, obtain a target live image with consistent illumination, and display the target live image.
[0170] In one embodiment, the compensation module 920 includes a second compensation submodule, which is used to add the pixel value of each pixel point in the second image to the pixel value of the corresponding pixel point in the original image to obtain the target image.
[0171] In one embodiment, the image processing device 900 further includes an enhancement module for performing enhancement processing on the target image, and the enhancement processing includes at least one of the following: contrast transformation and sharpening.
[0172] In one embodiment, the original image includes a whiteboard image with writing traces. The enhancement module includes an enhancement submodule for transforming the contrast of the target image and performing sharpening processing on the target image after the contrast transformation to obtain an enhanced image with enhanced writing traces.
[0173] In one embodiment, the image processing device 900 includes a video processing module for generating, for each original image in the same video, a second image for illumination compensation of each original image based on a first image corresponding to the video and each original image, so as to use each second image to perform illumination compensation on each pixel in each original image, respectively, to obtain a target video with consistent illumination, in which each original image in the target video and each pixel in each original image have consistent illumination.
[0174] In one embodiment, the image processing device 900 further includes a third determining module and a fourth determining module. The third determining module is used to determine the first image corresponding to each original image in the video. The fourth determining module is used to determine the first image corresponding to the video from the first images corresponding to each original image.
[0175] In one embodiment, the video is a video recording changes in writing traces on a whiteboard. The fourth determination module includes a second determination submodule for determining, for the video recording the addition of writing traces, a first image corresponding to the original image at the beginning of the video as the first image corresponding to the video.
[0176] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0177] It should be noted that the device part in the embodiments of the present disclosure corresponds to the method part in the embodiments of the present disclosure. The description of the device part specifically refers to the method part and will not be repeated here.
[0178] Fig.10 A block diagram of an electronic device suitable for an image processing method according to an embodiment of the present disclosure is schematically shown. Fig.10 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.
[0179] like Fig.10 As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 to a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0180] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0181] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the input / output (I / O) interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output (I / O) interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage portion 1008 as needed.
[0182] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0183] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0184] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0185] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 1002 and / or the RAM 1003 described above and / or one or more memories other than the ROM 1002 and the RAM 1003 .
[0186] The embodiments of the present disclosure also include a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiments of the present disclosure.
[0187] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0188] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0189] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two 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 box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0191] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. An image processing method, comprising: generating a second image for illumination compensation according to an original image and a first image corresponding to the original image, wherein the first image is a pure color image; The second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination.
2. The method according to claim 1, characterized in that Performing illumination compensation on the original image using the second image to obtain a target image with consistent illumination includes: The second image is used to perform illumination compensation on the original image to obtain a target image with the same illumination value for each pixel in the background area, where the illumination value includes: brightness value and / or contrast value.
3. The method according to claim 1, wherein: The step of generating a second image for illumination compensation according to an original image and a first image corresponding to the original image comprises: The second image for illumination compensation is generated according to the difference in illumination values of each pixel point between the original image and the first image.
4. The method according to claim 3, wherein: The size of the first image is consistent with the size of the original image, and generating the second image for illumination compensation according to the illumination value difference of each pixel point between the original image and the first image includes: Subtracting the pixel value of each pixel point in the first image from the pixel value of the corresponding pixel point in the original image to obtain a difference map representing the difference in illumination value; The difference image is subjected to image processing to generate the second image after the foreground content is removed.
5. The method according to claim 4, wherein: The foreground content includes at least one of the following: text and graphics.
6. The method according to claim 4, wherein: The performing image processing on the difference image to generate the second image after removing the foreground content comprises: Based on a target blur kernel, the difference image is filtered to obtain the second image after the foreground content is removed, and the size of the target blur kernel is positively correlated with the size of the original image.
7. The method according to claim 1, wherein: The original image is a whiteboard image with writing traces, and the first image is a pure white image with the same background color as the whiteboard.
8. The method according to any one of claims 1 to 7, wherein: The first image is obtained by at least one of the following methods: Determining the first image corresponding to the original image based on the interaction; The first image is determined based on the color characteristics of the original image.
9. The method according to claim 8, wherein: The determining the first image based on the color feature of the original image includes: Calculate the pixel average value of each pixel in the original image; A standard color segment in which the pixel average value is located is determined, and the first image is determined based on the standard color segment.
10. The method according to claim 8, wherein: The original image is a real-time image collected during the live broadcast process, and the method includes: determining the first image corresponding to the real-time image based on the color feature of the real-time image, and generating a second image for illumination compensation according to the real-time image and the first image corresponding to the real-time image; The second image is used to perform illumination compensation on the real-time image to obtain a target live image with consistent illumination, and the target live image is displayed.
11. The method according to any one of claims 1 to 7, wherein: The step of performing illumination compensation on the original image using the second image to obtain a target image with consistent illumination includes: The pixel value of each pixel point in the second image is added to the pixel value of the corresponding pixel point in the original image to obtain the target image.
12. The method according to claim 1, further comprising: The target image is enhanced, wherein the enhancement includes at least one of the following: contrast transformation and sharpening.
13. The method according to claim 1, further comprising: For each of the original images in the same video, a second image for illumination compensation of each of the original images is generated based on the first image corresponding to the video and each of the original images, so that each of the original images can be illuminated using each of the second images to obtain a target video with consistent illumination.
14. The method according to claim 13, further comprising: Determine the first image corresponding to each of the original images in the video; The first image corresponding to the video is determined from the first images corresponding to the original images.
15. An electronic device, comprising: one or more processors; a memory for storing one or more programs, 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 14.
16. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Image processing method, terminal and computer readable storage medium
CN108234970A
Image light supplementing method and device and computer device
CN109785423A
Image processing method and device, storage medium and electronic equipment
CN110060213A
Image generation method and device, electronic equipment and computer readable storage medium
CN111402384A
Image processing method and device, computer equipment and storage medium
CN111681201A
