CN110971913B - Bayer image compression method based on filling Y channel - Google Patents
Bayer image compression method based on filling Y channel Download PDFInfo
- Publication number
- CN110971913B CN110971913B CN201911065295.XA CN201911065295A CN110971913B CN 110971913 B CN110971913 B CN 110971913B CN 201911065295 A CN201911065295 A CN 201911065295A CN 110971913 B CN110971913 B CN 110971913B
- Authority
- CN
- China
- Prior art keywords
- matrix
- vec
- bayer
- quantization
- yuv
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N19/122—Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/186—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/67—Circuits for processing colour signals for matrixing
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
The invention belongs to the technical field of image processing, and particularly provides a Bayer image compression method; the compression method for overcoming the defects of the prior Bayer image comprises the following steps: or converting two green pixels into one process reduces the quality of the restored image; or a complex structural transformation is designed for the Y matrix, the algorithm is complex and difficult to understand, and a decoder needs to be redesigned; or the pixel values in the Y matrix are rotated, translated and the like, so that the high-frequency components of a transform domain are increased, the number of bits required by coding is increased and the like. The method is simple and easy to implement, the bit rate can be effectively reduced under the condition that the speed is not influenced, and the picture quality is improved under the condition that the memory occupied by the picture is the same; and can be decoded directly using a JPEG decoder without the need to redesign the decoder.
Description
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a Bayer image compression method.
Background
The camera is divided into a black-white camera and a color camera, the color camera is used for monitoring colored objects, the camera has a plurality of methods for obtaining color images, and the light-small-sized low-power-consumption CMOS camera obtains red, green and blue three spectral band images through a Bayer format optical filter array on a CMOS sensor and synthesizes the color images through interpolation. Most of the existing compression methods of CMOS images on civil digital cameras are image compression after image interpolation, and because a lot of redundant information is added to the images in the interpolation process, the amount of compressed data is three times of that of the original Bayer image, which is not beneficial to the real-time property of image compression.
In currently existing Bayer image compression methods: or converting two green pixels into one process reduces the quality of the restored image; or a complex structural transformation is designed for the Y matrix, the algorithm is complex and difficult to understand, and a decoder needs to be redesigned; or the pixel values in the Y matrix are rotated, translated, etc., increasing the high frequency components of the transform domain and increasing the number of bits required for encoding.
Disclosure of Invention
The invention aims to overcome the defects existing in the prior Bayer image compression method; providing a new Bayer image compression method; the method is simpler, does not increase the number of bits required for encoding, does not reduce the quality of the restored image, and does not require redesign of the decoder.
In order to achieve the purpose, the invention adopts the technical scheme that:
a Bayer image compression method comprising the steps of:
step 1: converting a Bayer-RGB matrix color space into a Bayer-YUV matrix color space;
step 2: separating a gray matrix Y and a chrominance matrix U, V from the Bayer-YUV matrix obtained in the step 1;
and step 3: dividing the gray matrix Y obtained in the step 2 into a plurality of 8 x 8 pixel blocks, and performing numerical filling on all the pixel blocks b to perform DCT:
the known two-dimensional DCT transform matrix form can be transformed into:
i,j=0~7
wherein, C is a two-dimensional DCT coefficient matrix, Vec (F) represents the transformation domain of Vec (f), and Vec is a vectorization operator;
the operation specifically comprises the following steps:
step 3.1, vectorizing the pixel block b, which is called Vec (b);
step 3.2, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (24689111315182022242527293134363840414345475052545657596163), the matrix of which is denoted as T11;
Step 3.3, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (135710121416171921232628303233353739424446484951535558606264), the matrix of which is denoted as T10;
Step 3.4, the column vector composed of the inserted 32 values is:
wherein y is a column vector consisting of 32 effective pixels in the vector Vec (b);
the 32 interpolated numbers obtained in steps 3.5 and 3.3 are inserted into vector Vec (b) in sequence
(815162223242930313237383940444546474851525354555658596061626364) line, resulting in vector vec (f);
step 3.6, vec (f) ═ T vec (f) is performed,the resulting vector vec (F) is reshaped into an 8 × 8 matrix F:
And 4, step 4: performing DCT (discrete cosine transformation) on the chrominance matrix U, V obtained in the step 2, and quantizing by using a chrominance quantization table to obtain a quantization matrix
And 5: for the quantization matrix obtained in step 3And the quantization matrix obtained in step 4JPEG entropy coding is carried out, and the data are transmitted;
step 6: receiving the data sent in the step 5, sending the data into a JPEG decoder to obtain a decoding matrixThen, willSplicing back to the Bayer-YUV matrix according to the reverse process of the step 2, and converting the Bayer-YUV matrix into the Bayer-RGB matrix according to the reverse process of the step 1.
The invention has the beneficial effects that:
the invention provides a Bayer image compression method based on a filling Y channel, which uses the information of all effective pixel points of a Y matrix in the process without losing any existing information; filling numerical values in the blank positions of the Y matrix, no more high-frequency components are generated in the frequency domain, and both positive and negative transformation can be operated by using matrix multiplication, so that the bit rate can be effectively reduced under the condition of not influencing the speed; the invention can directly use JPEG decoder to decode without redesigning decoder, and is simple and easy to operate.
Drawings
FIG. 1 is an overall flow chart of the Bayer image compression method of the invention.
Fig. 2 is a schematic diagram of a Bayer pattern picture in an embodiment of the present invention.
FIG. 3 is a schematic diagram of color space conversion according to an embodiment of the present invention.
FIG. 4 is a diagram illustrating color channel separation according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating a method for calculating a padding value according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
This embodiment provides a Bayer image compression method, the flow of which is shown in fig. 1, where the Bayer pattern is composed of a plurality of Bayer units, each Bayer unit includes four pixels, which are two G components, one R component, and one B component, as shown in fig. 2: the method comprises the following steps:
step 1: two G components, one R component, and one B component in all Bayer cells are represented by the formula:
converting the Bayer-RGB matrix color space to a Bayer-YUV matrix color space, wherein Y, U, V is located at a position corresponding to G, R, B; as shown in fig. 3;
step 2: separating a Y channel, a U channel and a V channel from the Bayer-YUV matrix obtained in the step 1:
Y(2m-1 2n-1)=S(2m-1 2n-1)
U(m n)=S(2m-1 2n)
V(m n)=S(2m 2n-1)
Y(2m 2n)=S(2m 2n)
wherein S is a Bayer-YUV matrix, Y is a separated gray matrix, and U, V is a separated chrominance matrix; m and n represent the m-th row and the n-th column of the matrix; as shown in fig. 4;
and step 3: dividing the Y matrix obtained in step 2 into a plurality of 8 × 8 pixel blocks, then performing vacancy numerical filling on all the pixel blocks b, and performing DCT transformation, as shown in fig. 5:
the known two-dimensional DCT transform matrix form can be transformed into:
i,j=0~7
wherein C is a two-dimensional DCT transform coefficient matrix,representing the Kronecker product, Vec (f) representing the transform domain of Vec (f), Vec being the vectorization operator;
the operation specifically comprises the following steps:
step 3.1, vectorizing the pixel block b, which is called Vec (b);
step 3.2, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (24689111315182022242527293134363840414345475052545657596163), the matrix of which is denoted as T11;
Step 3.3, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (135710121416171921232628303233353739424446484951535558606264), the matrix of which is denoted as T10;
Step 3.4, the column vector composed of the inserted 32 values is:
wherein y is a column vector consisting of 32 effective pixels in the vector Vec (b);
the 32 interpolated numbers obtained in steps 3.5 and 3.3 are inserted into vector Vec (b) in sequence
(815162223242930313237383940444546474851525354555658596061626364) line, resulting in vector vec (f);
step 3.6, vec (f) ═ T vec (f) is performed,the resulting vector vec (F) is reshaped into an 8 × 8 matrix F:
And 4, step 4: performing DCT transformation on the U matrix and the V matrix obtained in the step 2, and quantizing by using a chrominance quantization table to obtain a quantization matrix
And 5: for the quantization matrix obtained in step 3And the quantization matrix obtained in step 4JPEG entropy coding is carried out, and the data are transmitted;
step 6: receiving the data sent in the step 5, sending the data into a JPEG decoder to obtain a decoding matrixThen will beSplicing back to the Bayer-YUV matrix according to the reverse process of the step 2:
the Bayer-YUV matrix is then converted to a Bayer-RGB matrix following the reverse procedure of step 1:
by adopting the Bayer image compression method, the restored image has better quality, and has smaller bit rate after compression without redesigning a decoder.
While the invention has been described with reference to specific embodiments, any feature disclosed in this specification may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise; all of the disclosed features, or all of the method or process steps, may be combined in any combination, except mutually exclusive features and/or steps.
Claims (1)
1. A Bayer image compression method based on filling Y channels comprises the following steps:
step 1: converting a Bayer-RGB matrix color space into a Bayer-YUV matrix color space;
step 2: separating a gray matrix Y and a chrominance matrix U, V from the Bayer-YUV matrix obtained in the step 1;
and step 3: dividing the gray matrix Y obtained in the step 2 into a plurality of 8 x 8 pixel blocks, performing numerical filling on all the pixel blocks b, and performing DCT (discrete cosine transformation):
the two-dimensional DCT transform matrix is known in the form:
wherein, Vec (F) represents the transform domain of Vec (f), Vec is the vectorization operator; c is a two-dimensional DCT transform coefficient matrix:
i,j=0~7
the DCT transform specifically includes:
step 3.1, vectorizing the pixel block b, which is called Vec (b);
step 3.2, calculating T matrix, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (24689111315182022242527293134363840414345475052545657596163), the matrix of which is denoted as T11;
Step 3.3, selecting matrix T
(815162223242930313237383940444546474851525354555658596061626364) line,
Column (135710121416171921232628303233353739424446484951535558606264), the matrix of which is denoted as T10;
Step 3.4, the column vector composed of 32 values to be inserted is:
wherein y is a column vector consisting of 32 effective pixels in the vector Vec (b);
the 32 values in the column vector x obtained in step 3.5 and step 3.4 are inserted into the vector Vec (b) in sequence
Line (815162223242930313237383940444546474851525354555658596061626364), generating vec (f);
step 3.6, perform vec (F) ═ T vec (F), and transform the resulting vector vec (F) into an 8 × 8 matrix F:
And 4, step 4: performing DCT (discrete cosine transformation) on the chrominance matrix U, V obtained in the step 2, and quantizing by using a chrominance quantization table to obtain a quantization matrix
And 5: for the quantization matrix obtained in step 3And step 4The quantization matrix obtained inJPEG entropy coding is carried out, and the data are transmitted;
step 6: receiving the data sent in the step 5, sending the data into a JPEG decoder to obtain a decoding matrixThen, willSplicing back to the Bayer-YUV matrix according to the reverse process of the step 2, and converting the Bayer-YUV matrix into the Bayer-RGB matrix according to the reverse process of the step 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911065295.XA CN110971913B (en) | 2019-11-04 | 2019-11-04 | Bayer image compression method based on filling Y channel |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911065295.XA CN110971913B (en) | 2019-11-04 | 2019-11-04 | Bayer image compression method based on filling Y channel |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110971913A CN110971913A (en) | 2020-04-07 |
CN110971913B true CN110971913B (en) | 2021-09-24 |
Family
ID=70030113
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911065295.XA Active CN110971913B (en) | 2019-11-04 | 2019-11-04 | Bayer image compression method based on filling Y channel |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110971913B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101977330A (en) * | 2010-11-12 | 2011-02-16 | 北京空间机电研究所 | Bayer image compression method based on YUV conversion |
CN103414903A (en) * | 2013-08-28 | 2013-11-27 | 清华大学 | Compressing method and device for Bayer format images |
CN104427349A (en) * | 2013-08-20 | 2015-03-18 | 清华大学 | Bayer image compression method |
JP2018006999A (en) * | 2016-06-30 | 2018-01-11 | キヤノン株式会社 | Image encoding device and control method therefor |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8428120B2 (en) * | 2007-12-11 | 2013-04-23 | Taiwan Imagingtek Corporation | Method and apparatus of Bayer pattern direct video compression |
-
2019
- 2019-11-04 CN CN201911065295.XA patent/CN110971913B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101977330A (en) * | 2010-11-12 | 2011-02-16 | 北京空间机电研究所 | Bayer image compression method based on YUV conversion |
CN104427349A (en) * | 2013-08-20 | 2015-03-18 | 清华大学 | Bayer image compression method |
CN103414903A (en) * | 2013-08-28 | 2013-11-27 | 清华大学 | Compressing method and device for Bayer format images |
JP2018006999A (en) * | 2016-06-30 | 2018-01-11 | キヤノン株式会社 | Image encoding device and control method therefor |
Also Published As
Publication number | Publication date |
---|---|
CN110971913A (en) | 2020-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100880039B1 (en) | Method and system for achieving coding gains in wavelet-based image codecs | |
JP4367880B2 (en) | Image processing apparatus and method, and storage medium | |
JP4365957B2 (en) | Image processing method and apparatus and storage medium | |
JP2002516540A (en) | Color image compression based on two-dimensional discrete wavelet transform resulting in perceptually lossless images | |
JP2006246473A (en) | Color space scalable video coding and decoding method and apparatus for the same | |
CN101990095B (en) | Method and apparatus for generating compressed file, camera module associated therewith, and terminal including the same | |
CN107645662B (en) | Color image compression method | |
US20160112722A1 (en) | Apparatus and method for lossless compression of raw color sensor data from a color array filtered image sensor | |
CN110868603B (en) | Bayer image compression method | |
CN104144279B (en) | Handle the method and device of image/video data | |
JP2011015347A (en) | Apparatus and method for processing image, program and recording medium | |
JP4293912B2 (en) | Data compression of color images using wavelet transform | |
WO2019237659A1 (en) | Blind compressive sampling method, apparatus and imaging system | |
CN111654705B (en) | Mosaic image compression method based on color space conversion | |
CN110971913B (en) | Bayer image compression method based on filling Y channel | |
Koya et al. | Analysis of application of arithmetic coding on dct and dct-dwt hybrid transforms of images for compression | |
CN111385555A (en) | Data compression method and device for inter-component prediction of original and/or residual data | |
CN109413445B (en) | Video transmission method and device | |
CN108989820B (en) | Data compression method and device adopting respective corresponding chroma sampling formats at all stages | |
US20040207737A1 (en) | Image compression apparatus and image processing system | |
JP2005005925A (en) | Image compressing device and image processing system | |
JP2008124530A (en) | Raw data compressing method | |
KR101600029B1 (en) | Dual type real-time high-quality image restoration and encoding system | |
JP2006340300A (en) | Signal processing method, signal processing apparatus, signal processing program and information recording medium | |
US11765366B2 (en) | Method for processing transform coefficients |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |