WO2021180173A1 - 一种图像处理方法、装置、设备和存储介质 - Google Patents

一种图像处理方法、装置、设备和存储介质 Download PDF

Info

Publication number
WO2021180173A1
WO2021180173A1 PCT/CN2021/080203 CN2021080203W WO2021180173A1 WO 2021180173 A1 WO2021180173 A1 WO 2021180173A1 CN 2021080203 W CN2021080203 W CN 2021080203W WO 2021180173 A1 WO2021180173 A1 WO 2021180173A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel block
dark
target
brightness
intensity
Prior art date
Application number
PCT/CN2021/080203
Other languages
English (en)
French (fr)
Inventor
金时昱
Original Assignee
百果园技术(新加坡)有限公司
金时昱
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 百果园技术(新加坡)有限公司, 金时昱 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2021180173A1 publication Critical patent/WO2021180173A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing

Definitions

  • the embodiments of the present application relate to the field of image processing technology, for example, to an image processing method, device, device, and storage medium.
  • the dark light enhancement technology often sets a fixed dark light enhancement intensity in practical applications. Due to the different lighting conditions in different video images, the fixed dark light is set The enhancement intensity does not match the input video image, resulting in unsatisfactory effect of video image enhancement. For example, the dark light enhancement intensity used in a video image with better lighting conditions is higher, which causes the video image to be overexposed, which reduces the video image. The clarity.
  • This application provides an image processing method, device, equipment, and storage medium.
  • dynamically adjusting the dark light enhancement intensity of each video image according to the light and dark conditions of each video image the matching of dark light enhancement in the video image processing process is improved. Increase the brightness of the video image and enhance the clarity of the video image.
  • an image processing method which includes:
  • an image processing device which includes:
  • the distribution status module is set to determine the light and dark distribution status corresponding to the detection frame of the video image
  • An intensity determination module configured to determine the dark light enhancement intensity of the video image according to the light and dark distribution condition
  • the image adjustment module is configured to adjust the light and darkness of the video image according to the dark light enhancement intensity.
  • an embodiment of the present application also provides a device, which includes:
  • At least one processor At least one processor
  • Memory set to store at least one program
  • the at least one processor When the at least one program is executed by the at least one processor, the at least one processor implements the image processing method according to any one of the embodiments of the present application.
  • an embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the implementation is as in any one of the embodiments of the present application.
  • the described image processing method is not limited to:
  • This application detects the light and dark distribution of the video image, matches the actual light and dark distribution of the video image to a suitable dark light enhancement intensity, and adjusts the light and darkness of the video image, which solves the problem of over-darkness or over-exposure after the video image is processed. ,
  • the problem of poor display effect realizes the dynamic adjustment of dark light enhancement intensity during video image processing, and effectively enhances the effect of video image clarity.
  • FIG. 1 is a flowchart of an image processing method provided by Embodiment 1 of the present application.
  • FIG. 2 is a flowchart of an image processing method provided in Embodiment 2 of the present application.
  • FIG. 3 is a schematic diagram of a method for dividing pixel blocks according to Embodiment 2 of the present application.
  • FIG. 4 is a schematic diagram of the corresponding relationship between the brightness average value and the dark light enhancement intensity provided in the second embodiment of the present application;
  • FIG. 5 is a schematic structural diagram of an image processing apparatus according to Embodiment 3 of the present application.
  • FIG. 6 is a schematic structural diagram of a device provided in Embodiment 4 of the present application.
  • Figure 1 is a flow chart of an image processing method provided in Embodiment 1 of this application. This embodiment can be applied to the situation of improving the definition of video images.
  • the method can be executed by an image processing device, which can use hardware and software. It can be implemented in at least one of the ways, which can usually be integrated in a smart terminal.
  • the method includes step 110 to step 130.
  • Step 110 Determine the light and dark distribution condition corresponding to the detection frame of the video image.
  • the detection frame can be understood as a certain frame of image or a few frames of images in the video image, which can indirectly reflect the state of the entire video image.
  • the light-dark distribution can be understood as the brightness status of the detected frame image and its light-darkness distribution.
  • the detection frame after acquiring a video image, several frames of images can be randomly selected from the video image as the detection frame, or while the video image is acquired, several previous frames of the video image can be selected as the detection frame.
  • the image format of the detection frame may be a YUV format, and the light and dark distribution status of the detection frame may include the brightness of multiple pixel values of the detection frame and the number of detection frames with higher overall brightness.
  • the embodiment of the present application analyzes the light and dark distribution of the detection frame of the video image, which can reduce the amount of data processing, increase the processing speed, and realize the real-time nature of image processing.
  • Step 120 Determine the dark light enhancement intensity of the video image according to the light and dark distribution.
  • the dark light enhancement intensity can be understood as an intensity parameter when dark light enhancement is performed on a video image.
  • the light and dark distribution status corresponding to the detection frame determined in step 110 can be regarded as the overall light and dark distribution status of the video image, and the video image can be determined by the corresponding relationship between the light and dark distribution status and the dark light enhancement intensity
  • the dark light enhances the intensity.
  • the corresponding relationship between the light and dark distribution and the dark light enhancement intensity can be preset, for example, it can be a linear relationship or a non-linear relationship set based on actual experience, and the dark light corresponding to the light and dark distribution can be determined through the linear relationship or the non-linear relationship
  • the enhanced intensity for example, different light and dark distribution conditions correspond to different values of dark light enhanced intensity, and the corresponding dark light enhanced intensity can be determined by the light and dark distribution conditions.
  • Step 130 Perform light and dark adjustment on the video image according to the dark light enhancement intensity.
  • light and dark adjustment can be understood as dark light enhancement processing on the video image to improve the definition of the video image.
  • the light and dark adjustment of the video image can be performed by using any image dark light enhancement method to improve the brightness and definition of the video image and achieve the effect of dark light enhancement.
  • the dark light enhancement intensity is determined by the video image, which can ensure that the video image will not be over-dark or over-exposed.
  • the dark light enhancement intensity of the video image is obtained by determining the light and dark distribution condition corresponding to the detection frame of the video image, and the light and dark adjustment of the video image is performed according to the dark light enhancement intensity.
  • the technical solution of the embodiment of this application adopts Dynamic adjustment of the dark light enhancement intensity of the video image solves the problem of over-darkness or overexposure caused by the mismatch of the dark light enhancement intensity of the video image, and improves the matching degree of the video image and the dark light enhancement intensity during the video image processing.
  • the brightness and clarity of the video image can be enhanced to enhance the comfort of the user watching the video.
  • FIG. 2 is a flowchart of an image processing method provided in the second embodiment of the present application.
  • the embodiment of the present application refines the above-mentioned image processing method.
  • the image processing method provided in the embodiment of the present application includes step 210 Go to step 270.
  • Step 210 Select at least one image frame in the video image, wherein each image frame in the at least one image frame is used as a detection frame.
  • the image frame can be understood as a certain frame of the video image, and correspondingly, the detection frame can be at least one image frame in the video image.
  • the method for determining the detection frame can be selected according to actual needs. After the entire video image is acquired, it can be randomly selected from the video image or several image frames are selected as the detection frame according to a certain rule; it can also be At the same time as the video image, the first several image frames of the video image are selected as the detection frame. Selecting the detection frame from the entire video image can more comprehensively reflect the true state of the video image, and selecting the first several image frames of the video image as the detection frame can dynamically determine the video image while acquiring the video image.
  • the dark light enhances the intensity to ensure real-time image processing.
  • Step 220 Divide each detection frame into at least one pixel block, and determine the brightness value of the at least one pixel block respectively.
  • dividing pixel blocks can be understood as grouping all pixels in the detection frame according to their positions, and a pixel block is composed of all pixels in a certain area of the detection frame.
  • the brightness value can be understood as a parameter value indicating its brightness, for example, it can be the brightness component of a pixel.
  • each detection frame is divided into several pixel blocks, which can be divided in equal proportions, or can be divided according to other preset rules, and the brightness values of the divided pixel blocks are calculated according to the values of the pixels inside the divided pixel blocks.
  • the main purpose of this step is to divide each detection frame into several pixel blocks to calculate the brightness value.
  • the local average of the detection frame can highlight the brightness information of different areas of the image, thereby reducing the influence of mutual compensation of extreme brightness values in the average value, so that subsequent Analyze the status of the detection frame more accurately.
  • determining the brightness value of the at least one pixel block may include: determining the sum of Y components and the number of pixels of the pixel points included in each pixel block in the at least one pixel block; and combining the sum of the Y components and the number of pixels The ratio of is used as the brightness value of each pixel block.
  • the Y component in the image pixel can represent the brightness value of the pixel.
  • the number of pixels contained in the pixel block can be counted, and the Y component values of all pixels in the pixel block can be added to obtain the Y component of the pixel block
  • the sum of the Y component of the pixel block is divided by the number of pixels contained in the pixel block, that is, the average value of the Y component of the pixel in the pixel block is calculated, and this value can be used as the brightness of the pixel block value.
  • the brightness value of all pixel blocks can be calculated.
  • a detection frame is equally divided into 12 pixel blocks, according to the formula:
  • p i can represent the value of the Y component of the pixel point in the pixel block
  • M can represent the number of pixel points in the pixel block
  • l b can represent the brightness value of the pixel block.
  • Step 230 Determine at least one target pixel block in the at least one pixel block according to the brightness value of the at least one pixel block and the preset brightness.
  • the target pixel block can be understood as a pixel block in the pixel block that has an influence on the parameter setting of the subsequent light and dark enhancement processing process, for example, it may be a pixel block that is too dark or a pixel block that is too bright.
  • determining the target pixel block in the pixel block according to the brightness value of at least one pixel block and the preset brightness may include: using a pixel block with a brightness value less than or equal to the preset brightness as the target pixel block; or, setting the brightness The pixel block whose value is greater than or equal to the preset brightness is used as the target pixel block.
  • the brightness value of at least one pixel block determined in step 220 is respectively compared with the preset brightness. If the brightness value of the pixel block is less than or equal to the preset brightness, then the pixel block is a dark light block, which can be changed Determine as the target pixel block. In another case, the brightness value of at least one pixel block determined in step 220 is respectively compared with the preset brightness. If the brightness value of the pixel block is greater than or equal to the preset brightness, then the pixel block is a bright light block. Determine it as the target pixel block. In practical applications, the judgment conditions of the target pixel block can be set according to the needs.
  • the bright light block when the bright light block is selected as the target pixel block, it can be understood that the brightness of the video image is indirectly reflected by the number and distribution of the bright light block.
  • the video image can choose a lower dark enhancement intensity during the light and dark enhancement processing to prevent the video image from overexposing; when the number of bright blocks is small, the video image can be considered dark, so you can choose Higher dark light enhancement intensity performs image light and dark enhancement processing.
  • Step 240 If the ratio of the total number of target pixel blocks to the total number of pixel blocks in each detection frame is greater than or equal to a preset ratio, then each detection frame is taken as a target frame, and statistics of the target frame in at least one detection frame The quantity is used as the target total.
  • the target frame can be understood as a detection frame specially marked for determining subsequent image processing parameters.
  • the total number of targets can be understood as the number of target frames in the detection frame.
  • the number of detection frames is at least one.
  • the number of pixel blocks in the detection frame can be obtained and recorded as the total number of pixel blocks, the number of target pixel blocks in all pixel blocks of the detection frame is counted as the total number of target pixel blocks, and the target pixels are calculated The ratio of the total number of blocks to the total number of pixel blocks. If the ratio of the target pixel block in the detection frame is not lower than the preset ratio, the detection frame can be used as the target frame. In the same way, this method can be used to judge all detection frames, and count the number of target frames in all detection frames as the total number of targets.
  • Step 250 Determine the average brightness of at least one detection frame according to the brightness values of all target pixel blocks in all target frames, and use the average brightness and the total number of targets as light and dark distribution conditions.
  • the average brightness can be understood as a reference value for the brightness of all detected frames.
  • a luminance reference value may be calculated as the mean luminance value of at least one detection frame according to the luminance values of all target pixel blocks in all target frames, and the calculation method may be the sum of the luminance values of all target pixel blocks in all target frames.
  • the average value may also be the weighted sum of the brightness values of all target pixel blocks in all target frames.
  • the average brightness of the detection frame and the total number of targets determined in step 240 can be used as the light and dark distribution of the detection frame. Compared with using the global average brightness of the image as the judgment condition of image brightness, the brightness average of at least one detection frame is determined according to the brightness values of all target pixel blocks in all target frames.
  • This local average calculation method can highlight the brightness information of different areas of the image , Thereby reducing the influence of mutual compensation of extreme brightness values when averaging.
  • the ambient light brightness value is usually high and the target object brightness value is low.
  • the global brightness average value may not be low. If the global brightness average value is used as the image brightness average value, this value reflects the brightness of the image and the human eye The brightness of the focus of the image does not match.
  • determining the brightness mean value of at least one detection frame according to the brightness values of all target pixel blocks in all target frames may include: according to the fact that each target pixel block in all target pixel blocks in all target frames is in the corresponding target pixel block The position in the frame determines the weighting coefficient corresponding to each target pixel block; for each target pixel block, the product of the brightness value corresponding to each target pixel block and the weighting coefficient corresponding to each target pixel block is recorded as each target pixel block The weighted brightness value of the target frame; the ratio of the sum of the weighted brightness values of all target pixel blocks in all target frames to the sum of the weighted coefficients of all target pixel blocks in all target frames is used as the mean brightness value of at least one detection frame.
  • the possible degree of attention of the target pixel block can be determined according to the position of the target pixel block in the detection frame, and the degree of attention is determined according to the degree of attention.
  • the weighting coefficient of the target pixel block After determining the weighting coefficient of the target pixel block, the brightness value of the target pixel block and its corresponding weighting coefficient can be obtained, and the brightness value of the target pixel block and the weighting coefficient of the target pixel block are multiplied as the weighted brightness value of the target pixel block.
  • the ratio of the sum of all weighted brightness values of all target pixel blocks in all target frames to the sum of weighting coefficients of all target pixel blocks can be taken as at least one The average brightness of the detection frame.
  • the human eye usually pays attention to the middle area of the image and ignores the edge area.
  • the brightness of the middle area can more visually affect the judgment of the human eye on the image brightness. Therefore, when determining the weighting coefficient of the target pixel block, the middle of the detection frame can be determined.
  • the weighting coefficient of the target pixel block in the position is set higher, and the weighting coefficient of the target pixel block in the edge area is set lower.
  • the human eye usually pays attention to the middle area of the image and ignores the edges.
  • the brightness of the middle area can more visually affect people's judgment on the brightness of the image. Therefore, as shown in Figure 3, set the brightness of the pixel block in the middle area of the detection frame.
  • the weighting coefficient is higher than the weighting coefficient of the brightness of the pixel block in the edge area, so that the determined image processing parameters are more in line with actual requirements. According to the formula:
  • DB can represent the target pixel block
  • l bi can represent the brightness value of the i-th target pixel block
  • It can represent the weighting coefficient of the corresponding position of the i-th target pixel block
  • w db can represent the sum of the weighting coefficients of all target pixel blocks
  • l db can represent the average brightness of the detection frame
  • T can represent the number of target pixel blocks.
  • Step 260 Obtain the average brightness value and the total number of targets in the light and dark distribution, and select the dark light enhancement intensity from the preset intensity value set according to the average brightness and the total number of targets.
  • the dark light enhancement intensity can be understood as the intensity parameter when dark light enhancement is performed on the video image
  • the intensity value set can be understood as a numerical set of selectable dark light enhancement intensity, which can be a numerical interval or several discrete values. Numerical value.
  • the average brightness value and the total number of targets therefrom extract the average brightness value and the total number of targets therefrom, and select the matching dark light enhancement intensity from the preset intensity value set according to the corresponding relationship between the average brightness value and the total number of targets and the dark light enhancement intensity .
  • the corresponding relationship between the average brightness value and the total number of targets and the dark light enhancement intensity can be preset based on experience and actual conditions.
  • the expression of the corresponding relationship can be a linear function, a piecewise function or other reasonable functional forms, for example, dark light enhancement intensity It can be a linear function value with the average brightness value and the target total as variables.
  • selecting the dark light enhancement intensity from the preset intensity value set according to the brightness average and the total number of targets may include: if the total number of targets is less than the product of the total number of detection frames and the adjustment threshold ratio, then selecting the smallest in the preset intensity value set The intensity value is used as the dark light enhancement intensity; if the total number of targets is greater than or equal to the product of the total number of detection frames and the adjusted threshold ratio, the dark light enhancement intensity is selected from the preset intensity value set according to the corresponding relationship between the average brightness and the dark light enhancement intensity, where The corresponding relationship between the average brightness value and the dark light enhancement intensity may include a primary proportional relationship, a secondary proportional relationship, and a sine proportional relationship.
  • the ratio of the total number of detection frames to the preset adjustment threshold can be obtained, and the The two are multiplied, and the product is compared with the total number of targets. If the total number of targets is less than the product of the total number of detection frames and the adjusted threshold ratio, it can be considered that the proportion of the target frame is not high.
  • the dark light enhancement intensity can be selected according to the average brightness of the detection frame. For example, the dark light enhancement intensity can decrease at a uniform rate as the brightness average value increases, or the dark light enhancement intensity can be increased when the brightness average value is larger or smaller. The intensity is correspondingly smaller, and it can also correspond to a higher dark light enhancement intensity when the average brightness value is small, and as the average brightness value increases, the dark light enhancement intensity decreases rapidly.
  • the ratio of the total number of detection frames to the preset adjustment threshold can be obtained, and the two If the total number of targets is less than the product of the total number of detection frames and the adjusted threshold ratio, it can be considered that the proportion of the target frame is not high. At this time, the overall brightness of the video image is low. The average brightness of the detection frame selects the dark light enhancement intensity. If the total number of targets is greater than or equal to the product of the total number of detection frames and the adjusted threshold ratio, it means that the target frame reaches a certain proportion in the detection frame. At this time, the overall brightness of the video image is high, so it can Select the smallest intensity value in the preset intensity value set as the dark light enhancement intensity.
  • the correction increment can be understood as the amount of change when the dark light enhancement intensity is appropriately adjusted.
  • the correction increment can be determined according to these parameters, and then the dark light enhancement intensity can be intensity corrected.
  • the correction increment can be determined according to the number of bright light blocks and the brightness value to fine-tune the dark light enhancement intensity. When the number of bright light blocks and the brightness value are high, this operation can be weakened Increase the intensity, and will not cause the problem of overexposure of the video image.
  • the maximum value E max and the minimum value E min of the dark light enhancement intensity can be set, and the corresponding intensity value set is [E min , E max ], and the dark light enhancement intensity is determined according to the following correspondence relationship:
  • n df can represent the total number of targets
  • R dark can represent the adjustment threshold
  • n check_frames can represent the total number of detection frames
  • f(l db ) can represent the corresponding relationship between the average brightness and the intensity of dark light enhancement
  • R penalty can be the penalty coefficient
  • W db can represent the sum of the weighting coefficients of the target pixel block
  • w lb can represent the sum of the weighting coefficients of the non-target pixel block
  • It can represent the correction increment of the dark light enhancement intensity, thereby weakening the dark light enhancement intensity.
  • the corresponding relationship between the average brightness and the enhanced intensity of dark light f(l db ) can have various forms, as shown in Figure 4, it can be a primary proportional relationship, a quadratic proportional relationship, or a sine proportional relationship, as shown in Figure 4
  • the primary proportional relationship shown can indicate that as the average brightness value increases, the value of the dark light enhancement intensity decreases at a constant rate; the secondary proportional relationship shown in Figure 4 can indicate that when the average brightness value is higher or lower, the dark light
  • the value of the enhancement intensity is correspondingly small.
  • the value of the dark light enhancement intensity is relatively large; the sine proportional relationship shown in Figure 4 can indicate that when the average brightness value is low, the corresponding high dark light Increase the intensity, and as the average brightness value increases, the dark light enhancement intensity decreases rapidly.
  • the dark light enhancement intensity is close to the minimum value of the dark light enhancement intensity. It can also be other reasonable correspondences, so I won’t show them too much here.
  • Step 270 Perform light and dark adjustment on the video image according to the dark light enhancement intensity.
  • an applicable dark light enhancement method can be used, and the relevant parameter values in the dark light enhancement method are adjusted according to the dark light enhancement intensity determined in the above steps, and then the video image is processed to improve the definition of the video image, because the dark light
  • the enhancement intensity matches the video image. While the processed video image has a dark light enhancement effect, there will be no improper processing or over-processing, which will cause the video image to be too dark or overexposed.
  • the technical solution of the embodiment of the present application analyzes the detection frame and uses the brightness value of the target pixel block in the detection frame to determine the average brightness of the detection frame, which can highlight the brightness information of the target area of the image and reduce the extreme brightness value in the non-target area.
  • the impact on determining the average brightness at the same time, by using the average brightness of the detection frame and the target total number of the target frame as the light and dark distribution, the matching degree of adjusting the dark light enhancement intensity of the video image is improved, and the brightness and definition of the video image are improved.
  • the obtained video image will not be too dark or overexposed, which is more suitable for human eyes to watch.
  • FIG. 5 is a schematic structural diagram of an image processing device provided in Embodiment 3 of the present application.
  • the image processing device provided in the embodiment of the present application can execute the image processing method provided in any embodiment of the present application, and is equipped with functional modules corresponding to the execution method.
  • the apparatus may be implemented by at least one of software and hardware.
  • the image processing apparatus includes: a distribution state module 310, an intensity determination module 320, and an image adjustment module 330.
  • the distribution status module 310 is configured to determine the light and dark distribution status corresponding to the detection frame of the video image.
  • the intensity determining module 320 is configured to determine the enhanced dark light intensity of the video image according to the light and dark distribution condition.
  • the image adjustment module 330 is configured to adjust the light and darkness of the video image according to the dark light enhancement intensity.
  • the embodiment of the application detects the light and dark distribution of the video image, dynamically adjusts the dark light enhancement intensity when the video image is adjusted for light and dark, and solves the problem of poor display effect of using the same dark light enhancement intensity for different video images. Match the appropriate dark light enhancement intensity according to the actual light and dark distribution of the video image, effectively enhancing the clarity of the video image.
  • FIG. 6 is a schematic structural diagram of a device provided by Embodiment 4 of the present application.
  • the device includes a processor 40, a memory 41, an input device 42, and an output device 43; the number of processors 40 in the device may be At least one, one processor 40 is taken as an example in FIG. 6; the processor 40, the memory 41, the input device 42, and the output device 43 in the device may be connected by a bus or other means. In FIG. 6, the connection by a bus is taken as an example.
  • the memory 41 can be configured to store software programs, computer-executable programs, and modules, such as the program modules corresponding to the image processing method in the embodiment of the present application (for example, the distribution state module 310, the intensity determination module 320 and image adjustment module 330).
  • the processor 40 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 41, that is, realizes the above-mentioned image processing method.
  • the memory 41 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the terminal, and the like.
  • the memory 41 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 41 may include a memory remotely provided with respect to the processor 40, and these remote memories may be connected to the device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 42 may be configured to receive input numeric or character information, and to generate key signal input related to user settings and function control of the device.
  • the output device 43 may include a display device such as a display screen.
  • Embodiment 5 of the present application also provides a storage medium containing computer-executable instructions, which are used to execute an image processing method when executed by a computer processor, the method including:
  • a storage medium containing computer-executable instructions provided by the embodiments of the present application and the computer-executable instructions are not limited to the method operations described above, and can also execute the image processing methods provided in any embodiment of the present application. Related operations.
  • this application can be implemented by software and necessary general-purpose hardware, and of course, it can also be implemented by hardware.
  • the technical solution of this application essentially or the part that contributes to the related technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, Read-Only Memory (ROM), Random Access Memory (RAM), Flash memory (FLASH), hard disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, A server, or a network device, etc.) execute the method described in each embodiment of the present application.
  • a computer device which can be a personal computer, A server, or a network device, etc.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

