CN109978777B - Image brightness adjusting method and device - Google Patents

Image brightness adjusting method and device Download PDF

Info

Publication number
CN109978777B
CN109978777B CN201910103245.XA CN201910103245A CN109978777B CN 109978777 B CN109978777 B CN 109978777B CN 201910103245 A CN201910103245 A CN 201910103245A CN 109978777 B CN109978777 B CN 109978777B
Authority
CN
China
Prior art keywords
image
sub
original
brightness
pixel
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.)
Active
Application number
CN201910103245.XA
Other languages
Chinese (zh)
Other versions
CN109978777A (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.)
Sz Reach Tech Co ltd
Original Assignee
Sz Reach Tech 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 Sz Reach Tech Co ltd filed Critical Sz Reach Tech Co ltd
Priority to CN201910103245.XA priority Critical patent/CN109978777B/en
Publication of CN109978777A publication Critical patent/CN109978777A/en
Application granted granted Critical
Publication of CN109978777B publication Critical patent/CN109978777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/254Analysis of motion involving subtraction of images
    • 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/20212Image combination
    • G06T2207/20224Image subtraction

Abstract

An image brightness adjusting method and device are provided, the image brightness adjusting method comprises the following steps: collecting a video image of a target area; then obtaining a motion area of the video image; dividing the motion area into a plurality of rectangular areas to determine a plurality of sub-macro blocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length; finally, brightness enhancement is carried out on the sub-macro blocks according to the enhancement algorithm coefficient; the brightness of the motion area in the video image is only independently adjusted, so that the display effect of the image is improved, and the brightness adjustment efficiency of the motion area is improved by dividing the motion area into sub macro blocks.

Description

Image brightness adjusting method and device
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to an image brightness adjusting method and device.
Background
Image Processing (Image Processing) technology refers to analyzing an Image through various pixel Processing means, so that the processed Image achieves a preset effect, different visual requirements of a user are met, and good visual experience is brought to the user. The digital image is obtained by using electronic equipment such as a digital camera, a scanner and the like, the display state of an original image is changed by performing depth processing and transformation on the image data, for example, the color of the image is changed, and the image can change the parameters of the image according to the actual requirements of a user, so that the changed image can be widely applied to different industrial technical fields, and accordingly, the digital image processing method has a very high actual value for improving the image display quality, and accordingly, the digital image processing method also becomes a main development direction of image processing.
The main contents of the digital image processing method in the conventional technology include: the method comprises the following steps of image compression, enhancement and restoration, matching, description and identification, and common operation steps are image digitization, image coding, image enhancement, image restoration, image segmentation, image analysis and the like. While some of the other processes in the art can also be implemented optically or by analog techniques, they are far less flexible and convenient than digital image processing; however, the digital image processing in the conventional art also has the following disadvantages: the traditional digital image processing method can only carry out synchronous adjustment on the whole picture, for example, the color of the whole picture is changed, the target object and the background cannot be distinguished, and the display state of the target object cannot be independently adjusted; for example, the conventional image processing method can only enhance the brightness of all sub-regions of an image synchronously, and if a user only needs to enhance the brightness of a certain sub-region in the image, the conventional digital image processing method cannot realize independent adaptive adjustment of pixels in the region, so that the visual experience of the user is reduced, and further the image processing method in the conventional technology cannot meet the visual requirements of different users, and the compatibility and the practical value are reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide an image brightness adjustment method and apparatus, which are used to solve the problems that the brightness of a certain sub-region in an image cannot be individually adjusted by an image digital processing method in the conventional technical solution, the image brightness adjustment effect is poor, and the visual experience of a user is poor.
A first aspect of an embodiment of the present invention provides an image brightness adjusting method, including the following steps:
collecting a video image of a target area;
acquiring a motion area of the video image;
dividing the motion region into a plurality of rectangular regions to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length;
and performing brightness enhancement on the plurality of sub-macro blocks according to the enhancement algorithm coefficients.
A second aspect of an embodiment of the present invention provides an image luminance adjusting apparatus, including:
the acquisition module is used for acquiring a video image of a target area;
the motion area acquisition module is used for acquiring a motion area of the video image;
a dividing module for dividing the motion area into a plurality of rectangular areas to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length; and
and the enhancement module is used for carrying out brightness enhancement on the sub-macro blocks according to the enhancement algorithm coefficient.
In one embodiment thereof, the enhancement module comprises:
the original sub-macro block image data calculation module is used for calculating original sub-macro block image data according to the image data of each original image pixel in the sub-macro block; and
and the target sub-macro block image data acquisition module is used for acquiring target sub-macro block image data according to the enhancement algorithm coefficient and the original sub-macro block image data.
A third aspect of an embodiment of the present invention provides an image brightness adjustment device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the image brightness adjustment method as described above when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the image brightness adjustment method described above.
The image brightness adjusting method acquires a motion area to be adjusted in the video image by acquiring the video image of continuous frames, wherein the motion area belongs to a sub-area in the video image, and then the motion area is divided into a plurality of sub-macro blocks, each sub-macro block comprises a plurality of pixels, and the blocking brightness adjustment of the motion area is realized according to the sub-macro blocks, so that the brightness of the motion area in the image has higher self-adaptive flexible adjusting performance, and all the pixels in the same sub-macro block can realize synchronous adjustment, thereby simplifying the step of image brightness adjustment, and improving the speed of image brightness adjustment through the sub-macro blocks; the brightness of the motion area in each frame of video image can be changed according to the actual requirements of the user, so that the diversified visual requirements of the user are met, the flexibility of brightness adjustment of the motion area in the video image is improved, and the picture quality is improved; and the image brightness adjusting method can be suitable for different industrial application scenes, and has high compatibility and practical value.
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 embodiments or the prior art descriptions will be briefly described 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 flowchart illustrating an image brightness adjusting method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating the step S102 according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating an application of the image brightness adjusting method according to an embodiment of the present invention;
fig. 4 is another specific flowchart of step S102 according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating the step S103 according to an embodiment of the present invention;
fig. 6 is a schematic diagram of sub-macroblock partitioning according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating the step S104 according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating an embodiment of a method for adjusting image brightness;
fig. 9 is a schematic structural diagram of an image brightness adjusting apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a reinforcing module according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a motion region acquisition module according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a partitioning module according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an image brightness adjusting apparatus according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an image brightness adjustment 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 more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, a specific process of the image brightness adjusting method according to the embodiment of the present invention can independently adjust the brightness of a specific area in an image, so as to improve the image quality and have a wide application range; for convenience of explanation, only the parts related to the present embodiment are shown, and detailed as follows, the image brightness adjustment method includes the following steps:
s101: video images of the target area are acquired.
Optionally, the target area is information of an entire image acquired by a user in different environments, and for example, the target area is: the target area represents the actual shooting place of the user; when continuous multi-frame video images are obtained, each frame of video image contains corresponding image data, pixels in the video image contain corresponding original complete image information, and dynamic pictures can be displayed through the continuous multi-frame images along with image sampling in continuous time so as to present a video playing effect; therefore, the embodiment can display complete and clear dynamic video images after processing continuous multi-frame video images through the fact that the video images can contain large-capacity video data; therefore, the image brightness adjusting method in the embodiment can adaptively adjust the brightness of the continuous multi-frame video image, and the image brightness adjusting method can dynamically process large-capacity image data, thereby improving the parallel adjusting efficiency and adjusting performance of the image brightness adjusting method.
S102: and acquiring a motion area of the video image.
The motion area is a sub-area to be adjusted in the image by a user, the motion area comprises a plurality of pixels, and after brightness adjustment is carried out on the motion area, the video image can adjust video content needing attention according to the actual requirement brightness of the user; optionally, corresponding target pixels may be extracted from pixels in the video image according to the feature information in the video image, and the target pixels jointly form a motion region; illustratively, a current frame is selected in continuous multi-frame video images, and all target pixels are obtained from original video image pixels of the current frame, and the target pixels jointly form a target area to be processed in a current frame picture.
In a specific implementation, there may be two cases in step S102, and in the first case, step S102 may include step S1021 and step S1022; fig. 2 shows a specific implementation flow in S102 provided in this embodiment, and refer to fig. 2.
S1021: image data of an original image pixel in a video image is subtracted from image data of an original image pixel in a previous frame of video image to obtain a differential pixel value.
In continuous multi-frame video images, image data of pixels in a motion area can change, a target pixel to be controlled in the video images can be obtained according to the difference amplitude of the image data of the pixels of original images in two adjacent frames of video images, and the brightness difference amplitude of the two adjacent frames of video images can be obtained according to the difference pixel value.
Specifically, as a moving object (moving area) in a video image moves continuously in the image acquisition process, pixels of an original image contain acquired image data, and pixel information in the moving object can be accurately identified by comparing the difference between the pixels of the original image in two adjacent frames; the pixel change information of the moving object in the moving process can be obtained according to the differential pixel value; further, after the differential pixel value is analyzed and processed, a complete pixel contained in the moving object can be identified; therefore, the embodiment can accurately identify the moving object which is used as the pixel information to be processed according to the difference information between the original image pixels of the previous frame and the next frame, and the moving object is isolated from the image to realize the independent adjustment of the image brightness; the accuracy and efficiency of motion region identification are improved by step S1021.
S1022: judging whether the differential pixel value is in a preset interval or not; and if the difference pixel value is judged not to be positioned in the preset interval, determining that the original image pixel in the video image belongs to the motion area.
And if the differential pixel value is judged to be located in the preset interval, determining that the original image pixel in the video image belongs to a preset area.
The preset interval belongs to a background area in the video, and the preset area is not a target pixel adjusted by a user, so that all pixels in the video image can be divided into the preset area and a motion area according to the differential pixel value, the brightness of the pixels in the video image can be differentiated, the brightness adjustment precision of the motion area in the image is guaranteed, and the identification precision of the motion area in each frame of video image is improved.
In the process of acquiring the video image pixels, part of objects in the video image move, and a large difference exists between the video image pixels of two adjacent frames, so that a moving target in the video image can be obtained according to the difference between the video image pixels, wherein the moving target is a person or an object, therefore, the moving areas in the video image can be accurately identified through the pixel difference between the two adjacent frames of video images, and all pixels in the moving areas form a moving object; all pixels in the motion area are used as an image target to be processed, and the brightness of the partial area in the video image is independently adjusted by adjusting the brightness of the motion area, so that the flexible adjustment performance of the brightness of each area of the image is improved; thus, the motion region can be accurately identified and distinguished from the video image through the step S102, and the image brightness adjusting method can individually adjust the brightness of the motion region to improve the display quality of the video image.
As an alternative implementation, between step S1021 and step S1022, step S102 further includes:
and carrying out binarization processing on the differential pixel value.
The binarization processing refers to converting the differential pixel values into numbers of a specific scale, so that the pixel difference characteristics of the video image have better quantifiability and are convenient to calculate; illustratively, the gradation value of the differential pixel value is set to any one of values 0 to 255 by the binarization process; therefore, the binarization processing can directly measure the characteristics of the pixels of the video image through the size of the number, and is beneficial to the identification precision and the brightness control efficiency of the motion area in the image.
After S1021, the differential pixel value only reflects the characteristic difference amplitude between two adjacent frames of original image pixels, and there may be different dimensional differences in different application scenes; after the binarization processing of the above formula, the specific difference amplitude of the original image pixel of the previous frame and the original image pixel of the next frame can be directly obtained according to the value after the binarization processing, and can be accurately obtained according to the specific difference amplitude: the image brightness adjusting method can accurately adjust the specific image area, the image quality is higher, and the control performance is excellent.
Further, if the difference pixel value after the binarization processing is larger than a preset image threshold value, it is determined that the original image pixel in the previous frame of video image and the original image pixel in the next frame belong to a motion region.
When the difference pixel value after the binarization processing is greater than the image threshold, it indicates that the video image change difference between the previous frame and the next frame is large, the original image pixel in the current frame video image belongs to the pixel of the motion region, and the image data difference of the pixels of the two adjacent frames is large when the moving object moves in the image, so that the pixels in the motion region can be accurately identified according to the size relationship between the difference pixel value and the image threshold, and the identification precision is high; obtaining target pixels in multi-frame video images according to an image threshold value to form a motion area;
as an optional implementation manner, if the differential pixel value after the binarization processing is less than or equal to the image threshold, it is determined that the original image pixel in the current frame video image belongs to the preset region.
The preset area comprises a large number of background pixels, and if the original image pixels in the current frame image are background pixels, the original image pixels are not pixels which need brightness adjustment actually by a user; when the brightness of the video image is adjusted, the interference of background pixels needs to be eliminated, and only the brightness adjustment of the pixels in the motion area needs to be reserved; therefore, if the original image pixel is determined to belong to the background pixel according to the differential pixel value, brightness adjustment measures are not required to be taken for the background pixel, so that the problem of inaccurate brightness control of the whole pixel in the video image is avoided.
To better illustrate the principle of extracting motion areas in this embodiment, the following description will be given by referring to fig. 2 with a specific application scenario: how to obtain the pixels of the surge region from the video image.
Fig. 3 is a schematic diagram illustrating an application of the image brightness adjustment method provided by this embodiment, in fig. 3, there are consecutive N frames of video images, where N is a positive integer greater than or equal to 3, and in these N frames of video images, a human body is a moving object, and an image of the human body is a target pixel that needs to be brightness adjusted, and any object other than the human body belongs to a background pixel, because there is an image data difference of pixels between two consecutive frames of video images, such as the 1 st frame and the 2 nd frame of video images; because only the human body in the video image is moving, and other objects are still, if there is a large difference between the original image pixel of the 1 st frame and the original image pixel of the 2 nd frame, it indicates that the original image pixel of the 2 nd frame belongs to the range of the moving object (human body), and these pixels belong to the moving area; on the contrary, there is no difference or the difference amplitude is very small between the original image pixel of the 1 st frame and the original image pixel of the 2 nd frame, the difference pixel value with very small difference is usually caused by the external disturbance amount, and the original image pixels of the 2 nd frame all belong to the background area; therefore, referring to fig. 3, background information can be filtered out by comparing the difference between two adjacent frames of images, and a moving object is retained, and the image brightness adjustment method can adjust only the brightness of the moving object, and pixels located in a moving area jointly form the moving object.
In the second case, step S102 may include step S701, step S702, and step S703, for example, fig. 4 shows another implementation flow of step S102 provided in this embodiment, as shown in fig. 4.
S701: subtracting the gray value of the original image pixel in the video image from the gray value of the original image pixel in the previous frame of video image to obtain a gray difference value; and subtracting the saturation of the original image pixel in the video image from the saturation of the original image pixel in the previous frame of video image to obtain a saturation difference value.
In S701, the degree of difference between the previous frame of video image and the next frame of video image can be comprehensively analyzed through the gray value and the saturation, the luminance difference between the previous frame of video image and the next frame of video image can be identified according to the gray difference value, and the color difference between the previous frame of video image and the next frame of video image can be identified according to the saturation difference value; the change condition of the pixels in the operation object in the image can be accurately obtained according to the gray level difference value and the saturation difference value, the moving state of the pixels in the motion area in the continuous multi-frame video image can be more accurately monitored by analyzing the gray level difference value and the saturation difference value, and the accuracy and the reliability of identification of the motion area in the video image are improved.
S702: and carrying out binarization processing on the gray level difference value and the saturation difference value.
The luminance calculation precision and the accurate determination of the original image pixels in the image can be improved through binarization processing, and the gray level difference value and the saturation difference value can be represented by more quantized numbers; illustratively, after the binarization processing, the gray level difference value is 100, and the saturation difference value is: 5 (red); therefore, the difference amplitude of the image characteristic information in the adjacent frames can be obtained more accurately through the value after the binarization processing, a motion area required by a user can be found in the video image, and the display quality of the video image can be guaranteed through the image brightness adjusting method.
S703: and if the gray level difference value after the binarization processing and/or the saturation difference value after the binarization processing are/is larger than the image threshold value, determining that the original image pixel in the current frame belongs to the motion area.
Specifically, if the gray level difference value after the binarization processing and the saturation difference value after the binarization processing are less than or equal to the image threshold, it is determined that the original image pixel in the current frame belongs to a background region.
In this embodiment, the difference between two adjacent frames of video images can be obtained through the amplitude of the grayscale difference value and the amplitude of the saturation difference value, and for example, if the amplitude of the grayscale difference value after binarization processing is larger, it indicates that the brightness difference of the original image pixel between the previous frame and the next frame is larger; if the saturation difference value after binarization processing is larger, the color difference of the original image pixels between the previous frame and the current frame is larger; when any one of the gray level difference value and the saturation difference value is larger than the image threshold value, the pixel belongs to the pixel of the motion area, and only the moving object can cause the larger difference of the brightness and/or the color between two adjacent frames of video images, so that the pixel of the original image of the current frame belongs to the pixel of the motion area to be adjusted; if the gray level difference value and the saturation difference value are both less than or equal to the image threshold value, the brightness difference between two adjacent frames of video images is extremely low, even 0, the video image of the current frame has no great difference, the video image belongs to a static image, and the gray level value and the saturation value of the pixels of the two images do not have great fluctuation values; therefore, the present embodiment accurately obtains the motion region in the multi-frame video image through the variation condition of the gray value and the saturation of the pixels of the original image in the two adjacent frames of video images; according to the embodiment, the pixels of the motion area in the multi-frame video image can be accurately acquired according to the pixel change condition of the video image in two adjacent frames so as to form the motion object, and the brightness adjustment precision and the brightness adjustment accuracy of the specific area in the video image are improved.
S103: dividing the motion region into a plurality of rectangular regions to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length.
Each sub-macro block comprises a plurality of pixels of the motion area, and when the brightness of the sub-macro block changes, the brightness of the plurality of pixels of the motion area can realize synchronous change; the sub-macro block is used as a basic component of image processing, the brightness of a plurality of pixels can be synchronously adjusted in batch through the processing of the sub-macro block, so that the brightness of the sub-macro block can be adjusted according to the actual requirement of a user, and the brightness of the sub-macro blocks also has good adjustability; therefore, all pixels of the motion area in the current frame are divided into a plurality of sub-macroblocks through S103, so that the brightness adjustment flexibility of a plurality of pixels in the image is improved, and the brightness adjustment efficiency of the pixels in the motion area is improved.
In a specific implementation, step S103 includes step S1031 and step S1032, and fig. 5 shows a specific implementation flow of step S103 provided in this embodiment, referring to fig. 5.
Wherein, S1031: determining the sub-macro block parameters according to the area of the motion area; the sub-macroblock parameters include the preset pixel width and the preset pixel length.
The motion area comprises a plurality of pixels, and the area of the sub macro block can be set according to the area of the motion area so as to improve the efficiency of adjusting the brightness of the motion area in the video image; the sub-macro blocks comprise a plurality of pixels of the motion area, and target pixels in the video image can be processed in batch through the sub-macro blocks by reasonably setting the number of the pixels in each macro block, so that the display effect of the video image is ensured, and the efficiency of image brightness adjustment is improved.
After each sub-macro block in the video image is subjected to self-adaptive brightness adjustment, the brightness of a specific area in the image can be correspondingly changed according to the actual requirements of a user; illustratively, the sub-macroblocks are: 4 × 4 pixels, 8 × 8 pixels, 16 × 16 pixels, or 32 × 32 pixels; the user can select the size of the sub-macro block according to the size of the pixel of the original image so as to realize the quick and efficient adjustment of the brightness of the motion area in the video image.
S1032: dividing the motion area according to the sub-macroblock parameters to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle of the preset pixel width and the preset pixel length.
As an optional implementation manner, the dividing the motion area according to the sub-macroblock parameter to determine a plurality of sub-macroblocks specifically includes:
the area of the sub-macro block is smaller than the area of the motion region, and the number of pixels in each sub-macro block is the same.
Therefore, in the embodiment, by evenly distributing the number of pixels in each sub-macro block, when the brightness of each sub-macro block in the motion region is respectively adjusted, the brightness of different sub-macro blocks keeps consistent and coordinated changes, the brightness changes of all sub-macro blocks in the video image are completely matched, the color level difference between different motion regions is smaller, and the motion region in the video image can display an overall picture with better quality.
For example, fig. 6 shows a schematic diagram of sub-macroblock division provided in this embodiment, as shown in fig. 6, in each frame of video image, if a motion region in a current frame of video image is obtained, according to the size of the motion region in the current frame, a plurality of pixels in the motion region are divided into a plurality of sub-macroblocks, and each sub-macroblock includes the same number of pixels; therefore, the brightness of a plurality of pixels can be synchronously adjusted by setting the sub-macro blocks in the motion area, so that the brightness of a moving object in the video image can be rapidly and independently adjusted according to the actual requirement of a user; the brightness of the motion area in the current frame has a more flexible adjusting mode and adjusting effect, and the brightness adjusting efficiency of the moving object is improved.
S104: and performing brightness enhancement on the plurality of sub-macro blocks according to the enhancement algorithm coefficients.
In S104, the brightness of each sub-macroblock in the motion region can be adaptively changed according to the operation instruction of the user, so that the brightness of each sub-macroblock in the motion region can be adjusted one by one, the flexibility of adjusting the brightness of the motion region in each frame of video image is improved, and the adjustment efficiency and the adjustment speed of the image brightness are improved; when the brightness of the specific area in the current frame video image is changed correspondingly after all the sub-macro blocks in the motion area in the current frame video image are adjusted, at this time, the pixel in the enhanced motion area is output in S104, and the color level and color of the pixel are changed correspondingly according to the actual requirements of the user; in the adjusted video image, only the brightness of the pixels in the motion area is changed, but the brightness of the non-motion area is not changed, so that the function of independently adjusting the brightness of the specific area in the current frame video image is realized, and the motion area is highlighted.
In a specific implementation, step S104 may include step S1041 and step S1042, and fig. 7 shows a specific operation flow of step S104 provided in this embodiment, as shown in fig. 7.
S1041: and calculating the original sub-macro block image data according to the image data of each original image pixel in the sub-macro block.
Optionally, an average value of image data of each original image pixel in the sub-macroblock is calculated to obtain original sub-macroblock image data.
Specifically, image data of each original image pixel in the sub-macro block in a YUV space is obtained; wherein said Y represents an original luminance of said pixel, and said U and said V represent a first original color difference and a second original color difference, respectively, of said pixel; calculating an average value according to the original brightness of each original image pixel in the sub-macro block in the YUV space to obtain the original brightness of the sub-macro block; calculating an average value according to a first original color difference of each original image pixel in the sub-macro block in a YUV space to obtain a first original color difference of the sub-macro block; and calculating an average value according to the second original color difference of each original image pixel in the sub-macro block in the YUV space to obtain the second original color difference of the sub-macro block.
Optionally, the image data includes brightness and color difference of pixels, and the color difference can represent color difference of each pixel; in the YUV space in the present embodiment, for example, U represents that the color of the pixel is red, and V represents that the color of the pixel is purple; the characteristic information of each pixel in the original sub-macro block can be accurately obtained through the image data; the YUV space is used as a pixel compound standard in a video image, and the brightness and the color of a pixel can be comprehensively analyzed according to the image data of the pixel in the YUV space; therefore, the characteristic values of the sub-macro blocks in the YUV space are obtained, the accuracy and the quantization processing of pixels of an original image in the sub-macro blocks are facilitated, when the original sub-macro blocks are in the YUV space, the brightness and the color of each sub-macro block in the motion area can be represented by numerical values, the brightness calculation of the pixels is more accurate, the brightness adjusting precision of each pixel in the sub-macro blocks is improved, and the brightness of each original sub-macro block in the current frame has higher adjustability.
Because the sub-macro block comprises a plurality of original image pixels, when the image data of each original image pixel in the current frame is obtained, the sub-macro block comprises the original data of the motion area in the video image, the self-adaptive brightness adjustment of the sub-macro block can be realized according to the image data of the original sub-macro block, the adjustment precision of the brightness of the motion area in the video image is improved, and the brightness adjustment error is avoided.
S1042: and acquiring target sub-macro block image data according to the enhancement algorithm coefficient and the original sub-macro block image data.
In this embodiment, the original sub-macroblock image data and the target sub-macroblock image data have a one-to-one correspondence relationship, and therefore, the target sub-macroblock image data can be mapped according to the original sub-macroblock image data; the image brightness adjusting method can make the motion area in the video image realize self-adaptive change according to the actual requirement of the user.
Illustratively, the pixel values of the video image include: gray value and saturation; the gray value can reflect the color grading of the pixel, generally, the gray value of the pixel is 0-255, and the color and the brightness presented by the video image are different when the gray values of the pixels are different, so that the difference information of the brightness of the pixel can be obtained through the gray value difference information of the pixel, and the precision is high; the saturation represents the shade or vividness of the color of the pixel, and different colors in nature are often formed by mixing light sources of continuous colors, so that the color change condition of the pixel can be obtained through the amplitude change of the saturation, and further the color difference amplitude between two pixels is obtained; therefore, the embodiment can comprehensively obtain the characteristic image information of the pixel by combining the two parameters of the gray value and the saturation so as to more comprehensively monitor the change condition of the video image between two adjacent frames.
As an optional implementation manner, in S104, the enhancing the luminances of the sub-macroblocks according to the enhancement algorithm coefficients specifically includes:
and dividing the number of all pixels in the motion area by the number of all pixels in the sub-macro block to obtain a pixel processing sequence number.
And taking the pixel processing serial number as a finite element processing object.
And enhancing the brightness of each sub-macro block in the finite element processing object according to the macro block sequence determined by the pixel processing serial number and enhancement algorithm coefficients in sequence.
In this embodiment, the number of pixels in a sub-macroblock is smaller than the number of pixels in a motion region, and then a pixel set formed by all sub-macroblocks represents a motion region where a user needs to perform luminance processing, so that in this embodiment, by calculating the number of sub-macroblocks in the motion region and setting a sequence number for each sub-macroblock in a current frame video image according to the arrangement sequence of the sub-macroblocks, all sub-macroblocks in the motion region have a sequence, and the sequence number is used as a unique mark for each sub-macroblock; illustratively, the motion region includes 3 sub-macroblocks, and the sequence numbers of the three sub-macroblocks are: 1 st, 2 nd and 3 rd; therefore, in the process of adjusting the brightness of the sub-macro block of the moving object in the video image, the brightness of each sub-macro block in the video image can be accurately and independently adjusted, so that the brightness of the sub-macro block in the video image can be accurately adjusted, and the problem of disordered brightness adjustment of different target pixels in the video image is avoided.
The method comprises the steps that a plurality of sub macro blocks exist in a motion area of a current frame, in order to achieve brightness adjustment of all target pixels in the current frame, the sub macro blocks are used as finite elements, brightness of the finite elements is adjusted to enable brightness of a plurality of target pixels to change synchronously, and brightness of the motion area in a video image can be enhanced in real time; therefore, all the sub-macro blocks in the motion area are used as finite element processing objects, the brightness of one video image in the current frame can be adjusted according to the actual needs of a user, the brightness of the motion area in the video image has higher adjustability and controllability, and the quality effect of the video image after brightness adjustment is greatly enhanced.
Each sub-macro block has a specific serial number, the matched sub-macro block can be found according to the serial number, the pixel processing serial number comprises the front and back sequence of the plurality of sub-macro blocks, and the brightness of all pixels contained in each sub-macro block is uniformly adjusted according to the sequence of the arrangement of the sub-macro blocks; for example, when the brightness adjustment of the first sub-macroblock in the video image is completed, the brightness of the second sub-macroblock in the video image is adjusted, and so on; the brightness of each sub-macro block in the motion area can be adaptively and independently adjusted, the pixel of the motion object in the video image has a flexible adjustment mode, when the brightness of all the sub-macro blocks in the motion area is adjusted, the brightness of the video image part area in the current frame is also changed according to the operation instruction of the user, the brightness of the motion object in the video image has high adjustability, and the application range of the image brightness adjustment method in the embodiment is ensured.
Therefore, in the implementation, after a moving area in an image is divided into a plurality of finite elements, the finite elements are used as processing objects, and the brightness of each sub-macro block in the video image is sequentially adjusted, so that the brightness of target pixels in the video image can be uniformly changed according to the actual requirements of users, the adjustment efficiency and the adjustment precision of video pixels in the video image are improved, the brightness of each pixel in the moving area can be independently enhanced, and the image brightness adjustment method has better performance of adjusting the brightness of the image; the moving area of the image is processed by a finite element processing mode, so that the brightness adjusting speed of the specific area in the image is increased, the brightness adjusting step is simplified, and the image after the brightness adjustment of the image can be widely applied to different industrial scenes.
As an alternative embodiment, the original sub-macroblock image data includes original luminance, a first original chrominance and a second original chrominance, the target sub-macroblock image data includes target luminance, a first target chrominance and a second target chrominance, and the enhancement algorithm coefficients include a first enhancement algorithm coefficient, a second enhancement algorithm coefficient and a third enhancement algorithm coefficient; the step S1042 specifically is:
calculating the target sub-macroblock image data according to the following equation:
Figure GDA0002057041930000151
in the above formula (1), y ' is the target luminance of the sub-macroblock, u ' is the first target chrominance of the sub-macroblock, v ' is the second target chrominance of the sub-macroblock, y is the original luminance of the sub-macroblock, u is the first original chrominance of the sub-macroblock, v is the second original chrominance of the sub-macroblock, ρ 1 is the first enhancement algorithm coefficient, ρ 2 is the second enhancement algorithm coefficient, and ρ 3 is the third enhancement algorithm coefficient.
Optionally, the value ranges of ρ 1, ρ 2, and ρ 3 are: -180 °.
The target brightness of the target sub-macro block can be directly calculated and obtained through the formula (1), the brightness of the motion area can be accurately changed according to the actual needs of a user, and when the image data of each sub-macro block in the motion area is correspondingly changed, the flexibility and controllability of brightness adjustment of the video image are improved.
In the embodiment, in the process of adjusting the brightness of the sub-macro block, a YUV space is introduced, the brightness of all pixels in a video image is calculated and adjusted in the YUV space, so that the brightness change of the sub-macro block has higher adjustability and controllability, and the conversion calculation is performed on the brightness of the sub-macro block in the YUV space by using a specific formula, so that the brightness adjustment of the sub-macro block in a motion area has higher precision; the method for adjusting the brightness of the sub-macro block can adjust the brightness of the sub-macro block in a self-adaptive mode in different application scenes, the adjustment of the brightness and the color of the sub-macro block is high in accuracy and reliability, all the sub-macro blocks of a motion area in a current frame can achieve accurate brightness adjustment, the operation is simple and convenient, the image brightness adjusting method has an accurate calculation formula to achieve brightness adjustment of a specific area in each frame of video image, the image brightness adjusting method is high in compatibility, and the brightness of all pixels of the motion area in the video image is adjusted to achieve a high image display effect.
Because the image brightness adjusting method in the embodiment needs to adjust the brightness of multiple frames of video images simultaneously, if the brightness of the motion area of each frame of image pixel is adjusted, multiple frames of video images with enhanced brightness can be output, so as to bring good dynamic visual experience to users; if the brightness of the video images of all frames is not adjusted, pixels which are not adjusted in brightness in the continuous multi-frame video images need to be continuously adjusted, the image information of the video images of the current frame is updated, the steps of the image brightness adjusting method are returned again, the self-adaptive brightness adjustment of the pixels in the motion area of the current frame is realized, and the cyclic brightness adjustment is sequentially performed on the continuous multi-frame video images until the brightness adjustment of the target pixels of each frame in the continuous multi-frame video images is completed; the image brightness adjusting method in the embodiment can continuously output a plurality of frames of video images after brightness adjustment, and the brightness of the motion area of each frame of video image can be independently adjusted, so that the self-adaptive adjusting efficiency of the brightness of the plurality of frames of video images is guaranteed, and the dynamic video display quality of the plurality of frames of video images is improved.
As an alternative implementation manner, fig. 8 shows another implementation flow of the image brightness adjusting method provided in this embodiment, where this embodiment is different from the embodiment of fig. 1 in that, before step S104, the image brightness adjusting method further includes step S904 and step S905.
S904: and carrying out scene recognition on the video image to acquire scene information.
In the embodiment, by performing mode processing on pixels in a video image, after the video image is acquired for different target areas, in different external environments, brightness adjustment modes of moving areas in the video image are different; therefore, scene information is identified and classified through S904, and the brightness of the video image is adaptively adjusted in different scenes, so that the video image of each type of target area can be changed in brightness according to the actual requirement of the user.
S905: and acquiring the enhancement algorithm coefficient according to the scene information.
With reference to the foregoing embodiment, when the scene information of the target region is obtained, an enhancement algorithm coefficient matched with the scene information may be obtained, where the enhancement algorithm coefficient is used as an optimal parameter for adjusting the sub-macro block in the motion region, and the luminance of the sub-macro block can have the most flexible adjustability according to the enhancement algorithm coefficient; when the image brightness adjusting method is applied to different external environments, the enhancement algorithm coefficient can be changed in a self-adaptive mode according to the change of the image information of the target area, so that the independent and accurate adjusting performance of the specific area in the video image is achieved, and a user can obtain the video image with higher image quality.
Therefore, in this embodiment, the image brightness adjustment method can be compatible and applicable to different environments, and the enhancement algorithm coefficient in the image brightness adjustment method can be adaptively changed according to the change of the application scene, so as to achieve the optimal adjustment performance for the motion region in the video image, so as to achieve the optimal video image display effect and ensure the visual experience of the user.
Fig. 9 shows a schematic structure of the image brightness adjusting apparatus 100 provided in the present embodiment, and as shown in fig. 10, the image brightness adjusting apparatus 100 includes: an acquisition module 1001, a motion region acquisition module 1002, a division module 1003, and an enhancement module 1004.
The acquisition module 1001 is used for acquiring a video image of a target area.
The motion region acquiring module 1002 is configured to acquire a motion region of the video image.
The dividing module 1003 is configured to divide the motion region into a plurality of rectangular regions to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length.
It should be noted that the image brightness adjusting apparatus 100 in fig. 9 corresponds to the image brightness adjusting method in fig. 1, and therefore, reference may be made to the embodiment in fig. 1 for specific implementation of each module of the image brightness adjusting apparatus 100 in fig. 9, and details are not repeated here.
As shown in fig. 10, the enhancement module 1004 includes an original sub-macroblock image data calculation module 110 and a target sub-macroblock image data acquisition module 111.
The original sub-macroblock image data calculating module 110 is configured to calculate original sub-macroblock image data according to image data of each original image pixel in the sub-macroblock.
The target sub-macroblock image data obtaining module 111 is configured to obtain target sub-macroblock image data according to the enhancement algorithm coefficient and the original sub-macroblock image data.
As shown in fig. 11, the motion region acquisition module 1002 includes: a differential pixel acquisition module 120 and a judgment module 121.
The differential pixel obtaining module 120 is configured to subtract image data of an original image pixel in a video image from image data of an original image pixel in a previous frame of video image to obtain a differential pixel value.
The judging module 121 is configured to judge whether the differential pixel value is in a preset interval;
the motion region obtaining module 121 is configured to determine that an original image pixel in the video image belongs to a motion region if the determining module 121 determines that the differential pixel value is not located in the preset interval.
As shown in fig. 12, the dividing module 1003 includes a parameter obtaining module 130 and a macroblock setting module 131.
The parameter obtaining module 130 is configured to determine the sub-macroblock parameter according to the area of the motion region; the sub-macroblock parameters include the preset pixel width and the preset pixel length.
The macroblock setting module 131 is configured to divide the motion area according to the sub-macroblock parameters to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle of the preset pixel width and the preset pixel length.
As shown in fig. 13, the image brightness adjusting apparatus 100 may further include a scene recognition module 143 and an algorithm coefficient acquisition module 144.
The scene recognition module 143 is configured to perform scene recognition on the video image to obtain scene information.
The algorithm coefficient obtaining module 144 is configured to obtain the enhancement algorithm coefficient according to the scene information.
Fig. 14 is a schematic structural diagram of an image brightness adjustment apparatus 150 according to an embodiment of the present invention. As shown in fig. 14, the image brightness adjustment device of this embodiment includes: a processor 1501, a memory 1502, and a computer program 1503 stored in the memory 1502 and executable on the processor 1501; the processor 1501, when executing the computer program 1503, implements the steps in each of the above-described embodiments of the image brightness adjustment method, such as S101 to S104 shown in fig. 1. Alternatively, the processor 1501, when executing the computer program 1503, implements the functions of the modules in the foregoing embodiments of the image brightness adjustment apparatus 100, such as the functions of the acquisition module 1001 to the enhancement module 1004 shown in fig. 9.
In this embodiment, since the corresponding operation instruction is stored in advance in the computer program, the image brightness adjustment device 150 can access information of consecutive multi-frame video images, and according to the actual needs of a user, a moving region in a video image is taken as a target object to be processed, and pixels in the moving object are identified, separated, calculated and converted, so that the pixels in each frame of video image can realize brightness adaptive adjustment, and the image brightness adjustment device 150 can continuously adjust the brightness of the moving region in the consecutive multi-frame video images, so as to realize the difference adjustment of the brightness of the pixels in different regions in the video image; the image brightness adjusting device 150 in this embodiment has better controllability and flexibility for adjusting pixels in video images, the image brightness adjusting device 150 can only adjust a specific area in continuous multi-frame video images, and the image with adjusted brightness has higher quality, which brings better visual experience to users; the effectual image brightness adjusting device who has solved among the conventional art can't adjust alone the luminance of specific area in the video image, and the luminance adjustability of video image is not high, the quality of the image after the image brightness adjusting device output luminance strengthens is not good, and traditional image brightness adjusting device can't universally be applicable to each different industrial technology field, and user's visual experience is not good problem.
Illustratively, the computer program 1503 may be partitioned into one or more modules/units that are stored in the memory 1502 and executed by the processor 1501 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 1503 in the image brightness adjusting device 150.
The image brightness adjusting device 150 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The image brightness adjustment device 150 may include, but is not limited to, a processor 1501 and a memory 1502. Those skilled in the art will appreciate that fig. 14 is only an example of the image brightness adjusting apparatus 150, and does not constitute a limitation to the image brightness adjusting apparatus 150, and may include more or less components than those shown, or combine some components, or different components, for example, the image brightness adjusting apparatus 150 may further include an input/output device, a network access device, a bus, etc.
The Processor 1501 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 1502 may be an internal storage unit of the image brightness adjustment device 150, such as a hard disk or a memory of the image brightness adjustment device 150. The memory 1502 may also be an external storage device of the image brightness adjustment apparatus 150, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the image brightness adjustment apparatus 150. Further, the memory 1502 may also include both an internal storage unit and an external storage device of the image brightness adjustment apparatus 150. The memory 1502 is used for storing the computer program and other programs and data required by the image brightness adjustment device 150. The memory 1502 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed image brightness adjusting apparatus 150 and the image brightness adjusting method can be implemented in other ways. For example, the above-described embodiment of the image brightness adjustment apparatus 150 is merely illustrative, and for example, the division of the modules or units is only a logical division, and there may be other divisions when the actual implementation is performed, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the image brightness adjusting method according to the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium and used by a processor to implement the steps of the image brightness adjusting method embodiments. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The image brightness adjusting method can independently adjust the brightness of a moving area in a video image so as to enable the brightness of a specific area in the video image to be correspondingly changed according to the actual needs of a user, a multi-frame video image can have a better quality effect, the user can obtain clearer and more complete image information, and the visual experience of the user is excellent; therefore, the image brightness adjusting method can be applied to various different technical fields, and the following describes an embodiment of the image brightness adjusting method of the present invention by applying the image brightness adjusting method to a teaching video image, specifically as follows:
the teaching video images in the preset continuous time are obtained; the teaching video image comprises corresponding video information, the video information comprises the teaching content of a teacher in a video record, and the teaching content of the teacher in class is stored by completely acquiring the teaching video of the teacher; therefore, the collected continuous multi-frame teaching video images can be used as demonstration classroom video data, the teaching efficiency of teachers can be greatly improved, and the application range is wide.
Referring to the above embodiments of fig. 1 to 8, after processing the original image pixels in each frame of teaching video image, a motion area in the teaching video image is obtained, where the motion area represents a motion object that needs to be processed in advance in the video image, and the motion object is exemplarily a teacher; then, the brightness of a target pixel in each frame of video image in the teaching video image is adjusted in sequence, so that the brightness of a motion area in the multi-frame teaching video image is changed according to the actual requirement of a user, and the video display quality in the teaching video image is improved; therefore, the image brightness adjusting method in the embodiment can identify the specific motion area in the teaching video image and enhance the brightness of the motion area, so as to achieve a stronger teaching video recording effect, and a user can obtain teaching knowledge more intuitively through the teaching video image after brightness adjustment, thereby greatly enhancing the comprehension and memory of the user on teaching knowledge points of a teacher and improving the teaching efficiency of the teacher.
When continuous multi-frame teaching images are acquired, in order to improve the comprehension of a user on teaching knowledge points in a specific motion area in a teacher video image, the brightness of the specific area in the teaching video image needs to be changed according to the actual requirements of the user, for example, the brightness of an individual image such as a teacher in the teaching video image needs to be enhanced, so that the user can pay more attention to the teaching content of the teacher in class when watching the teaching video for a period of time, the interference of background areas (such as a podium, a blackboard and the like) of the image on the teaching content of the teacher is avoided, the display quality of the teaching video image is improved, and the user has higher learning efficiency; therefore, the image brightness adjusting method can distinguish and identify the motion areas in the continuous multi-frame teaching video images according to the viewing requirements of users, only adjusts the brightness of a specific area in the images, improves the adjusting efficiency and the adjusting accuracy of the brightness in the images, can highlight the teaching content of teachers in classes through the multi-frame teaching video images after the brightness adjustment, and is better in quality of teaching videos; the problems that in the prior art, the brightness of all pixels in the teaching video can only be uniformly adjusted, the brightness of a specific area in an image cannot be self-adaptively and independently adjusted, the brightness adjustability of the traditional teaching image is not high, the display effect of the teaching video is poor, the class efficiency of a user in watching the teaching video is reduced, and the compatibility and the practical value are low are effectively solved.
It should be noted that the above example is only an embodiment, and does not mean that the image brightness adjusting method of the present invention is only applicable to the education industry, and a skilled person can apply the image brightness adjusting method to various fields such as music videos, tv series videos, etc. on the basis of not violating the essential operation steps of the image brightness adjusting method; the image brightness adjusting method can adjust the brightness of the specific pixel in the video image only, so that the adjusting effect of the brightness in the video image is greatly improved, the brightness of the video image has more flexible adjustability and operability, and the display quality of the video image is higher; therefore, the image adjusting method has extremely important positive effects on the development of video image processing in the field, and higher practical value can be generated.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. An image brightness adjusting method is characterized by comprising the following steps:
collecting a video image of a target area;
acquiring a motion area of the video image, wherein corresponding target pixels are extracted from pixels in the video image according to characteristic information in the video image, and the target pixels jointly form the motion area;
dividing the motion region into a plurality of rectangular regions to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length; each sub-macroblock comprises the same number of pixels;
performing luminance enhancement on the plurality of sub-macroblocks according to enhancement algorithm coefficients, including:
calculating original sub-macro block image data according to the image data of each original image pixel in the sub-macro block;
acquiring target sub-macro block image data according to the enhancement algorithm coefficient and the original sub-macro block image data;
the acquiring of the motion area of the video image specifically includes:
subtracting image data of an original image pixel in a video image from image data of an original image pixel in a previous frame of video image to obtain a differential pixel value;
judging whether the differential pixel value is in a preset interval or not;
if the difference pixel value is not in the preset interval, determining that the original image pixel in the video image belongs to a motion area, including: analyzing the difference degree between the previous frame of video image and the next frame of video image through the gray value and the saturation degree, identifying the brightness difference between the previous frame of image and the next frame of image according to the gray difference value, and identifying the color difference between the previous frame of image and the next frame of image according to the saturation difference value; obtaining the change condition of the pixels in the operation object in the image according to the gray difference value and the saturation difference value;
the original sub-macro block image data is image data of each original image pixel in a YUV space and comprises original brightness, first original chromaticity and second original chromaticity, the target sub-macro block image data comprises target brightness, first target chromaticity and second target chromaticity, and the enhancement algorithm coefficient comprises a first enhancement algorithm coefficient, a second enhancement algorithm coefficient and a third enhancement algorithm coefficient; the obtaining of the target sub-macroblock image data according to the enhancement algorithm coefficient and the original sub-macroblock image data specifically includes:
calculating the target sub-macroblock image data according to the following equation:
Figure FDA0003134315110000021
wherein y ' is the target luminance of the sub-macroblock, u ' is the first target chrominance of the sub-macroblock, v ' is the second target chrominance of the sub-macroblock, y is the original luminance of the sub-macroblock, u is the first original chrominance of the sub-macroblock, v is the second original chrominance of the sub-macroblock, ρ 1 is the first enhancement algorithm coefficient, ρ 2 is the second enhancement algorithm coefficient, and ρ 3 is the third enhancement algorithm coefficient.
2. The image brightness adjustment method according to claim 1, wherein the dividing of the motion region into a plurality of rectangular regions to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle with a preset pixel width and a preset pixel length, and the sub-macro block comprises:
determining sub-macro block parameters according to the area of the motion area; the sub-macroblock parameters comprise the preset pixel width and the preset pixel length;
dividing the motion area according to the sub-macroblock parameters to determine a plurality of sub-macroblocks; the sub-macro block is a rectangle of the preset pixel width and the preset pixel length.
3. The image brightness adjustment method according to claim 1, wherein said brightness enhancement of said plurality of sub-macroblocks according to enhancement algorithm coefficients further comprises:
carrying out scene recognition on the video image to acquire scene information;
and acquiring the enhancement algorithm coefficient according to the scene information.
4. An image brightness adjustment device, characterized in that the image brightness adjustment device comprises:
the acquisition module is used for acquiring a video image of a target area;
a motion region obtaining module, configured to obtain a motion region of the video image, where corresponding target pixels are extracted from pixels in the video image according to feature information in the video image, and the target pixels jointly form the motion region;
a dividing module for dividing the motion area into a plurality of rectangular areas to determine a plurality of sub-macroblocks; the sub-macro blocks are rectangles with preset pixel width and preset pixel length, and each sub-macro block comprises the same number of pixels; and
the enhancement module is used for carrying out brightness enhancement on the sub-macro blocks according to enhancement algorithm coefficients;
the enhancement module includes:
the original sub-macro block image data calculation module is used for calculating original sub-macro block image data according to the image data of each original image pixel in the sub-macro block; and
the target sub-macro block image data acquisition module is used for acquiring target sub-macro block image data according to the enhancement algorithm coefficient and the original sub-macro block image data;
the acquiring of the motion area of the video image specifically includes:
subtracting image data of an original image pixel in a video image from image data of an original image pixel in a previous frame of video image to obtain a differential pixel value;
judging whether the differential pixel value is in a preset interval or not;
if the difference pixel value is not in the preset interval, determining that the original image pixel in the video image belongs to a motion area, including: analyzing the difference degree between the previous frame of video image and the next frame of video image through the gray value and the saturation degree, identifying the brightness difference between the previous frame of image and the next frame of image according to the gray difference value, and identifying the color difference between the previous frame of image and the next frame of image according to the saturation difference value; obtaining the change condition of the pixels in the operation object in the image according to the gray difference value and the saturation difference value;
the original sub-macro block image data is image data of each original image pixel in a YUV space and comprises original brightness, first original chromaticity and second original chromaticity, the target sub-macro block image data comprises target brightness, first target chromaticity and second target chromaticity, and the enhancement algorithm coefficient comprises a first enhancement algorithm coefficient, a second enhancement algorithm coefficient and a third enhancement algorithm coefficient; the obtaining of the target sub-macroblock image data according to the enhancement algorithm coefficient and the original sub-macroblock image data specifically includes:
calculating the target sub-macroblock image data according to the following equation:
Figure FDA0003134315110000041
wherein y ' is the target luminance of the sub-macroblock, u ' is the first target chrominance of the sub-macroblock, v ' is the second target chrominance of the sub-macroblock, y is the original luminance of the sub-macroblock, u is the first original chrominance of the sub-macroblock, v is the second original chrominance of the sub-macroblock, ρ 1 is the first enhancement algorithm coefficient, ρ 2 is the second enhancement algorithm coefficient, and ρ 3 is the third enhancement algorithm coefficient.
5. An image brightness adjustment device, comprising: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the image brightness adjustment method according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the image brightness adjustment method according to any one of claims 1 to 3.
CN201910103245.XA 2019-02-01 2019-02-01 Image brightness adjusting method and device Active CN109978777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910103245.XA CN109978777B (en) 2019-02-01 2019-02-01 Image brightness adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910103245.XA CN109978777B (en) 2019-02-01 2019-02-01 Image brightness adjusting method and device

