Image processing method, device and equipment, storage medium and image acquisition system
Patent Information
- Application Number
- CN202310429702.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-04-20
AI Technical Summary
[0002]在诸如相机等图像采集设备拍摄时,画面中大面积为单一颜色的情况下,容易因画面过于单一而没有足够多的参考点,甚至没有参考点,从而造成拍照时白平衡所应用的判定色温与环境光源的真实色温存在差距,而根据不准确的判定色温进行白平衡而得到的图像存在偏色的现象
[0038]本公开的实施例所提供的技术方案,确定待处理图像的第一判定色温,再确定第一判定色温与多个第二判定色温之间关系。由于该多个第二判定色温是偏向同一颜色的多个偏色图像分别的判定色温,所以当该关系是多个第二判定色温对应的值包括第一判定色温对应的值时,可以确定待处理图像是偏色图像。偏色图像具有色彩空间通道值在第一预设范围内的待处理像素,该待处理像素对应的颜色为偏色图像偏向的颜色,之后,对待处理像素的色彩空间通道值进行处理,以使待处理像素的色彩空间通道值落在第二预设范围,得到消除偏色后的图像。通过直接对待处理像素的色彩空间通道值进行处理以消除偏色的方式,可以在使用少量计算资源及能耗的情况下,快速消除待处理像素存在的偏色,进而快速消除待处理图像中存在的偏色。
Smart Images

Figure CN116437225B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of digital processing technology, and in particular to an image processing method, apparatus, device and storage medium, and image acquisition system. Background Technology
[0002] When shooting with image acquisition devices such as cameras, if a large area of the image is a single color, there may not be enough reference points, or even any reference points at all, due to the monotony of the image. This can cause a discrepancy between the color temperature used for white balance and the true color temperature of the ambient light source. Images obtained by white balancing based on an inaccurate color temperature will have a color cast.
[0003] How to eliminate color casts in images is a problem that urgently needs to be solved.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] This disclosure provides an image processing method, apparatus, device, storage medium, and image acquisition system, which at least to some extent provides a solution to eliminate color cast in images.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to one aspect of this disclosure, an image processing method is provided, comprising: acquiring an image to be processed; determining a first determination color temperature of the image to be processed; determining a relationship between the first determination color temperature and a plurality of second determination color temperatures, wherein the plurality of second determination color temperatures are determination color temperatures of a plurality of color-skewed images biased towards the same color; determining the image to be processed as a color-skewed image when the relationship is such that the values corresponding to the plurality of second determination color temperatures include the values corresponding to the first determination color temperature, wherein the color-skewed image has pixels to be processed whose color space channel values are within a first preset range; processing the color space channel values of the pixels to be processed so that the color space channel values of the pixels to be processed fall within a second preset range, thereby obtaining an image after color cast removal.
[0008] In one embodiment of this disclosure, the plurality of color-biased images are biased towards purple; the pixels to be processed whose color space channel values are within the first preset range are pixels with a color bias towards purple.
[0009] In one embodiment of this disclosure, the color space is the YUV color space, which is defined as luminance, hue, and saturation. The first preset range is shown in the following formula:
[0010]
[0011] Where U is the value of a pixel in the U channel of the YUV space, V is the value of a pixel in the V channel of the YUV space, A1 and A2 are both values greater than 0 and less than 1, and A2>A1, and the value range of A3 is [0, A2-A1).
[0012] In one embodiment of this disclosure, A1 is 0.2; A2 is 0.8.
[0013] In one embodiment of this disclosure, processing the color space channel values of the pixel to be processed so that the color space channel values of the pixel to be processed fall within a second preset range to obtain an image after color cast elimination includes: when the color space is the Hue / Saturation / Luminance (HSV) space, increasing the value of the pixel to be processed in the G channel of the RGB space so that the values of the pixel to be processed in the three HSV channels fall within the second preset range corresponding to the HSV space to obtain an image after color cast elimination; or, when the color space is the YUV space, decreasing the values of the pixel to be processed in the U and V channels so that the values of the pixel to be processed in the U and V channels fall within the second preset range corresponding to the YUV space to obtain an image after color cast elimination.
[0014] In one embodiment of this disclosure, the second preset range corresponding to the YUV space is shown in the following formula:
[0015] A4≤U,V≤A5
[0016] Where U is the value of a pixel in the U channel in the YUV space, V is the value of a pixel in the V channel in the YUV space, and the values of A4 and A5 are both in the range of (-0.2, 0.2), and A4 ≤ A5.
[0017] In one embodiment of this disclosure, both A4 and A5 are 0.
[0018] In one embodiment of this disclosure, before determining the relationship between the first determined color temperature and the plurality of second determined color temperatures, the method further includes: acquiring the plurality of color-biased images; determining the determined color temperature of each color-biased image as a second determined color temperature, thereby obtaining the plurality of second determined color temperatures.
[0019] In one embodiment of this disclosure, the image to be processed and the plurality of color-distorted images are captured by the same image acquisition device; or, the image to be processed and the plurality of color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
[0020] According to another aspect of this disclosure, an image processing apparatus is provided, comprising: an acquisition module for acquiring an image to be processed; a determination module for determining a first determination color temperature of the image to be processed; the determination module further for determining a relationship between the first determination color temperature and a plurality of second determination color temperatures, wherein the plurality of second determination color temperatures are determination color temperatures of a plurality of color-biased images biased towards the same color; the determination module further for determining that the image to be processed is a color-biased image when the relationship is such that the values corresponding to the plurality of second determination color temperatures include the values corresponding to the first determination color temperature, wherein the color-biased image has pixels to be processed whose color space channel values are within a first preset range; and a processing module for processing the color space channel values of the pixels to be processed so that the color space channel values of the pixels to be processed fall within a second preset range, thereby obtaining an image after color bias removal.
[0021] In one embodiment of this disclosure, the plurality of color-biased images are biased towards purple; the pixels to be processed whose color space channel values are within the first preset range are pixels with a color bias towards purple.
[0022] In one embodiment of this disclosure, the color space is the YUV color space, which is defined as luminance, hue, and saturation. The first preset range is shown in the following formula:
[0023]
[0024] Where U is the value of a pixel in the U channel of the YUV space, V is the value of a pixel in the V channel of the YUV space, A1 and A2 are both values greater than 0 and less than 1, and A2>A1, and the value range of A3 is [0, A2-A1).
[0025] In one embodiment of this disclosure, A1 is 0.2; A2 is 0.8.
[0026] In one embodiment of this disclosure, the processing module is configured to, when the color space is the Hue / Saturation / Luminance (HSV) space, increase the value of the pixel to be processed in the G channel of the RGB space so that the values of the pixel to be processed in the three HSV channels fall within a second preset range corresponding to the HSV space, thereby obtaining an image after color cast elimination; or, when the color space is the YUV space, decrease the values of the pixel to be processed in the U and V channels so that the values of the pixel to be processed in the U and V channels fall within a second preset range corresponding to the YUV space, thereby obtaining an image after color cast elimination.
[0027] In one embodiment of this disclosure, the second preset range corresponding to the YUV space is shown in the following formula:
[0028] A4≤U,V≤A5
[0029] Where U is the value of a pixel in the U channel in the YUV space, V is the value of a pixel in the V channel in the YUV space, and the values of A4 and A5 are both in the range of (-0.2, 0.2), and A4 ≤ A5.
[0030] In one embodiment of this disclosure, both A4 and A5 are 0.
[0031] In one embodiment of this disclosure, the acquisition module is further configured to acquire the plurality of color-distorted images; the determination module is further configured to determine the determination color temperature of each color-distorted image as a second determination color temperature, thereby obtaining the plurality of second determination color temperatures.
[0032] In one embodiment of this disclosure, the image to be processed and the plurality of color-distorted images are captured by the same image acquisition device; or, the image to be processed and the plurality of color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
[0033] According to another aspect of this disclosure, an image acquisition system is provided, comprising: an image acquisition device for acquiring an image to be processed; an image processing device for determining a first determination color temperature of the image to be processed; determining a relationship between the first determination color temperature and a plurality of second determination color temperatures; and determining that the image to be processed is a color-biased image when the relationship is such that the values corresponding to the plurality of second determination color temperatures include the values corresponding to the first determination color temperature, thereby processing the color space channel values of the pixels to be processed so that the color space channel values of the pixels to be processed fall within a second preset range to obtain an image after color bias removal, wherein the plurality of second determination color temperatures are the determination color temperatures of a plurality of color-biased images biased towards the same color, and the color-biased image has pixels to be processed whose color space channel values are within the first preset range.
[0034] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the above-described image processing methods by executing the executable instructions.
[0035] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the image processing methods described above.
[0036] According to another aspect of this disclosure, a computer program product is provided, the computer program product comprising a computer program or computer instructions, the computer program or computer instructions being loaded and executed by a processor to enable a computer to implement any of the image processing methods described above.
[0037] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0038] The technical solution provided by the embodiments of this disclosure determines a first determined color temperature of the image to be processed, and then determines the relationship between the first determined color temperature and a plurality of second determined color temperatures. Since the plurality of second determined color temperatures are the determined color temperatures of multiple color-skewed images that are biased towards the same color, when the relationship is such that the values corresponding to the plurality of second determined color temperatures include the values corresponding to the first determined color temperature, it can be determined that the image to be processed is a color-skewed image. The color-skewed image has pixels to be processed whose color space channel values are within a first preset range, and the color corresponding to the pixel to be processed is the color biased by the color-skewed image. Then, the color space channel values of the pixels to be processed are processed so that the color space channel values of the pixels to be processed fall within a second preset range, resulting in an image after color cast removal. By directly processing the color space channel values of the pixels to be processed to eliminate color cast, the color cast present in the pixels to be processed can be quickly eliminated using a small amount of computing resources and energy consumption, thereby quickly eliminating the color cast present in the image to be processed.
[0039] Furthermore, processing only the pixels to be processed to eliminate color cast can avoid interference with other pixels, thereby reducing the side effects on the image caused by eliminating color cast.
[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0042] Figure 1 This diagram illustrates an image processing system according to one embodiment of the present disclosure;
[0043] Figure 2 This diagram illustrates a flowchart of an image processing method according to one embodiment of the present disclosure;
[0044] Figure 3 This diagram illustrates the points where pixels in an image fall in the coordinate system corresponding to the UV channels in one embodiment of the present disclosure.
[0045] Figure 4 This diagram illustrates a first preset range corresponding to the YUV space in one embodiment of the present disclosure;
[0046] Figure 5This diagram illustrates a second preset range corresponding to the YUV space in one embodiment of the present disclosure;
[0047] Figure 6 A schematic diagram of an image processing apparatus according to one embodiment of the present disclosure is shown;
[0048] Figure 7 A structural block diagram of an electronic device according to one embodiment of the present disclosure is shown. Detailed Implementation
[0049] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0050] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0051] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0052] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0053] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0054] Image acquisition devices utilize white balance during photography to ensure that the captured image matches the visual requirements of the human eye. Specifically, white balance ensures that the physical entities in the image appear in the colors that the human eye would perceive directly. The principle behind white balance is as follows: based on the color temperature of the ambient light source, the gain coefficients of the three RGB channels (Red, Green, Blue) are determined. These gain coefficients are then used to amplify the pixel values in the RGB channels, resulting in an image with colors closer to reality. Therefore, determining the color temperature of the ambient light source is crucial before white balance processing, and the accuracy of this determination significantly impacts the quality of the white balance. Determining the color temperature of the ambient light source requires analyzing the pixels in the captured image, typically by selecting key points from the image's pixels.
[0055] When the environment has a relatively uniform color, the resulting image will also have a uniform color. Therefore, key points determined from the image are often invalid reference points, causing the color temperature of the ambient light source determined during white balance processing to differ from the actual color temperature. This results in poor white balance performance based on the determined color temperature, ultimately leading to color casts in the final image.
[0056] In related technology 1, the white balance effect is improved by enhancing the performance of the white balance algorithm. However, due to the correction of the Planck fitting curve, the difference between the determined color temperature and the true color temperature cannot be avoided in principle. Improving the white balance effect by enhancing the white balance algorithm cannot avoid the appearance of color cast in the image. Furthermore, the white balance algorithm, which becomes more complex due to the need to improve the white balance effect, requires significant computational resources and power consumption during operation. Supporting the operation of this white balance algorithm requires high-performance chips. Therefore, the method of improving the white balance effect by complicating the white balance algorithm also suffers from poor adaptability.
[0057] In related technology 2, invalid reference points are isolated by manually setting an isolation frame, so that valid reference points have greater weight in color temperature determination. Implementing this method requires developers to have knowledge of photography principles. Because this method relies on additional algorithms, the computational resources and power consumption required for color temperature determination are high. Furthermore, the manually set isolation frame is applied regardless of whether the environment has relatively simple or varied colors when shooting with the camera. In environments with relatively varied colors, the application of the isolation frame isolates valid reference points, reducing the number of applicable reference points for color temperature determination. This results in a greater difference between the determined color temperature and the true color temperature of the ambient light source, leading to poorer white balance performance and reduced white balance stability.
[0058] Therefore, this disclosure provides an image processing method that first identifies whether an image is a color-biased image, and if it is determined that the image is a color-biased image, processes the pixels exhibiting color bias (biased color, for example, purple) to eliminate the color bias in the image. By directly processing the pixels, the color bias in the image can be quickly eliminated with less computational resources and energy consumption, and the impact on other pixels can be avoided, thereby reducing the side effects on the image caused by eliminating the color bias.
[0059] Figure 1 The diagram illustrates an image processing system according to an embodiment of the present disclosure, which can apply the image processing methods or image processing apparatuses of various embodiments of the present disclosure.
[0060] like Figure 1 As shown, the image processing system may include an image acquisition device 11 and an image processing device 12.
[0061] The image acquisition device 11 can capture images of the environment. The image acquisition device 11 includes a memory in which the captured images are stored. In one embodiment, the memory of the image acquisition device 11 is removable. The image processing device 12 can connect via a data cable to read the memory of the image acquisition device 11, thereby being able to read the contents of the memory and download images from it. Alternatively, the image processing device 12 can read the contents of the memory in other ways to obtain the images stored in the memory.
[0062] In another embodiment, the image acquisition device 11 can communicate with the image processing device 12 via a network, which can be a wired network or a wireless network.
[0063] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0064] The image processing device 12 can access the content stored in the memory of the image acquisition device 11 via a network.
[0065] In another embodiment, the image processing device 12 and the image acquisition device 11 may belong to the same device and be connected through the internal wiring of the same device, so that the image processing device 12 can acquire the image acquired by the image acquisition device 11.
[0066] The image processing device 12 has the ability to identify the determination color temperature used in white balance processing of an image, and can identify and determine the determination color temperature of an image acquired from the imaging device 11. The image processing device 12 has a storage function, storing the determination color temperatures of multiple color-biased images. The image processing device 12 can also determine pixels with specified pixel data (color space channel values) from an image, and process the pixel data of the determined pixels to change the color that the pixel can display; for example, processing the pixel data of a pixel that displays purple to make that pixel appear white.
[0067] In one embodiment, the image acquisition device 11 can perform the image processing function of the image processing device 12 described above, including identifying the color temperature of the image, storing the color temperatures corresponding to multiple color-biased images, determining the pixels to be processed from the image, and processing the pixel data.
[0068] The device containing the image acquisition device 11 can be any electronic device with the above-mentioned functions, including but not limited to smartphones, tablets, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.
[0069] The image processing device 12 can be any electronic device with the aforementioned functions. For example, the electronic device can be a terminal or a server. The terminal can be a smartphone, tablet computer, desktop computer, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0070] The following detailed description of this exemplary implementation method is provided in conjunction with the accompanying drawings and embodiments.
[0071] This disclosure provides an image processing method that can be executed by any electronic device with computing capabilities. For example, the electronic device may be an image processing device or a camera.
[0072] Figure 2 A flowchart of an image processing method according to one embodiment of this disclosure is shown, such as Figure 2 As shown, the image processing method provided in this embodiment may include the following steps S201 to S205.
[0073] S201, Obtain the image to be processed.
[0074] The image to be processed can be any type of image. In one embodiment, the image to be processed can be an image that meets preset conditions, where the colors are relatively uniform. In one embodiment, the preset conditions can be that the color channel values of more than a certain proportion of pixels are concentrated within a range of a certain size. Here, color channel values are the channel values used to define the pixel color in the various channel values corresponding to each color space. For example, in the RGB space, color channel values are the channel values corresponding to the three RGB channels. As another example, in the YUV (Y represents luminance, U represents hue, V represents saturation) space, color channel values are the channel values corresponding to the two UV channels.
[0075] It should be noted that both the set ratio and the interval of set size are set values, which can be determined based on experience. The size of the set interval is related to the value range of the color space channel values.
[0076] For example, when the color space is YUV space, 93% of the pixels in the image have their channel values in the two UV channels (the maximum values of both UV are 1) concentrated in the interval (0.1, 0.2) (the interval size is 0.1). If the set ratio is 90% and the set interval size is 0.1, the color presented by the image is considered relatively monotonous.
[0077] For another example, if the interval of set size is 0.05, still taking YUV space as the color space example, if more than the set ratio of pixels in the image have their channel values on the U channel (minimum is -1, maximum is 1) located in (X, X+0.05), and the channel values of this part of pixels on the V channel (minimum is -1, maximum is 1) are located in (Y, Y+0.05), then the color presented by the image is considered relatively monotonous. Wherein, both X and Y are greater than or equal to -1, and both X and Y are less than or equal to 1-0.05.
[0078] The landing points of pixels in the image in the coordinate system corresponding to the UV channels are as shown in Figure 3 , wherein Figure 3 (1) and (2) in correspond to two images. From Figure 3 (1) it can be seen that 91.9% of the pixel landing points are concentrated in area A (0.43<U<0.53, 0.13<V<0.23). From Figure 3 (2) it can be seen that 96% of the pixel landing points are concentrated in area B (0.3<U<0.32, 0.1<V<0.15). If the interval of set size is 0.1 and the set ratio is 90%, it is considered that the colors presented by the images corresponding to Figure 3 (1) and (2) in are relatively monotonous. If the interval of set size is 0.05 and the set ratio is 95%, it is considered that the color presented by the image corresponding to Figure 3 (2) in is relatively monotonous, while the color presented by the image corresponding to Figure 3 (1) in is relatively complex.
[0079] For another example, when the color space is RGB space, 91% of the pixels in the image have their channel values in the three RGB channels (the maximum value of each of the three RGB channels is 255) concentrated in the interval (170, 180) (the interval size is 10). If the set ratio is 90% and the set interval size is 20 (10<20), the color presented by the image is relatively monotonous.
[0080] This disclosure does not limit the methods for acquiring the images to be processed. For example, the images can be directly captured by the execution device (e.g., an image processing device or an image acquisition device), or acquired by the execution device via a network.
[0081] S202, determine the first color temperature of the image to be processed.
[0082] The first color temperature determination can be the color temperature of the ambient light source determined from the image to be processed. The color temperature of the ambient light source determined from the image can be used when performing white balance on the image.
[0083] The color temperature can be read using software that can read the color temperature applied during white balance processing of an image, or using software that can read the color temperature of the ambient light source determined based on the image. The image to be processed is then processed based on this software environment to obtain a first determined color temperature.
[0084] S203, determine the relationship between the first determination color temperature and multiple second determination color temperatures, wherein the multiple second determination color temperatures are the determination color temperatures of multiple color-biased images that are biased towards the same color.
[0085] An image is considered a color-biased image if the colors presented in the image deviate from the colors presented in the corresponding real environment. Each of these color-biased images deviates from the colors presented in the corresponding real environment; that is, each color-biased image is biased towards a certain color compared to the real environment, and all the color-biased images are biased towards the same color.
[0086] Furthermore, different color-biased images that favor the same color can have the same or different degrees of color bias. For example, in two color-biased images that favor purple, one may have a higher degree of bias, resulting in a deeper purple, while the other may have a lower degree of bias, resulting in a lighter purple. The degree of color bias is related to the difference between the light source color temperature determined during white balance processing and the actual light source color temperature; the greater the difference, the higher the degree of color bias.
[0087] In one embodiment, the determined color temperature can be the color temperature of the ambient light source determined based on the image, and each second determined color temperature can be the color temperature of the ambient light source determined based on the corresponding color cast image. The plurality of second determined color temperatures can be pre-stored in the execution device, and the execution device can directly call them from the memory when using the plurality of second determined color temperatures.
[0088] In one embodiment, the execution device can identify multiple color-distorted images to obtain the multiple second determined color temperatures. That is, before determining the relationship between the first determined color temperature and the multiple second determined color temperatures, the method may further include: acquiring the multiple color-distorted images; determining the determined color temperature of each color-distorted image as a second determined color temperature, thus obtaining the multiple second determined color temperatures. This disclosure does not limit how the multiple color-distorted images are acquired. For example, they can be directly captured by the execution device, or acquired by the execution device via a network.
[0089] S204, when the relationship is that the values corresponding to multiple second determined color temperatures include the values corresponding to the first determined color temperature, the image to be processed is determined to be a color-biased image, and the color-biased image has pixels to be processed with color space channel values within a first preset range.
[0090] Since the image corresponding to the second determined color temperature is a color-biased image, it can be assumed that when the value of the first determined color temperature is the same as the value of a certain second determined color temperature, the image corresponding to the first determined color temperature is also considered to be a color-biased image, and the biased color is the same as the biased color of the color-biased image corresponding to the second determined color temperature.
[0091] Taking an image that meets preset conditions as an example, an image that meets preset conditions will have relatively uniform colors. This is because images with uniform colors can be captured in environments with uniform colors, and images captured in environments with uniform colors are prone to color cast. When multiple values corresponding to the second determination color temperature include the value corresponding to the first determination color temperature, it can be determined that the image corresponding to the first determination color temperature is the same as the image corresponding to the second determination color temperature; both are color-cast images, and the cast color is the same.
[0092] In one embodiment, the color temperature determination method used to obtain the multiple color-skewed images is the same as the color temperature determination method used to obtain the image to be processed. The determined color temperature has the same relationship with the actual color temperature (both are determined color temperatures that are less than or greater than the actual color temperature), thereby causing the image obtained by white balance processing based on the determined color temperature to be biased towards the same color. For example, the color temperature determination method used to obtain the multiple color-skewed images is the same as the color temperature determination method used to obtain the image to be processed, so that when the same or similar color temperature determination method is applied for color temperature determination, the determined color temperature has the same relationship with the actual color temperature, thereby causing the multiple color-skewed images and the image to be processed to be biased towards the same color.
[0093] In one embodiment, the image to be processed and multiple color-cast images are captured by the same image acquisition device; or, the image to be processed and multiple color-cast images are captured by different image acquisition devices with the same configuration. In one embodiment, the white balance processing method applied in the different image acquisition devices with the same configuration is the same or similar.
[0094] The color presented by the pixel to be processed whose color space channel value falls within a first preset range is the same as the color biased by the color cast image. This disclosure does not limit which color the multiple color cast images are biased by. For example, if the multiple color cast images are biased by purple, the pixel to be processed whose color space channel value falls within the first preset range is a pixel biased by purple. As another example, if the multiple color cast images are biased by blue, the pixel to be processed whose color space channel value falls within the first preset range is a pixel biased by blue.
[0095] The first preset range corresponds to the color space. Different color spaces correspond to different first preset ranges, but the colors of the pixels to be processed within the first preset range corresponding to different color spaces are the same.
[0096] Taking a pixel to be processed with a purple hue and a YUV color space as an example, the first preset range corresponding to the YUV space can be as follows: Figure 4 As shown, the first preset range can be represented by the following formula 1:
[0097]
[0098] Where U is the value of a pixel in the U channel of the YUV space, V is the value of a pixel in the V channel of the YUV space, A1 and A2 are both values greater than 0 and less than 1, and A2>A1, and the value range of A3 is [0, A2-A1).
[0099] In one embodiment, A1 is 0.2 and A2 is 0.8 in Formula 1 above.
[0100] S205, process the color space channel values of the pixel to be processed so that the color space channel values of the pixel to be processed fall within the second preset range, and obtain the image after color cast is eliminated.
[0101] The second preset range varies in different color spaces, but the pixels corresponding to the second preset range in different color spaces present the same color.
[0102] In one embodiment, pixels whose color space channel values fall within a second preset range are displayed as lighter colors, close to white. The color space channel values of the pixels to be processed are calculated to ensure that the processed color space channel values fall within the second preset range, thereby making the colors of the pixels to be processed closer to white, thus eliminating color cast in the image to be processed.
[0103] Taking a pixel with a purplish tint as an example, the color space channel values of the pixel to be processed are adjusted to fall within a second preset range, resulting in an image with color cast eliminated. This can include: when the color space is HSV (Hue Saturation Value) space, increasing the value of the G channel in the RGB space of the pixel to be processed, so that the values of the three HSV channels fall within the second preset range corresponding to the HSV space, thus obtaining an image with color cast eliminated. For a pixel with a purplish tint, increasing the value of the G component in the RGB space can make the color of the pixel appear closer to white, and can also change the values of the three HSV channels. When the values of the three HSV channels of the pixel fall within the second preset range corresponding to the HSV space, the color of the pixel changes from purplish to a lighter color or white, completing the color cast elimination.
[0104] Taking a pixel with a purplish tint as an example, the color space channel values of the pixel to be processed are adjusted to fall within a second preset range, resulting in an image with color cast eliminated. This can include: when the color space is YUV, reducing the values of the pixel in the U and V channels so that these values fall within the second preset range corresponding to the YUV space, thus obtaining an image with color cast eliminated. A purplish pixel has values greater than 0 in both the U and V channels. The closer the values in the U and V channels are to 0, the lighter the pixel's color. When the values of the pixel in the U and V channels are reduced until they fall within the second preset range corresponding to the YUV space, the color of the pixel changes from purplish to a lighter color or white, completing the color cast elimination.
[0105] In one embodiment, the second preset range corresponding to the YUV space can be as follows: Figure 5 As shown, the second preset range corresponding to the YUV space can be represented by the following formula 2:
[0106] A4≤U,V≤A5 (2)
[0107] Where U is the value of a pixel in the U channel in the YUV space, V is the value of a pixel in the V channel in the YUV space, and the values of A4 and A5 are both in the range of (-0.2, 0.2), and A4 ≤ A5.
[0108] In one embodiment, A4 and A5 in Formula 2 above are both 0.
[0109] The technical solution provided by the embodiments of this disclosure determines a first determined color temperature of the image to be processed, and then determines the relationship between the first determined color temperature and a plurality of second determined color temperatures. Since the plurality of second determined color temperatures are the determined color temperatures of multiple color-skewed images that are biased towards the same color, the image to be processed can be determined to be a color-skewed image when the values corresponding to the plurality of second determined color temperatures include the values corresponding to the first determined color temperature. The color-skewed image has pixels to be processed whose color space channel values are within a first preset range, and the color corresponding to the pixel to be processed is the color biased by the color-skewed image. Then, the color space channel values of the pixels to be processed are processed to make the color space channel values of the pixels to be processed fall within a second preset range, resulting in an image after color cast removal. By directly processing the color space channel values of the pixels to be processed to eliminate color cast, the color cast present in the pixels to be processed can be quickly eliminated using a small amount of computing resources and energy consumption, thereby quickly eliminating the color cast present in the image to be processed.
[0110] Furthermore, processing only the pixels to be processed to eliminate color cast can avoid interference with other pixels, thereby reducing the side effects on the image caused by eliminating color cast.
[0111] Based on the same inventive concept, this disclosure also provides an image processing apparatus, as described in the following embodiments. Since the principle by which this apparatus solves the problem is similar to that of the method embodiments described above, the implementation of this apparatus embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be repeated.
[0112] Figure 6 A schematic diagram of an image processing apparatus according to one embodiment of the present disclosure is shown, such as... Figure 6 As shown, the device includes: an acquisition module 601 for acquiring an image to be processed; a determination module 602 for determining a first determination color temperature of the image to be processed; the determination module 602 is further used to determine the relationship between the first determination color temperature and multiple second determination color temperatures, wherein the multiple second determination color temperatures are the determination color temperatures of multiple color-biased images that are biased towards the same color; the determination module 602 is further used to determine that the image to be processed is a color-biased image when the relationship is that the values corresponding to the multiple second determination color temperatures include the values corresponding to the first determination color temperature, wherein the color-biased image has pixels to be processed whose color space channel values are within a first preset range; and a processing module 603 for processing the color space channel values of the pixels to be processed so that the color space channel values of the pixels to be processed fall within a second preset range, thereby obtaining an image after color bias removal.
[0113] In one embodiment of this disclosure, the color bias of multiple color-biased images is purple; the pixels to be processed with color space channel values within a first preset range are pixels with a color bias towards purple.
[0114] In one embodiment of this disclosure, the color space is a YUV space of brightness, hue, and saturation, and the first preset range is as shown in Formula 1 above.
[0115] In one embodiment of this disclosure, A1 in Formula 1 above is 0.2; A2 is 0.8.
[0116] In one embodiment of this disclosure, the processing module 603 is configured to, when the color space is the Hue / Saturation / Luminance (HSV) space, increase the value of the pixel to be processed in the G channel of the RGB space so that the values of the pixel to be processed in the three HSV channels fall within a second preset range corresponding to the HSV space, thereby obtaining an image after color cast elimination; or, when the color space is the YUV space, decrease the values of the pixel to be processed in the U and V channels so that the values of the pixel to be processed in the U and V channels fall within a second preset range corresponding to the YUV space, thereby obtaining an image after color cast elimination.
[0117] In one embodiment of this disclosure, the second preset range corresponding to the YUV space is as shown in Formula 2 above.
[0118] In one embodiment of this disclosure, A4 and A5 in Formula 2 above are both 0.
[0119] In one embodiment of this disclosure, the acquisition module 601 is further configured to acquire multiple color-biased images; the determination module 602 is further configured to determine the determination color temperature of each color-biased image as a second determination color temperature, thereby obtaining multiple second determination color temperatures.
[0120] In one embodiment of this disclosure, the image to be processed and multiple color-distorted images are captured by the same image acquisition device; or, the image to be processed and multiple color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
[0121] The technical solution provided by the embodiments of this disclosure determines a first determined color temperature of the image to be processed, and then determines the relationship between the first determined color temperature and a plurality of second determined color temperatures. Since the plurality of second determined color temperatures are the determined color temperatures of multiple color-skewed images that are biased towards the same color, the image to be processed can be determined to be a color-skewed image when the values corresponding to the plurality of second determined color temperatures include the values corresponding to the first determined color temperature. The color-skewed image has pixels to be processed whose color space channel values are within a first preset range, and the color corresponding to the pixel to be processed is the color biased by the color-skewed image. Then, the color space channel values of the pixels to be processed are processed to make the color space channel values of the pixels to be processed fall within a second preset range, resulting in an image after color cast removal. By directly processing the color space channel values of the pixels to be processed to eliminate color cast, the color cast present in the pixels to be processed can be quickly eliminated using a small amount of computing resources and energy consumption, thereby quickly eliminating the color cast present in the image to be processed.
[0122] Furthermore, processing only the pixels to be processed to eliminate color cast can avoid interference with other pixels, thereby reducing the side effects on the image caused by eliminating color cast.
[0123] This disclosure also provides an image acquisition system, including: an image acquisition device for acquiring an image to be processed; and an image processing device for determining a first determination color temperature of the image to be processed; determining the relationship between the first determination color temperature and a plurality of second determination color temperatures; and determining that the image to be processed is a color-skewed image when the relationship is such that the values corresponding to the plurality of second determination color temperatures include the values corresponding to the first determination color temperature, thereby processing the color space channel values of the pixels to be processed so that the color space channel values of the pixels to be processed fall within a second preset range, thereby obtaining an image after color skew removal, wherein the plurality of second determination color temperatures are the determination color temperatures of a plurality of color-skewed images biased towards the same color, and the color-skewed image has pixels to be processed whose color space channel values are within the first preset range.
[0124] In one embodiment, the image acquisition device and the image processing device may be different devices; that is, the image acquisition system is composed of different devices. In another embodiment, the image acquisition device and the image processing device may belong to the same device; that is, the same device includes the image acquisition system.
[0125] This disclosure also provides a shooting device that can apply the image processing methods described in any of the above embodiments. This disclosure does not limit the specific type of device used. For example, the shooting device can be a camera, video camera, video recorder, or other electronic devices with shooting capabilities, such as smartphones.
[0126] In one embodiment, the imaging device is equipped with an image processing button, which can be used to turn the image processing function on or off. This image processing function is implemented based on the image processing method in any of the above embodiments. When the image processing function is on, the images captured by the imaging device are all processed images; when the image processing function is off, the images captured by the imaging device are all unprocessed images.
[0127] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0128] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0129] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including storage unit 720 and processing unit 710).
[0130] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Detailed Description" section of this specification according to various exemplary embodiments of this disclosure.
[0131] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include a read-only memory (ROM) 7203.
[0132] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0133] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0134] Electronic device 700 can also communicate with one or more external devices 740 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with the electronic device 700, and / or with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. Figure 7As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0135] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0136] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Detailed Description" section above.
[0137] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0138] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0139] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0140] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and 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).
[0141] In exemplary embodiments of this disclosure, a computer program product is also provided, comprising a computer program or computer instructions, which are loaded and executed by a processor to enable a computer to perform the steps of the various exemplary embodiments of this disclosure described in the foregoing “Detailed Description” section of this specification.
[0142] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0143] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0144] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0145] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope of this disclosure is indicated by the appended claims.
Claims
1. An image processing method, characterized in that, include: Obtain the image to be processed; Determine the first color temperature of the image to be processed; Determine the relationship between the first determined color temperature and multiple second determined color temperatures, wherein the multiple second determined color temperatures are the determined color temperatures of multiple color-biased images that are biased towards the same color. When the relationship is that the values corresponding to multiple second determined color temperatures include the values corresponding to the first determined color temperature, the image to be processed is determined to be a color-biased image, and the color-biased image has pixels to be processed with color space channel values within a first preset range; The color space channel values of the pixel to be processed are processed so that the color space channel values of the pixel to be processed fall within a second preset range, thereby obtaining an image after color cast is eliminated; Wherein, the image to be processed and the plurality of color-distorted images are captured by the same image acquisition device; or, the image to be processed and the plurality of color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
2. The method according to claim 1, characterized in that, The multiple color-biased images are biased towards the color purple; The pixels to be processed whose color space channel values are within the first preset range are pixels with a purple tint.
3. The method according to claim 2, characterized in that, The color space is the YUV color space, which is based on brightness, hue, and saturation. The first preset range is shown in the following formula: in, For pixels in YUV space Values on the channel For pixels in YUV space Values on the channel and All are values greater than 0 and less than 1, and , The range of values is .
4. The method according to claim 3, characterized in that, The It is 0.2; The It is 0.
8.
5. The method according to claim 2, characterized in that, The step of processing the color space channel values of the pixel to be processed so that the color space channel values of the pixel to be processed fall within a second preset range to obtain an image after color cast removal includes: In the case that the color space is the hue, saturation, and brightness HSV space, the value of the pixel to be processed in the G channel of the red, green, and blue RGB space is increased so that the value of the pixel to be processed in the three HSV channels falls within the second preset range corresponding to the HSV space, thereby obtaining the image after eliminating color cast. or, When the color space is YUV, the values of the pixel to be processed in the U and V channels are reduced so that the values of the pixel to be processed in the U and V channels fall within the second preset range corresponding to the YUV space, thereby obtaining an image after color cast is eliminated.
6. The method according to claim 5, characterized in that, The second preset range corresponding to the YUV space is shown in the following formula: in, For pixels in YUV space Values on the channel For pixels in YUV space Values on the channel and The range of values is ,and .
7. The method according to claim 6, characterized in that, The and All are 0.
8. The method according to claim 1, characterized in that, Before determining the relationship between the first determined color temperature and the multiple second determined color temperatures, the method further includes: Acquire the multiple color-distortion images; The determination color temperature of each color-biased image is determined as a second determination color temperature, and the plurality of second determination color temperatures are obtained.
9. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the image to be processed; The first determining module is used to determine the first color temperature of the image to be processed; The second determining module is used to determine the relationship between the first determined color temperature and multiple second determined color temperatures, wherein the multiple second determined color temperatures are the determined color temperatures of multiple color-biased images that are biased towards the same color. The third determining module is used to determine that the image to be processed is a color-biased image when the relationship is that the values corresponding to multiple second determined color temperatures include the values corresponding to the first determined color temperature. The color-biased image has pixels to be processed with color space channel values within a first preset range. The processing module is used to process the color space channel values of the pixel to be processed so that the color space channel values of the pixel to be processed fall within a second preset range, thereby obtaining an image after color cast is eliminated. Wherein, the image to be processed and the plurality of color-distorted images are captured by the same image acquisition device; or, the image to be processed and the plurality of color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
10. An image acquisition system, characterized in that, include: Image acquisition equipment, used to acquire images to be processed; Image processing equipment for determining a first determination color temperature of the image to be processed; The relationship between the first determined color temperature and multiple second determined color temperatures is determined, and when the relationship is such that the values corresponding to the multiple second determined color temperatures include the values corresponding to the first determined color temperature, the image to be processed is determined to be a color-skewed image. Then, the color space channel values of the pixels to be processed are processed so that the color space channel values of the pixels to be processed fall within a second preset range, thereby obtaining an image after color cast is eliminated. The multiple second determined color temperatures are the determined color temperatures of multiple color-skewed images that are biased towards the same color, and the color-skewed image has pixels to be processed whose color space channel values are within the first preset range. Wherein, the image to be processed and the plurality of color-distorted images are captured by the same image acquisition device; or, the image to be processed and the plurality of color-distorted images are respectively acquired by different image acquisition devices with the same configuration.
11. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the image processing method according to any one of claims 1 to 8 by executing the executable instructions.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
White balance calibration parameter generation method and system, image correction method and system, equipment and medium
CN114612571A
Image white balance method suitable for monotonous scene
CN115665395A