一种图像处理方法、装置、设备和存储介质,其中,该方法包括:确定视频图像的检测帧对应的光暗分布状况(110);根据所述光暗分布状况确定所述视频图像的暗光增强强度(120);根据所述暗光增强强度对所述视频图像进行光暗调整(130)。

Description

一种图像处理方法、装置、设备和存储介质
本申请要求在2020年3月12日提交中国专利局、申请号为202010170504.3的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及图像处理技术领域,例如涉及一种图像处理方法、装置、设备和存储介质。
背景技术
随着互联网技术的发展,视频在线业务成为业界研究的重点,但是受视频录制环境的影响,视频图像在录制时由于光线条件的制约导致录制视频的清晰度较低,为了提高视频录制的效果,常采用暗光增强技术对图像进行处理,提高视频图像的清晰度。
在实现本申请过程中,发明人发现相关技术中至少存在如下问题:暗光增强技术在实际应用中常设置固定的暗光增强强度,由于不同的视频图像中的光照条件不同,固定设置的暗光增强强度与输入的视频图像不匹配,导致视频图像增强的效果不理想,例如,在光照条件较好的视频图像中使用的暗光增强强度较高,导致视频图像过曝,反而降低了视频图像的清晰度。
发明内容
本申请提供一种图像处理方法、装置、设备和存储介质,通过根据每个视频图像的光暗情况动态调整每个视频图像的暗光增强强度,提高了视频图像处理过程中暗光增强的匹配度,提高了视频图像的亮度,可增强视频图像的清晰度。
第一方面,本申请实施例提供了一种图像处理方法,该方法包括:
确定视频图像的检测帧对应的光暗分布状况;
根据所述光暗分布状况确定所述视频图像的暗光增强强度;
根据所述暗光增强强度对所述视频图像进行光暗调整。
第二方面,本申请实施例还提供了一种图像处理装置,该装置包括:
分布状态模块,设置为确定视频图像的检测帧对应的光暗分布状况;
强度确定模块,设置为根据所述光暗分布状况确定所述视频图像的暗光增强强度;
图像调整模块,设置为根据所述暗光增强强度对所述视频图像进行光暗调整。
第三方面,本申请实施例还提供了一种设备,该设备包括:
至少一个处理器;
存储器,设置为存储至少一个程序,
当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如本申请实施例中任一所述的图像处理方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如本申请实施例中任一所述的图像处理方法。
本申请通过对视频图像光暗分布状况的检测,以视频图像实际的光暗分布状况匹配适合的暗光增强强度后,对视频图像进行光暗调整,解决了视频图像处理后过暗或过曝、显示效果不佳的问题,实现了视频图像处理时动态调整暗光增强强度,有效增强视频图像清晰度的效果。
附图说明
图1是本申请实施例一提供的一种图像处理方法的流程图;
图2是本申请实施例二提供的一种图像处理方法的流程图;
图3是本申请实施例二提供的一种像素块划分方法示意图;
图4是本申请实施例二提供的亮度均值与暗光增强强度对应关系的示意图;
图5是本申请实施例三提供的一种图像处理装置的结构示意图;
图6是本申请实施例四提供的一种设备的结构示意图。
具体实施方式
实施例一
图1为本申请实施例一提供的一种图像处理方法的流程图,本实施例可适用于提高视频图像清晰度的情况,该方法可以由图像处理装置来执行,该装置可以采用硬件和软件中的至少一种方式来实现,通常可以集成在智能终端中,该方法包括步骤110至步骤130。
步骤110、确定视频图像的检测帧对应的光暗分布状况。
其中,当图像连续变化每秒超过24帧以上时,根据视觉暂留原理,人眼无法辨别单幅图像的静态画面,而是看到平滑连续的动态画面,这样连续的画面叫做视频。在本申请实施例中,检测帧可以理解为视频图像中的某一帧图像或某几帧图像,可以间接反映整个视频图像的状态。光暗分布状况可以理解为检测帧图像的亮度状况及其明暗程度分布。
示例性的,可以在获取到视频图像后,从该视频图像中随机抽取若干帧图像作为检测帧,也可以在获取视频图像的同时,选取该视频图像的前若干帧图像作为检测帧。在确定好检测帧后,对检测帧的光暗分布状况进行计算统计。检测帧的图像格式可以是YUV格式,检测帧的光暗分布状况可以包括检测帧多个像素值的亮度情况以及整体亮度较高的检测帧的数量等。本申请实施例对视频图像的检测帧进行光暗分布状况的分析,可以减少数据处理的数量,提高处理速度,实现图像处理的实时性。
步骤120、根据光暗分布状况确定视频图像的暗光增强强度。
其中,暗光增强强度可以理解为对视频图像进行暗光增强时的强度参数, 暗光增强强度越高,则对视频图像处理时需要提高的亮度越大。
示例性的的,可以将步骤110中确定的检测帧对应的光暗分布状况看做视频图像整体的光暗分布状况,可以通过光暗分布状况与暗光增强强度的对应关系,确定出视频图像的暗光增强强度。光暗分布状况与暗光增强强度的对应关系可以预先设定,例如,可以是根据实际经验设置的线性关系或非线性关系,可以通过线性关系或者非线性关系确定出光暗分布状况对应的暗光增强强度,例如,不同的光暗分布状况对应不同的暗光增强强度的数值,可以通过光暗分布状况确定出对应的暗光增强强度。
步骤130、根据暗光增强强度对视频图像进行光暗调整。
其中,光暗调整可以理解为对视频图像进行暗光增强处理,以提高视频图像清晰度。
示例性的,根据步骤120确定的暗光增强强度对视频图像进行光暗调整,可以使用任何图像暗光增强方法进行处理,提高视频图像的亮度和清晰度,起到暗光增强的效果,由于暗光增强强度由视频图像确定,可以确保视频图像不会发生过暗或过曝问题。
本申请实施例,通过确定视频图像的检测帧对应的光暗分布状况,得到视频图像的暗光增强强度,根据暗光增强强度对视频图像进行光暗调整,本申请实施例的技术方案,通过动态调整视频图像的暗光增强强度,解决了由于视频图像的暗光增强强度不匹配导致的过暗或过曝问题,提高了视频图像处理过程中视频图像与暗光增强强度的匹配程度,提高了视频图像的亮度和清晰度,可增强用户观看视频的舒适度。
实施例二
图2是本申请实施例二提供的一种图像处理方法的流程图,参见图2,本申 请实施例对上述图像处理方法进行了细化,本申请实施例的提供的图像处理方法包括步骤210至步骤270。
步骤210、在视频图像内选取至少一个图像帧,其中,将所述至少一个图像帧中的每个图像帧作为一个检测帧。
其中,图像帧可以理解为视频图像的某一帧图像,相应的,检测帧可以是视频图像中至少一个图像帧。
示例性的,可以根据实际需求选择确定检测帧的方法,可以是在获取到整个视频图像后,从该视频图像中随机抽取或按一定规则抽取若干个图像帧作为检测帧;也可以是在获取视频图像的同时,选取该视频图像的前若干个图像帧作为检测帧。从整个视频图像中选取检测帧可以更加全面的反映出视频图像的真实状态,而选取视频图像的前若干个图像帧作为检测帧则可以在获取视频图像的同时就动态的确定出该视频图像的暗光增强强度,从而保证图像处理的实时性。
步骤220、将每个检测帧划分为至少一个像素块,并分别确定至少一个像素块的亮度值。
其中,划分像素块可以理解为将检测帧内的所有像素点依据所在位置进行分组,一个像素块由检测帧某区域内的所有像素点组成。亮度值可以理解为表示其明亮程度的参数数值,例如可以是像素点的亮度分量。
示例性的,将每个检测帧分成若干个像素块,可以等比例划分,也可以按其他预设规则进行划分,根据划分好的像素块内部像素点的数值计算其的亮度值。该步骤的主要目的在于,将每个检测帧分成若干个像素块计算亮度值,检测帧局部均值能够突出图像不同区域的亮度信息,从而降低极端亮度值在求均值时相互补偿的影响,使后续分析检测帧的状态更加精准。
可选的,确定至少一个像素块的亮度值可以包括:确定至少一个像素块中 的每个像素块内包括的像素点的Y分量之和以及像素点数量;将Y分量之和与像素点数量的比值作为所述每个像素块的亮度值。
其中,检测帧的图像格式是YUV格式时,图像像素点中的Y分量可以表示该像素点的亮度值。
示例性的,确定某一个像素块的亮度值时,可以统计该像素块内包含的像素点的数量,并将该像素块内所有像素点的Y分量的数值相加,得到该像素块Y分量之和,再将该像素块的Y分量之和除以该像素块内包含的像素点的数量,即计算出该像素块内像素点的Y分量均值,可以以此值作为该像素块的亮度值。同理,可以计算出所有像素块的亮度值。
示例性的,如图3,将一个检测帧等比例划分成12个像素块,根据公式:
Figure PCTCN2021080203-appb-000001
计算出每个像素块的亮度值。其中,p i可以表示像素块内像素点Y分量的值,M可以表示像素块内像素点的数量,l b可以表示像素块的亮度值。
步骤230、根据至少一个像素块的亮度值和预设亮度在至少一个像素块中确定至少一个目标像素块。
其中,目标像素块可以理解为像素块中对后续光暗增强处理过程的参数设定有影响的像素块,例如,可以是过暗的像素块或者是过亮的像素块。
可选的,根据至少一个像素块的亮度值和预设亮度在像素块中确定出目标像素块,可以包括:将亮度值小于或等于预设亮度的像素块作为目标像素块;或,将亮度值大于或等于预设亮度的像素块作为目标像素块。
示例性的,将步骤220中确定的至少一个像素块的亮度值分别与预设亮度相比,若像素块的亮度值小于或等于预设亮度,则该像素块为暗光块,可以将 其确定为目标像素块。另一种情况下,将步骤220中确定的至少一个各像素块的亮度值分别与预设亮度相比,若像素块的亮度值大于或等于预设亮度,则该像素块为亮光块,可以将其确定为目标像素块。在实际应用中,可以根据需要设定目标像素块的判定条件,例如,在选择亮光块为目标像素块时,可以理解为通过亮光块的数量和分布情况间接反映视频图像的亮度情况,当亮光块数量较多时,视频图像在进行光暗增强处理时可以选择较低的暗光增强强度以防止视频图像出现过曝问题;当亮光块数量较少时,可以认为视频图像较暗,因此可以选择较高的暗光增强强度进行图像光暗增强处理。
步骤240、若所述每个检测帧内目标像素块总数与像素块总数之比大于或等于预设比例,则将所述每个检测帧作为目标帧,并统计至少一个检测帧中目标帧的数量作为目标总数。
其中,目标帧可以理解为用于确定后续图像处理参数而特殊标记的检测帧。目标总数可以理解为检测帧中目标帧的数量。检测帧的数量为至少一个。
示例性的,对于某一检测帧,可以获取到该检测帧中像素块的数量记为像素块总数,统计该检测帧所有像素块中目标像素块的数量记为目标像素块总数,计算目标像素块的总数占像素块总数的比值,若该检测帧中目标像素块的比例不低于预设比例时,则可以将该检测帧作为目标帧。同理,可以用该方法对所有检测帧进行判断,统计所有检测帧中目标帧的数量作为目标总数。
步骤250、根据所有目标帧中的所有目标像素块的亮度值确定至少一个检测帧的亮度均值,并将亮度均值和目标总数作为光暗分布状况。
其中,亮度均值可以理解为所有检测帧亮度情况的参考值。
示例性的,可以依据所有目标帧中所有目标像素块的亮度值计算出一个亮度参考值作为至少一个检测帧的亮度均值,其计算方法可以为所有目标帧中的所有目标像素块的亮度值的平均值,也可以是所有目标帧中的所有目标像素块的亮度值的加权之和。可以将检测帧的亮度均值和步骤240中确定的目标总数 作为检测帧的光暗分布状况。相比使用图像的全局亮度均值作为图像亮度的判断条件,根据所有目标帧中所有目标像素块的亮度值确定至少一个检测帧的亮度均值这种局部均值的计算方法能够突出图像不同区域的亮度信息,从而降低极端亮度值在求均值时相互补偿的影响。例如,在背光图像中,环境光亮度值通常较高而目标物体亮度值较低,全局亮度均值可能并不低,若使用全局亮度均值作为图像亮度均值,该值反映出的图像亮度与人眼对图像关注点的亮度并不相符。
可选的,根据所有目标帧中的所有目标像素块的亮度值确定至少一个检测帧的亮度均值,可以包括:根据所有目标帧中的所有目标像素块中的每个目标像素块在对应的目标帧中的位置确定每个目标像素块对应的加权系数;针对每个目标像素块将每个目标像素块对应的亮度值与每个目标像素块对应的加权系数之积记为每个目标像素块的加权亮度值;将所有目标帧中的所有目标像素块的加权亮度值的和与所有目标帧中的所有目标像素块加权系数的和的比值作为至少一个检测帧的亮度均值。
示例性的,人眼观看视频图像时,对图像不同位置的关注程度有所不同,因此,可以根据目标像素块在检测帧的位置判断该目标像素块可能的受关注程度,根据关注程度确定该目标像素块的加权系数。确定目标像素块的加权系数后,可以获取目标像素块的亮度值与其对应的加权系数,将目标像素块的亮度值与该目标像素块的加权系数相乘记为该目标像素块的加权亮度值,在计算出所有目标帧中所有目标像素块的加权亮度值后,可以将所有目标帧中的所有目标像素块的所有加权亮度值之和与所有目标像素块加权系数的和的比值作为至少一个检测帧的亮度均值。
一般情况下,人眼通常关注图像中间区域而忽略边缘区域,中间区域的亮度更能在视觉上影响人眼对图像亮度的判断,因此在确定目标像素块的加权系数时,可以将检测帧中间位置的目标像素块的加权系数设置高一些,而边缘区 域的目标像素块的加权系数设置低一些。
示例性的,人眼通常关注图像中间区域而忽略边缘,中间区域的亮度更能在视觉上影响人对图像亮度的判断,因此,如图3所示,设置检测帧中中间区域像素块亮度的加权系数高于边缘区域像素块亮度的加权系数,这样确定的图像处理参数更符合实际需求。根据公式:
Figure PCTCN2021080203-appb-000002
确定检测帧的亮度均值l db。其中,DB可以代表目标像素块,l bi可以表示第i个目标像素块的亮度值,
Figure PCTCN2021080203-appb-000003
可以表示第i个目标像素块对应位置的加权系数,w db可以表示所有目标像素块加权系数的和,l db可以表示检测帧的亮度均值,T可以表示目标像素块的个数。
步骤260、获取光暗分布状况中的亮度均值和目标总数,根据亮度均值和目标总数在预设强度值集合中选择暗光增强强度。
其中,暗光增强强度可以理解为对视频图像进行暗光增强时的强度参数,强度值集合可以理解为可选择的暗光增强强度的数值集合,可以是一个数值区间,也可以是几个离散数值。
示例性的,在获取到光暗分布状况后,从中提取亮度均值和目标总数,根据亮度均值和目标总数与暗光增强强度的对应关系,在预设强度值集合中选择匹配的暗光增强强度。亮度均值和目标总数与暗光增强强度的对应关系可以根据经验和实际情况预先设定,其对应关系的表达形式可以为线性函数、分段函数或其他合理的函数形式,例如,暗光增强强度可以是以亮度均值和目标总数为变量的线性函数值。
可选的,根据亮度均值和目标总数在预设强度值集合中选择暗光增强强度, 可以包括:若目标总数小于检测帧的总数与调整阈值比例之积,则选择预设强度值集合中最小强度值作为暗光增强强度;若目标总数大于或等于检测帧的总数与调整阈值比例之积,根据亮度均值与暗光增强强度的对应关系在预设强度值集合中选择暗光增强强度,其中,亮度均值与暗光增强强度的对应关系可以包括一次比例关系、二次比例关系和正弦比例关系。
示例性的,在选择暗光块为目标像素块(即将亮度值小于或等于所述预设亮度的像素块作为目标像素块)时,可以获取检测帧的总数与预设的调整阈值比例,将二者相乘,乘积与目标总数进行比较,若目标总数小于检测帧的总数与调整阈值比例之积,可以认为目标帧所占的比例不高,此时视频图像整体亮度偏高,因此可以选择预设强度值集合中最小强度值作为暗光增强强度;若目标总数大于或等于检测帧的总数与调整阈值比例之积,说明目标帧在检测帧中达到一定比例,此时视频图像整体亮度偏低,此时可以根据检测帧的亮度均值选取暗光增强强度,例如,可以是随着亮度均值的增大,暗光增强强度匀速下降,也可以是亮度均值较大或较小时,暗光增强强度也相应较小,还可以是亮度均值较小时对应较高的暗光增强强度,而随着亮度均值的增大,暗光增强强度迅速下降。
示例性的,在选择亮光块为目标像素块(即将亮度值大于或等于所述预设亮度的像素块作为目标像素块)时,可以获取检测帧的总数与预设的调整阈值比例,将二者相乘,乘积与目标总数进行比较,若目标总数小于检测帧的总数与调整阈值比例之积,可以认为目标帧所占的比例不高,此时视频图像整体亮度偏低,此时可以根据检测帧的亮度均值选取暗光增强强度,若目标总数大于或等于检测帧的总数与调整阈值比例之积,说明目标帧在检测帧中达到一定比例,此时视频图像整体亮度偏高,因此可以选择预设强度值集合中最小强度值作为暗光增强强度。
可选的,确定暗光增强强度的修正增量,并根据修正增量修正暗光增强强 度。
其中,修正增量可以理解为对暗光增强强度进行适当调整时的变化量。
示例性的,除了上述确定暗光增强强度所用到的参数外,还有一些对暗光增强强度有影响的参数,因此可以根据这些参数确定修正增量,进而对暗光增强强度进行强度修正,例如,在目标像素块确定为暗光块时,可以根据亮光块的数量和亮度值确定修正增量对暗光增强强度进行微调,在亮光块的数量和亮度值较高时,该操作可以削弱增强强度,不会造成视频图像过曝的问题。
示例性的,可以设定暗光增强强度最大值E max,最小值E min,对应的强度值集合为[E min,E max],根据以下对应关系确定暗光增强强度:
Figure PCTCN2021080203-appb-000004
其中,n df可以表示目标总数,R dark可以表示调整阈值,n check_frames可以表示检测帧的总数,f(l db)可以表示亮度均值与暗光增强强度的对应关系,R penalty可以为惩罚项系数,w db可以表示目标像素块加权系数的和,w lb可以表示非目标像素块加权系数的和,
Figure PCTCN2021080203-appb-000005
可以表示暗光增强强度的修正增量,以此削弱暗光增强强度。
亮度均值与暗光增强强度的对应关系f(l db)可以有多种表现形式,如图4所示,可以是一次比例关系,可以是二次比例关系,也可以是正弦比例关系,图4所示的一次比例关系,可以表示随着亮度均值的增大,暗光增强强度的取值匀速下降;图4所示的二次比例关系,可以表示亮度均值较高或较低时,暗光增强强度的取值相应较小,在亮度均值适中时,暗光增强强度的取值相对较大;图4所示的正弦比例关系,可以表示在亮度均值较低时,对应较高的暗光 增强强度,而随着亮度均值的增大,暗光增强强度迅速下降,在亮度均值较高时,暗光增强强度接近暗光增强强度最小值。还可以是其他合理的对应关系,在此不进行过多展示。
步骤270、根据暗光增强强度对视频图像进行光暗调整。
示例性的,可以采用适用的暗光增强方法,根据上述步骤确定的暗光增强强度调整暗光增强方法中相关的参数值,进而对视频图像进行处理,提高视频图像的清晰度,因为暗光增强强度与视频图像相匹配,处理后的视频图像有暗光增强效果的同时,也不会出现处理不到位或处理过度,使视频图像发生过暗或过曝的现象。
本申请实施例的技术方案,通过对检测帧进行分析,采用检测帧中目标像素块的亮度值确定检测帧的亮度均值,能够突出图像目标区域的亮度信息,可以降低非目标区域中极端亮度值对确定亮度均值的影响;同时,通过将检测帧的亮度均值和目标帧的目标总数作为光暗分布状况,提高调整视频图像的暗光增强强度的匹配度,在提高视频图像亮度和清晰度的同时,得到的视频图像不会过暗或过曝,更加适宜人眼观看。
实施例三
图5是本申请实施例三提供的一种图像处理装置的结构示意图。本申请实施例所提供的图像处理装置可执行本申请任意实施例所提供的图像处理方法,具备执行方法相应的功能模块。该装置可以由软件和硬件中的至少一种方式来实现,该图像处理装置包括:分布状态模块310、强度确定模块320和图像调整模块330。
分布状态模块310,设置为确定视频图像的检测帧对应的光暗分布状况。
强度确定模块320,设置为根据所述光暗分布状况确定所述视频图像的暗光 增强强度。
图像调整模块330,设置为根据所述暗光增强强度对所述视频图像进行光暗调整。
本申请实施例通过对视频图像光暗分布状况的检测,在视频图像进行光暗调整时动态调整暗光增强强度,解决对不同视频图像使用同一暗光增强强度处理显示效果不佳的问题,实现根据视频图像实际的光暗分布状况匹配适合的暗光增强强度,有效增强视频图像清晰度的效果。
实施例四
图6是本申请实施例四提供的一种设备的结构示意图,如图6所示,该设备包括处理器40、存储器41、输入装置42和输出装置43;设备中处理器40的数量可以是至少一个,图6中以一个处理器40为例;设备中的处理器40、存储器41、输入装置42和输出装置43可以通过总线或其他方式连接,图6中以通过总线连接为例。
存储器41作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例中的图像处理方法对应的程序模块(例如,分布状态模块310、强度确定模块320和图像调整模块330)。处理器40通过运行存储在存储器41中的软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述的图像处理方法。
存储器41可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器41可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器41可包括相对于处理器40远程设置的存储器,这些远程存储器可以通过网络连接至设备。上述网络的实例包括但不限 于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置42可设置为接收输入的数字或字符信息,以及产生与设备的用户设置以及功能控制有关的键信号输入。输出装置43可包括显示屏等显示设备。
实施例五
本申请实施例五还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种图像处理方法,该方法包括:
确定视频图像的检测帧对应的光暗分布状况;
根据所述光暗分布状况确定所述视频图像的暗光增强强度;
根据所述暗光增强强度对所述视频图像进行光暗调整。
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本申请任意实施例所提供的图像处理方法中的相关操作。
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
值得注意的是,上述图像处理装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应 的功能即可;另外,各功能单元的名称也只是为了便于相互区分,并不用于限制本申请的保护范围。

