CN113099191A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN113099191A
CN113099191A CN202110301046.7A CN202110301046A CN113099191A CN 113099191 A CN113099191 A CN 113099191A CN 202110301046 A CN202110301046 A CN 202110301046A CN 113099191 A CN113099191 A CN 113099191A
Authority
CN
China
Prior art keywords
image
block
intensity value
processed
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110301046.7A
Other languages
Chinese (zh)
Other versions
CN113099191B (en
Inventor
邵一轶
况璐
隋小波
潘武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110301046.7A priority Critical patent/CN113099191B/en
Publication of CN113099191A publication Critical patent/CN113099191A/en
Application granted granted Critical
Publication of CN113099191B publication Critical patent/CN113099191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides an image processing method and device, wherein the method comprises the following steps: determining each target image block from the image to be processed, wherein the image in at least one target image block is a color image; determining an image correction coefficient of the image to be processed according to the brightness correction value of each target image block; and correcting the image to be processed according to the image correction coefficient. Compared with the prior art in which single analysis and correction are performed only through color temperature or brightness, the method can further eliminate the perception difference of human eyes to images and videos and the picture jump of the images and the videos, and improve the visual effect of color migration.

Description

Image processing method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
Background
With the increase of network speed, visual files such as images and videos are more and more appeared in our lives. Such as video capture of surveillance systems, video capture of photography, image capture, and the like. But acquired video and images generally require corrective processing. On one hand: because the response of human eyes to brightness has logarithmic nonlinearity, and the sensitivity of human eyes to different light waves is different; therefore, human eyes perceive color and brightness differently from those of the physical world. Therefore, in capturing video and images, correction of the video and images acquired by the camera is often required to provide better visual effects. On one hand: sudden changes in the acquisition environment can also result in sudden changes in the video or image frames. For example, when a video surveillance system shoots, a surveillance scene or a surveillance magnification may need to be changed, and the change of the surveillance scene and the change of the magnification may cause a jump of color and brightness in the surveillance scene. For another example, when an image or a video is captured by using an imaging device, in the same scene, a display screen corresponding to the imaging device before switching and a display screen corresponding to the imaging device after switching are greatly different, and a display screen may have a significant jump. Therefore, it is necessary to eliminate the jump by performing a rectification process on the video and the picture. On one hand: in order to pursue the shooting effect, people can adjust the style of the shot image or video through a color migration means, namely, the color style is changed on the premise of not changing the content of the original image, so that different illumination, weather conditions, scene materials and even artistic color effects can be simulated. Therefore, there is also a need to analyze and process the captured video streams and images. In the prior art, only the color saturation, color temperature and the like of the video and the image are often analyzed and corrected, so as to improve the visual effect of the video and the image. The video and image obtained by the correction method can not obtain good visual effect.
Therefore, there is a need for an image processing method and apparatus for eliminating the difference in perception of images and videos and the picture jump of images and videos by human eyes, and improving the visual effect of color migration.
Disclosure of Invention
The embodiment of the invention provides an image processing method and device, which are used for eliminating the perception difference of human eyes on images and videos and the picture jump of the images and the videos and improving the visual effect of color migration.
In a first aspect, an embodiment of the present invention provides an image processing method, where the method includes:
determining each target image block from the image to be processed, wherein the image in at least one target image block is a color image; determining an image correction coefficient of the image to be processed according to the brightness correction value of each target image block; and correcting the image to be processed according to the image correction coefficient.
In the method, the obtained target image block has the logical significance of correcting the image to be processed through the target image block, and further, the brightness correction coefficient obtained according to the target image block is more accurate. And acquiring an image correction coefficient of the image to be processed according to the brightness correction coefficient. Therefore, compared with the prior art that only single analysis and correction are carried out through color temperature or brightness, the image correction factor comprises the brightness correction factor, the perception difference of human eyes to images and videos and the picture jump of the images and the videos can be further eliminated, and the visual effect of color migration is improved.
Optionally, determining each target image block from the image to be processed includes: partitioning the image to be processed according to a first partitioning rule; for each block, determining whether the image attribute of the block is black, white and gray according to the color intensity value of each color channel in the block; and determining the blocks corresponding to the preset hue trend from the non-black, white and gray blocks as the target image blocks.
In the method, the image to be processed is blocked according to a first blocking rule to respectively obtain the color intensity values of each color channel of each block, namely the red intensity value, the green intensity value and the blue intensity value of each block. Furthermore, the black, white and gray blocks are ignored, the preset hue trend of each non-black, white and gray block is determined, and the block corresponding to the preset hue trend is used as the target image block. Therefore, the hue trend characteristics of the target image block are more consistent with the correction scene logic of the image, the accuracy of the image correction coefficient is improved, and the correction effect is improved.
Optionally, determining whether the image attribute of the block is black, white and gray according to the color intensity value of each color channel in the block includes: and if the difference value between any color intensity value of the block and the other two color intensity values is smaller than the difference threshold value, the image attribute of the block is black, white and gray.
In the method, if the difference value between any color intensity value of a block and the other two color intensity values is smaller than the difference threshold value, the color intensity values of the block are considered to be similar, and the maximum probability of the image attribute of the image with the similar color intensity value is black, white and gray.
Optionally, each color channel is an RGB three-primary color channel; determining the blocks corresponding to the preset hue trend from the blocks which are not black, white and gray, wherein the method comprises the following steps: if the red intensity value of the block is greater than the green intensity value and the green intensity value is greater than the blue intensity value, the block belongs to a yellow hue trend; if the red intensity value of the block is smaller than the green intensity value and the green intensity value is smaller than the blue intensity value, the block belongs to the blue hue trend; if the red intensity value of the block is greater than the green intensity value and the green intensity value is less than the blue intensity value, the block belongs to the red hue trend; and if the red intensity value of the block is smaller than the green intensity value and the green intensity value is larger than the blue intensity value, the block belongs to the green hue trend.
In the method, the preset hue trend is determined according to the color intensity value relationship in the colorimetry, and the accuracy of the result of judging the preset hue trend to which the blocks belong is improved.
Optionally, the method further includes: if the blocks corresponding to the preset hue trend are not determined from the non-black, white and gray blocks, blocking the image to be processed according to a second blocking rule and continuously selecting a target image block; or selecting the blocks with the number of the types according with the preset hue trend from the blocks of the black, white and gray.
In the method, if the blocks corresponding to the preset hue trend are not found out from the blocks which are not black, white and gray; partitioning the image to be processed according to a second partitioning rule; further, the blocks corresponding to the preset hue trend are obtained. Therefore, the blocks obtained after the image to be processed is blocked are smaller, the preset hue trend of the blocks which are not corresponding last time is increased, and the probability of matching the blocks is obtained. In another mode, a certain number of black-white-gray sub-blocks can be directly selected from the black-white-gray sub-blocks, so that the certain number of black-white-gray sub-blocks belong to preset hue trends without corresponding non-black-white-gray sub-blocks, and the condition that the result is inaccurate due to the fact that the corresponding sub-blocks with the preset hue trends are lost is prevented.
Optionally, determining an image rectification coefficient of the image to be processed according to the brightness rectification value of each target image block includes: determining a brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block; and multiplying the brightness correction coefficient and the color temperature correction coefficient corresponding to the image to be processed to obtain the image correction coefficient of the image to be processed.
In the method, the brightness correction coefficient is multiplied by the color temperature correction coefficient corresponding to the image to be processed, so that the acquired image correction coefficient comprises both the brightness correction element and the color temperature correction element, and the visual effect of the corrected image is improved.
Optionally, determining the brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block includes: for each target image block, determining a corrected RGB value of the target image block according to a brightness correction table; and determining the RGB value of each target image block before correction and the RGB value of each target image block after correction as the brightness correction coefficient.
In the method, the brightness correction table can be preset as required, and then the image to be processed can be corrected according to the corresponding requirement, for example, the image to be processed is corrected according to the brightness correction table corresponding to the daylight effect, the moonlight effect or the normal effect with the best perception of human eyes; different rectified images can be acquired. And determining the RGB value before the correction of each target image block and the RGB value after the correction of each target image block as a brightness correction coefficient, so that the correction logic corresponding to each selected target image block can be obtained, and the pertinence of the correction effect is improved.
In a second aspect, an embodiment of the present invention provides an image processing apparatus, including:
the acquisition module is used for determining each target image block from the image to be processed, wherein the image in at least one target image block is a color image;
the processing module is used for determining an image correction coefficient of the image to be processed according to the brightness correction value of each target image block;
the processing module is further configured to correct the image to be processed according to the image correction coefficient.
In a third aspect, an embodiment of the present application further provides a computing device, including: a memory for storing a program; a processor for calling the program stored in said memory and executing the method as described in the various possible designs of the first aspect according to the obtained program.
In a fourth aspect, embodiments of the present application further provide a computer-readable non-transitory storage medium including a computer-readable program which, when read and executed by a computer, causes the computer to perform the method as described in the various possible designs of the first aspect.
These and other implementations of the present application will be more readily understood from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an image processing architecture according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an image processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a system architecture for image processing, as shown in fig. 1, an image to be processed is input into a partitioning unit in an image processing system. The blocking unit can be provided with a plurality of blocking rules, so that the blocking unit determines a first blocking rule corresponding to the image to be processed according to the image information of the image to be processed, and blocks the image to be processed according to the first blocking rule; the image information may include an image size, an image resolution and the like, so that the blocking unit determines a first blocking rule corresponding to the image to be processed according to the image information such as the image size, the image resolution and the like; the blocking unit sends the obtained multiple blocks to the screening unit. The screening unit determines a preset hue trend of each block according to the relation among the red intensity value, the green intensity value and the blue intensity value of each block; selecting at least one block from the blocks corresponding to the preset hue trends as a target image block; the screening unit sends the acquired target image block to the calculating unit. The computing unit determines a brightness correction coefficient of the image to be processed according to the color intensity value of the target image block and the brightness correction table, multiplies the brightness correction coefficient and a color temperature correction coefficient corresponding to the image to be processed to obtain an image correction coefficient, corrects the image to be processed according to the image correction coefficient to obtain a corrected image, and outputs the corrected image as a processing result. Compared with the prior art that the image is corrected only through a gamma table or only through a color temperature correction coefficient, the method corresponding to the system architecture can not only eliminate the perception difference of human eyes to the image and the video and the picture jump of the image and the video, but also improve the visual effect of color migration.
Based on this, an embodiment of the present application provides a flow of an image processing method, as shown in fig. 2, including:
step 201, determining each target image block from an image to be processed, wherein an image in at least one target image block is a color image;
here, the image to be processed may be a photographic image, or an image corresponding to a video frame in a video, for example, a person image, a street image, a landscape image, or the like; the image to be processed may also be a monitoring image or an image corresponding to a video frame in a monitoring video, for example, a hall image, a road image, or the like. The target image block may be an image block meeting a preset condition in the image to be processed, for example, if the image to be processed is a road image, the scenery included in the image to be processed is generally a large-area black or gray road surface, a large-area white road line, and small-area signs of blue, green, and red; the image blocks corresponding to the blue hue trend, the green hue trend and the red hue trend can be preset as target image blocks. Therefore, the target image blocks have set logic significance, the images to be processed are corrected through the brightness correction coefficients determined by the target image blocks, and the obtained corrected images are closer to the observation requirements of workers.
Step 202, determining an image rectification coefficient of the image to be processed according to the brightness rectification value of each target image block;
and 203, correcting the image to be processed according to the image correction coefficient.
In the method, the obtained target image block has the logical significance of correcting the image to be processed through the target image block, and further, the brightness correction coefficient obtained according to the target image block is more accurate. And acquiring an image correction coefficient of the image to be processed according to the brightness correction coefficient. Therefore, compared with the prior art that only single analysis and correction are carried out through color temperature or brightness, the image correction factor comprises the brightness correction factor, the perception difference of human eyes to images and videos and the picture jump of the images and the videos can be further eliminated, and the visual effect of color migration is improved.
The embodiment of the application provides a method for determining target image blocks, which determines each target image block from an image to be processed, and comprises the following steps: partitioning the image to be processed according to a first partitioning rule; for each block, determining whether the image attribute of the block is black, white and gray according to the color intensity value of each color channel in the block; and determining the blocks corresponding to the preset hue trend from the non-black, white and gray blocks as the target image blocks.
That is to say, after a first blocking rule corresponding to the image to be processed is determined according to the image information of the image to be processed, the image to be processed is blocked according to the first blocking rule. Acquiring a color intensity value of each color channel of each block, wherein the color channel can be a color channel corresponding to RGB three primary colors; determining whether the block is a black-white gray block or not according to the color intensity value of each block, and if the block is the black-white gray block, rejecting the block; and if the color block is the non-black-white gray block, determining the preset hue trend to which the non-black-white gray block belongs respectively. Further, the target image block is selected according to the non-black-white gray blocks corresponding to the preset hue trends. For example, the image information of the image to be processed includes: the image to be processed is a road image, the size of 10cm by 10cm, the resolution is 1920 by 1080 and the like. Then the block rule corresponding to the image information is the first block rule. The first blocking rule may be: counting the color intensity value of each color channel of 10 × 10 blocks of the current image to be processed; the method for obtaining 10 × 10 blocks of the current image to be processed may be to divide the image to be processed into 10 × 10 blocks with uniform size, or 10 × 10 blocks with non-uniformity, and the specific blocking method may be set as needed, and the exemplary blocking method is not limited to the specific implementation of the scheme. Determining that the 10 x 10 blocks comprise 60 black-white gray blocks and 40 non-black-white gray blocks according to the color intensity value of each color channel of the 10 x 10 blocks of the image to be processed; the preset hue trend is as follows: determining preset hue trends of the 40 non-black-white gray sub-blocks according to the yellow hue trend, the red hue trend, the blue hue trend and the green hue trend; for example, 10 of the 40 non-black and white gray patches belong to a yellow color trend, 10 non-black and white gray patches belong to a red color trend, 10 non-black and white gray patches belong to a blue color trend, and 10 non-black and white gray patches belong to a green color trend. And selecting at least one block from the blocks corresponding to the yellow hue trend, the red hue trend, the blue hue trend and the green hue trend as a target image block. In addition, the target image block selected from the non-black-and-white gray blocks corresponding to the preset hue trend may also be selected according to a selection principle corresponding to the preset hue trend, where the selection principle may be: determining preset color intensity values of all non-black-and-white gray blocks in a preset hue trend, and taking the non-black-and-white gray block with the maximum preset color intensity value or the minimum preset color intensity value as a target image block; or determining color intensity values of at least two preset colors of all non-black and white gray blocks in the preset hue trend, and taking the non-black and white gray block with the largest average value of the at least two preset color intensity values or the smallest average value of the at least two preset color intensity values as the target image block. The selection principle can be set according to the requirement, and is not limited specifically.
The embodiment of the present application provides a method for determining an image attribute, which determines whether an image attribute of a block is black, white and gray according to a color intensity value of each color channel in the block, and includes: and if the difference value between any color intensity value of the block and the other two color intensity values is smaller than the difference threshold value, the image attribute of the block is black, white and gray.
That is, if R ≈ G ≈ B, the image attribute of the patch can be determined as a black-and-white gray patch. The determination may be made in the formulas of ABS | G-R | <10 and ABS | G-B | <10, ABS | B-R | <10 and ABS | B-G | <10, ABS | R-G | <10 and ABS | R-B | <10, where the difference threshold 10 is a corresponding difference threshold 10 when the color channel value of the image to be processed is normalized to 8 bits, which may be obtained empirically or by professional knowledge. Similarly, if the color channel value of the image to be processed is normalized to 10 bits, the difference threshold value is 10 × 4; if the color channel value of the image to be processed is normalized to 12 bits, the difference threshold value is 10 × 16.
The embodiment of the application provides a method for judging hue trend of blocks, wherein each color channel is an RGB three-primary color channel; determining the blocks corresponding to the preset hue trend from the blocks which are not black, white and gray, wherein the method comprises the following steps: if the red intensity value of the block is greater than the green intensity value and the green intensity value is greater than the blue intensity value, the block belongs to a yellow hue trend; if the red intensity value of the block is smaller than the green intensity value and the green intensity value is smaller than the blue intensity value, the block belongs to the blue hue trend; if the red intensity value of the block is greater than the green intensity value and the green intensity value is less than the blue intensity value, the block belongs to the red hue trend; and if the red intensity value of the block is smaller than the green intensity value and the green intensity value is larger than the blue intensity value, the block belongs to the green hue trend.
That is, if R > G > B of a non-black and white gray patch, then the non-black and white gray patch belongs to a yellow hue trend; if R < G < B of the non-black-white gray blocks, the non-black-white gray blocks belong to the blue hue trend; if R of the non-black-white gray blocks is greater than G and less than B, the non-black-white gray blocks belong to the red hue trend; if R < G > B of the non-black and white gray block, the non-black and white gray block belongs to the green hue trend. Here, the preset hue trend category is only an example of a preset hue trend category, and there may also be a purple hue trend, a pink hue trend, an orange hue trend, and the like, and the specific preset hue trend category may be determined according to the image category of the image to be processed, for example, if the image category of the image to be processed is an image of a lavender garden, the preset hue trend may include a green hue trend and a purple hue trend; the determination of the preset hue trend is not limited herein.
The embodiment of the application provides an image processing method, which further comprises the following steps: if the blocks corresponding to the preset hue trend are not determined from the non-black, white and gray blocks, blocking the image to be processed according to a second blocking rule and continuously selecting a target image block; or selecting the blocks with the number of the types according with the preset hue trend from the blocks of the black, white and gray.
In the above example, if there is no corresponding non-black-white-gray block in a part or all of a yellow hue trend, a red hue trend, a blue hue trend, and a green hue trend in the preset hue trends, the image to be processed is blocked according to a second blocking rule to obtain a corresponding block; the number of blocks obtained by the second block rule can be larger or smaller than the number of blocks obtained by the first block rule; the specific setting can be according to needs. And then determining the non-black-white gray blocks obtained by the second block rule block division, determining the preset hue trend to which the non-black-white gray blocks belong, and taking at least one non-black-white gray block corresponding to the preset hue trend as a target image block. Or, in the above example, if there is no corresponding non-black-and-white gray segment in the red phase trend and the blue phase trend in the preset hue trend, selecting at least two black-and-white gray segments from the black-and-white gray segments obtained by the first segmentation rule as the red phase trend and the blue hue trend segments, respectively; and determining a target image block from the blocks corresponding to the preset hue trends. Or, in the above example, if there is no corresponding non-black and white gray segment in the red phase trend and the blue phase trend in the preset hue trend, selecting at least two non-black and white gray segments from the non-black and white gray segments corresponding to the yellow phase trend and/or the green hue trend as the red phase trend and the blue hue trend respectively; and determining a target image block from the blocks corresponding to the preset hue trends. Or, the target image block is directly determined from the preset hue trend of the corresponding non-black-white gray block.
The embodiment of the present application provides an image processing method, determining an image correction coefficient of an image to be processed according to a brightness correction value of each target image block, including: determining a brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block; and multiplying the brightness correction coefficient and the color temperature correction coefficient corresponding to the image to be processed to obtain the image correction coefficient of the image to be processed.
Here, the color temperature correction coefficient may be determined according to the image to be processed, for example, if the streaming media processing system includes a correlation algorithm, the color temperature value of the image to be processed may be determined by the correlation algorithm of the color temperature value, and if the color temperature of the image to be processed belongs to the high color temperature, the color temperature correction coefficient of the high color temperature image is selected to be multiplied by the brightness correction coefficient of the image to be processed; if the color temperature of the image to be processed belongs to the middle color temperature, the color temperature correction coefficient of the middle color temperature image is selected to be multiplied by the brightness correction coefficient of the image to be processed; and if the color temperature of the image to be processed belongs to the low color temperature, selecting the color temperature correction coefficient of the low color temperature image to be multiplied by the brightness correction coefficient of the image to be processed. The Color temperature Correction coefficient here may be CCM (Color Correction matrix). Therefore, by the method, the brightness element and the color temperature element can be used in a matching manner to correct the image to be processed, and the phenomenon that in the prior art, the correction effect is poor due to the fact that another element in the image is not well influenced because single correction is carried out according to the brightness element or the color temperature element is eliminated.
The embodiment of the present application provides an image processing method, determining a brightness correction coefficient of an image to be processed according to a brightness correction value of each target image block, including: for each target image block, determining a corrected RGB value of the target image block according to a brightness correction table; and determining the RGB value of each target image block before correction and the RGB value of each target image block after correction as the brightness correction coefficient.
For example, if four target image blocks are currently included, the RGB values of the target image blocks are determined as follows:
Figure BDA0002986287850000111
determining the RGB value of the corrected target image block according to the brightness correction table as follows:
Figure BDA0002986287850000112
can be combined with
Figure BDA0002986287850000113
And
Figure BDA0002986287850000114
the result obtained by the division may be used as a luminance correction coefficient, or the luminance correction coefficient may be obtained by subtraction or the like, and the manner of obtaining the luminance correction coefficient is not particularly limited herein. The brightness correction table may have an input color intensity value on the horizontal axis and an output color intensity value on the vertical axis, for example, the input color intensity value is r1The output color intensity value is r1' this is merely an example of a brightness correction table provided in the present application, and the brightness correction table may also be presented in the form of key value pairs, which is not limited in particular. There may be a plurality of brightness correction tables, for example, when the brightness value in the image to be processed is required to be higher, it corresponds to one brightness correction table; corresponding to a brightness correction table when the brightness value of the image to be processed is lower; the image to be processed can be processed into a daylight effect, and the daylight effect corresponds to a brightness correction table and the like. In general, the color temperature correction coefficient is 3 × 3 matrix, and if the color temperature correction coefficient is 3 × 3 matrix, the matrix of the luminance correction coefficient is converted into 3 × 3 matrix; it is also possible to scale each row in the matrix obtained by scaling the luminance correction coefficient so that the sum of the values in each row is 1.
Based on the above method flow, an embodiment of the present application provides a flow of an image processing method, as shown in fig. 3, including:
step 301, acquiring an image to be processed.
Step 302, determining a first blocking rule corresponding to the image to be processed according to the image information of the image to be processed, and blocking the image to be processed according to the first blocking rule to obtain blocks of the image to be processed. Or after step 304 is executed, determining a second blocking rule corresponding to the image to be processed according to the image information of the image to be processed, and blocking the image to be processed according to the second blocking rule to obtain blocks of the image to be processed; in this case, the image information of the image to be processed may include information of the last block, such as the block size and resolution obtained by the first block rule; a second partitioning rule is facilitated to be determined. A limited number of ordered blocking rules for a type of image to be processed may be set, and if the image to be processed is blocked according to the last blocking rule and the non-black-and-white gray blocks of which the number is not greater than or equal to the preset number are still not obtained, a certain number of blocks are obtained from the black-and-white gray blocks, and the black-and-white gray blocks are assumed to be the non-black-and-white gray blocks, so that the non-black-and-white gray blocks in step 304 are greater than or equal to the preset number.
And step 303, determining color intensity values of the blocks, determining black-white gray blocks and non-black-white gray blocks according to the color intensity values of the blocks, and determining color temperature correction coefficients of the image to be processed according to the image information of the image to be processed and the number of the non-black-white gray blocks. For example, if the image to be processed is a road image and the number of non-black-white-gray blocks is less than the preset number, it may be considered that the image to be processed includes a large area of black-gray road surface, and further, it is determined that the color temperature correction coefficient of the image to be processed is a low color temperature correction coefficient.
And step 304, determining whether the non-black and white gray blocks are larger than or equal to a preset number. If the number is greater than or equal to the preset number, executing step 305; if the number is less than the predetermined number, go to step 302. In one example, the preset number may be greater than or equal to the number of categories of preset hue trends.
And 305, determining the preset hue trend of each non-black-white-gray block.
And step 306, selecting a target image block from the non-black-white gray blocks corresponding to the preset hue trends.
Step 307, searching a brightness correction table according to the color intensity value of the target image block, and obtaining the color intensity value of the corrected target image block.
And step 308, taking the ratio of the color intensity value of the target image block to the color intensity value of the corrected target image block as a brightness correction coefficient.
Step 309, multiplying the brightness correction coefficient and the low color temperature correction coefficient corresponding to the image to be processed to obtain an image correction coefficient.
And step 310, correcting the image to be processed according to the image correction coefficient. In the above example, if the image correction coefficient is a 3 × 3 matrix obtained by multiplying a 3 × 3 matrix of the brightness correction coefficient and a 3 × 3 matrix of the low color temperature correction coefficient, the 3 × 3 matrix of the image correction coefficient may be multiplied by the color intensity values of the blocks of the image to be processed, respectively; the 3 × 3 matrix of image correction coefficients may also be multiplied by a 3 × 3 matrix of color intensity values (RGB) of every three blocks of the image to be processed. The method for correcting the image to be processed according to the image correction coefficient is only an example, and is not limited in particular.
It should be noted that, the above-mentioned steps of the process are not exclusive, for example, the process of determining the color temperature correction coefficient corresponding to the image to be processed in step 303 may be executed in step 302, that is, the color temperature correction coefficient corresponding to the image to be processed is directly determined according to the image information of the image to be processed.
Based on the above method flow, an embodiment of the present application provides a flow of an image processing method, as shown in fig. 4, including:
step 401, acquiring an image to be processed.
Step 402, determining a blocking rule corresponding to the image to be processed according to the image information of the image to be processed, and blocking the image to be processed according to the blocking rule to obtain blocks of the image to be processed.
And step 403, determining the color intensity value of each block, and determining the black-white gray block and the non-black-white gray block according to the color intensity values of the blocks. And determining the color temperature correction coefficient of the image to be processed according to the image information of the image to be processed and the number of the non-black-white gray blocks.
Step 404, determining whether the non-black and white gray blocks are greater than or equal to a preset number. If the number is greater than or equal to the preset number, go to step 406; if the number is less than the predetermined number, go to step 405.
Step 405, selecting a certain number of blocks from the black and white gray blocks obtained by the block rule block, and assuming the black and white gray blocks as non-black and white gray blocks, so that the non-black and white gray blocks in step 404 are greater than or equal to the preset number.
And step 406, determining the preset hue trend of each non-black-white-gray block.
Step 407, selecting a target image block from the non-black-white gray blocks corresponding to the preset hue trends.
And step 408, searching a brightness correction table according to the color intensity value of the target image block to obtain the color intensity value of the corrected target image block.
And step 409, taking the ratio of the color intensity value of the target image block to the color intensity value of the corrected target image block as a brightness correction coefficient.
And step 410, multiplying the brightness correction coefficient by the low color temperature correction coefficient corresponding to the image to be processed to obtain an image correction coefficient.
And 411, correcting the image to be processed according to the image correction coefficient.
It should be noted that, the above-mentioned steps of the process are not exclusive, for example, the process of determining the color temperature correction coefficient corresponding to the image to be processed in step 403 may be executed in step 402, that is, the color temperature correction coefficient corresponding to the image to be processed is directly determined according to the image information of the image to be processed.
Based on the same idea and based on the above method flow, an embodiment of the present application provides an image processing apparatus, as shown in fig. 5, including:
an obtaining module 501, configured to determine each target image block from an image to be processed, where an image in at least one target image block is a color image;
a processing module 502, configured to determine an image rectification coefficient of the image to be processed according to the brightness rectification value of each target image block;
the processing module 502 is further configured to correct the image to be processed according to the image correction coefficient.
Optionally, the obtaining module 501 is specifically configured to: partitioning the image to be processed according to a first partitioning rule; for each block, determining whether the image attribute of the block is black, white and gray according to the color intensity value of each color channel in the block; and determining the blocks corresponding to the preset hue trend from the non-black, white and gray blocks as the target image blocks.
Optionally, the obtaining module 501 is specifically configured to: and if the difference value between any color intensity value of the block and the other two color intensity values is smaller than the difference threshold value, the image attribute of the block is black, white and gray.
Optionally, the obtaining module 501 is specifically configured to: each color channel is an RGB three-primary color channel; determining a block corresponding to a preset hue trend from the non-black, white and gray blocks, wherein if the red intensity value of the block is greater than the green intensity value and the green intensity value is greater than the blue intensity value, the block belongs to a yellow hue trend; if the red intensity value of the block is smaller than the green intensity value and the green intensity value is smaller than the blue intensity value, the block belongs to the blue hue trend; if the red intensity value of the block is greater than the green intensity value and the green intensity value is less than the blue intensity value, the block belongs to the red hue trend; and if the red intensity value of the block is smaller than the green intensity value and the green intensity value is larger than the blue intensity value, the block belongs to the green hue trend.
Optionally, the obtaining module 501 is further configured to: if the blocks corresponding to the preset hue trend are not determined from the non-black, white and gray blocks, blocking the image to be processed according to a second blocking rule and continuously selecting a target image block; or selecting the blocks with the number of the types according with the preset hue trend from the blocks of the black, white and gray.
Optionally, the processing module 502 is specifically configured to: determining a brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block; and multiplying the brightness correction coefficient and the color temperature correction coefficient corresponding to the image to be processed to obtain the image correction coefficient of the image to be processed.
Optionally, the processing module 502 is specifically configured to: for each target image block, determining a corrected RGB value of the target image block according to a brightness correction table; and determining the RGB value of each target image block before correction and the RGB value of each target image block after correction as the brightness correction coefficient.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An image processing method, comprising:
determining each target image block from the image to be processed, wherein the image in at least one target image block is a color image;
determining an image correction coefficient of the image to be processed according to the brightness correction value of each target image block;
and correcting the image to be processed according to the image correction coefficient.
2. The method as recited in claim 1 wherein determining each target image block from the image to be processed comprises:
partitioning the image to be processed according to a first partitioning rule;
for each block, determining whether the image attribute of the block is black, white and gray according to the color intensity value of each color channel in the block;
and determining the blocks corresponding to the preset hue trend from the non-black, white and gray blocks as the target image blocks.
3. The method of claim 2, wherein determining whether the image attribute of the tile is black, white, and gray based on the color intensity values of the color channels in the tile comprises:
and if the difference value between any color intensity value of the block and the other two color intensity values is smaller than the difference threshold value, the image attribute of the block is black, white and gray.
4. The method as claimed in claim 2, wherein each of the color channels is a RGB tricolor channel; determining the blocks corresponding to the preset hue trend from the blocks which are not black, white and gray, wherein the method comprises the following steps:
if the red intensity value of the block is greater than the green intensity value and the green intensity value is greater than the blue intensity value, the block belongs to a yellow hue trend;
if the red intensity value of the block is smaller than the green intensity value and the green intensity value is smaller than the blue intensity value, the block belongs to the blue hue trend;
if the red intensity value of the block is greater than the green intensity value and the green intensity value is less than the blue intensity value, the block belongs to the red hue trend;
and if the red intensity value of the block is smaller than the green intensity value and the green intensity value is larger than the blue intensity value, the block belongs to the green hue trend.
5. The method as recited in claim 2, further comprising:
if the blocks corresponding to the preset hue trend are not determined from the non-black, white and gray blocks, blocking the image to be processed according to a second blocking rule and continuously selecting a target image block; or
And selecting the blocks with the types and the number which accord with the preset hue trend from the blocks of the black, the white and the gray.
6. The method according to any one of claims 1-4, wherein determining the image rectification coefficients of the image to be processed according to the brightness rectification value of each target image block comprises:
determining a brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block;
and multiplying the brightness correction coefficient and the color temperature correction coefficient corresponding to the image to be processed to obtain the image correction coefficient of the image to be processed.
7. The method of claim 1,
determining the brightness correction coefficient of the image to be processed according to the brightness correction value of each target image block, wherein the determining comprises the following steps:
for each target image block, determining a corrected RGB value of the target image block according to a brightness correction table;
and determining the RGB value of each target image block before correction and the RGB value of each target image block after correction as the brightness correction coefficient.
8. An image processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for determining each target image block from the image to be processed, wherein the image in at least one target image block is a color image;
the processing module is used for determining an image correction coefficient of the image to be processed according to the brightness correction value of each target image block;
the processing module is further configured to correct the image to be processed according to the image correction coefficient.
9. A computer-readable storage medium, characterized in that it stores a program which, when run on a computer, causes the computer to carry out the method of any one of claims 1 to 7.
10. A computer device, comprising:
a memory for storing a computer program;
a processor for calling a computer program stored in said memory to execute the method of any of claims 1 to 7 in accordance with the obtained program.
CN202110301046.7A 2021-03-22 2021-03-22 Image processing method and device Active CN113099191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110301046.7A CN113099191B (en) 2021-03-22 2021-03-22 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110301046.7A CN113099191B (en) 2021-03-22 2021-03-22 Image processing method and device

Publications (2)

Publication Number Publication Date
CN113099191A true CN113099191A (en) 2021-07-09
CN113099191B CN113099191B (en) 2023-04-07

Family

ID=76668865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110301046.7A Active CN113099191B (en) 2021-03-22 2021-03-22 Image processing method and device

Country Status (1)

Country Link
CN (1) CN113099191B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113920037A (en) * 2021-12-14 2022-01-11 极限人工智能有限公司 Endoscope picture correction method, device, correction system and storage medium

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5278641A (en) * 1990-05-14 1994-01-11 Kabushiki Kaisha Toshiba Brightness referenced color image correcting apparatus
US5619229A (en) * 1990-10-15 1997-04-08 Nec Corporation Display apparatus with color temperature control
JP2001358961A (en) * 2000-04-14 2001-12-26 Fujitsu Ltd Color image processor
US20020008771A1 (en) * 2000-04-13 2002-01-24 Fumiko Uchino Digital camera and image processing apparatus
JP2005039408A (en) * 2003-07-17 2005-02-10 Ricoh Co Ltd Apparatus and method for image processing, program, and recording medium
US7016075B1 (en) * 1999-09-22 2006-03-21 Nec Corporation Apparatus and method for automatic color correction and recording medium storing a control program therefor
US20060066912A1 (en) * 2004-09-30 2006-03-30 Fuji Photo Film Co., Ltd. Image processing apparatus, method and program
US20070035641A1 (en) * 2004-05-27 2007-02-15 Rui Yamada Image processing apparatus, image processing method, and computer program
JP2007124695A (en) * 2006-12-27 2007-05-17 Ricoh Co Ltd Image processing apparatus
JP2009050032A (en) * 2008-12-02 2009-03-05 Oki Electric Ind Co Ltd Image data correcting apparatus
JP2009071494A (en) * 2007-09-12 2009-04-02 Sony Corp Imaging apparatus, image processing apparatus, and program
US20110317935A1 (en) * 2010-06-25 2011-12-29 Fujitsu Limited Image processing device, method thereof, and a computer readable non transitory storage medium storing an image processing program
US20130016249A1 (en) * 2011-07-14 2013-01-17 Canon Kabushiki Kaisha Imaging apparatus capable of controlling exposure including flash amount control of flash apparatus, and control method thereof
US20130088613A1 (en) * 2011-10-07 2013-04-11 Fujitsu Limited Image processing apparatus and image pickup apparatus
WO2017024787A1 (en) * 2015-08-12 2017-02-16 青岛海信电器股份有限公司 Image correction method and device
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction
US20180249141A1 (en) * 2015-09-09 2018-08-30 Samsung Electronics Co., Ltd. Image processing apparatus and image processing method

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5278641A (en) * 1990-05-14 1994-01-11 Kabushiki Kaisha Toshiba Brightness referenced color image correcting apparatus
US5619229A (en) * 1990-10-15 1997-04-08 Nec Corporation Display apparatus with color temperature control
US7016075B1 (en) * 1999-09-22 2006-03-21 Nec Corporation Apparatus and method for automatic color correction and recording medium storing a control program therefor
US20020008771A1 (en) * 2000-04-13 2002-01-24 Fumiko Uchino Digital camera and image processing apparatus
JP2001358961A (en) * 2000-04-14 2001-12-26 Fujitsu Ltd Color image processor
JP2005039408A (en) * 2003-07-17 2005-02-10 Ricoh Co Ltd Apparatus and method for image processing, program, and recording medium
US20070035641A1 (en) * 2004-05-27 2007-02-15 Rui Yamada Image processing apparatus, image processing method, and computer program
US20060066912A1 (en) * 2004-09-30 2006-03-30 Fuji Photo Film Co., Ltd. Image processing apparatus, method and program
JP2007124695A (en) * 2006-12-27 2007-05-17 Ricoh Co Ltd Image processing apparatus
JP2009071494A (en) * 2007-09-12 2009-04-02 Sony Corp Imaging apparatus, image processing apparatus, and program
JP2009050032A (en) * 2008-12-02 2009-03-05 Oki Electric Ind Co Ltd Image data correcting apparatus
US20110317935A1 (en) * 2010-06-25 2011-12-29 Fujitsu Limited Image processing device, method thereof, and a computer readable non transitory storage medium storing an image processing program
US20130016249A1 (en) * 2011-07-14 2013-01-17 Canon Kabushiki Kaisha Imaging apparatus capable of controlling exposure including flash amount control of flash apparatus, and control method thereof
US20130088613A1 (en) * 2011-10-07 2013-04-11 Fujitsu Limited Image processing apparatus and image pickup apparatus
WO2017024787A1 (en) * 2015-08-12 2017-02-16 青岛海信电器股份有限公司 Image correction method and device
US20180249141A1 (en) * 2015-09-09 2018-08-30 Samsung Electronics Co., Ltd. Image processing apparatus and image processing method
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
中国感光学会编著: "《2016-2017 感光影像学 学科发展报告》", 31 March 2018, 北京:中国科学技术出版社 *
葛涛: "网络摄像机自动白平衡控制方法研究", 《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113920037A (en) * 2021-12-14 2022-01-11 极限人工智能有限公司 Endoscope picture correction method, device, correction system and storage medium
CN113920037B (en) * 2021-12-14 2022-04-12 极限人工智能有限公司 Endoscope picture correction method, device, correction system and storage medium

Also Published As

Publication number Publication date
CN113099191B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US8164649B2 (en) White balance adjusting device, imaging apparatus, and recording medium storing white balance adjusting program
US7684096B2 (en) Automatic color correction for sequences of images
CN112752023B (en) Image adjusting method and device, electronic equipment and storage medium
JPWO2006059573A1 (en) Color adjustment apparatus and method
KR20100011772A (en) Method for controlling auto white balance
CN109862389A (en) A kind of method for processing video frequency, device, server and storage medium
KR20070090224A (en) Method of electronic color image saturation processing
US9378564B2 (en) Methods for color correcting digital images and devices thereof
JP6934240B2 (en) Image processing device
US10645304B2 (en) Device and method for reducing the set of exposure times for high dynamic range video/imaging
CN107872663A (en) Image processing method and device, computer-readable recording medium and computer equipment
CN108063926A (en) Image processing method and device, computer readable storage medium and computer equipment
CN108174173B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN108063934B (en) Image processing method and device, computer readable storage medium and computer device
CN113099191B (en) Image processing method and device
KR101854432B1 (en) Method and apparatus for detecting and compensating back light frame
CN107959843B (en) Image processing method and device, computer readable storage medium and computer equipment
JP2013114692A (en) Video processor and video processing method for automatic video correction
JPH09261580A (en) Image processing method
KR20000059451A (en) Method of raw color adjustment and atmosphere color auto extract in a image reference system
CN113596422A (en) Method for adjusting color correction matrix CCM and monitoring equipment
CN114266803A (en) Image processing method, image processing device, electronic equipment and storage medium
KR101903428B1 (en) System and Method of Color Correction for Related Images
KR102315200B1 (en) Image processing apparatus for auto white balance and processing method therefor
CN111275725B (en) Method and device for determining color temperature and tone of image, storage medium and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant