Video Image Enhancement Processing Method and Device
By converting the image frames of infrared camera videos into arrays and generating a matrix, combining Gaussian Laplace operator and histogram equalization algorithm for image enhancement, the problem of insufficient adaptability and real-time performance of image enhancement algorithms in the prior art is solved, and image detail enhancement under different lighting conditions is achieved.
Patent Information
- Application Number
- CN202111197089.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-10-14
AI Technical Summary
The existing image enhancement algorithms cannot meet the adaptability and real-time requirements of different scenes at the same time, resulting in the incomplete image details of the videos captured by infrared cameras under different lighting conditions, which affects the value of the video.
By converting the image frames of the video to be processed into an array, the video frame number is calculated and the pending matrix is generated, and image enhancement processing is combined with the Gaussian Laplace operator, histogram equalization algorithm and bilinear interpolation algorithm to generate the enhanced image matrix.
It realizes the enhancement of image details in different application scenarios, and at the same time has good real-time performance, adapting to video image processing under different lighting conditions.
Smart Images

Figure CN113850745B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies, and in particular, to a method and device for video image enhancement processing. Background Art
[0002] With the development of society accompanied by the rise of the Internet field and mobile terminals, infrared cameras have been widely used in various scenarios of life. A large number of related videos are collected and uploaded every day. How to make these videos more valuable becomes very meaningful for research. Due to hardware limitations or the particularity of scenarios, videos captured by infrared cameras may have phenomena such as blurring and overexposure. There are also large differences in the image brightness obtained during day and night times, and the details of black-and-white imaging may not be perfect enough. This leads to a large number of videos being possibly invalid, and people will obtain less useful information when watching videos. Currently, there are already many image enhancement algorithms to solve the above existing problems.
[0003] In the process of implementing the existing technology, the inventors found that:
[0004] Many of the existing traditional image enhancement algorithms do not have ideal effects, and there are limitations in the applicable video formats, and they cannot effectively adapt to the brightness of various different scenarios for image detail enhancement. The deep learning method cannot meet the requirements in terms of real-time performance.
[0005] Therefore, it is necessary to provide a method and device for video image enhancement processing to solve the technical problem that the adaptability requirements and real-time requirements cannot be simultaneously met in image detail enhancement. Summary of the Invention
[0006] Embodiments of this application provide a method and device for video image enhancement processing to solve the technical problem that the adaptability requirements and real-time requirements cannot be simultaneously met in image detail enhancement.
[0007] Specifically, a method for video image enhancement processing includes the following specific steps:
[0008] Input the video to be processed;
[0009] Transfer and store the image frames in the video to be processed to obtain an array to be processed;
[0010] Convert the array to be processed to obtain a matrix to be processed;
[0011] Process the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix;
[0012] Output the enhanced image matrix as a visible image.
[0013] Further, converting the array to be processed to obtain a matrix to be processed includes the following specific steps:
[0014] Obtain the array length of the array to be processed and the image size of the image frame;
[0015] Calculate the number of video frames of the video to be processed according to the array length and the image size;
[0016] Using the array length, the image size, the array to be processed, and the number of video frames as parameters, obtain a matrix to be processed through a matrix transformation function.
[0017] Further, the calculation formula for the number of video frames is as follows:
[0018] k = len / (Height * Width)
[0019] Where k represents the number of video frames, len represents the array length, Height represents the length in the image size, and Width represents the width in the image size.
[0020] Further, the calculation formula for the matrix to be processed is as follows:
[0021] images = reshape(data, Width, Height, k)
[0022] Where images represents the matrix to be processed, reshape is an array transformation function, data is the array to be processed storing image reading parameters, k represents the number of video frames, Height represents the length in the image size, and Width represents the width in the image size.
[0023] Further, process the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix, including the following specific steps:
[0024] Normalize the matrix to be processed to obtain a normalized image matrix;
[0025] Extract the Laplacian of Gaussian operator of the normalized image matrix to obtain an optimized image matrix;
[0026] Divide the image frames in the optimized image matrix into blocks, and process them in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix.
[0027] Further, the normalization calculation formula for the matrix to be processed is as follows:
[0028] R[i] = (image[i] - min) / (max - min)
[0029] Among them, R[i] is the normalized image matrix corresponding to the i-th frame of the image, image[i] is the matrix to be processed of the i-th frame of the image, and min and max respectively represent the minimum and maximum values of the pixel points in the matrix.
[0030] Further, the calculation formula for extracting the Laplacian of Gaussian operator of the normalized image matrix is as follows:
[0031] G[i] = log(1 + v * R[i]) / log(v + 1)
[0032] Among them, log is the Laplacian of Gaussian operator extraction function, R[i] is the normalized image matrix corresponding to the i-th frame of the image, and v is a fixed parameter.
[0033] Further, the image frames in the optimized image matrix are divided into blocks, and processed in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix, including the following specific steps:
[0034] The image frames in the optimized image matrix are uniformly divided into blocks to obtain unit image blocks;
[0035] The unit image blocks are processed by the histogram equalization algorithm to obtain optimized image blocks;
[0036] According to the distribution of the optimized image blocks, the pixels of the optimized image blocks are determined respectively through gray mapping, linear interpolation and bilinear interpolation algorithms to obtain an enhanced image matrix.
[0037] Further, the unit image blocks are processed by the histogram equalization algorithm to obtain optimized image blocks, including the following specific steps:
[0038] Calculate the histogram of the unit image block;
[0039] Clip the histogram according to the threshold to obtain a clipped histogram;
[0040] Equalize the clipped histogram to obtain an optimized image block.
[0041] This application also provides a video image enhancement processing device, including:
[0042] An input module, used to input the video to be processed;
[0043] A transfer storage module, used to transfer and store the image frames in the video to be processed to obtain an array to be processed;
[0044] A conversion module, used to convert the array to be processed to obtain a matrix to be processed;
[0045] An image enhancement module, used to process the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix;
[0046] An output module, configured to output the enhanced image matrix as a visible image.
[0047] The technical solution provided by the embodiments of the present application has at least the following beneficial effects:
[0048] By adapting to different application scenarios, it can enhance the image details in different application scenarios and has good real-time processing performance. Description of the Drawings
[0049] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0050] Figure 1 is a flowchart of a video image enhancement processing method provided by an embodiment of the present application;
[0051] Figure 2 is a schematic structural diagram of a video image enhancement processing device provided by an embodiment of the present application. Detailed Embodiments
[0052] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0053] Please refer to Figure 1 , a video image enhancement processing method, including the following specific steps:
[0054] S100: Input the video to be processed.
[0055] It should be noted that the video to be processed here can be video data in a 12-bit raw image format. Preferably, the video to be processed here is in the raw original camera video format. The extensions of RAW files generated by different cameras are generally different. The video to be processed here can be a video file recorded by an infrared device. The infrared device here can be an infrared camera. In the specific implementation process, the video to be processed can be read by calling a file reading function to complete the input operation of the video to be processed.
[0056] S200: Transcribe the image frames in the video to be processed to obtain an array to be processed.
[0057] It can be understood that the smallest unit constituting a video is an image frame. The video to be processed here can be split into image frames. In a specific implementation process, the video to be processed here is saved in the form of image frames to an array, and the finally obtained array can be understood as the array to be processed here. When the video to be processed is a raw format video of 12-bit images, the parameters of the video to be processed read can be read into an array of uint16. It should be noted that when processing image frames of corresponding specifications in the video to be processed, it is preferred to open the video data to be processed in a read-only manner. Obviously, opening the video data to be processed in a read-only manner can effectively prevent the image data from being accidentally edited and improve the stability of the data.
[0058] S300: Convert the array to be processed to obtain a matrix to be processed.
[0059] It can be understood that the matrix to be processed here needs to correspond to the array to be processed, so as to ensure that the image data in the array to be processed can be correspondingly saved in the matrix to be processed. This conversion operation can be understood as reconstructing the array to be processed containing the data of the entire video to be processed into a corresponding matrix.
[0060] Specifically, converting the array to be processed to obtain a matrix to be processed includes the following specific steps:
[0061] Obtain the array length of the array to be processed and the image size of the image frame;
[0062] Calculate the number of video frames of the video to be processed according to the array length and the image size;
[0063] Using the array length, the image size, the array to be processed, and the number of video frames as parameters, obtain a matrix to be processed through a matrix conversion function.
[0064] It can be understood that when performing array conversion, it is necessary to ensure that the data of the key image frames in the original video data to be processed can be completely converted into the matrix to be processed. In the specific implementation process, the array length of the array to be processed and the image size of the image frame can be calculated first through the corresponding function, and the array to be processed storing the image reading parameters of all image frames can be obtained. According to the array length and the image size, the number of video frames of the video to be processed can be calculated through the corresponding calculation formula. When specifically using the matrix conversion function to generate the matrix to be processed, the obtained array length, image size, array to be processed and video parameters can be used as input parameters. By calling the matrix conversion function, the specified array can be transformed into a matrix with a specific dimension to obtain the corresponding matrix to be processed. It should be noted that the number of elements in the obtained matrix to be processed remains unchanged compared with the number of elements in the original array to be processed. The number of rows and columns of the matrix to be processed is the image size of the image frame of the video to be processed, and the dimension of the matrix to be processed is the number of video frames.
[0065] Furthermore, the calculation formula for the number of video frames is as follows:
[0066] k = len / (Height * Width)
[0067] Where k represents the number of video frames, len represents the array length, Height represents the length in the image size, and Width represents the width in the image size.
[0068] It should be noted that the number of video frames k refers to the total number of image frames of the video to be processed. The array length len refers to the total length of the array occupied after the video to be processed is transferred to the array to be processed. The length Height in the image size refers to the array length occupied by the length in the size of a single image frame, and the width Width in the image size refers to the array length occupied by the width in the size of a single image frame. Here, Height * Width represents the array length occupied by a single-frame image in the array. Obviously, by calculating the ratio of the array length to the occupied length of a single-frame image, the number of video frames of the video to be processed can be obtained.
[0069] Specifically, the calculation formula for the matrix to be processed is as follows:
[0070] images = reshape(data, Width, Height, k)
[0071] Where images represents the matrix to be processed, reshape is the array transformation function, data is the array to be processed storing the image reading parameters, k represents the number of video frames, Height represents the length in the image size, and Width represents the width in the image size.
[0072] It should be noted that reshape is a function that can resize the number of rows, columns, and dimensions of a matrix. Here, data is the array to be processed that stores the image reading parameters of all image frames in the video to be processed. The number of elements in the matrix images to be processed obtained is the same as that of the original array data to be processed. The number of rows and columns of the matrix images to be processed is the image size of the image frames of the video to be processed, and the dimension k of the matrix images to be processed is the number of video frames.
[0073] S400: Process the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix.
[0074] It can be understood that when processing the matrix to be processed through an enhancement algorithm, it is necessary to perform image enhancement operations on each frame of the video to be processed. Specifically, first perform corresponding preprocessing on the image data, and then perform enhancement processing on the core image details of the preprocessed image data to finally obtain the enhanced image matrix after enhancement processing.
[0075] Furthermore, processing the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix includes the following specific steps:
[0076] Normalize the matrix to be processed to obtain a normalized image matrix;
[0077] Extract the Laplacian of Gaussian operator of the normalized image matrix to obtain an optimized image matrix;
[0078] Divide the image frames in the optimized image matrix into blocks and process them in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix.
[0079] It should be noted that normalization is a way to simplify calculations. It can transform a dimensional expression into a dimensionless expression through transformation and become a scalar. The normalization operation adopted in this application is dynamic normalization on the to-be-processed matrix after analyzing the data parameters of the actual video to be processed, rather than separately processing each frame of image data in the to-be-processed matrix. For example, the upper and lower limits of normalization can be comprehensively selected according to a preset number of image frames. Preferably, the preset number is set to 1000 here. After performing the normalization operation on the to-be-processed matrix, the original image data stored in the to-be-processed matrix can be compressed into floating-point numbers between 0 and 1, and finally a normalized image matrix is obtained. Obviously, the normalized image matrix obtained through the dynamic normalization mechanism can be adjusted accordingly according to the actual situation, which helps to improve the video image enhancement processing ability. The Laplacian of Gaussian operator is an operator obtained by using the Laplacian operator to extract edges on the basis of the Gaussian function and can be used to highlight the edges in the image. In this application, by extracting the Laplacian of Gaussian operator from the normalized image matrix, the image data can be further optimized, the processing difficulty for subsequent image enhancement processing can be reduced, and the image enhancement efficiency can be effectively improved. The histogram equalization algorithm is a method to enhance the contrast of an image, mainly to make the histogram distribution of an image become approximately uniform distribution, so as to enhance the contrast of the image. The bilinear interpolation algorithm is the interpolation of a two-variable function z = f(x, y) on a 2D straight-line grid. First, linear interpolation is performed in one direction, and then another operation is performed in the other direction. In this application, when generating the enhanced image matrix by using the histogram equalization algorithm and the bilinear interpolation algorithm, the image frames in the obtained optimized image matrix are first processed in blocks, and then optimized by using the histogram equalization algorithm, and finally the enhanced image matrix is obtained through the bilinear interpolation algorithm. Obviously, by comprehensively using dynamic normalization, the Laplacian of Gaussian operator, the histogram equalization algorithm, the bilinear interpolation algorithm, etc., the image enhancement processing ability can be effectively improved, and the recognizability of the final image can be improved.
[0080] Specifically, the normalization calculation formula of the to-be-processed matrix is as follows:
[0081] R[i] = (image[i] - min) / (max - min)
[0082] where R[i] is the normalized image matrix corresponding to the i-th frame of the image, image[i] is the to-be-processed matrix of the i-th frame of the image, min and max respectively represent the minimum and maximum values of the pixel points in the matrix, and i is an integer.
[0083] It can be understood that since a video file is composed of multiple frames of images, when performing the normalization operation, a dynamic normalization method that can synthesize the data of multiple frames of images needs to be adopted. In the specific implementation process, the selection operations of max and min in the formula are as follows: First, define two global variable arrays max and min to store the maximum and minimum pixel values of a preset number of image frames. During the process of processing each frame of the preset number of images, the maximum and minimum values in each frame are added to the corresponding global arrays and then the average value is taken. After actual tests and experiments, preferably, the preset number is set to 1000 here. Such an operation can effectively avoid problems in the normalization result caused by sudden overexposure or underexposure in the video, and solve the problem of sudden brightness changes after image enhancement.
[0084] Furthermore, the calculation formula for extracting the Laplacian of Gaussian operator of the normalized image matrix is as follows:
[0085] G[i] = log(1 + v * R[i]) / log(v + 1)
[0086] Wherein, G[i] is the optimized image matrix corresponding to the i-th frame of image, log is the Laplacian of Gaussian operator extraction function, R[i] is the normalized image matrix corresponding to the i-th frame of image, v is a fixed parameter, and i is an integer.
[0087] It should be noted that G[i] is the matrix of the corresponding image frame further optimized after extracting the Laplacian of Gaussian operator, and the brightness of the corresponding image frame can be effectively improved, which is helpful for subsequent image enhancement processing. Preferably, the fixed parameter v here is set to 10. Obviously, by optimizing the normalized image matrix by extracting the Laplacian of Gaussian operator, the image enhancement ability can be effectively improved.
[0088] Specifically, the image frames in the optimized image matrix are divided into blocks, and processed in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix, including the following specific steps:
[0089] The image frames in the optimized image matrix are uniformly divided into blocks to obtain unit image blocks;
[0090] The unit image blocks are processed by the histogram equalization algorithm to obtain optimized image blocks;
[0091] According to the distribution of the optimized image blocks, the pixels of the optimized image blocks are determined respectively through gray mapping, linear interpolation and bilinear interpolation algorithms to obtain an enhanced image matrix.
[0092] It should be noted that when uniformly partitioning the image frames in the optimized image matrix, the data of the row index and column index during partitioning can be determined according to the size information of the image frame and the number of partitions, and finally, uniform partitioning is performed to obtain unit image blocks. Preferably, the number of partitions here is 4x4. Histogram equalization is to enhance the contrast by adjusting the gray values using the cumulative distribution function, mainly changing the gray histogram of the original image from a relatively concentrated gray interval to a uniform distribution within the entire gray range. In the specific implementation process, when applying the histogram equalization algorithm, it is necessary to first calculate the histogram of the unit image block, then trim the histogram, and finally perform histogram equalization processing. The number of histograms is preferably 256. When performing the histogram equalization algorithm on the image frame by partitioning, since the histograms of each sub-block are different, the sub-blocks need to be equalized to obtain the equalized sub-block histograms. Since the histograms of each sub-block are different before and after equalization, the gray levels output by each sub-block change. If the result image is directly obtained according to the equalized histogram, at this time, the corresponding pixels only obtain the output result according to the gray transformation of the sub-block to which they belong, and block effects will appear between adjacent blocks. To address this, based on the histogram information of adjacent blocks, the bilinear interpolation algorithm can be used to determine the output pixels between adjacent blocks in a way of assigning weights without affecting the image enhancement effect. In the specific implementation process, to prevent discontinuity at the boundaries of each partition area obtained by partitioning the image frame, the present application combines the use of the bilinear interpolation algorithm and processes the pixels in the original image according to their distribution into three cases: the pixels in the four corner areas are gray-mapped according to the transformation function of the sub-graph where they are located; the pixels in the four side areas are linearly interpolated after being transformed according to the transformation functions of the two adjacent sub-graphs where they are located; the pixels in other areas are bilinearly interpolated after being transformed according to the transformation functions of the four adjacent sub-graphs where they are located. By combining the use of the bilinear interpolation algorithm, the efficiency of the entire image enhancement processing can be effectively improved.
[0093] Further, processing the unit image block through the histogram equalization algorithm to obtain an optimized image block includes the following specific steps:
[0094] Calculate the histogram of the unit image block;
[0095] Crop the histogram according to a threshold to obtain a cropped histogram;
[0096] Perform equalization processing on the cropped histogram to obtain an optimized image block.
[0097] It should be noted that when calculating the histogram of a unit image block, common calculation methods can be used. Specifically, the maximum and minimum values of the grayscale value data of the unit image block can be calculated first to obtain the range, that is, the maximum value of the data minus the minimum value; determine the number of groups of the histogram, and then calculate the ratio between the range and the number of groups to obtain the width of each group of the histogram, that is, the group distance; determine the boundary values of each group, and include all the data when grouping; count the frequencies of each group to finally obtain the required histogram. After calculating the histogram, the histogram can be further cropped. Preferably, the threshold for the histogram distribution is 0.01. Crop the distribution exceeding the threshold to obtain a cropped histogram. Further, the cropped part is evenly dispersed onto the probability density distribution to limit the increase amplitude of the transfer function (cumulative histogram), thereby realizing the equalization processing of the cropped histogram to obtain an optimized image block. The cumulative histogram represents the cumulative probability distribution of the image components at the gray level, and each probability value represents the probability less than or equal to this gray level. The contrast amplification around the specified pixel value is mainly determined by the slope of the transfer function. This slope is proportional to the slope of the cumulative histogram of the region. By cropping the histogram with a predefined threshold, the purpose of limiting the amplification amplitude can be achieved. By limiting the slope of the cumulative histogram function, the slope of the transfer function can be correspondingly limited. Obviously, by setting a threshold to crop the histogram and performing corresponding equalization processing, the image enhancement effect can be effectively improved.
[0098] S500: Output the enhanced image matrix as a visible image.
[0099] It can be understood that the bit depth of a general visible image is 8, that is, the number of color discrimination levels is 8 bit. The visible image here can be understood as a general image or video. The enhanced image matrix in this application can ultimately be output as an observable 8-bit image or video through simple data conversion. These visible images output in the form of 8-bit images or videos can directly observe the effect after image enhancement on a computer.
[0100] It should be pointed out that this application can adapt to images in different scenarios and has a good enhancement effect. It can effectively handle the problems of too high brightness and image whitening in video images, has a good brightening effect for too dark scenarios, and can significantly enhance the image details in various scenarios. This application can also be directly adapted to existing infrared camera devices to process and feedback results in real time.
[0101] Please refer to Figure 2 , this application also provides a video image enhancement processing device 100, including:
[0102] An input module 11, configured to input a video to be processed;
[0103] A storage transfer module 12, configured to store and transfer image frames in the video to be processed, so as to obtain an array to be processed;
[0104] A conversion module 13, configured to convert the array to be processed, so as to obtain a matrix to be processed;
[0105] An image enhancement module 14, configured to process the matrix to be processed through an enhancement algorithm, so as to obtain an enhanced image matrix;
[0106] An output module 15, configured to output the enhanced image matrix as a visual image.
[0107] It should be noted that the video to be processed in the input module 11 can be video data in the format of a 12-bit raw image. Preferably, the video to be processed here is in the raw format of the original camera video. The extensions of RAW files generated by different cameras are generally different. The video to be processed here can be a video file recorded by an infrared device. The infrared device here can be an infrared camera. In a specific implementation process, the video to be processed can be read by calling a file reading function to complete the input operation of the video to be processed. It can be understood that the smallest unit that makes up a video is an image frame. When the transfer module 12 performs a transfer operation, it can split the video to be processed obtained from the input module 11 into image frames. In a specific implementation process, the video to be processed is transferred to an array in the form of image frames, and the final obtained array can be understood as the array to be processed here. When the video to be processed is a raw format video to be processed with 12-bit images, the parameters of the video to be processed read can be read into an array of uint16. It should be noted that when processing image frames of corresponding specifications in the video to be processed, preferably, the video data to be processed is opened in a read-only manner, and on this basis, the operation of reading image frames and transferring them to an array is performed. Opening the video data to be processed in a read-only manner can prevent the image data from being accidentally edited and reduce the impact on the final image quality. It should be noted that when the conversion module 13 converts the array to be processed into a matrix to be processed, the matrix to be processed needs to correspond to the array to be processed to ensure that the image data in the array to be processed can be correspondingly stored in the matrix to be processed. This conversion operation can be understood as reconstructing the array to be processed containing the data of the entire video to be processed into a corresponding matrix. It can be understood that when the image enhancement module 14 processes the matrix to be processed through an enhancement algorithm, it is necessary to perform an image enhancement operation on each frame of the video to be processed, that is, it is necessary to perform image enhancement processing on the matrix data corresponding to each frame of the image in the matrix to be processed. Specifically, the image data is first subjected to corresponding preprocessing, and then the enhanced processing of the core image details of the preprocessed image data is performed, and finally, the enhanced image matrix after the enhancement processing is obtained. It can be understood that the bit depth of a general visible image is 8, that is, the number of color discrimination levels is 8 bit. The visible image output by the output module 15 can be understood as a general image or video. The enhanced image matrix in this application can finally be output as an observable 8-bit image or video through simple data conversion. These visible images output in the form of 8-bit images or videos can directly observe the effect of image enhancement on a computer.
[0108] It should be noted that the video image enhancement processing device 100 can adapt to images in different scenarios and has a good enhancement effect. It can effectively handle the problems of too high brightness and image whitening in video images, has a good brightening effect for too dark scenarios, and can significantly enhance the image details in various scenarios. The video image enhancement processing device 100 can also be directly adapted to existing infrared camera devices to process and feedback results in real time.
[0109] The technical solutions provided by the embodiments of the present application have at least the following beneficial effects:
[0110] It is adapted to different application scenarios, can enhance the image details in different application scenarios, and has good real-time processing performance.
[0111] It should be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the said element.
[0112] The above are only the embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A video image enhancement processing method, characterized in that It includes the following specific steps: Input the video to be processed; Transfer and store the image frames in the video to be processed to obtain an array to be processed; Convert the array to be processed to obtain a matrix to be processed; Process the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix; Output the enhanced image matrix as a visible image; The step of transferring and storing the image frames in the video to be processed to obtain an array to be processed includes: Split the video to be processed into image frames, transfer and store the video to be processed in the form of image frames into an array, and the finally obtained array is the array to be processed; The step of converting the array to be processed to obtain a matrix to be processed includes the following specific steps: Obtain the array length of the array to be processed and the image size of the image frame; Calculate the number of video frames of the video to be processed according to the array length and the image size; Using the array length, the image size, the array to be processed, and the number of video frames as parameters, obtain a matrix to be processed through a matrix conversion function; The step of processing the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix includes the following specific steps: Normalize the matrix to be processed to obtain a normalized image matrix; Extract the Laplacian of Gaussian operator of the normalized image matrix to obtain an optimized image matrix; Divide the image frames in the optimized image matrix into blocks, and process them in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix.
2. The processing method according to claim 1, characterized in that, The calculation formula for the number of video frames is as follows: k = len / (Height * Width) Where k represents the number of video frames, len represents the array length, Height represents the length in the image size, and Width represents the width in the image size.
3. The processing method according to claim 1, wherein The calculation formula for the matrix to be processed is as follows: images = reshape(data, Width, Height, k) Where images represents the matrix to be processed, reshape is an array transformation function, data is the array to be processed storing image reading parameters, k represents the number of video frames, Height represents the length in the image size, and Width represents the width in the image size.
4. The processing method according to claim 3, characterized in that, The normalization calculation formula for the matrix to be processed is as follows: R[i] = (image[i] - min) / (max - min) Where R[i] is the normalized image matrix corresponding to the i-th frame image, image[i] is the matrix to be processed of the i-th frame image, and min and max respectively represent the minimum and maximum values of the pixel points in the matrix.
5. The processing method according to claim 3, characterized in that The calculation formula for extracting the Laplacian of Gaussian operator of the normalized image matrix is as follows: G[i] = log(1 + v * R[i]) / log(v + 1) Where log is the Laplacian of Gaussian operator extraction function, R[i] is the normalized image matrix corresponding to the i-th frame image, and v is a fixed parameter.
6. The processing method according to claim 3, characterized in that, The step of dividing the image frames in the optimized image matrix into blocks and processing them in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix includes the following specific steps: Perform uniform block processing on the image frames in the optimized image matrix to obtain unit image blocks; Process the unit image block through the histogram equalization algorithm to obtain an optimized image block; According to the distribution of the optimized image block, determine the pixels of the optimized image block through gray mapping, linear interpolation, and bilinear interpolation algorithms respectively to obtain an enhanced image matrix.
7. The processing method according to claim 6, wherein Processing the unit image block through the histogram equalization algorithm to obtain an optimized image block includes the following specific steps: Calculate the histogram of the unit image block; Crop the histogram according to a threshold to obtain a cropped histogram; Perform equalization processing on the cropped histogram to obtain an optimized image block.
8. A video image enhancement processing device, characterized in that, Including: An input module for inputting a video to be processed; A transfer storage module for transferring and storing the image frames in the video to be processed to obtain an array to be processed; A conversion module for converting the array to be processed to obtain a matrix to be processed; An image enhancement module for processing the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix; An output module for outputting the enhanced image matrix as a visible image; The transferring and storing the image frames in the video to be processed to obtain an array to be processed includes: Split the video to be processed into image frames, transfer and store the video to be processed in the form of image frames into an array, and the finally obtained array is the array to be processed; Converting the array to be processed to obtain a matrix to be processed includes the following specific steps: Obtain the array length of the array to be processed and the image size of the image frame; Calculate the number of video frames of the video to be processed according to the array length and the image size; Using the array length, the image size, the array to be processed, and the number of video frames as parameters, obtain a matrix to be processed through a matrix conversion function; The processing the matrix to be processed through an enhancement algorithm to obtain an enhanced image matrix includes the following specific steps: Normalize the matrix to be processed to obtain a normalized image matrix; Extract the Laplacian of Gaussian operator of the normalized image matrix to obtain an optimized image matrix; Divide the image frames in the optimized image matrix into blocks, and process them in combination with the histogram equalization algorithm and the bilinear interpolation algorithm to obtain an enhanced image matrix.
Citation Information
Patent Citations
Method, apparatus and computer storage medium for augmenting reality
CN109509261A
Video watermark adding method and device, video watermark extracting method and device, equipment and storage medium
CN112040337A