Claims (12)

  1. 一种图像处理方法,包括:
    确定视频图像的检测帧对应的光暗分布状况;
    根据所述光暗分布状况确定所述视频图像的暗光增强强度;
    根据所述暗光增强强度对所述视频图像进行光暗调整。
  2. 根据权利要求1所述的方法,还包括:
    在所述视频图像内选取至少一个图像帧,其中,将所述至少一个图像帧中的每个图像帧作为一个检测帧。
  3. 根据权利要求1所述的方法,其中,所述检测帧的数量为至少一个,所述确定视频图像的检测帧对应的光暗分布状况包括:
    将每个检测帧划分为至少一个像素块,并分别确定所述至少一个像素块的亮度值;
    根据所述至少一个像素块的亮度值和预设亮度在所述至少一个像素块中确定至少一个目标像素块;
    响应于所述每个检测帧内所述目标像素块总数与所述像素块总数之比大于或等于预设比例,将所述每个检测帧作为目标帧,并统计至少一个检测帧中目标帧的数量作为目标总数;
    根据所有目标帧中所有目标像素块的亮度值确定所述至少一个检测帧的亮度均值,并将所述亮度均值和所述目标总数作为光暗分布状况。
  4. 根据权利要求3所述的方法,其中,所述确定所述至少一个像素块的亮度值,包括:
    确定所述至少一个像素块中的每个像素块内包括的像素点的Y分量之和以及像素点数量;
    将所述Y分量之和与像素点数量的比值作为所述每个像素块的亮度值。
  5. 根据权利要求3所述的方法,其中,所述根据所述至少一个像素块的亮度值和预设亮度在所述像素块中确定出至少一个目标像素块,包括:
    将亮度值小于或等于所述预设亮度的像素块作为目标像素块;或,
    将亮度值大于或等于所述预设亮度的像素块作为目标像素块。
  6. 根据权利要求3所述的方法,其中,所述根据所有目标帧中所有目标像素块的亮度值确定所述至少一个检测帧的亮度均值,包括:
    根据所述目标帧中所有目标像素块中的每个目标像素块在对应的所述目标帧中的位置,确定所述每个目标像素块对应的加权系数;
    针对每个目标像素块将所述每个目标像素块对应的亮度值与所述每个目标像素块对应的加权系数之积,记为所述每个目标像素块的加权亮度值;
    将所有目标帧中所有目标像素块的所述加权亮度值的和与所有目标帧中所有目标像素块对应的所述加权系数的和的比值,作为所述至少一个检测帧的亮度均值。
  7. 根据权利要求5所述的方法,其中,所述根据所述光暗分布状况确定所述视频图像的暗光增强强度,包括:
    获取所述光暗分布状况中的亮度均值和目标总数;
    根据所述亮度均值和所述目标总数在预设强度值集合中选择暗光增强强度。
  8. 根据权利要求7所述的方法,其中,在将亮度值小于或等于所述预设亮度的像素块作为目标像素块的情况下,所述根据所述亮度均值和所述目标总数在预设强度值集合中选择暗光增强强度,包括:
    响应于所述目标总数小于所述检测帧的总数与调整阈值比例之积,选择所述预设强度值集合中最小强度值作为暗光增强强度;
    响应于所述目标总数大于或等于所述检测帧的总数与调整阈值比例之积,根据所述亮度均值与所述暗光增强强度的对应关系在所述预设强度值集合中选择暗光增强强度,其中,所述亮度均值与所述暗光增强强度的对应关系至少包括一次比例关系、二次比例关系和正弦比例关系。
  9. 根据权利要求8所述的方法,还包括:
    确定所述暗光增强强度的修正增量,并根据所述修正增量修正所述暗光增强强度。
  10. 一种图像处理装置,包括:
    分布状态模块,设置为确定视频图像的检测帧对应的光暗分布状况;
    强度确定模块,设置为根据所述光暗分布状况确定所述视频图像的暗光增强强度;
    图像调整模块,设置为根据所述暗光增强强度对所述视频图像进行光暗调整。
  11. 一种设备,包括:
    至少一个处理器;
    存储器,设置为存储至少一个程序,当所述至少一个程序被处理器执行,使得所述至少一个处理器实现如权利要求1-9中任一所述的图像处理方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-9中任一所述的图像处理方法。