Publications (2)

Publication Number Publication Date
CN109978777A CN109978777A (en) 2019-07-05
CN109978777B true CN109978777B (en) 2021-10-15

Family

ID=67076873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910103245.XA Active CN109978777B (en) 2019-02-01 2019-02-01 Image brightness adjusting method and device

Country Status (1)

Country Link
CN (1) CN109978777B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112396559A (en) * 2019-08-19 2021-02-23 王艳苓 Live broadcast picture orientation beauty platform
CN113034412B (en) * 2021-02-25 2024-04-19 北京达佳互联信息技术有限公司 Video processing method and device
CN113038093B (en) * 2021-03-26 2022-12-16 华东理工大学 System, method, apparatus and storage medium for video image flicker suppression processing
CN114972124B (en) * 2022-07-29 2022-10-28 自然资源部第三地理信息制图院 Remote sensing image brightness self-adaptive equalization method and system
CN115547230B (en) * 2022-11-23 2023-03-10 南京芯视元电子有限公司 Video data display processing method and device, micro display screen and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710931A (en) * 2005-07-27 2005-12-21 华亚微电子(上海)有限公司 Picture colour controlling method and system
CN103514588A (en) * 2013-10-10 2014-01-15 广东威创视讯科技股份有限公司 Image enhancement method and system
CN107635124A (en) * 2017-10-31 2018-01-26 广东欧珀移动通信有限公司 White balancing treatment method, device and the equipment of face shooting
WO2019002825A1 (en) * 2017-06-30 2019-01-03 Sony Interactive Entertainment Inc. Content modification device and method
CN109218695A (en) * 2017-06-30 2019-01-15 中国电信股份有限公司 Video image enhancing method, device, analysis system and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108124139A (en) * 2016-11-28 2018-06-05 深圳市中兴微电子技术有限公司 A kind of pixel processing method and processing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710931A (en) * 2005-07-27 2005-12-21 华亚微电子(上海)有限公司 Picture colour controlling method and system
CN103514588A (en) * 2013-10-10 2014-01-15 广东威创视讯科技股份有限公司 Image enhancement method and system
WO2019002825A1 (en) * 2017-06-30 2019-01-03 Sony Interactive Entertainment Inc. Content modification device and method
CN109218695A (en) * 2017-06-30 2019-01-15 中国电信股份有限公司 Video image enhancing method, device, analysis system and storage medium
CN107635124A (en) * 2017-10-31 2018-01-26 广东欧珀移动通信有限公司 White balancing treatment method, device and the equipment of face shooting

