Image processing methods, electronic devices and computer-readable storage media
By generating solid color images for illumination compensation, the problem of uneven illumination in images taken under different lighting conditions is solved, achieving a target image with consistent illumination and improving image quality and user experience.
Patent Information
- Application Number
- CN202411325845.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-09-23
AI Technical Summary
Images taken in poor lighting conditions often make it difficult to read text, and existing lighting compensation techniques can easily cause text to disappear or bright spots to appear.
A solid color image corresponding to the original image is generated as the first image. This solid color image is then used for illumination compensation to generate a second image for illumination compensation. This second image is then superimposed on the original image to achieve a target image with consistent illumination.
It improves the lighting compensation effect of images captured under various shooting conditions, ensuring clear image content, especially consistent lighting in the background area, without affecting the foreground content, thus enhancing the user experience.
Smart Images

Figure CN119136060B_ABST
Abstract
Description
Technical Field
[0001] This 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 Technology
[0002] With the continuous development of computer technology, users can take photos, record videos, live stream, and start video conferences anytime, anywhere. However, the image quality captured by various shooting methods is affected by the lighting conditions. For example, text in images taken in poor lighting is difficult to read, and even after image processing, various problems may arise. For instance, enhancing images taken in low light conditions can cause text to disappear, while enhancing images taken in overexposed conditions can result in noticeable bright spots. 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 raw images captured under shooting light conditions.
[0004] One aspect of this disclosure provides an image processing method, comprising: 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 solid 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 this disclosure provides an electronic device comprising: one or more processors; and 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 cause the one or more processors to implement the image processing method described above.
[0006] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the methods described above.
[0007] Another aspect of this disclosure provides a computer program product including computer-executable instructions that, when executed, are used to implement the methods described above.
[0008] In the embodiments of this disclosure, a second image for illumination compensation is generated based on the original image and the first image. This second image is then used to perform illumination compensation on the original image, ensuring consistent illumination in the target image. This resolves the impact of dark areas, overexposed areas, or bright spots in the original image on the image content, improving the illumination compensation effect for original images captured under various lighting conditions. Furthermore, since the first image in these embodiments is a solid color image corresponding to the original image, when the second image is used to perform illumination compensation on the original image to obtain the target image, the illumination of the target image can be adapted to the original image, thus improving the illumination compensation effect for original images captured under various lighting conditions and enhancing the user experience. Attached Figure Description
[0009] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0010] Figure 1 The illustration schematically shows an exemplary system architecture for image processing methods and apparatus to which the present disclosure can be applied;
[0011] Figure 2 A flowchart illustrating an image processing method according to an embodiment of the present disclosure is shown schematically.
[0012] Figure 3 A flowchart illustrating the generation of a second image for illumination compensation according to an embodiment of the present disclosure is shown schematically.
[0013] Figure 4 The illustration shows the effect of illumination compensation on a whiteboard image using a specific embodiment of the present disclosure.
[0014] Figure 5 A flowchart illustrating the determination of a first image according to an embodiment of the present disclosure is shown schematically.
[0015] Figure 6 A flowchart illustrating an image processing method according to another embodiment of the present disclosure is shown schematically.
[0016] Figure 7 A schematic diagram of a whiteboard image processing flowchart according to a specific embodiment of the present disclosure is shown.
[0017] Figure 8 The illustration shows the effect of illumination compensation and enhancement on a whiteboard image according to a specific embodiment of the present disclosure.
[0018] Figure 9 A block diagram of an image processing apparatus according to an embodiment of the present disclosure is shown schematically.
[0019] Figure 10 A block diagram of an electronic device suitable for an image processing method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0020] The embodiments of the present disclosure will now 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 disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0021] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0022] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0023] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0024] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0025] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0026] Figure 1 An exemplary system architecture 100 for image processing methods and apparatus of this disclosure is schematically illustrated. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this 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 can be various electronic devices that support shooting functions, including but not limited to smartphones, tablets, laptops, desktop computers, cameras, shooting watches, gimbals with shooting functions, etc.
[0029] Users can use the first terminal device 101 and the second terminal device 102 to interact with the server 103 via 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, photography applications, image processing applications, etc. (for example only).
[0030] In one illustrative embodiment, the first terminal device 101 can be installed on a gimbal, and the user can control the gimbal to capture raw images, record videos, start video conferences or live broadcasts through the first terminal device 101.
[0031] Optionally, the image processing method of this disclosure embodiment can be implemented by a first terminal device 101 and a 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 solid color image; and use the second image to perform illumination compensation on the original image to obtain a target image with consistent illumination.
[0032] Optionally, the image processing method of this embodiment can also be implemented by server 103. For example, the first terminal device 101 and the second terminal device 102 obtain an original image and send it to server 103. Server 103 generates a second image for illumination compensation based on the original image and a first image corresponding to the original image. The first image is a solid color image. The second image is used to perform illumination compensation on the original image to obtain a target image with consistent illumination. Server 103 can also return the illumination-compensated target image to the first terminal device 101 and the second terminal device 102 for display to the user.
[0033] It should be understood that Figure 1The number of terminal devices and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices and servers can be used.
[0034] Figure 2 A flowchart illustrating an image processing method according to an embodiment of the present disclosure is shown schematically.
[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 based on the original image and the first image corresponding to the original image. The first image is a solid color image.
[0037] Specifically, the original image can be an image without illumination compensation. In one specific embodiment, the original image can be obtained directly from a terminal device with a shooting function. For example, the original image can be an image captured under various shooting light conditions, an image at a specific moment in a video, or a real-time image acquired during a video conference or live broadcast. In another embodiment, the original image can also be an image that has undergone other image processing but without illumination compensation, such as resizing or noise reduction.
[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 be matched with the same first image, and one original image can also be matched with one first image. The first image is a solid color image, that is, all pixels in the first image have the same pixel value and the same illumination value. The illumination value includes: brightness value and / or contrast value, both of which can be determined by the pixel values (R, G, B) of the image.
[0039] In one embodiment, the second image includes multiple illumination values, each used to perform illumination compensation on each pixel in the original image. For example, one of the multiple illumination values can be used to perform illumination compensation on one or more 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 solid color image, using one illumination value to perform illumination compensation on multiple pixels means that the illumination values of the multiple pixels being compensated are consistent in the original image.
[0040] In embodiments of this disclosure, a second image for illumination compensation can be generated by performing image processing on the original image and the first image. For example, the second image can be generated based on the difference in illumination values between the original image and the first image.
[0041] In step S220, the original image is illuminated using the second image to obtain a target image with consistent illumination.
[0042] Specifically, the second image is used for illumination compensation; 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 simultaneously, or multiple illumination values in the second image can be used to perform illumination compensation on some pixels in the original image separately. 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, meaning the illumination value is the same.
[0044] In the embodiments of this disclosure, a second image for illumination compensation is generated based on the original image and a first image corresponding to the original image. Illumination compensation is then performed on the original image using the second image, ensuring consistent illumination in the target image. This solves the technical problem of image content being affected by various shooting light conditions in the original image, enhancing dark areas, overexposed areas, or bright spots in the original image, and improving the illumination compensation effect for original images captured under various shooting light conditions. Furthermore, since the first image in these embodiments is a solid color image corresponding to the original image, 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 for original images captured under various shooting light conditions and enhancing the user experience.
[0045] In one specific embodiment, operation S220 includes: using the second image to perform illumination compensation on the original image to obtain a target image in which the illumination values of each pixel in the background region are the same, wherein the illumination values include: brightness value and / or contrast value.
[0046] The original image includes a background region and foreground content. When compensating the original image using the second image, illumination compensation can be applied to both the foreground content and the background region simultaneously. This ensures that the illumination values of all pixels in the background region of the target image are the same, and that the illumination values of all pixels in the background region are identical to those in the first image. The illumination values of all pixels in the foreground content of the target image can be the same or different, but they are typically different from those in the background region to prevent the foreground content from disappearing from the target image.
[0047] For example, consider an original image with black text on a white background. The foreground content is black text, and the background area is white. The first image is a pure white image. Due to lighting conditions during shooting, the illumination values of multiple pixels on the white background differ; in reality, the illumination values of these pixels are all the illumination values corresponding to "white". Therefore, using the second image to perform illumination compensation on the original image with black text on a white background can compensate the illumination values of each pixel on the white background in the target image to the illumination values corresponding to "white", but it cannot compensate the illumination values of each pixel on the black text to the illumination values corresponding to "white", which would cause the black text to disappear from the target image. Furthermore, the illumination values of each pixel on the black text can be the same, such as the illumination values 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 real-time operation described above will be further explained below.
[0049] In one specific embodiment, for step S210, generating a second image for illumination compensation based on the original image and a first image corresponding to the original image includes: generating a second image for illumination compensation based on the difference in illumination values of each pixel between the original image and the first image.
[0050] In this embodiment, the first image is a solid color image. Therefore, each pixel in the original image can be compared with the corresponding pixels in the first image to obtain the difference in illumination value for each pixel. Then, based on the difference in illumination value for each pixel, a second image for illumination compensation is generated.
[0051] Since illumination values can be determined based on pixel values, differences in illumination values can be reflected through differences in pixel values. A second image for illumination compensation can be generated based on the differences in pixel values between the original image and the first image. The second image can then be used to compensate for the illumination of the original image, resulting in a target image with consistent illumination.
[0052] Figure 3 A flowchart illustrating the generation of a second image for illumination compensation according to an embodiment of the present disclosure is shown schematically.
[0053] In a specific embodiment 300, generating a second image for illumination compensation based on the illumination differences of each pixel between the original image and the first image includes steps S311 to S312.
[0054] In step S311, the pixel values of each pixel in the first image are subtracted from the corresponding pixel values in the original image to obtain a difference map representing the difference in illumination values.
[0055] Specifically, the pixel value of each pixel in the original image can be used to calculate the illumination value at the location of each pixel. Since the first image is a solid color image in which the pixel value and illumination value of each pixel are the same, the difference image representing the difference in illumination value can be obtained by subtracting the pixel value of each pixel in the first image from the pixel value of the corresponding pixel in the original image.
[0056] The original image and the first image are the same size; therefore, each pixel in the first image corresponds one-to-one with each pixel in the original image. Subtraction can be understood as subtracting the pixel values of each pixel in the original image from the pixel values of each pixel in the first image. In the resulting difference image, the pixel values of each pixel can be the same or different. For example, if the shooting light was the same for all pixels in the original image, subtracting the first image from the original image will result in the same pixel values for all pixels in the difference image. If the shooting light differs for each pixel in the original image, subtracting the first image from the original image will result in different pixel values for all pixels in the difference image.
[0057] In step S312, the difference image is processed to generate a second image after removing the foreground content.
[0058] Specifically, the original image includes foreground content and background areas. The difference operation in step S311 does not distinguish between background areas and foreground content. After obtaining the difference image, image processing can be performed on the difference image to generate a second image after removing the foreground content, so as to avoid the subsequent step S220 using the second image to perform illumination compensation on 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 treated as noise content and denoised on the difference image to obtain a second image with the foreground content removed. In other embodiments, various segmentation algorithms can be used to segment the foreground content in the difference image to obtain a second image with the foreground content removed. In still other embodiments, the foreground content in the difference image can be overlaid to obtain a second image with the foreground content removed.
[0060] The embodiments of this disclosure obtain a difference map representing the difference in illumination values by performing a subtraction operation on pixels. Then, image processing is performed on the difference map to generate a second image after removing foreground content. This ensures that when using the second image after removing foreground content to perform illumination compensation on the original image, different illumination compensations are applied to 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 embodiments of this disclosure, the foreground content includes at least one of the following: text and graphics. It is understood that for line-shaped text and graphics, the ratio of the number of pixels in the line strokes to the total number of pixels in the area occupied by the entire text or image is usually small. Therefore, images after existing lighting compensation operations may not display line-shaped text or graphics, or may have missing lines, resulting in poor lighting compensation effects.
[0062] The embodiments of this disclosure generate a second image by using the above-described image processing method, removing foreground content such as text and graphics, and then use the second image 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 the foreground content with line shapes is not affected, thereby improving the illumination compensation effect of the original image with foreground content with line shapes.
[0063] In one specific embodiment, step S312, which involves image processing of the difference image to generate a second image after removing foreground content, includes: filtering the difference image based on a target blur kernel to obtain a second image after removing foreground content, wherein the size of the target blur kernel is positively correlated with the size of the original image.
[0064] Specifically, a linear filtering method can be used to filter the difference image through a blur kernel to obtain a second image after removing foreground content.
[0065] In this embodiment, there are certain requirements for the fuzzy kernel used for linear filtering, that is, the target fuzzy kernel is used to filter the difference image.
[0066] The target blur kernel can be understood as the filtering window used in linear filtering. By sliding the target blur kernel, filtering operations are performed on different regions of 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 larger features, while a smaller blur kernel can extract smaller features.
[0067] For example, for text or images with linear shapes, a larger target blur kernel can be used to remove the foreground content of this feature.
[0068] In this embodiment of the disclosure, the original image has a large selection space. For example, the original image can have multiple sizes, such as 1242x1660 pixels, 1125x633 pixels, etc.
[0069] Therefore, the size of the target blur kernel is positively correlated with the size of the original image, which makes the filtering process applicable to original images of various sizes, improves the applicability of illumination compensation for original images of various sizes, and at the same time ensures 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, 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 foreground content. Specifically, the filtering process includes at least one of the following: median filtering, average value filtering, magnitude filtering, sliding filtering, Gaussian filtering, bilateral filtering, etc. Alternatively, the filtering process can be a combination of at least one of the above filtering methods. In this embodiment, the foreground content is treated as noise content and removed through filtering.
[0072] By filtering the difference image to remove foreground content, the second image after removing the foreground content can distinguish between linear foreground content and background, which helps to improve the illumination compensation effect of using the second image after removing the foreground content to compensate the original image.
[0073] In one illustrative embodiment, the original image is a whiteboard image with writing marks, 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; and using the second image to perform illumination compensation on the whiteboard image to obtain a target image with writing marks and the same illumination value for each pixel of the whiteboard.
[0075] Specifically, the size of the pure white image is the same as the size of the whiteboard image. The pixel values of each pixel in the pure white image and the corresponding pixel values in the whiteboard image can be subtracted to obtain a difference image representing the difference in pixel values. The writing marks in the difference image are removed to obtain a second image after removing the writing marks.
[0076] The method for subtracting the pure white image and the whiteboard image in this embodiment is the same as in the above embodiments, and will not be repeated here.
[0077] Figure 4 The illustration shows the effect of illumination compensation on a whiteboard image using a specific embodiment of the present disclosure. Figure 4 The document contains four images, from image (a) to image (d).
[0078] For example, image (a) is a whiteboard image with black text on a white background. In image (a), there are two obvious bright spots in the upper right corner. Compared to the writing marks in other areas without bright spots, the writing marks covered by the bright spots are not very clear. Image (b) is a difference image obtained by subtracting image (a) from a pure white image with pixel values of 255. Image (c) is the second image after filtering image (b) to remove the writing marks. In image (c), it can be seen that the positions corresponding to the bright spots are significantly different from other areas, meaning the second image includes at least two pixel values / illuminance values (the pixel values / illuminance values corresponding to the bright spots and other areas, respectively). Image (d) is the target image obtained after applying illumination compensation to each pixel in image (a) using image (c). In image (d), the bright spots in image (a) are removed, and the writing marks "VP" covered by the bright spots are also restored.
[0079] For whiteboard images captured under various lighting conditions, when a target image with consistent lighting is obtained by using a second image to perform illumination compensation on the whiteboard image, the illumination values of each pixel (including bright spots) in the whiteboard area of the target image can be matched with the original image, i.e., remain white, and the black writing marks in the target image are also enhanced compared to the original image. Therefore, the embodiments of this disclosure can improve the illumination compensation effect for whiteboard images captured under various lighting conditions, thereby enhancing the user experience.
[0080] It should be noted that the above example only uses a whiteboard image with writing marks as the original image, but it is not limited to the above scenario.
[0081] For example, the original image could be a photograph of a paper document containing multiple text elements, with the text itself as the foreground. The corresponding first image could also be a plain white image. The pixel values of each pixel in the plain white image are subtracted from the corresponding pixel values in the paper document photograph to obtain a difference image. The text in the difference image is then removed, resulting in a second image with the text removed. Finally, the second image is used to apply illumination compensation to the paper document photograph, resulting in a paper document photograph where the white blank area (i.e., the background area) has the same illumination value.
[0082] For example, the original image can also be a blackboard image with chalk writing marks on it, with the foreground content being the chalk writing marks, and the first image corresponding to the blackboard image being a pure black image with a pixel value of 0. The image processing method is similar to that of the whiteboard image mentioned above, and will not be repeated here.
[0083] According to embodiments of this disclosure, the first image used in step S210 that corresponds to the original image 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 obtaining the original image, the user is shown the original image and a first image selection prompt, so that the user can interactively select the first image corresponding to the original image.
[0086] Considering that illumination compensation of the original image needs to ensure that the foreground content can be clearly identified in the target image, the color features of the original image can refer to the overall color features of the original image or the color features of the background area of the original image, in order to distinguish the foreground content from the background area.
[0087] The embodiments of this disclosure determine a first image through interactive or color features of the original image. A second image can be generated for each original image using the corresponding first image. The second image is then used to perform illumination compensation on the original image to obtain a target image with consistent illumination. Since the illumination values of each pixel in the target image are compensated to the illumination values 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. This improves the illumination compensation effect for various original images and enhances the user experience.
[0088] Figure 5 A flowchart illustrating the determination of a first image according to an embodiment of the present disclosure is shown schematically.
[0089] In one embodiment 500, determining the first image based on the color features of the original image includes steps S510 and S520.
[0090] Step S510: Calculate the average pixel value of each pixel in the original image.
[0091] Step S520: Determine the standard color segment in which the average pixel value is located, and determine the first image based on the standard color segment.
[0092] When the foreground content of the original image consists of text, graphics, or other line shapes, the average pixel value of each pixel in the original image can reflect the color characteristics of the background area. This is because the number of pixels in line shapes is much smaller than the number of pixels in the background; therefore, the average pixel value represents the color characteristics of the background area. For other types of original images, the average pixel value represents the overall color characteristics of the original image.
[0093] The pixel values of each pixel in the original image may deviate due to the influence of the shooting light. Figure 4Taking images (a) and (d) in the embodiment as examples, the background in image (a) appears to the naked eye as a white board with a white pixel value of 255. However, due to the influence of the shooting light, the pixel value of the background in image (a) is not 255, but rather other pixel values close to white, such as 230, and the calculated average pixel value is not 255.
[0094] Therefore, after determining the average pixel value of the original image, the pixel value of the standard color segment in which the average pixel value is located is used as the pixel value of the first image, generating a solid color first image with the same size as the original image. If the average pixel value of each pixel in the original image is 234, and its standard color segment is white, then a pure white image with a pixel value of 255 can be generated.
[0095] The embodiments of this disclosure calculate the average pixel value of each pixel in the original image and determine the first image based on the standard color segment where the average pixel value is located. This can determine the first image that best matches the original image, making the target image seen by the user's naked eye closer to the original image and the foreground content clearer. This can improve the effect of illumination compensation and enhance the user experience.
[0096] In practical applications, for real-time scenarios such as live streaming and online meetings, the original image is a real-time image, and it is difficult to determine the first image corresponding to each 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 captured during the live broadcast. The image processing method includes: determining a first image corresponding to the real-time image based on the color features of the real-time image, and generating a second image for illumination compensation based on the real-time image and the first image corresponding to the real-time image; using the second image to perform illumination compensation on the real-time image to obtain a target live broadcast image with consistent illumination, and displaying the target live broadcast image.
[0098] Specifically, the average pixel value of each pixel in the real-time image can be calculated, the standard color segment in which the average pixel value is located can be determined, and a first image corresponding to the real-time image can be determined based on the standard color segment. A second image for illumination compensation is generated based on the real-time image and the corresponding first image. Illumination compensation is then performed on the real-time image using the second image to obtain a target live-stream image with the same illumination value for each pixel in the background area, and this target live-stream image is then displayed. Therefore, this embodiment enables automatic illumination compensation of the real-time image in real time and displays a target live-stream image with the same illumination value to the user, improving the user experience.
[0099] In some embodiments, for step S220, using the second image to perform illumination compensation on the original image to obtain a target image with consistent illumination includes: 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 second image has the same dimensions as the original image. The pixel values 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 / pixel values of the first image.
[0101] In summary, through the above embodiments, illumination compensation can be performed on the original image through steps S210 and S220 to obtain a target image with consistent illumination.
[0102] In other embodiments, the target image may also undergo other image processing. Figure 6 A flowchart illustrating an image processing method according to another embodiment of the present disclosure is shown schematically.
[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 based on the original image and the first image corresponding to the original image. The first image is a solid color image.
[0105] In step S620, the original image is illuminated using the second image to obtain a target image with consistent illumination.
[0106] In step S630, the target image is enhanced.
[0107] In this embodiment, steps S610 and S620 are similar to steps S210 and S220, and will not be described again here.
[0108] Specifically, the target image is the image after illumination compensation of the original image. In addition to illumination compensation of the original image, various image processing can be performed on the target image through step S630, such as enhancement processing, to enhance the foreground content in the target image and improve the user experience.
[0109] Specifically, the enhancement process in step S630 includes at least one of the following: contrast transformation and sharpening. Contrast transformation includes increasing contrast, decreasing contrast, or adjusting contrast to a predetermined contrast value. In some embodiments, a preferred contrast value can be predetermined.
[0110] Sharpening includes, but is not limited to: adjusting sharpening parameters, adjusting sharpening radius, adjusting sharpening filters, etc.
[0111] The enhancement processing in this embodiment includes, but is not limited to, individual enhancement processing or combined processing such as contrast transformation and sharpening. It 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 a target image with consistent lighting. For example, various artificial intelligence algorithms such as convolutional neural network models, encoder-decoder models, and deep network models can also be used for image enhancement.
[0112] The embodiments of this disclosure enhance the clarity of foreground content on a target image with consistent lighting by performing enhancement processing on the target image, thereby improving the user experience.
[0113] In one specific embodiment, the original image is a whiteboard image with writing marks. The writing marks in the whiteboard image are typically foreground content such as strokes, shapes, or lines. 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-S620, the contrast of the target image can be changed to enhance the details of the writing marks, making them easier for the user to identify. Furthermore, the target image after contrast change is sharpened to focus on the edges of the writing marks, improving the clarity or focal length of the writing marks in the image, making the colors of the writing marks in the target image more vivid, improving the image processing effect, and making it easier for the user to identify them.
[0114] To make this disclosure easier to understand, a whiteboard image will be used as an example below. Figure 7 and Figure 8 A specific embodiment will be further described.
[0115] Figure 7 A schematic diagram of a whiteboard image processing flowchart according to a specific embodiment of the present disclosure is shown. Figure 8 The illustration shows the effect of illumination compensation and enhancement on a whiteboard image according to a specific embodiment of the present disclosure. Figure 8 Includes six images in total, from image (a) to image (f), each image corresponding to... Figure 7 The image after one step of processing.
[0116] Step 1: For whiteboard image 701, first create a pure white image 702 with the same size as whiteboard image 701, and use pure white image 702 as the first image corresponding to whiteboard image 701. Figure 8 Image (a) in the image is the whiteboard image 701.
[0117] Step 2: Subtract the pure white image 702 and the whiteboard image 701 pixel by pixel to obtain the difference image 703 used for illumination compensation. Figure 8Image (b) in the image is the difference image 703.
[0118] Step 3: Use the target blur check to perform median filtering on the difference map 703 obtained in Step 2.
[0119] Because the writing marks in the whiteboard image 701 are all line-shaped characters, the text will disappear after median filtering of the difference image 703 using a large blur kernel, resulting in a text-free second image 704. 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 adapts to different sizes of whiteboard images 701. Figure 8 Image (c) in the image 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 the target image 705 with consistent lighting in the whiteboard area. Figure 8 Image (d) is the target image 705. As shown in image (d), the bright spots in the whiteboard image 701 have also been removed.
[0121] Step 5: Next, image enhancement is performed on the target image 705 obtained in step 4 to obtain the enhanced image, such as... Figure 8 Image (e) in the image.
[0122] Step 6: Finally, adjust the contrast and sharpness of the image obtained in Step 5 sequentially to obtain an enhanced image 706 with a stable enhancement effect, as shown. Figure 8 Image (f) in the image.
[0123] The image processing method of the present disclosure can compensate the illumination of each original image to the illumination value of the first image, and the compensation benchmark of each pixel on the white board is consistent. Therefore, no matter what changes occur in the original illumination in the environment, causing various defects (bright spots, dark light) in the original image, the target image after the illumination of each pixel is compensated to be consistent can remove the defects without affecting the foreground content of other areas, thus enhancing the effect of illumination compensation.
[0124] In one specific embodiment, the image processing method further includes: for each original image in the same video, generating 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 original image respectively, thereby obtaining a target video with consistent illumination.
[0125] In practical applications, shooting light not only affects the quality of the original image (e.g., bright spots and dark spots), but also the overall quality of the video and the user experience. For example, a sudden change in shooting light at a certain moment in the video can cause inconsistent lighting for the same pixel in the first and second halves of the video, such as changes in illumination values, thus impacting the user experience.
[0126] Therefore, in this embodiment of the present disclosure, for each original image in the same video, a second image for illumination compensation is generated based on the same first image corresponding to the video and each original image. Specifically, for each original image, a difference map can be obtained by subtracting the pixel values of each pixel in the first image corresponding to the video from the corresponding pixel values in the original image. Image processing is then performed on the difference map to generate a second image corresponding to each original image after removing 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, the target images can be assembled into a target video according to the shooting order of each original image in the video.
[0128] In one specific embodiment, the illumination values of each pixel in the background region of multiple target images are all consistent.
[0129] In some embodiments, the same image enhancement processing can be applied to each target image, and the enhanced target images can be combined to form a target video.
[0130] For example, still using a whiteboard image, Figure 7 The whiteboard image in the video can be any frame from the video. All original images in the same video use the same pure white image 702 and undergo the same processing, such as the lighting compensation and image enhancement in steps 2 to 6. Because each whiteboard image is compensated to 255 pixels of the pure white image, the compensated background is consistent. Therefore, regardless of changes in the original shooting light in the environment, the lighting compensation effect of each original image in the video remains consistent, improving the user experience.
[0131] In one 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, a first image corresponding to each original image can be determined based on multiple interactions, and the first image corresponding to the video can be determined from the first images corresponding to each original image. Alternatively, the first image corresponding to each original image can be determined based on a single interaction, in which case the first image corresponding to each original image is the same, that is, the first image corresponding to the video.
[0133] Alternatively, the first image corresponding to each original image can be determined based on the color characteristics of each original image, and then the first image corresponding to the video can be selected from the first images corresponding to each original image.
[0134] In one illustrative embodiment, a first image can be randomly selected from the first images corresponding to each original image as the first image corresponding to the video. Alternatively, the first image corresponding to the video can be determined from the first images corresponding to each original image based on the color characteristics of each original image. Alternatively, the first images corresponding to each original image can be merged into a single first image, and this merged first image can be used as the first image corresponding to the video. Alternatively, the first image corresponding to the video can be determined from the first images corresponding to each original image based on the shooting position of the original image in the video.
[0135] For example, in a video recording the increasing amount of writing on a whiteboard, as time progresses, the amount of writing on the whiteboard in the video will continuously increase, and the proportion of the pixels of the writing marks in the original image will also gradually increase. This may result in a significant difference between the first image corresponding to the original image at different shooting moments of the video and the original image. For instance, at the beginning of the video, the first image corresponding to the whiteboard image recording a blank whiteboard may be a pure white image; at the end of the video, the first image corresponding to the whiteboard image recording a full whiteboard may be a pure black image, making it difficult to distinguish the black writing marks on the whiteboard.
[0136] Therefore, for videos that record added writing marks, 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 marks in the target video after illumination compensation.
[0137] Alternatively, for videos that record reduced writing marks, such as videos of erasing writing marks on a whiteboard, the first image corresponding to the original image at the end of the video can be determined as the first image corresponding to the video.
[0138] Alternatively, the original image with the least amount of writing marks can be determined from all the original images, and the first image corresponding to the original image with the least amount of writing marks can be determined as the first image corresponding to the video.
[0139] Similarly, determining the original image with the least amount of writing marks, 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 marks in the target video after illumination compensation.
[0140] The embodiments of this disclosure provide an image processing method that can adapt to original images under various shooting conditions. Whether the surrounding shooting light is too dark, overexposed, or there is a sudden change in shooting light, it will not affect the result after illumination compensation, so as to provide users with a better user experience.
[0141] For document-type images or videos with foreground content such as text and graphics, the above image processing methods can avoid various problems such as the disappearance of text information after image processing due to low light and the appearance of obvious bright spots after image processing due to overexposure. This improves the applicability of images and videos under various shooting lighting conditions and the lighting compensation effect, thereby enhancing the user experience.
[0142] Figure 9 A block diagram of an image processing apparatus according to an embodiment of the present disclosure is shown schematically.
[0143] like Figure 9 As shown, the image processing apparatus 900 includes a generation module 910 and a compensation module 920.
[0144] The generation module 910 is used to 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 solid 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, which is used to perform illumination compensation on the original image using the second image to obtain a target image in which the illumination values of each pixel in the background area are the same, and the illumination values include: brightness value and / or contrast value.
[0147] In one embodiment, the generation module 910 includes a generation submodule for generating a second image for illumination compensation based on the pixel value differences between each pixel point of the original image and the first image.
[0148] In one embodiment, the size of the first image is the same as the size of the original image. The generation submodule includes a first generation unit and a second generation unit.
[0149] The first generation unit is used to calculate the difference between the pixel value of each pixel in the first image and the pixel value of the corresponding pixel in the original image to obtain a difference map representing the illumination difference.
[0150] The second generation unit is used to perform image processing on the difference map to generate a second image after removing foreground content.
[0151] In one embodiment, the foreground content includes at least one of the following: text, graphics.
[0152] In one embodiment, the second generation unit further includes a first filtering subunit for filtering the difference image to obtain a second image after removing foreground content.
[0153] In one embodiment, the second generation unit further includes a second filtering subunit, which is used to filter the difference map based on the target blur kernel to obtain a second image after removing foreground content, wherein 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 marks, 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 based on the pure white image and the whiteboard image.
[0156] The whiteboard image compensation module is used to perform illumination compensation on each pixel in the whiteboard image using the second image, so as to obtain a target image with writing marks and the same illumination value for each pixel in the whiteboard.
[0157] In one embodiment, the size of the pure white image is the same as the size of the whiteboard image. The whiteboard image compensation module includes a third generation unit and a fourth generation unit.
[0158] The third generation unit is used to calculate the difference between the pixel value of each pixel in the pure white image and the pixel value of the corresponding pixel in the whiteboard image to obtain a difference map representing the difference in pixel values.
[0159] The fourth generation unit is used to remove writing marks from the difference map to obtain a second image after removing writing marks.
[0160] In one embodiment, the first image is obtained by at least one of the following methods: determining a first image corresponding to the original image based on interaction; determining the first image based on the color features of the original image.
[0161] For example, the image processing apparatus 900 further includes a first determining module and / or a second determining module.
[0162] The first determining module is used to determine the first image corresponding to the original image based on interaction.
[0163] The second determining module is used to determine the first image based on the color features of the original image.
[0164] In one embodiment, the second determining module includes a pixel calculation submodule and a first determining submodule.
[0165] The pixel calculation submodule is used to calculate the average pixel value of each pixel in the original image.
[0166] The first determining submodule is used to determine the standard color segment in which the average pixel value is located, and to determine the first image based on the standard color segment.
[0167] In one embodiment, the original image is a real-time image captured during a live broadcast, 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 features of the real-time image, and to generate a second image for illumination compensation based on the real-time image and the first image corresponding to the real-time image.
[0169] The real-time image compensation module is used to perform illumination compensation on the real-time image using the second image to obtain a target live image with consistent illumination, and then 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 in the second image to the pixel value of the corresponding pixel in the original image to obtain the target image.
[0171] In one embodiment, the image processing apparatus 900 further includes an enhancement module for enhancing the target image, the enhancement process including at least one of the following: contrast transformation and sharpening.
[0172] In one embodiment, the original image includes a whiteboard image with writing marks. The enhancement module includes an enhancement submodule for transforming the contrast of the target image and sharpening the contrast-transformed target image to obtain an enhanced image with enhanced writing marks.
[0173] In one embodiment, the image processing apparatus 900 includes a video processing module, configured to generate a second image for illumination compensation of each original image in the same video, 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 to obtain a target video with consistent illumination, wherein the illumination of each original image and each pixel in each original image in the target video is consistent.
[0174] In one embodiment, the image processing apparatus 900 further includes a third determining module and a fourth determining module. The third determining module is used to determine a first image corresponding to each original image in the video. The fourth determining module is used to determine a 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 marks on a whiteboard. The fourth determining module includes a second determining submodule, used to determine, for the video recording the addition of writing marks, a first image corresponding to the original image at the beginning of the video as the first image corresponding to the video.
[0176] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-Chip, a System-on-a-Substrate, a System-on-Package, an Application-Specific Integrated Circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.
[0177] It should be noted that the apparatus portion in the embodiments of this disclosure corresponds to the method portion in the embodiments of this disclosure. The description of the apparatus portion is specifically referred to in the method portion, and will not be repeated here.
[0178] Figure 10 A block diagram of an electronic device suitable for an image processing method according to an embodiment of the present disclosure is shown schematically. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0179] like Figure 10 As shown, an 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 portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include 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] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1002 and / or RAM 1003. It should be noted that the programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0181] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The system 1000 may also include one or more of the following components connected to the input / output (I / O) interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 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 disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0182] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0183] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0184] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0185] For example, according to embodiments of this disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.
[0186] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the methods provided in the embodiments of this disclosure.
[0187] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0188] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1009, and / or installed from a removable medium 1011. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0189] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0191] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. An image processing method, comprising: A second image for illumination compensation is generated based on the original image and a first image corresponding to the original image. The first image is a solid color image. The original image includes a whiteboard image with writing marks. The first image is a pure white image with the same background color as the whiteboard. The foreground content of the original image, including the writing marks, is removed from the second image. The original image is illuminated using the second image to obtain a target image in which the illumination values of each pixel in the background region are the same. The illumination values include: brightness value and / or contrast value.
2. The method according to claim 1, wherein, The step of generating a second image for illumination compensation based on the original image and a first image corresponding to the original image includes: A second image for illumination compensation is generated based on the difference in illumination values of each pixel between the original image and the first image.
3. The method according to claim 2, wherein, The size of the first image is the same as the size of the original image. Generating the second image for illumination compensation based on the difference in illumination values of each pixel between the original image and the first image includes: The difference between the pixel value of each pixel in the first image and the pixel value of the corresponding pixel in the original image is used to obtain a difference map representing the difference in illumination value; The difference image is processed to generate the second image after removing foreground content.
4. The method according to claim 3, wherein, The foreground content includes at least one of the following: text and graphics.
5. The method according to claim 3, wherein, The step of performing image processing on the difference image to generate the second image after removing foreground content includes: Based on the target blur kernel, the difference image is filtered to obtain the second image after removing the foreground content. The size of the target blur kernel is positively correlated with the size of the original image.
6. The method according to any one of claims 1 to 5, wherein, The first image was obtained through at least one of the following methods: The first image corresponding to the original image is determined based on the interaction; The first image is determined based on the color features of the original image.
7. The method according to claim 6, wherein, Determining the first image based on the color features of the original image includes: Calculate the average pixel value of each pixel in the original image; Determine the standard color segment in which the average pixel value is located, and determine the first image based on the standard color segment.
8. The method according to claim 6, wherein, The original image is a real-time image captured during the live broadcast, and the method includes: Based on the color features of the real-time image, a first image corresponding to the real-time image is determined, and a second image for illumination compensation is generated based on 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-stream image with consistent illumination, and the target live-stream image is then displayed.
9. The method according to any one of claims 1 to 5, wherein, The step of using the second image to perform illumination compensation on the original image to obtain a target image with consistent illumination includes: The target image is obtained by adding the pixel values of each pixel in the second image to the corresponding pixel values in the original image.
10. The method according to claim 1, further comprising: The target image is enhanced, and the enhancement process includes at least one of the following: contrast transformation and sharpening.
11. 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 as to use each of the second images to perform illumination compensation on each of the original images respectively, thereby obtaining a target video with consistent illumination.
12. The method of claim 11, 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 each of the original images.
13. An electronic device, comprising: One or more processors; Memory, used to store 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 method of any one of claims 1 to 12.
14. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 12.
Citation Information
Patent Citations
Image generation method and device, electronic equipment and computer readable storage medium
CN111402384A
Image processing method and device, storage medium and electronic equipment
CN118365571A