PCT/CN2021/080203 2020-03-12 2021-03-11 一种图像处理方法、装置、设备和存储介质 WO2021180173A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010170504.3 2020-03-12
CN202010170504.3A CN111369471B (zh) 2020-03-12 2020-03-12 一种图像处理方法、装置、设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021180173A1 true WO2021180173A1 (zh) 2021-09-16

Family

ID=71210387

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080203 WO2021180173A1 (zh) 2020-03-12 2021-03-11 一种图像处理方法、装置、设备和存储介质

Country Status (2)

Country Link
CN (1) CN111369471B (zh)
WO (1) WO2021180173A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111369471B (zh) * 2020-03-12 2023-09-08 广州市百果园信息技术有限公司 一种图像处理方法、装置、设备和存储介质
CN112601068B (zh) * 2020-12-15 2023-01-24 山东浪潮科学研究院有限公司 视频数据增广方法、装置及计算机可读介质
CN112863010B (zh) * 2020-12-29 2022-08-05 宁波友好智能安防科技有限公司 一种防盗锁的视频图像处理系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340512A (zh) * 2008-08-12 2009-01-07 中兴通讯股份有限公司 一种视频图像处理方法
CN102223546A (zh) * 2011-06-07 2011-10-19 中兴通讯股份有限公司 视频图像的亮度调整方法和装置
CN109543581A (zh) * 2018-11-15 2019-03-29 北京旷视科技有限公司 图像处理方法、图像处理装置以及非易失性存储介质
US20190362475A1 (en) * 2018-05-28 2019-11-28 Multitek Inc. Method and Computer System of Image Enhancement
CN111369471A (zh) * 2020-03-12 2020-07-03 广州市百果园信息技术有限公司 一种图像处理方法、装置、设备和存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090024666A1 (en) * 2006-02-10 2009-01-22 Koninklijke Philips Electronics N.V. Method and apparatus for generating metadata
CN109936698B (zh) * 2017-12-18 2021-07-02 杭州海康威视数字技术股份有限公司 一种自动曝光控制方法、装置、电子设备及存储介质
CN109166533A (zh) * 2018-09-29 2019-01-08 重庆石墨烯研究院有限公司 一种根据图像亮度值调整显示背光的方法
CN110225403A (zh) * 2019-07-12 2019-09-10 四川长虹电器股份有限公司 视频图像亮暗场景识别控制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340512A (zh) * 2008-08-12 2009-01-07 中兴通讯股份有限公司 一种视频图像处理方法
CN102223546A (zh) * 2011-06-07 2011-10-19 中兴通讯股份有限公司 视频图像的亮度调整方法和装置
US20190362475A1 (en) * 2018-05-28 2019-11-28 Multitek Inc. Method and Computer System of Image Enhancement
CN109543581A (zh) * 2018-11-15 2019-03-29 北京旷视科技有限公司 图像处理方法、图像处理装置以及非易失性存储介质
CN111369471A (zh) * 2020-03-12 2020-07-03 广州市百果园信息技术有限公司 一种图像处理方法、装置、设备和存储介质