Also Published As

Publication number Publication date
CN109978777A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN109978777B (en) Image brightness adjusting method and device
US10074164B2 (en) Method and apparatus for adjusting image brightness
US7684096B2 (en) Automatic color correction for sequences of images
CN106204513B (en) The methods, devices and systems of image procossing
US9467677B2 (en) Image processing method, image processing device, and electronic apparatus
CN110136166B (en) Automatic tracking method for multi-channel pictures
CN112241714B (en) Method and device for identifying designated area in image, readable medium and electronic equipment
Smith et al. Beyond tone mapping: Enhanced depiction of tone mapped HDR images
CN108806638B (en) Image display method and device
CN109903265B (en) Method and system for setting detection threshold value of image change area and electronic device thereof
Chen et al. Blind quality index for tone-mapped images based on luminance partition
CN113034509A (en) Image processing method and device
WO2017057926A1 (en) Display device and method for controlling same
CN110111347B (en) Image sign extraction method, device and storage medium
CN111768377A (en) Image color evaluation method and device, electronic equipment and storage medium
CN109472874B (en) Display method, display device, VR display device and storage medium
CN109191398B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
EP3363193B1 (en) Device and method for reducing the set of exposure times for high dynamic range video imaging
CN104010134B (en) For forming the system and method with wide dynamic range
CN109194942A (en) A kind of naked eye 3D video broadcasting method, terminal and server
Senthamaraikannan et al. Real time color recognition
CN111754492A (en) Image quality evaluation method and device, electronic equipment and storage medium
Mayes et al. Automated brand color accuracy for realtime video
CN108470327A (en) Image enchancing method, device, electronic equipment and storage medium
CN109523562A (en) A kind of Infrared Image Segmentation based on human-eye visual characteristic

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