Image low-distortion reversible contrast enhancement method based on RDH
Through the reversible contrast enhancement method of image low distortion based on RDH, the histogram specification and blur mean clustering algorithm are used to solve the problems of pixel displacement, overflow/underflow and global contrast enhancement, and the high-efficiency and low-distortion image contrast enhancement is achieved. and local features with outstanding effects.
Patent Information
- Application Number
- CN202411093343.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In the prior art, the image distortion, overflow and underflow risks caused by pixel displacement, the balance of data embedding efficiency and image distortion, and the problem of over-enhancement of images and poor visual effects caused by global contrast enhancement.
Using the reversible contrast enhancement method of image low distortion based on RDH, grayscale mapping is calculated through histogram prescriptive processing, data extraction and embedding is used using one-to-one and one-to-many grayscale mapping data structures, combined with the fuzzy mean clustering algorithm Perform local contrast enhancement, reduce pixel displacement and overflow/underflow, and improve embedding efficiency and image quality.
The contrast enhancement of extremely low distortion images is achieved, maintaining the natural feeling and visual effects of the image, avoiding excessive enhancement problems caused by global processing, and improving the recovery accuracy and image quality of embedded data.
Smart Images

Figure CN119205600A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image processing, and in particular to an image low-distortion reversible contrast enhancement method based on RDH. Background Art
[0002] In the field of image processing, the combination of reversible contrast enhancement (RCE) and reversible data hiding (RDH) has become a hot topic. These technologies are constantly improving, mainly focusing on enhancing contrast by adjusting the image histogram while ensuring the reversibility of information and ensuring that the original data of the image is not lost.
[0003] The RCE technique was first proposed by Wu et al., who realized the expansion of the image histogram in the entire grayscale range by improving the RDH scheme. The technique relies on the histogram shift method, which completes the data embedding by adjusting the grayscale of the image and creating gaps in the histogram.
[0004] There are two main aspects of adverse effects that may occur during reversible contrast enhancement, namely, excessive contrast enhancement leading to loss of image details and excessive image distortion caused by embedding restored data. Therefore, domestic and foreign scholars have conducted many studies in recent years. Some top domestic scholars have proposed a reversible data hiding technology that combines controlled contrast enhancement with integer wavelet transform, and sets a threshold to avoid excessive contrast enhancement. S. Kim et al. effectively avoided overflow or underflow problems by merging the displacement direction of the lowest bit and the adjacent bit. This strategy greatly reduces artifacts caused by preprocessing and intensity mismatch, but requires a position map to track the merging of pixels. Wu et al. made new breakthroughs in subsequent research and proposed a better bit merging selection method. In order to further enhance the naturalness of contrast enhancement, domestic and foreign scholars have also conducted a large number of related studies. For example, by combining local histogram selection with global brightness adjustment strategy, not only the image contrast is effectively improved, but also the original image is accurately restored, ensuring image enhancement while maintaining authenticity. In addition, bidirectional histogram expansion not only achieves effective contrast enhancement and higher information security, but also maintains the average brightness of the image, avoiding excessive processing of the image. By adaptively selecting histogram bins and using dual histogram shifting techniques, these methods effectively integrate the two functions of contrast enhancement and reversible data hiding, significantly improving the embedding capacity while ensuring the complete recovery of images and data. While ensuring the realization of reversible contrast, these technologies avoid excessive contrast enhancement caused by over-processing of the image, but they still have shortcomings in avoiding the introduction of large distortions while restoring data embedding.
[0005] Therefore, in order to reduce the distortion caused by data embedding, many scholars at home and abroad have done a lot of research on reversible data hiding (RDH). Inspired by the existing pairwise reversible data hiding (RDH) technology, a series of high-fidelity RDH schemes have been born. For example, an adaptive pixel pairing technology is introduced, which operates specifically on pixel pairs with similar prediction errors. This adaptive method increases the number of pixel pairs that can embed data at the same time and reduces the number of pixels that need to be shifted, thereby achieving a lower embedding bit rate. In addition, a new RDH scheme based on pixel value ordering (Pixel Value Ordering, PVO) significantly improves the fidelity and image quality during data embedding by optimizing the two-dimensional mapping selection through a novel predictor and self-learning mechanism. There is also a dual pairwise PEE (Prediction Error Expansion) strategy that significantly improves the balance between data embedding capacity and image quality by more effectively utilizing the correlation of errors. These schemes maintain low embedding distortion while improving image quality. It should be pointed out that the 2D method provides better image quality contrast enhancement than the 1D method while maintaining low embedding distortion. The above technologies have made significant breakthroughs in ensuring high-fidelity images during data embedding, but the performance of reducing distortion has reached its upper limit and is difficult to improve further.
[0006] Therefore, with the deepening of research, technicians proposed a direct RCE method. Unlike traditional RCE technology, it covers the entire dynamic range through image sharpening and adjustment to achieve global contrast improvement. The specific method is to process the part below the average grayscale value through linear mapping, adjust the lowest grayscale value to zero, and adjust the part above the average grayscale value through linear mapping so that the highest grayscale value reaches 255. Then, the relevant information of contrast enhancement and image sharpening is embedded through reversible data hiding technology (RDH). This simple linear adjustment method is particularly effective for images with low contrast. However, if the lowest grayscale value of the image itself is close to zero and the highest grayscale value is also close to 255, the effect of this contrast enhancement will be relatively limited. Subsequently, Zhang et al. proposed a similar bilinear stretch mapping scheme. This new scheme uses the median to replace the average grayscale level and improves the embedding bit rate through adaptive multi-bit prediction error extension (RDH) technology.
[0007] Based on the idea of the new RCE technology mentioned above, Dinu Coltuc et al. proposed an RCE technology that can ensure extremely low distortion. The technology is based on contrast enhancement. First, the global contrast of the image is enhanced, and then the data is embedded based on the histogram sparsity of the enhanced image. The embedding process uses the very low distortion (VLD) histogram shift RDH scheme designed for sparse histogram images. At the same time, the restored data sequence is encoded to further reduce the embedding distortion. The emergence of this technology not only achieves reversible contrast, but also ensures extremely low distortion of the image after embedding data. The fidelity performance achieved by this scheme far exceeds the currently proposed low-distortion RDH scheme, but the disadvantage is that the implementation of this technology is based on the improvement of global contrast. This method leads to excessive contrast enhancement in some areas of the image on some specific images, resulting in the loss of image details and thus affecting the visual effect of the image.
[0008] It can be seen that the prior art has the following problems:
[0009] (1) Image distortion caused by pixel displacement: In traditional RDH technology, data is embedded by moving pixels to the highest bin (peak). This method requires adjusting the pixel position, and this displacement may cause image quality degradation, especially in areas with rich details.
[0010] (2) Risk of overflow and underflow: In traditional methods, the adjustment of pixel values may cause pixel value overflow (exceeding the maximum grayscale value) or underflow (lower than the minimum grayscale value), which will cause irreversible information loss and image distortion.
[0011] (3) Balance between data embedding efficiency and image distortion: Traditional RDH methods may need to move multiple pixels over a large range in order to create enough space to embed data in the peak bin, which not only affects the embedding efficiency but may also increase the overall distortion of the image.
[0012] (4) In traditional contrast enhancement methods, global processing techniques are often used, which may lead to over-enhancement of certain areas of the image, affecting the visual effect and the naturalness of the image. In addition, global methods are not effective in processing images with complex brightness distribution and cannot effectively highlight the local features of the image. Summary of the invention
[0013] The object of the present invention is to provide a low-distortion reversible contrast enhancement method for images based on RDH, so as to reduce the distortion of images caused by embedding recovery data in the traditional reversible contrast technology.
[0014] The technical solution adopted by the present invention is:
[0015] The method for low-distortion reversible contrast enhancement of an image based on RDH comprises the following steps:
[0016] Step 1, the original image is subjected to histogram normalization processing to calculate a contrast-enhanced grayscale map;
[0017] Step 2, transforming the original image according to the gray level mapping to obtain a global enhanced image;
[0018] Step 3, according to the gray level mapping, respectively calculate the inverse one-to-one and one-to-many gray level mapping data structures A and B, where the data structure A is a structure containing L α The data structure Β is a table containing l entries, mapping the actual grayscale to the original grayscale. β A structure of entries that associates each actual grayscale with a compressed list of corresponding original grayscales;
[0019] Specifically, the contrast enhancement method uses the histogram specification. The histogram specification cannot distinguish pixels with the same gray level. Let i, j be the gray levels of the original image and the transformed image respectively. There are basically two cases: one-to-one gray level transformation i→j, or many-to-one transformation {i1,i2,…,i k}→j, where k>1 and i j is i1≤i j ≤i k The one-to-one transformation is inverted at the expense of storing the corresponding grayscale pairs (i, j). The one-to-many transformation requires keeping a list of the original grayscales for each j. The transformed image is scanned, and whenever a pixel with grayscale j is encountered, its original grayscale i is j will be recorded in the corresponding list. Let L α ,L β The information required to restore the original image includes two data structures, A and B. Data structure A is a structure containing L α The data structure Β is a table containing L entries, mapping the actual grayscale to the original grayscale. β The structure of 10 entries associates each actual grayscale with a compressed list of the corresponding original grayscales.
[0020] Step 4, extracting global restored data information from the original image using data structures A and B;
[0021] Step 5, using the global recovery data information as embedded data to perform variable-length encoding;
[0022] Step 6, embed the encoded recovery data into the global enhanced image to obtain a reversible global contrast enhanced image. This step uses the peak and zero point selection method introduced above. At the end of this process, a graph containing p pairs (zk ,p k ). Further create a peak map M p For data embedding, data extraction is done using peak mapping M p Generate zero-point map M z , through M z Extract data structures A and B, and the list of decompressed B can be used to restore the global contrast enhanced image to the original image;
[0023] Step 7, using a fuzzy mean clustering algorithm to perform local contrast enhancement on the reversible global contrast enhanced image, thereby further obtaining a local contrast enhanced image;
[0024] Step 8: After the image is gray-scaled using the fuzzy mean clustering algorithm, the number of one-to-one mappings and many-to-one mappings L is converted to α and L β Recording, thereby extracting local restored data information from the reversible global contrast enhanced image, where the data can be used to restore the image with local contrast enhanced to the original image;
[0025] Step 9: embedding the local restored data information into the local contrast enhanced image to obtain a reversible local contrast enhanced image.
[0026] Further, the contrast-enhanced grayscale map is calculated by histogram equalization or histogram normalization in step 1. Specifically, in step 1, the original image is processed by exponential histogram normalization.
[0027] Furthermore, the variable-length encoding method of step 5 is to use different encoding methods for "1" and "0", that is, to transform "1" into "010" and transform "0" into "00" for encoding.
[0028] Furthermore, step 6 specifically includes the following steps:
[0029] Step 6-1, calculate the histogram of the enhanced image to generate the peak and zero point map M p , and calculate the maximum bit rate;
[0030] Step 6-2, by using M p to embed data;
[0031] Step 6-3, the required bit rate should ensure that the embedded data structure satisfies the following formula:
[0032]
[0033] Where |.| represents the bit size, N represents the total number of image pixels; A is a αΒ is a table containing L β The structure of 10 entries associates each actual grayscale with a compressed list of the corresponding original grayscale. p The size of the embedded data is stored in the reserved image area of the header. At the same time, the header file Parameter that should be added to store the data sequence extension.
[0034] Furthermore, the calculation steps of the maximum bit rate in step 6-1 are as follows:
[0035] Step 6-1-1, traverse the histogram H = {h0, h1, ..., h L} to find p pairs of adjacent zero and peak intervals (z k ,p k );
[0036] Step 6-1-2, based on p pairs of adjacent zero and peak intervals (z k ,p k ), create a peak map M p For data embedding and extraction; if h i is not selected as the peak bins, then M p (i) = 0; if h i is selected, then M p (i)≠0 indicates the position of the corresponding adjacent zero bins; if the corresponding zero bin is on i-1, then M p (i) = -1; if the zero bin is on i+1, then M p (i)=1.
[0037] Step 6-1-3, calculate the maximum bit rate guaranteed by pairing, the maximum bit rate calculation formula is as follows:
[0038]
[0039] in is the maximum number of pixels used for embedding; N is the total number of pixels; P represents the interval pair of adjacent zero values and peak values (z k ,p k ) number; z k represents the zero-value interval of the kth interval pair, p k Represents the peak interval of the kth interval pair.
[0040] Furthermore, the interval pair search method of step 6-1-1 is: determine the value h of the current interval i=0; if so, check the values of the two adjacent intervals; determine whether the value of only one adjacent interval is not zero; if so, take the corresponding non-zero adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, determine whether the values of the two adjacent intervals are both greater than zero; if so, check whether the value of the previous interval of the adjacent previous interval is zero; if so, take the adjacent previous interval as the peak interval and pair it with the previous interval of the adjacent interval to form an interval pair, and at the same time, take the adjacent subsequent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, the value of the previous interval of the adjacent previous interval is greater than zero, select the interval with the largest value of the adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair.
[0041] Specifically, if the current interval h i = 0, then check its two adjacent intervals. If only one of the intervals is non-zero (i.e. h i-1 or i+1 ), it is selected as the peak and paired with the current zero-value interval. If the values of both intervals are greater than zero, continue to check h i-2 If h i-2 =0, then select p k =h i+1 , and h i-1 will be with h i-2 Pairing. If h i-2 >0, that is, only one interval pair can be formed, then the maximum value p of the two intervals is selected k =max(h i-1 ,h i+1 ).
[0042] Furthermore, the specific steps of step 6-2 are:
[0043] Step 6-2-1, b i ,i=1,…,P is defined as the bit sequence to be embedded. The embedding process is: scan the image from left to right and from top to bottom, and check each pixel a;
[0044] Step 6-2-2 Determine M p (a) = 0; if so, skip the pixel; otherwise, execute step 4-2-3.
[0045] Step 6-2-3: Embed bit b i :If b i = 0, the pixel remains unchanged; if b i =1, the gray level of a will increase or decrease according to the corresponding zero bin position; b i The embedding of is expressed as follows:
[0046] A=a+bi M p (a), if M p (a)≠0 (7).
[0047] Step 6-2-4, data extraction and raw recovery are performed immediately. The pixels should be detected whether they belong to the selected peak-zero pair. If they belong to the selected bins, the embedded bits should be extracted (if it is a peak, then b i =0; if it is zero, then b i =1) and restore the original grayscale. p Create a zero point map M z , similar to the map of peaks:
[0048]
[0049] Step 6-2-5, the pixels are checked in the scanning order, and for each pixel A, the original gray level is restored as follows:
[0050] a=AM z (a) (9).
[0051] In step 6-2-6, the embedded data is extracted bit by bit from the selected memory cell.
[0052]
[0053] The only information required for detection is the pattern of peaks and the number of embedded bits.
[0054] Furthermore, the fuzzy mean clustering in step 7 specifically includes the following steps:
[0055] Step 7-1, initialize the membership matrix U with random numbers between 0 and 1 so as to satisfy the following constraint:
[0056]
[0057] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The degree of membership;
[0058] Step 7-2, calculate c cluster centers c i (i=1,…,c), the specific calculation formula is as follows:
[0059]
[0060] Step 7-3, calculate the objective function. When the value of the objective function is less than the set value, or the change in the value of the objective function relative to the previous objective function is less than the set threshold ε, the algorithm stops. The calculation formula of the objective function is as follows:
[0061]
[0062] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The membership degree of ||x is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering; i -c j || is x i To cluster center c j The Euclidean distance of .
[0063] Step 7-4, calculate and update the membership matrix U, and execute step 7-2; the update formula of the membership matrix U is as follows:
[0064]
[0065] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The membership degree of ||x is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering; i -c j || is x i To cluster center c h The Euclidean distance of .
[0066] The present invention adopts the above technical solution. In order to minimize the distortion introduced by pixel displacement and overflow / underflow control, the peak is selected by limiting the bit rate within the required range; the peak that provides embedding space without overflow / underflow control and / or pixel displacement is selected, and the sparsity of the histogram after the specification is selected; the empty histogram box is simply paired with the adjacent non-empty box, which eliminates the pixel displacement and overflow / underflow control and provides very low distortion. In order to further reduce the distortion caused by the embedded data, the embedded data is encoded, and fewer "1" bits are used to represent the same information, which is achieved by encoding the embedded data first and then embedding it. In order to prevent over-enhancement of certain areas of the image after global contrast enhancement, fuzzy mean clustering is used to divide the image into different areas, and appropriate local contrast enhancement techniques are applied to these areas. This helps to maintain the naturalness and visual effects of the image, while avoiding the problem of over-enhancement of certain areas that may be caused by global processing techniques. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments;
[0068] Figure 1 Schematic diagram of the principle of the RDH-based low-distortion reversible contrast enhancement method for images of the present invention;
[0069] Figure 2 This is a schematic diagram of the Kodak collection;
[0070] Figure 3 Schematic diagram showing the local contrast enhancement effect of different images;
[0071] Figure 4 It is a schematic diagram comparing the results of the experiment of the present invention with the global contrast enhancement map. Implementation
[0073] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0074] In order to reduce the distortion caused by embedding data, the scheme proposed in the present invention adopts the following two methods at the same time: (1) Selection of zero points and peaks during embedding: In order to minimize the distortion introduced by pixel displacement and overflow / underflow control, the improved RDH scheme selects peaks by limiting the bit rate to the required range. The proposed scheme selects peaks that provide embedding space without overflow / underflow control and / or pixel displacement. The selection is based on the sparsity of the specified post-histogram. The proposed method simply pairs empty histogram bins with adjacent non-empty bins. Since pixel displacement and overflow / underflow control are eliminated, very low distortion is provided. (2) Further reducing distortion through encoding: In order to further reduce the distortion caused by embedded data, the embedded data can be encoded. Since the size of the distortion is determined by the number of "1" bits in the embedded data. Therefore, if the same information can be represented with fewer "1" bits, the distortion will be reduced, which can be achieved by encoding the embedded data first and then embedding it.
[0075] In order to solve the problem that global methods are not effective in processing images with complex brightness distribution and cannot effectively highlight the local features of the image, the solution proposed in this invention adopts the following methods: (1) Introducing local contrast enhancement: In order to prevent over-enhancement of certain areas of the image after global contrast enhancement, fuzzy mean clustering is used to divide the image into different areas, and appropriate local contrast enhancement techniques are applied to these areas. This helps to maintain the naturalness and visual effect of the image, while avoiding the problem of over-enhancement of certain areas that may be caused by global processing techniques.
[0076] like Figures 1 to 4 As shown in one, the present invention discloses a low-distortion reversible contrast enhancement method for images based on RDH, comprising the following steps:
[0077] Step 1, the original image is subjected to histogram normalization processing to calculate a contrast-enhanced grayscale map;
[0078] Step 2, transforming the original image according to the gray level mapping to obtain a global enhanced image;
[0079] Step 3, according to the grayscale mapping, the data structures A and B of the inverted one-to-one and one-to-many grayscale mappings are calculated respectively; the contrast enhancement method adopts the histogram specification. The histogram specification cannot distinguish pixels with the same grayscale. Let i, j be the grayscale of the original image and the transformed image respectively. There are basically two cases: one-to-one grayscale transformation i→j, or many-to-one transformation {i1,i2,…,i k}→j, where k>1 and i j is i1≤i j ≤i k The one-to-one transformation is inverted at the expense of storing the corresponding grayscale pairs (i, j). The one-to-many transformation requires keeping a list of the original grayscales for each j. The transformed image is scanned, and whenever a pixel with grayscale j is encountered, its original grayscale i is j will be recorded in the corresponding list. Let L α ,L β The information required to restore the original image includes two data structures, Α and Β. Α is a structure containing L α Β is a table containing L β The structure of 10 entries associates each actual grayscale with a compressed list of the corresponding original grayscales.
[0080] Step 4, extracting global restored data information from the original image using data structures A and B, i.e. preparing data for original image restoration, which is obtained by respectively calculating and inverting the one-to-one and one-to-many grayscale mapping data structures A and B;
[0081] Step 5, using the global recovery data information as embedded data to perform variable-length encoding;
[0082] Step 6, embed the encoded recovery data into the global enhanced image to obtain a reversible global contrast enhanced image. This step uses the peak and zero point selection method introduced above. At the end of this process, a graph containing p pairs (z k ,p k ). Further create a peak map M pFor data embedding, data extraction is done using peak mapping M p Generate zero-point map M z , through M z Extract data structures A and B, and the list of decompressed B can be used to restore the global contrast enhanced image to the original image;
[0083] Step 7, using a fuzzy mean clustering algorithm to perform local contrast enhancement on the reversible global contrast enhanced image, thereby further obtaining a local contrast enhanced image;
[0084] Step 8: After the image is gray-scaled using the fuzzy mean clustering algorithm, the number of one-to-one mappings and many-to-one mappings L is converted to α and L β Recording, thereby extracting local restored data information from the reversible global contrast enhanced image, where the data can be used to restore the image with local contrast enhanced to the original image;
[0085] Step 9: embedding the local restored data information into the local contrast enhanced image to obtain a reversible local contrast enhanced image.
[0086] Further, the contrast-enhanced grayscale map is calculated by histogram equalization or histogram normalization in step 1. Specifically, in step 1, the original image is processed by exponential histogram normalization.
[0087] Furthermore, the variable-length encoding method of step 5 is to use different encoding methods for "1" and "0", that is, to transform "1" into "010" and transform "0" into "00" for encoding.
[0088] Furthermore, step 6 specifically includes the following steps:
[0089] Step 6-1, calculate the histogram of the enhanced image to generate the peak and zero point map M p , and calculate the maximum bit rate;
[0090] Step 6-2, by using M p to embed data;
[0091] Step 6-3, the required bit rate should ensure that the embedded data structure satisfies the following formula:
[0092]
[0093] Where |.| represents the bit size, N represents the total number of image pixels; A is a α Β is a table containing L βThe structure of 10 entries associates each actual grayscale with a compressed list of the corresponding original grayscale. p The size of the embedded data is stored in the reserved image area of the header. At the same time, the header file Parameter that should be added to store the data sequence extension.
[0094] Furthermore, the calculation steps of the maximum bit rate in step 6-1 are as follows:
[0095] Step 6-1-1, traverse the histogram H = {h0, h1, ..., h L} to find p pairs of adjacent zero and peak intervals (z k ,p k );
[0096] Step 6-1-2, based on p pairs of adjacent zero and peak intervals (z k ,p k ), create a peak map M p For data embedding and extraction; if h i is not selected as the peak bins, then M p (i) = 0; if h i is selected, then M p (i)≠0 indicates the position of the corresponding adjacent zero bins; if the corresponding zero bin is on i-1, then M p (i) = -1; if the zero bin is on i+1, then M p (i)=1.
[0097] Step 6-1-3, calculate the maximum bit rate guaranteed by the pairing, the maximum bit rate calculation formula is as follows:
[0098]
[0099] in is the maximum number of pixels used for embedding; N is the total number of pixels; P represents the interval pair of adjacent zero values and peak values (z k ,p k ) number; z k represents the zero-value interval of the kth interval pair, p k Represents the peak interval of the kth interval pair.
[0100] Furthermore, the interval pair search method of step 6-1-1 is: determine the value h of the current interval i=0; if so, check the values of the two adjacent intervals; determine whether the value of only one adjacent interval is not zero; if so, take the corresponding non-zero adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, determine whether the values of the two adjacent intervals are both greater than zero; if so, check whether the value of the previous interval of the adjacent previous interval is zero; if so, take the adjacent previous interval as the peak interval and pair it with the previous interval of the adjacent interval to form an interval pair, and at the same time, take the adjacent subsequent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, the value of the previous interval of the adjacent previous interval is greater than zero, select the interval with the largest value of the adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair.
[0101] Specifically, if the current interval h i = 0, then check its two adjacent intervals. If only one of the intervals is non-zero (i.e. h i-1 or i+1 ), it is selected as the peak and paired with the current zero-value interval. If the values of both intervals are greater than zero, continue to check h i-2 If h i-2 =0, then select p k =h i+1 , and h i-1 will be with h i-2 Pairing. If h i-2 >0, that is, only one interval pair can be formed, then the maximum value p of the two intervals is selected k =max(h i-1 ,h i+1 ).
[0102] Furthermore, the specific steps of step 6-2 are:
[0103] Step 6-2-1, b i ,i=1,…,P is defined as the bit sequence to be embedded. The embedding process is: scan the image from left to right and from top to bottom, and check each pixel a;
[0104] Step 6-2-2 Determine M p (a) = 0; if so, skip the pixel; otherwise, execute step 4-2-3.
[0105] Step 6-2-3: Embed bit b i :If b i = 0, the pixel remains unchanged; if b i =1, the gray level of a will increase or decrease according to the corresponding zero bin position; b i The embedding of is expressed as follows:
[0106] A=a+bi M p (a), if M p (a)≠0 (7).
[0107] Step 6-2-4, data extraction and raw recovery are performed immediately. The pixels should be detected whether they belong to the selected peak-zero pair. If they belong to the selected bins, the embedded bits should be extracted (if it is a peak, then b i =0; if it is zero, then b i =1) and restore the original grayscale. p Create a zero point map M z , similar to the map of peaks:
[0108]
[0109] Step 6-2-5, the pixels are checked in the scanning order, and for each pixel A, the original gray level is restored as follows:
[0110] a=AM z (a) (9).
[0111] In step 6-2-6, the embedded data is extracted bit by bit from the selected memory cell.
[0112]
[0113] The only information required for detection is the pattern of peaks and the number of embedded bits.
[0114] Furthermore, the fuzzy mean clustering in step 7 specifically includes the following steps:
[0115] Step 7-1, initialize the membership matrix U with random numbers between 0 and 1 so as to satisfy the following constraint:
[0116]
[0117] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The degree of membership;
[0118] Step 7-2, calculate c cluster centers c i (i=1,…,c), the specific calculation formula is as follows:
[0119]
[0120] Step 7-3, calculate the objective function. When the value of the objective function is less than the set value, or the change in the value of the objective function relative to the previous objective function is less than the set threshold ε, the algorithm stops. The calculation formula of the objective function is as follows:
[0121]
[0122] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The membership degree of ||x is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering; i -c j || is x i To cluster center c j The Euclidean distance of .
[0123] Step 7-4, calculate and update the membership matrix U, and execute step 7-2; the update formula of the membership matrix U is as follows:
[0124]
[0125] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The membership degree of ||x is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering; i -c h || is x i To cluster center c j The Euclidean distance of .
[0126] The specific principle of the present invention is described in detail below:
[0127] The technical solution of the present invention includes two main stages, contrast enhancement and extremely low distortion reversible data hiding. Contrast enhancement includes global contrast enhancement and local contrast enhancement. Global contrast enhancement is achieved by using classic histogram equalization / regulation, while local contrast enhancement is achieved by first performing fuzzy mean clustering on the globally enhanced image, and then using different contrast enhancement techniques on the clustered gray value blocks to improve the local contrast. After contrast enhancement, a reversible information hiding method is used to embed relevant information into the enhanced image to ensure that the receiving end can restore the original image and achieve reversible contrast enhancement.
[0128] The process of the contrast enhancement (CE) stage is as follows:
[0129] (1) Computing contrast-enhanced grayscale maps by histogram equalization or histogram normalization;
[0130] (2) transforming the image according to grayscale mapping;
[0131] (3) Prepare data for original image restoration: Calculate the data structures A and B for inverting the one-to-one and one-to-many grayscale mappings respectively.
[0132] (4) The present invention then uses the fuzzy mean clustering algorithm to perform local contrast enhancement on the enhanced image.
[0133] The RDH stage embeds the complete information of the image enhancement stage:
[0134] (1) Calculate the histogram of the enhanced image and generate the peak and zero point map M p , and evaluate the maximum bit rate according to formula (6);
[0135] (2) After discussing the selection of peak and zero points, by using M p to embed data.
[0136] (3) The required bit rate should ensure the data structure embedded in the CE map and the parameters required by the RDH algorithm.
[0137]
[0138] Here, |.| represents the bit size, and N represents the total number of image pixels. Parameter that should be added to store the data sequence extension.
[0139] (4) Two cases of fixed-length coding and variable-length coding for embedded data are discussed, and the performance of the two different coding methods in reducing distortion is evaluated.
[0140] (5) Restoration of the original image: extracting restoration information from the globally enhanced and locally enhanced images so that the image can be restored.
[0141] Enhancement of image contrast: The appearance of an image is mainly determined by the grayscale distribution of pixels. Therefore, the present invention generally improves the image contrast by changing the grayscale transformation of the image. This operation aimed at changing the grayscale distribution is called histogram normalization.
[0142] The histogram specification problem is usually solved in the framework of statistics. This framework provides an exact solution for the case of continuous images and an approximate solution for discrete images. In this framework, the image intensity is regarded as a continuous random variable (Random Variable, RV), and its characteristics are described by its probability density function (Probability Density Function, PDF). Under such a setting, given a random variable with a known distribution, the present invention needs to find a transformation so that the transformed random variable has a specific PDF.
[0143] Histogram equalization: A well-known example of histogram regulation is histogram equalization, which aims to modify pixels to ensure a uniform distribution of gray levels. In other words, histogram equalization distributes the pixels across the entire grayscale range and assigns an equal number of pixels to each gray level. After histogram equalization, the contrast of black and white images is improved and the grayscale distribution becomes more evenly distributed.
[0144] In the case of histogram equalization, let r be a continuous random variable (RV) with values in the range [0,1], and p r (r) is its probability density function (PDF). Let is the cumulative distribution function (CDF) of r. If T(r) is strictly increasing, the random variable z=T(r) is uniformly distributed. Given a continuous grayscale image f with a value range of [0,L], let f / L be the random variable r. The random variable z obtained in the above way is uniformly distributed on [0,1], and L×z is uniformly distributed on [0,L]. Therefore, the transformation r→L×T(r) can achieve the equalization of the grayscale image.
[0145] The discrete version of the statistical method is directly converted to use the image histogram and cumulative histogram instead of the probability density function (PDF) and cumulative distribution function (CDF). The transformation r→L×T(r) becomes:
[0146]
[0147] in is the largest integer not exceeding x, r = 0, ..., L, h i ,i=0,…,L is the histogram of the original image.
[0148] According to formula (4), histogram equalization becomes a simple grayscale mapping. The histogram is stretched to the entire grayscale range, continuous data segments are merged together, and the data segments are usually placed in the histogram flattening. Histogram equalization enhances image contrast and makes the details of dark or bright areas in the original image visible.
[0149] Gaussian histogram normalization and exponential histogram normalization: Histogram normalization generalizes the case of histogram equalization. As mentioned above, consider the continuous case. Let r be the original random variable (RV) and u be a random variable with the expected probability density function p u (u). Let T and G be the cumulative distribution functions (CDFs) of r and u, respectively, and assume, as before, that T and G are strictly increasing. Also let z = T(r) and v = G(u). Since z and v are uniformly distributed on [0,1], v = z, and therefore u = G -1 (z) = G -1 (T(r)). Therefore, G -1 (T) Map the given r to a vector with probability density function p u (u). In the discrete case, since the cumulative distribution functions are equal, there is the following mapping:
[0150]
[0151] Where 0≤r,u≤L, and g i is a specified histogram. This study uses Gaussian histogram specification and exponential histogram specification. This is achieved by calculating the pixel mapping that minimizes the difference in the cumulative distribution of the two histograms. Specifically, for each original gray level r, the formula finds a target gray level u such that the absolute value of the difference between the original histogram accumulation up to r and the target histogram accumulation up to u is minimized.
[0152] Histogram equalization is a special form of histogram normalization. The typical application of these two methods is to enhance image contrast.
[0153] Since histogram equalization may over-enhance contrast, histogram regularization may achieve better results. For example, you may consider using a Gaussian histogram or an exponential histogram instead of a uniform histogram for regularization. By using a Gaussian histogram, contrast and brightness can be easily controlled by adjusting σ and μ. For example, histogram equalization that preserves brightness can be immediately solved by increasing only σ, while μ is set to the average gray level of the image.
[0154] In addition to the histograms mentioned above, exponential histograms can also be considered. This is because the human visual system has a logarithmic response. In fact, the balance of perceived grayscale should require a super-arc distribution of image grayscale rather than a uniform distribution. Using these histograms for regulation can achieve better visual effects.
[0155] Selection of zeros and peaks and embedding of data: To minimize the distortion introduced by pixel shift and overflow / underflow control, the improved RDH scheme selects peaks by limiting the bit rate to the required range. The proposed scheme selects peaks that provide embedding space without overflow / underflow control and / or pixel shift. The selection is based on the sparsity of the post-specified histogram. The proposed method simply pairs the empty histogram bins with the adjacent non-empty bins. Very low distortion is provided due to the elimination of pixel shift and overflow / underflow control.
[0156] The selection of zero and peak points is based on the following method. L} is defined as the histogram of the contrast-enhanced image. H is traversed interval by interval to find the adjacent zero-value and peak interval pairs (z k ,p k ). The pairing process starts from the right end of the histogram. If the current interval h i = 0, then check its two adjacent intervals. If only one of the intervals is non-zero (i.e. h i-1 or i+1 ), it is selected as the peak and paired with the current zero-value interval. If the values of both intervals are greater than zero, continue to check h i-2 If h i-2 =0, then select p k =h i+1 , and h i-1 will be with h i-2 Pairing. If h i-2 >0, that is, only one interval pair can be formed, then the maximum value p of the two intervals is selected k =max(h i-1 ,h i+1 ).
[0157] At the end of this process, we will get a list containing p pairs (z k ,p k ). Further create a peak map M p Used for data embedding and extraction. This map contains L+1 elements. If h i is not selected as the peak bins, then M p (i) = 0. If h i is selected, then M p (i)≠0 indicates the location of the corresponding adjacent zero bins. Therefore, if the corresponding zero bin is on i-1, then M p (i) = -1, if the zero bin is on i+1, then M p (i)=1.
[0158] At the end of this process, we will get a list containing p pairs (z k,p k ). Further create a peak map M p Used for data embedding and extraction. This map contains L+1 elements. If h i If M is not selected as the peak bin, p (i) = 0. If h i is selected, then M p (i)≠0 indicates the position of the corresponding adjacent zero bin. Therefore, if the corresponding zero bin is on i-1, then M p (i) = -1, if the zero bin is on i+1, then M p (i)=1.
[0159] Let N be the total number of pixels. Pairing ensures maximum bitrate:
[0160]
[0161] in is the maximum number of pixels to use for embedding.
[0162] b i , i=1,…,P is defined as the bit sequence to be embedded. The embedding process is as follows. Scan the image from left to right and from top to bottom and check each pixel a. If M p (a) = 0, then skip the pixel; otherwise embed bit b i If b i = 0, the pixel remains unchanged. i =1, then the gray level of a will increase or decrease according to the corresponding zero bin position. i The embedding of can be expressed as an equation:
[0163] A=a+b i M p (a), if M p (a)≠0 (7)
[0164] Data extraction and raw restoration are done at once. Pixels should be detected whether they belong to the selected peak-zero pair. If they belong to the selected bins, the embedded bits should be extracted (if peak, then b i =0; if it is zero, then b i =1) and restore the original grayscale. Let the present invention first create a zero point map M z , similar to the map of peaks:
[0165]
[0166] The pixels are checked in scanning order and for each pixel A, the original gray level is restored as follows:
[0167] a=AM z (a) (9)
[0168] The embedded data is extracted bit by bit from the selected memory cell.
[0169]
[0170] The only information required for detection is the peak map and the number of embedded bits. The zero bit map can be immediately derived from the peak map. p The size of the embedded data is stored in the reserved image area of the header. It is important to note that the amount of data required for detection is very low. This is because the proposed variable-length data hiding does not suffer from overflow or underflow.
[0171] A distortion of ±1 is introduced when embedding a "1" bit. This is the only distortion introduced by the proposed scheme. Since "1" and "0" are equally likely, the mean square error introduced when embedding P bits is 0.5P. Let B = P / N be the embedding bit rate, then the mean square error is 0.5B. In summary, the proposed scheme operates on the same mean square error as simple LSB replacement, and the embedding is reversible.
[0172] Multi-level embedding: To further increase the embeddable space of the data, after embedding the entire first-level available space, additional space can be obtained through a second-level embedding. As described above, the second stage of pairing is performed to create a new mapping. Then, embedding is performed according to equation (7) using the mapping generated by the new pairing.
[0173] The peak bins selected in the second stage come from the peaks or zeros selected in the first stage. The peak previously selected as the peak also has the "0" bit embedded. The distortion introduced by the second-stage embedding is at most ±1. The peak bins previously selected as the zero point contain pixels with the "1" bit embedded, that is, they have been distorted by ±1. For these pixels, the distortion introduced in the second stage is ±1 (embedded with "0") or ±2 (embedded with "1"). The maximum distortion caused at this time is only ±2. In order to ensure that the result after multi-stage embedding is still very low distortion, it is necessary to limit the pairing in the second stage to the previously selected peak.
[0174] The embedding of the second level provides less space than the first level: in the first level, the peak value is halved, and in addition, the number of selected pairs is reduced. On the other hand, with the embedding of the second level, it is possible to exceed 1bpp variable length data hiding (VLD RDH). This is easy to understand, since the bins h selected in both levels i Provided 3h i / 2 bits of space, that is, the first level provides h i The second level provides hi / 2 bits. Theoretically, the bit rate of VLD RDH is limited to 1.5bpp.
[0175] When a higher bit rate is needed, in addition to selecting all pairs at the second stage, one can continue with the third stage and so on. Each new level provides less space than the previous one. In addition, the maximum distortion increases by ±1 with the embedding level. Therefore, after s stages of embedding, the maximum distortion is ±s, i.e., the maximum squared error increases by s. 2 .
[0176] Restoration of the original image: Residual-based exact restoration technique: First, an approximate image matching the original histogram is restored. It is expected that this approximate image is visually indistinguishable from the original image. Next, the approximate image is modified to accurately restore the original image. Specifically, the difference between the original image and the approximate image is calculated. These difference values are then losslessly compressed and compared with the original histogram. Figure 1 The original image is restored by inversely embedding it into the enhanced image. Although the original histogram has a small amount of data, the compressed difference values are not. By using an accurate histogram regularization method instead of traditional methods, a slight data reduction can be achieved. By using accurate histogram regularization, a version very close to the original image is obtained after histogram equalization.
[0177] At the same time, the residual-based exact recovery technology is introduced, and a two-stage robust reversible watermark embedding process is used. In order to ensure the coexistence of robustness and reversibility, the robust watermark embedding stage is first implemented, and then the residual and necessary information are embedded through the reversible differential spread spectrum technology to achieve the reverse operation of the robust and reversible watermark. When the system is not attacked, this method shows both robustness and reversibility; when attacked, although the robust watermark can still be identified, the reversibility may be destroyed.
[0178] This method of restoring the original image is often used when global contrast enhancement and local contrast enhancement are used simultaneously in reversible contrast to ensure reversibility.
[0179] Mapping inversion: The method to restore the original image is to directly invert the mapping defined by equations (4) and (5). The histogram specification cannot distinguish pixels with the same grayscale. Let i, j be the grayscale of the original image and the transformed image, respectively. There are basically two cases: a one-to-one grayscale transformation i→j, or a many-to-one transformation {i1,i2,…,i k}→j, where k>1 and i j is i1≤i j ≤i k A collection of gray levels.
[0180] The one-to-one transformation is inverted at the expense of storing the corresponding grayscale pairs (i, j). The one-to-many transformation requires keeping a list of the original grayscales for each j. The transformed image is scanned, and whenever a pixel with grayscale j is encountered, its original grayscale i is j will be recorded in the corresponding list.
[0181] Let L α ,L β The information required to restore the original image includes two data structures, Α and Β. Α is a structure containing L α Β is a table containing L β The structure of 10 entries associates each actual grayscale with a compressed list of the corresponding original grayscales.
[0182] Encoding of embedded data: The distortion introduced by the reversible data hiding used strictly depends on the embedded data. The square error introduced by the algorithm is exactly the number of "1" bits. Therefore, in order to reduce distortion, the present invention should minimize the number of "1" bits in the embedded data, that is, the present invention needs to use fewer "1" bits to represent the same information. Since the data to be embedded is either encrypted or losslessly compressed, the number of "1" and "0" bits is roughly equal. Therefore, the present invention should select an appropriate encoding method to encode the embedded data to reduce the number of 1s.
[0183] Fixed-length coding: The data encoding process is based on the observation that if a bit string containing n bits contains k 1s, then its complement sequence contains nk 1s. Therefore, by embedding these bits or their complements, the number of bits and the implicit distortion are reduced. By adding a (n+1) th bits to ensure correct detection. Assume b1b2…b n is an n-bit sequence, for b i The number of 1s in each group of n bits is:
[0184]
[0185] The data sequence is split into disjoint groups of n bits, and each group is expanded to n+1 bits as follows:
[0186]
[0187] Therefore, for the entire sequence, we first study the division of the sequence into groups of n=2, and there are four cases: "00", "01", "10" and "11". The worst case is for the pair "11". By taking the complement code and extending the sequence to 3 bits, we get "11"→"001". The worst case is to encode with only one bit of "1" instead of two bits. The number of "1" in the other 3 cases does not change after expansion: "00"→"000", "01"→"010" and "10"→"100". By encoding the bit pair on three bits, there is at most one "1" in a group of 3 bits. On average, each bit has 3 / (4×3)=0.250, that is, one of the 4 bits is "1". By considering the bit pair, the number of "1" is halved, but the length of the data sequence is increased by 50%.
[0188] Variable-length coding: Similarly, the embedded data can also be encoded in a variable-length coding manner, which can be achieved by using different coding methods for "1" and "0". That is, "1"→"010", "0"→"00". After such encoding, each bit has 1 / 5=0.2, that is, one of the 5 bits is "1". It should be noted that after encoding in this variable-length manner, the present invention does not need to group the original data sequence into groups of n bits, and the encoding is directly based on each bit of the original data.
[0189] Although it has a lower number of "1", it also increases the length of the data sequence. In short, the distortion gain of the two coding methods is achieved at the cost of increasing the embedded bit rate.
[0190] Local contrast enhancement - Fuzzy C-means clustering algorithm: Fuzzy C-Means (FCM) is a commonly used clustering algorithm that allows a data point to belong to multiple cluster groups. The degree of belonging is expressed by membership or fuzziness. Unlike the traditional K-Means clustering algorithm, in which each data point can only belong to one cluster center, fuzzy mean clustering provides more flexible attribution methods for data points by introducing fuzzy set theory.
[0191] The core concept of fuzzy mean clustering: In fuzzy mean clustering, each data point is associated with each cluster center through a membership function, which indicates the degree to which the data point belongs to a cluster center. The membership value is between 0 and 1, and the sum of the membership of a data point to all cluster centers is equal to 1.
[0192] The goal of fuzzy mean clustering is to minimize the weighted sum of the distances between the cluster center and all the data points belonging to the cluster, where the weight is the degree of membership of the data point to the cluster.
[0193] The objective function is calculated as follows:
[0194]
[0195] Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The membership degree of m is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering. i -c j || is x i To cluster center c h Euclidean distance. Note that the objective function in the above should also satisfy the following constraints:
[0196]
[0197] Membership update formula:
[0198]
[0199] This formula is used to update the data point x i For all cluster centers c j The membership degree of x i The relative proximity of different cluster centers.
[0200] Cluster center update formula:
[0201]
[0202] Cluster center c j The position of is updated to reflect the center of the data points belonging to the cluster by considering the weighted average of all data points (the weight is the mth power of the membership degree).
[0203] Implementation steps of fuzzy mean clustering (FCM):
[0204] The first step is to initialize the membership matrix U with random numbers between 0 and 1 so that it satisfies the constraints in equation (14).
[0205] The second step is to calculate c cluster centers c using formula (16) i (i=1,…,c).
[0206] The third step is to calculate the objective function according to formula (13). If it is less than a certain value, or the change in the value of the value function relative to the last time is less than a threshold ε, the algorithm stops.
[0207] Step 4: Use equation (15) to calculate the new U matrix. Return to step 2.
[0208] The above algorithm can also initialize the cluster centers first and then perform the iterative process.
[0209] Technical effect:
[0210] In order to evaluate the performance of this reversible contrast scheme, the following experiments will be used to verify the performance of the experiment. First, verify whether the new embedding method can achieve extremely low distortion. Take the use of exponential histogram for global contrast enhancement as an example. Study the similarity of the image before and after embedding the restored data in this case. Secondly, study the effect of encoding the embedded data before embedding it on reducing distortion. Finally, introduce global contrast enhancement and local contrast enhancement at the same time to study the gain of this reversible contrast scheme for further enhancing the image contrast, and whether it has a better visual effect of light and dark details.
[0211] The experimental subjects used the grayscale version of the Kodak set, e.g. Figure 1 As shown. The Kodak collection consists of 24 full-color images of size 512x768. The grayscale version of the full-color image is calculated by the weighted average of the three color channels, i.e. 0.2126R+0.7152G+0.0722B. Kodak01 - Grayscale version of Kodak24: from left to right, from top to bottom.
[0212] Performance analysis of exponential histogram regulation: In order to verify the superiority of exponential histogram regulation, a set of comparative experiments are first conducted to compare the exponential histogram regulation with the Gaussian histogram regulation.
[0213] The histogram adjusted according to the exponential distribution is mainly based on the total number of pixels P of the image and the mean value μ of the exponential distribution. In this function, the mean value μ is used to calculate the rate parameter λ of the distribution, that is, λ = 1 / μ, and is applied to the formula f(x) = λe -λ To calculate the probability density of each gray level. Let μ o and μ e Represent the grayscale averages of the original image and the histogram equalized image, respectively. These probability densities are then multiplied by the total number of pixels P and rounded to get the expected number of pixels for each gray level. If the total number of pixels in the histogram does not match P, the function will adjust it by appropriately increasing or decreasing the number of pixels at certain gray levels to ensure that the total number of pixels matches accurately. This allows the histogram to reflect the characteristics of an exponential distribution.
[0214] Because the change of the exponential histogram is only affected by μ, in order to study the maximum embedding space B under the global regulation of the exponential histogram, max And the change of PSNR after embedding data. By specifying an average value for σ To reduce the contrast, two experiments can be considered according to the difference of μ. The first experiment keeps the brightness of the original image μ = μ o The second experiment is μ=μ e The purpose is to maintain the brightness of the histogram equalized image version. The following is a performance comparison study of different parameters for the image grayscale average value under three different conditions. It should also be noted that the B in the following data max It is calculated using the secondary embedding, which contains two layers of embedding space. The specific data are shown in Table 1.
[0215] Table 1 Performance comparison of index histogram under different parameters
[0216]
[0217]
[0218] From the data in the table above, it can be clearly seen that under the same parameters, this selection of zero point and peak value is extremely superior, which ensures extremely low distortion after embedding the recovered data. The average PSNR of the recovered data embedded in the exponential histogram under these two conditions is 56.50dB and 56.79dB respectively, which is very close to the Gaussian histogram. However, under the exponential histogram, B max is significantly larger than the Gaussian histogram normalized B max Under two parameters, B max The difference is 0.04bpp and 0.07bpp respectively, which is a significant gain for the embedding space, with an improvement of 5% to 10%. This shows that compared with Gaussian histogram normalization, exponential histogram normalization has better embedding performance advantages.
[0219] The variable length coding proposed by the present invention has a gain on the image signal-to-noise ratio. The coding method adopted by the present invention is variable length coding. In order to study the performance of the variable length coding method, the present invention compares the performance shown by the traditional fixed length coding. After encoding the embedded data using these two coding methods, the effect of reducing distortion is compared. The specific coding will be described in the specific implementation method. Let μ o ,σ o and μ e ,σ e Represent the grayscale mean and standard deviation of the original image and the histogram equalization image respectively. This study performs global contrast enhancement in four different situations, namely histogram equalization, Gaussian histogram specification, and parameter specification σ=(σ o +σ e ) / 2, μ is equal to μ o and μ eand μ = μ e After global contrast enhancement is performed in these ways, the collected recovery data is encoded in different ways to obtain a new PSNR index. The specific data is shown in Table 2.
[0220] Table 2. Gains of PSNR for different encoding methods
[0221]
[0222] The table above records the PSNR gain of encoding in different situations in detail. After encoding the embedded data using fixed-length coding with n=2, the PSNR of histogram equalization increased from 58.66dB to 60.62dB, while the PSNR of Gaussian histogram normalization under two parameters increased from 57.14dB and 57.15dB to 59.18dB and 57.17dB respectively. For exponential histogram normalization, compared with the data in Table 1, the PSNR increased from 56.79dB to 59.28dB. To summarize the encoding of these four situations using traditional fixed-length codes with n=2, the PSNR has an average gain of 2.13dB.
[0223] Further research on the PSNR gain under the variable length coding method shows that the gain is greater than that under the fixed length coding method with n = 2. From the last row in Table 2, it can be seen that in the four cases, the gain of variable length coding over fixed length coding is 0.98dB, 0.97dB, 1.02dB, and 0.97dB respectively. On average, the gain of variable length coding over fixed length coding with n = 2 is 0.985dB.
[0224] In order to ensure the comparability of the data, different global contrast enhancement techniques and the same local contrast enhancement parameter settings are used. At this time, 16 categories are clustered at the same time, and gamma correction is used for the 5th category with a gamma correction value of 0.5. Kodak03, Kodak04, Kodak11, Kodak17, and Kodak18 are used as experimental objects, and the data of RCE, RMBE and PSNR are recorded in Table 3.
[0225] The RCE index usually refers to the performance index of reversible contrast enhancement. This index is used to evaluate the improvement of image quality after reversible contrast enhancement. Specifically, the RCE index involves the contrast enhancement effect and the ability to retain image details, as well as the reversibility of the enhancement process.
[0226]
[0227] As shown in formula (1), the calculation of RCE uses the standard deviation (Std.) of the image and the number of gray levels "L". Since the quantitative value of each evaluation index is fixed between 0 and 1 in this study, a constant 0.5 is added to the formula to achieve the required range. When the image contrast reaches the optimal level, RCE = 1; if RCE is equal to 0.5, the image contrast is not enhanced. When the image contrast decreases, RCE is less than 0.5, otherwise it is greater than 0.5.
[0228] RMBE, the full name of which is "Reversible Mean Brightness Error", is an indicator that evaluates the brightness preservation performance during image processing. In image processing, it is very important to maintain the original visual properties of the image, especially when additional data needs to be embedded into the image (such as watermarks or other information). RMBE focuses on the deviation between the average brightness of the processed image and the average brightness of the original image, which is a key link to ensure that the image quality is not significantly changed.
[0229]
[0230] The RMBE formula is equation (2), where M original Represents the average brightness of the original image, M new represents the average brightness of the image to be tested, and L represents the maximum grayscale level. When the average brightness of the contrast-enhanced image remains unchanged, RMBE is 1, but the greater the difference in average brightness between the original image and the enhanced image, the closer RMBE is to zero.
[0231] Table 3 Record of various parameter indicators for introducing local contrast enhancement
[0232]
[0233] From the data in the table above, it can be seen that after using different global contrast enhancement techniques to enhance the global contrast of an image, the contrast of the image will also be enhanced to varying degrees by introducing the same local contrast enhancement technique. Figure 2 The local contrast enhancement (first column) after histogram equalization for Kodak03 (first row), Kodak04 (second row), Kodak11 (third row), Kodak17 (fourth row) and Kodak18 (fifth row) with μ o Local contrast enhancement after Gaussian histogram normalization (second column), with μ e The local contrast enhancement after Gaussian histogram normalization (third column) and the e The exponential histogram normalized version of the local contrast enhancement (fourth column).
[0234] At the same time, by comparing the data, it can be concluded that the local contrast enhancement under this parameter should be the best based on the Gaussian histogram σ=(σ o +σ e ) / 2, μ=μ e , RCE can reach 0.53, and in terms of image brightness, the best performance is the exponential histogram normalization, with an RMBE of 0.989, and the visual effect is almost the same as that of the image without local contrast enhancement in terms of brightness. However, it should be pointed out that while this method improves the contrast, it also leads to further modification of the image. The PSNR after embedding has a 4.1dB attenuation under the local contrast enhancement of this parameter.
[0235] This experiment shows that after performing global contrast enhancement on a specified image, the present invention can perform further operations to modify the image to achieve the purpose of local contrast enhancement, enhance the light and dark details of the image, and then use precise restoration technology based on residuals to ensure the reversibility of the overall algorithm.
[0236] In order to intuitively see the effect of the present invention, Figure 3 In the equation, for σ=(σ o +σ e ) / 2, μ=μ e The Gaussian histogram normalization under the condition is compared with the effect presented by the scheme of the present invention under the parameter in the figure. Kodak03, Kodak04, Kodak11, Kodak17 and Kodak18 are still taken as experimental objects. It can be seen that the result image formed by the scheme described in the present invention has more advantages in local contrast, richer light and dark details and better visual effect.
[0237] The present invention adopts the above technology and has the following technical characteristics: the traditional reversible contrast enhancement technology is often a global contrast enhancement, which may also lead to the loss of some details of the image. The present invention also proposes a solution to this problem by introducing local contrast enhancement. Finally, the superiority of the present invention in solving these two problems is verified through experiments.
[0238] Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians of the art without making creative work are within the scope of protection of the present application.
Claims
1. A low-distortion reversible contrast enhancement method for images based on RDH, characterized by: It includes the following steps: Step 1, the original image is subjected to histogram normalization processing to calculate a contrast-enhanced grayscale map; Step 2, transforming the original image according to the gray level mapping to obtain a global enhanced image; Step 3, according to the gray level mapping, respectively calculate the inverse data structures A and B of the one-to-one and one-to-many gray level mappings; the data structure A is a structure containing L α A table of entries that maps the actual grayscale to the original grayscale; The data structure Β is a β A structure of entries that associates each actual grayscale with a compressed list of corresponding original grayscales; Step 4, extracting global restored data information from the original image using data structures A and B, i.e. preparing data for original image restoration, obtained by respectively calculating and inverting the one-to-one and one-to-many grayscale mapping data structures A and B; Step 5, using the global recovery data information as embedded data to perform variable-length encoding; Step 6: embed the encoded recovery data into the global enhanced image to obtain a reversible global contrast enhanced image, and use the peak and zero point selection method to obtain a set of p pairs (z k ,p k ) Create a peak map M p For data embedding, data extraction is done using peak mapping M p Zero-point mapping M z , through M z Extract data structures A and B, and decompress the list of B to restore the image with global contrast enhancement to the original image; Step 7, using a fuzzy mean clustering algorithm to perform local contrast enhancement on the reversible global contrast enhanced image, thereby further obtaining a local contrast enhanced image; Step 8: After the image is gray-scaled using the fuzzy mean clustering algorithm, the number of one-to-one mappings and many-to-one mappings L is converted to α and l β Recording, thereby extracting local restoration data information from the reversible global contrast enhanced image, and restoring the image with local contrast enhancement to the original image; Step 9: embedding the local restored data information into the local contrast enhanced image to obtain a reversible local contrast enhanced image.
2. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 1, characterized in that: In step 1, a contrast-enhanced grayscale map is calculated by histogram equalization or histogram normalization.
3. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 2, characterized in that: In step 1, the original image is processed by exponential histogram normalization.
4. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 1, characterized in that: The variable-length encoding method of step 5 is to use different encoding methods for "1" and "0", that is, to transform "1" into "010" and transform "0" into "00" for encoding.
5. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 1, characterized in that: Step 6 specifically includes the following steps: Step 6-1, calculate the histogram of the enhanced image to generate the peak and zero point map M p , and calculate the maximum bit rate; Step 6-2, by using M p to embed data; Step 6-3, the required bit rate should ensure that the embedded data structure satisfies the following formula: Where |.| represents the bit size, N represents the total number of image pixels; A is a α Entries table, mapping the actual grayscale to the original grayscale; Β is a table containing L β The structure of entries associates each actual grayscale with a compressed list of corresponding original grayscales; the peak map M p The size of the embedded data is stored in the reserved image area of the header. At the same time, the header file Parameters added to store extended data sequences.
6. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 5, characterized in that: The maximum bit rate calculation steps in step 6-1 are as follows: Step 6-1-1, traverse the histogram H = {h0, h1, ..., h L } to find p pairs of adjacent zero and peak intervals (z k ,p k ); Step 6-1-2, based on p pairs of adjacent zero and peak intervals (z k ,p k ), create a peak map M p For data embedding and extraction; if h i is not selected as the peak bins, then M p (i) = 0; if h i is selected, then M p (i)≠0 indicates the position of the corresponding adjacent zero bins; if the corresponding zero bin is on i-1, then M p (i) = -1; If the zero bin is at i+1, then M p (i) = 1; Step 6-1-3, calculate the maximum bit rate guaranteed by pairing, the maximum bit rate calculation formula is as follows: in is the maximum number of pixels used for embedding; N is the total number of pixels; P represents the interval pair of adjacent zero values and peak values (z k ,p k ) number; z k represents the zero-value interval of the kth interval pair, p k Represents the peak interval of the kth interval pair.
7. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 6, characterized in that: The interval pair search method in step 6-1-1 is: determine the value h of the current interval i = 0; if so, check the values of two adjacent intervals; Determine whether the value of only one adjacent interval is not zero; if so, take the corresponding non-zero adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, determine whether the values of both adjacent intervals are greater than zero; if so, check whether the value of the previous interval of the adjacent previous interval is zero; if so, take the adjacent previous interval as the peak interval and pair it with the previous interval of the adjacent interval to form an interval pair, and at the same time take the adjacent subsequent interval as the peak interval and pair it with the current zero-value interval to form an interval pair; otherwise, the value of the previous interval of the adjacent previous interval is greater than zero, select the interval with the largest value of the adjacent interval as the peak interval and pair it with the current zero-value interval to form an interval pair.
8. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 5, characterized in that: The specific steps of step 6-2 are: Step 6-2-1, b i ,i=1,…,P is defined as the bit sequence to be embedded. The embedding process is: scan the image from left to right and from top to bottom, and check each pixel a; Step 6-2-2, determine M p (a) = 0; if so, skip the pixel; otherwise, execute step 4-2-3. Step 6-2-3, embed bit b i :If b i = 0, the pixel remains unchanged; if b i =1, the gray level of a will increase or decrease according to the corresponding zero bin position; b i The embedding of is expressed as follows: A=a+b i M p (a),if M p (a)≠0 (7); Step 6-2-4, data extraction and raw restoration are performed immediately to detect whether the pixel belongs to the selected peak-zero pair; If it belongs to the selected bins, the embedded bit is extracted, that is, if it is a peak, then b i =0, if it is zero point, then b i =1; restore the original grayscale; use the peak map M p Create a zero point map M z : Step 6-2-5, the pixels are checked in the scanning order, and the original gray level of each pixel A is restored as follows: a=A-M z (a) (9); Step 6-2-6, the embedded data is extracted bit by bit from the selected storage unit, and the only information required for detection is the peak value pattern and the number of embedded bits; 9. The RDH-based low-distortion reversible contrast enhancement method for images according to claim 1, characterized in that: The fuzzy mean clustering in step 7 specifically includes the following steps: Step 7-1, initialize the membership matrix U with random numbers between 0 and 1 so as to satisfy the following constraint: Where n is the total number of data points, c is the total number of cluster centers, and u ij is the data point x i For cluster center c j The degree of membership; Step 7-2, calculate c cluster centers c i (i=1,…,c), the specific calculation formula is as follows: Step 7-3, calculate the objective function. When the value of the objective function is less than the set value, or the change in the value of the objective function relative to the previous objective function is less than the set threshold ε, the algorithm stops. The calculation formula of the objective function is as follows: Among them, m is a real number greater than 1, called the fuzzification parameter, which controls the fuzziness of the clustering; ||x i -c j || is x i To cluster center c j The Euclidean distance of Step 7-4, calculate and update the membership matrix U, and execute step 7-2; the update formula of the membership matrix U is as follows:
Citation Information
Patent Citations
Reversible data hiding method and recovery method for realizing contrast enhancement of a color image
CN110111270A
Contrast enhancement RDH method and system based on histogram movement
CN113781285A
Night image enhancement method based on histogram equalization
CN115311176A
Image processing method and system, electronic device and storage medium
CN117372311A
Global tone mapping with contrast enhancement and chroma boost
US20230052082A1