Also Published As

Publication number Publication date
CN111369471A (zh) 2020-07-03
CN111369471B (zh) 2023-09-08

Similar Documents

Publication Publication Date Title
WO2021180173A1 (zh) 一种图像处理方法、装置、设备和存储介质
US8644638B2 (en) Automatic localized adjustment of image shadows and highlights
WO2020038124A1 (zh) 图像对比度增强方法、装置、设备及存储介质
US20170083767A1 (en) Scene recognition method and apparatus
CN112752023B (zh) 一种图像调整方法、装置、电子设备及存储介质
CN108198155B (zh) 一种自适用色调映射方法及系统
WO2021218603A1 (zh) 图像处理方法及投影系统
CN110766639A (zh) 图像增强方法、装置、移动设备及计算机可读存储介质
US20130039577A1 (en) Method for improving image quality
WO2020135234A1 (zh) 一种图像处理方法及装置
US20150341537A1 (en) Local enhancement apparatus and method
WO2023098251A1 (zh) 图像处理方法、设备及可读存储介质
TW202022799A (zh) 測光補償方法及其相關監控攝影設備
CN110751608A (zh) 一种夜景高动态范围图像融合方法、装置和电子设备
TWI567707B (zh) 影像調整方法及其顯示器
CN111314622A (zh) 一种多种场景下图像亮度自适应调节方法、装置及系统
JP4851505B2 (ja) 画像処理装置及び画像処理方法
CN110175967B (zh) 图像去雾处理方法、系统、计算机设备和存储介质
US9571744B2 (en) Video processing method and apparatus
CN112653845B (zh) 曝光控制方法、装置、电子设备及可读存储介质
JP2009124264A (ja) 画像処理装置および画像処理方法
CN112561906A (zh) 一种图像处理方法、装置、设备及介质
JP2013114692A (ja) 自動映像補正のための映像処理装置及び方法
JP2010050568A (ja) 画像処理装置、画像処理方法、プログラムおよび記録媒体
JP6879636B1 (ja) 画像処理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21767394

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21767394

Country of ref document: EP

Kind code of ref document: A1