A method of reversible conversion between color and grayscale images
Patent Information
- Application Number
- CN202610850213.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]本发明的目的在于提供一种彩色图像与灰度图像之间的可逆转换方法,解决了嵌入容量小、亮度易丢失、重建质量低的问题
本发明所提供的一种彩色图像与灰度图像之间的可逆转换方法,通过将亮色分离、有损压缩、外部冗余空间构建、码本控制的逐层位平面嵌入以及完整的逆向恢复流程有机融合,实现了整体性能的显著提升。该方法能够在保证原始亮度信息完全无损恢复的前提下,将压缩后的完整色度信息高效隐藏于灰度图像中,生成的含密灰度图具有极高的视觉保真度,同时解码端可精确提取色度分量并重建出高质量彩色图像。实验表明,该方法在不同纹理复杂度与色彩分布的图像集上均表现出优异的稳定性和泛化能力,在含密灰度图质量和重建彩色图质量上均显著优于现有技术,且有效克服了传统方法中亮度信息易丢失、嵌入容量小、重建质量低等固有问题,为彩色图像与灰度图像之间的可逆转换提供了一种高容量、高保真、高鲁棒性的系统化解决方案。
Smart Images

Figure CN122601804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for reversible conversion between color images and grayscale images. Background Technology
[0002] The reversible conversion technology between color and grayscale images aims to establish a bridge between color images and their grayscale versions. It can save storage and transmission resources through dimensionality reduction processing, and can restore the original color information without loss or with loss when necessary. It has important application value in image compression, medical image archiving, black and white printing, and specific transmission channels.
[0003] However, existing technologies still face many bottlenecks. On the one hand, traditional edge-information-based (SE-based) methods typically use wavelet transform or discrete cosine transform to embed chromaticity information into the high-frequency components of the luminance component. This forced replacement strategy often leads to a significant loss of high-frequency texture information in the luminance component, resulting in a blurry grayscale image and limited spatial resolution of the reconstructed color image. On the other hand, while vector quantization (VQ-based) methods can better preserve luminance information, they are limited by the complexity of the color palette design, and the strong correlation between luminance and chromaticity components restricts further improvements in embedding capacity. Therefore, how to preserve as much chromaticity information as possible while maintaining high fidelity and achieving a sufficiently large embedding capacity is a key problem that urgently needs to be solved. Summary of the Invention
[0004] The purpose of this invention is to provide a reversible conversion method between color images and grayscale images, which solves the problems of small embedding capacity, easy loss of brightness, and low reconstruction quality.
[0005] To address the aforementioned technical problems, embodiments of the present invention provide a method for reversible conversion between color images and grayscale images, comprising the following steps: Separate the luminance component and two chrominance components from the original color image; The two chroma components are lossily compressed according to a preset compression ratio to obtain their respective compressed bitstreams, and the two compressed bitstreams are concatenated into a compressed chroma bitstream; The brightness component is amplified by nearest neighbor interpolation to obtain an amplified brightness map. Then, the amplified brightness map is subjected to integer wavelet transform to obtain a low-frequency sub-band containing the original brightness information and three high-frequency sub-bands with zero high-frequency coefficients. The maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is determined based on the coefficient values of the low-frequency subband. The length information of the compressed chroma bitstream is concatenated with the compressed chroma bitstream to form a secret information stream. The length information includes the total length of the two compressed bitstreams and the length of one of the chroma component compressed bitstreams. Starting from the lowest bit plane, traverse all high-frequency coefficients of all high-frequency sub-bands layer by layer. If the maximum number of embeddable bits of the current high-frequency coefficient is greater than or equal to the current bit plane level, take one bit from the secret information stream and embed it into the current bit plane of the high-frequency coefficient. Repeat the above process until the secret information stream is completely embedded to obtain the three modified high-frequency sub-bands. Inverse integer wavelet transform is performed on the low-frequency sub-band and the three modified high-frequency sub-bands to generate a dense grayscale image.
[0006] In some optional embodiments, the method further includes converting the dense grayscale image into a color image, with the following specific steps: Perform integer wavelet transform on the dense grayscale image to re-obtain the low-frequency sub-band and the three modified high-frequency sub-bands; Based on the re-acquired low-frequency subbands, the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is re-determined, and the secret information stream is extracted from the three modified high-frequency subbands using a bit-plane sequence that is the reverse of the embedding steps in claim 1. The length information of the compressed chroma bit stream is parsed from the extracted secret information stream, and the two chroma components are separated and decoded based on the length information; The re-acquired low-frequency subband and the two decoded chromaticity components are inversely transformed back to the original color space to reconstruct the color image.
[0007] In some optional embodiments, the preset compression ratio is such that the two compressed chromaticity components are greater than the capacity of three high-frequency subbands embedded in a single-layer bit plane, and less than the capacity of three high-frequency subbands embedded in a double-layer bit plane.
[0008] In some optional embodiments, the lossy compression is implemented using a JPEG2000 encoder, and the corresponding decompression is implemented using a JPEG2000 decoder.
[0009] In some alternative embodiments, the step of separating the luminance component and the two chrominance components is achieved by converting the original color image from the RGB color space to the YCbCr color space.
[0010] In some optional embodiments, the nearest neighbor interpolation magnification makes the four pixel values of each 2×2 local block in the magnified image equal, and the top-left pixel of each 2×2 block is the pixel value of the original luminance component.
[0011] In some optional embodiments, the integer wavelet transform employs a variant of the Haar wavelet transform-based lifting scheme, wherein the high-frequency coefficients are the differences between adjacent pixels, and the low-frequency coefficients are the pixel values at odd positions.
[0012] In some optional embodiments, the specific steps for determining the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency sub-band based on the coefficient values of the low-frequency sub-band are as follows: Let the low-frequency subband coefficient be ,remember Then the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is: .
[0013] Embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described reversible conversion method between a color image and a grayscale image.
[0014] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described reversible conversion method between a color image and a grayscale image.
[0015] The reversible conversion method between color images and grayscale images provided by this invention has at least the following beneficial effects: This invention provides a reversible conversion method between color and grayscale images. By organically integrating luminance-color separation, lossy compression, external redundancy space construction, codebook-controlled layer-by-layer bit-plane embedding, and a complete reverse recovery process, it achieves a significant improvement in overall performance. This method can efficiently hide the compressed, complete chrominance information within a grayscale image while ensuring complete lossless recovery of the original luminance information. The generated dense grayscale image has extremely high visual fidelity, while the decoding end can accurately extract the chrominance components and reconstruct a high-quality color image. Experiments show that this method exhibits excellent stability and generalization ability on image sets with different texture complexities and color distributions. It significantly outperforms existing technologies in both the quality of the dense grayscale image and the quality of the reconstructed color image, and effectively overcomes the inherent problems of traditional methods such as easy loss of luminance information, small embedding capacity, and low reconstruction quality. It provides a high-capacity, high-fidelity, and highly robust systematic solution for the reversible conversion between color and grayscale images. Attached Figure Description
[0016] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0017] Figure 1 This is a flowchart of a reversible conversion method between a color image and a grayscale image according to an embodiment of the present invention; Figure 2This is a schematic diagram of nearest neighbor interpolation dimension expansion of the brightness channel according to an embodiment of the present invention; Figure 3 This is a flowchart of chroma information hiding from a color image to a dense grayscale image according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the decoding process of a color image reversible information hiding method according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the embodiments of the present invention to facilitate a better understanding of the invention. However, the technical solutions claimed in the present invention can be implemented even without these technical details and various variations and modifications based on the following embodiments. The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.
[0019] One embodiment of the present invention relates to a method for reversible conversion between color images and grayscale images. The implementation details of the method for reversible conversion between color images and grayscale images in this embodiment are described in detail below. The following implementation details are provided for ease of understanding and are not necessary for implementing this solution.
[0020] Step 101: Separate the luminance component and two chrominance components from the original color image; Input a raw RGB color image, and first convert it to the YCbCr color space. The conversion formula is as follows:
[0021] ; Where Y is the luminance component, which contains the grayscale contour and most of the structural information of the image; and The chromaticity component primarily carries color difference information. Because the human eye is far more sensitive to changes in brightness than changes in chromaticity, it is less sensitive to... , Compression does not significantly affect the subjective quality of the reconstructed image.
[0022] Step 102: Perform lossy compression on the two chroma components according to a preset compression ratio to obtain their respective compressed bitstreams, and then concatenate the two compressed bitstreams into a compressed chroma bitstream; Original chromaticity components , All dimensions are ( , (These are the number of rows and columns of the original image, respectively). Each component is represented by 8 bits, so the total amount of original data for the two chroma components is... Bits. The capacity for embedding it into subsequent constructions is approximately... to The space that carries bits must be efficiently compressed for the chroma components.
[0023] This invention uses a JPEG2000 encoder with a preset compression ratio of 4:1. The compressed chroma data size is approximately... bits, this value is greater than the single-layer embedding capacity ( (bits) and less than the capacity of double-layer embedding ( (bits), thus ensuring sufficient color information while minimizing the loss of grayscale image quality. JPEG2000 uses Discrete Wavelet Transform (DWT) instead of the traditional block DCT transform in JPEG, which has high compression efficiency and bitstream controllability, and can retain more image details at the same compression ratio.
[0024] Step 103: The brightness component is amplified by nearest neighbor interpolation to obtain an amplified brightness map. Then, the amplified brightness map is subjected to integer wavelet transform to obtain a low-frequency sub-band containing the original brightness information and three high-frequency sub-bands with zero high-frequency coefficients. To ensure the absolute fidelity of the original luminance information (i.e., reversible recovery), this invention employs the nearest neighbor interpolation algorithm. For the luminance components... (size Perform nearest neighbor interpolation and enlarge its size. To obtain the interpolated image The mapping relationship is as follows: for a magnified image pixels in Its value is derived from the original image. The corresponding pixel in the middle determines:
[0025] ; in This indicates rounding up to the nearest integer. Therefore, in... In the local unit, the top-left pixel is the original pixel, and the other three are interpolated pixels, with all four pixel values being exactly the same:
[0026] ; This numerical consistency ensures that the original luminance pixels are completely and undamagedly preserved in the enlarged image.
[0027] For magnified images Integer wavelet transform (IWT) is performed. This invention employs a variant of the lifting scheme based on Haar wavelet transform, whose row transform formula is:
[0028] ; First, perform the above transformation on each row to obtain the low-frequency subband. and high-frequency subband (Width halved); then... and Perform column transformations (using the same formula) separately to obtain four sub-bands: Low-frequency subband A (LL), size Its coefficient is equal to the pixel value of the original luminance component (i.e., Horizontal high-frequency subband H (HL), size ; Vertical high-frequency subband V (LH), dimensions ; Diagonal high-frequency subband D (HH), size .
[0029] Because each interpolated image Since the four pixel values within a block are equal and the difference between adjacent pixels is zero, the coefficients of the three high-frequency sub-bands H, V, and D are all zero. The zero coefficients constitute a pure external embedding space.
[0030] A schematic diagram of nearest neighbor interpolation dimension expansion for the brightness channel is shown below. Figure 2 As shown in the figure, the key preliminary step in the patent is visually illustrated: the original luminance channel image is magnified by a factor of 2 using nearest neighbor interpolation, expanding each original pixel to... 2×2 The same value block is used to create a high-frequency subband that is naturally zero for subsequent integer wavelet transform without changing the luminance information, thus providing a dedicated space for lossless embedding of chrominance information.
[0031] Step 104: Determine the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency sub-band based on the coefficient values of the low-frequency sub-band; Based on low-frequency subband Each coefficient value Calculate the maximum number of embeddable bits for the corresponding high-frequency coefficients. To prevent pixel value overflow after the inverse transform (exceeding the 0-255 range), the safe modification range is limited by the distance between the low-frequency coefficients and the boundary (0 or 255). Define a symmetric modification range. Then the number of possible values for each high-frequency coefficient is Therefore, the maximum number of embeddable bits is:
[0032] ; This formula applies to all high-frequency coefficients, horizontally, vertically, and diagonally. When Or at 255, That is, it cannot embed any bits; when hour, The calculation results for all positions constitute the codebook. CB .
[0033] Step 105: Concatenate the length information of the compressed chroma bitstream with the compressed chroma bitstream to form a secret information stream. The length information includes the total length of the two compressed bitstreams and the length of one of the chroma component compressed bitstreams. JPEG2000 compressed , The bytecode stream is concatenated into a chroma information stream, and then concatenated with the decoding control information (which includes at least the total length of the compressed data and the compressed length of one of the chroma components) to form a secret information stream. Its total length is approximately Bit.
[0034] Step 106: Starting from the lowest bit plane, traverse all high-frequency coefficients of all high-frequency sub-bands layer by layer. If the maximum number of embeddable bits of the current high-frequency coefficient is greater than or equal to the current bit plane level, take one bit from the secret information stream and embed it into the current bit plane of the high-frequency coefficient. Repeat the above process until the secret information stream is completely embedded to obtain the three modified high-frequency sub-bands. All of the three high-frequency subbands The coefficients are arranged in a fixed order (e.g., first...). Sub-bands are sorted by row first, then... Sub-belt, then Sub-bands are arranged. Starting from the lowest bit plane (layer 1), all coefficients are traversed layer by layer. For the current layer number... ( If the codebook value of a certain coefficient Then from the secret information flow Take one bit from the current layer and replace the existing bit in the current bit plane of the coefficient with this bit; otherwise, skip the coefficient (without consuming the secret information bit). After processing all coefficients in the current layer, proceed to the next layer. Repeat the above process until all bits in the secret information stream are embedded or the embedding capacity is exhausted. This ultimately yields the three modified high-frequency subbands. , , .
[0035] This "breadth-first" polling strategy evenly distributes secret information across the lower-order planes of all coefficients, effectively avoiding excessive local distortion.
[0036] Step 107: Perform inverse integer wavelet transform on the low-frequency sub-band and the three modified high-frequency sub-bands to generate a dense grayscale image.
[0037] Unmodified low-frequency subband With the modified high-frequency subband , , Perform inverse integer wavelet transform (IIWT) to reconstruct the spatial domain image. (size The inverse transform formula is:
[0038] ; The generated graph This results in the final dense grayscale image. Due to the low-frequency subband... The grayscale image, which has not been modified, retains the original brightness information and is visually very similar to the interpolated grayscale image, while hiding the compressed chromaticity information.
[0039] The process of hiding chroma information from a color image to a grayscale image Figure 3 As shown in the figure, the core steps for generating a dense grayscale image from the original color image are as follows: First, the image is converted to the YCbCr color space, and the luminance component Y and chrominance components Cb and Cr are separated. After nearest neighbor interpolation amplification of Y, zero-value high-frequency sub-bands are generated through integer wavelet transform, while Cb and Cr are encoded using JPEG2000 to obtain the binary code stream to be embedded. Then, the code stream is written into the high-frequency sub-band using an embedding algorithm. Finally, a dense grayscale image is generated through inverse integer wavelet transform, achieving the goal of hiding complete chrominance information into the grayscale image without destroying the luminance information.
[0040] Perform integer wavelet transform on the dense grayscale image to re-obtain the low-frequency sub-band and the three modified high-frequency sub-bands; Based on the re-acquired low-frequency subbands, the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is re-determined, and the secret information stream is extracted from the three modified high-frequency subbands using a bit-plane sequence that is the reverse of the embedding steps in claim 1. The length information of the compressed chroma bit stream is parsed from the extracted secret information stream, and the two chroma components are separated and decoded based on the length information; The re-acquired low-frequency subband and the two decoded chromaticity components are inversely transformed back to the original color space to reconstruct the color image.
[0041] The receiver performs the same integer wavelet transform on the dense grayscale image as the encoder to re-obtain the low-frequency subband. and the modified high-frequency subband , , .in That is, the original luminance component that is recovered without loss. .
[0042] Based on the recovered low-frequency subband It uses the exact same formula as the encoding end ( Regenerate the codebook CB Then, using the reverse bit-plane order from the encoding end (i.e., traversing layer by layer starting from the least significant bit plane, with the extraction conditions being the same as the embedding conditions), the secret information stream is extracted from the modified high-frequency subband. .
[0043] from The decoding control information is parsed to obtain the total length of the compressed data and The compression length of the component, thus separating it. , The compressed bitstream was processed. The spectral density components were recovered using a JPEG2000 decoder. Finally, the low-frequency subband was... (i.e., luminance component) ) and the recovered , Together, we inversely transform the image from the YCbCr color space back to the RGB color space to reconstruct the original color image. The inverse transformation formula is:
[0044] ; The preset compression ratio can be determined based on the single-layer embedding capacity ( ) and dual-layer embedded capacity ( The constraint is chosen to be 4:1, which reduces the compressed data size (approximately...). It falls between the two, balancing color preservation and grayscale quality.
[0045] The nearest neighbor interpolation magnification factor is not limited to 2 times (4 times the area), but in this embodiment, it is magnified by 2 times in both length and width.
[0046] The integer wavelet transform specifically adopts a Haar-based lifting variant, but any integer wavelet that can generate all-zero high-frequency subbands and is completely reversible can be applied.
[0047] In the aforementioned multi-level bit-plane embedding, the maximum number of layers actually used is determined by the codebook value, and generally does not exceed two layers (because...). The amount of data only requires partial coefficients to use the second layer.
[0048] The decoding control information can be represented by two length values using a fixed bit length (e.g., 32 bits each), or it can be represented by variable-length encoding.
[0049] A schematic diagram of the decoding process for the reversible information hiding method in color images is shown below. Figure 4As shown in the figure, the low-frequency luminance component LL (Y) and the dense high-frequency sub-bands LH', HL', and HH' are separated by integer wavelet transform (IWT) using the dense grayscale image Stego as input. The hidden binary bitstream payload_bits are then recovered from the high-frequency sub-bands by an extraction algorithm. The chrominance components Cb' and Cr' are then obtained by JPEG2000 decoding. Finally, the luminance component and the decoded chrominance component are converted to the YCbCr2RGB color space to complete the high-fidelity reconstruction of the original color image, fully presenting the technical path of the decoding end.
[0050] To verify the effectiveness of this invention, extensive simulation experiments were conducted on standard image datasets. The experimental environment was: 12th Gen Intel(R) Core(TM) i5-1240P (1.70GHz), 16GB RAM, Intel(R) Iris(R) XeGraphics graphics card, Windows 11 operating system, and MATLAB R2024b algorithm development platform. Two publicly available datasets were used:
[0051] The Kodak dataset consists of 24 color images of 512×768 pixels, mainly depicting natural scenes (blue sky, grass, vegetation), with relatively simple textures and high color uniformity.
[0052] McMaster dataset: 18 color images of 512×512 pixels, covering architecture, people, natural landscapes, etc., with high texture complexity and diverse color distribution.
[0053] The evaluation metric is Peak Signal-to-Noise Ratio (PSNR), which measures the degree of distortion between the reconstructed color image and the original color image. A higher PSNR indicates better quality. The formula for calculating PSNR is:
[0054] ; Where MSE is the mean squared error, calculated as follows: ; in, To reconstruct the color image, Original color image; Experimental Results: Table 1 presents detailed results of the PSNR of dense grayscale images and the PSNR of reconstructed color images for 42 test images on the Kodak and McMaster datasets.
[0055] Table 1 PSNR results for the image dataset Table 2. Statistics of Mean and Standard Deviation Results Analysis: As can be seen from Tables 1 and 2, on the Kodak dataset, the average PSNR of the dense grayscale image is as high as 53.79dB, and the average PSNR of the reconstructed color image is 49.69dB, with a standard deviation of only 0.27dB. This indicates that the algorithm performs extremely stably on images with simple textures and is almost unaffected by the image content.
[0056] On the McMaster dataset, the average PSNR for dense grayscale images is 49.67 dB, and the average PSNR for reconstructed color images is 47.11 dB, with a standard deviation of 1.71 dB, slightly higher than the Kodak dataset, but still maintaining high quality. A few images (such as 1.png) have a reconstructed PSNR of 42.63 dB due to high-contrast building outlines and complex leaf textures, but the remaining 17 images all have a PSNR of at least 44.72 dB, with the highest reaching 49.15 dB.
[0057] Overall, the average PSNR of the reconstructed color images from all 42 images reached 48.59 dB, indicating that the algorithm has good generalization ability.
[0058] On the same Kodak dataset, the performance of this invention was compared with existing publicly available methods. For the algorithm of this invention, the average PSNR for dense grayscale images was 53.79 dB, and the average PSNR for reconstructed color images was 49.69 dB. The CCIW method proposed by Liang Qiaoyi achieved an average PSNR of 51.18 dB for dense grayscale images and 41.60 dB for reconstructed color images; her CCPS method achieved an average PSNR of 51.23 dB for dense grayscale images and 45.66 dB for reconstructed color images. The method proposed by Zhu et al. achieved an average PSNR of 44.42 dB for dense grayscale images and 44.41 dB for reconstructed color images. The method proposed by Yu et al. achieved an average PSNR of 51.14 dB for dense grayscale images and 47.56 dB for reconstructed color images (this value uses the HVS-PSNR index, dpi=150, which differs slightly from the standard PSNR but can be used as a reference). Experimental results show that the present invention significantly outperforms all comparison methods in terms of both the quality of dense grayscale images and the quality of reconstructed color images. In particular, the PSNR of the reconstructed color image is improved by about 4 dB compared to the best comparison method (CCPS, 45.66 dB).
[0059] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.
[0060] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0061] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A method for reversible conversion between color images and grayscale images, characterized in that, The method includes: Separate the luminance component and two chrominance components from the original color image; The two chroma components are lossily compressed according to a preset compression ratio to obtain their respective compressed bitstreams, and the two compressed bitstreams are concatenated into a compressed chroma bitstream; The brightness component is amplified by nearest neighbor interpolation to obtain an amplified brightness map. Then, the amplified brightness map is subjected to integer wavelet transform to obtain a low-frequency sub-band containing the original brightness information and three high-frequency sub-bands with zero high-frequency coefficients. The maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is determined based on the coefficient values of the low-frequency subband. The length information of the compressed chroma bitstream is concatenated with the compressed chroma bitstream to form a secret information stream. The length information includes the total length of the two compressed bitstreams and the length of one of the chroma component compressed bitstreams. Starting from the lowest bit plane, traverse all high-frequency coefficients of all high-frequency sub-bands layer by layer. If the maximum number of embeddable bits of the current high-frequency coefficient is greater than or equal to the current bit plane level, take one bit from the secret information stream and embed it into the current bit plane of the high-frequency coefficient. Repeat the above process until the secret information stream is completely embedded to obtain the three modified high-frequency sub-bands. Inverse integer wavelet transform is performed on the low-frequency sub-band and the three modified high-frequency sub-bands to generate a dense grayscale image.
2. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, This also includes converting a dense grayscale image into a color image, with the following specific steps: Perform integer wavelet transform on the dense grayscale image to re-obtain the low-frequency sub-band and the three modified high-frequency sub-bands; Based on the re-acquired low-frequency subbands, the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is re-determined, and the secret information stream is extracted from the three modified high-frequency subbands using a bit-plane sequence that is the reverse of the embedding steps in claim 1. The length information of the compressed chroma bit stream is parsed from the extracted secret information stream, and the two chroma components are separated and decoded based on the length information; The re-acquired low-frequency subband and the two decoded chromaticity components are inversely transformed back to the original color space to reconstruct the color image.
3. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The preset compression ratio ensures that the two chromaticity components after compression are greater than the capacity of three high-frequency subbands embedded in a single-layer bit plane, but less than the capacity of three high-frequency subbands embedded in a double-layer bit plane.
4. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The lossy compression is implemented using a JPEG2000 encoder, and the corresponding decompression is implemented using a JPEG2000 decoder.
5. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The step of separating the luminance component and the two chrominance components is achieved by converting the original color image from the RGB color space to the YCbCr color space.
6. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The nearest neighbor interpolation magnification makes the four pixel values of each 2×2 local block in the magnified image equal, and the top left pixel of each 2×2 block is the pixel value of the original brightness component.
7. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The integer wavelet transform adopts a variant of the lifting scheme based on the Haar wavelet transform, where the high-frequency coefficients are the differences between adjacent pixels and the low-frequency coefficients are the pixel values at odd positions.
8. The reversible conversion method between color images and grayscale images according to claim 1, characterized in that, The specific steps for determining the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency sub-band based on the coefficient values of the low-frequency sub-band are as follows: Let the low-frequency subband coefficient be ,remember Then the maximum number of embeddable bits for each high-frequency coefficient in each high-frequency subband is: .
9. A computer system, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a reversible conversion method between a color image and a grayscale image as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, is capable of performing the reversible conversion method between a color image and a grayscale image as defined in any one of claims 1 to 8.