Image encoding device, control method and program thereof
The image encoding device addresses the inefficiency in encoding RAW images by generating and encoding data approximating a fourth color using three primary colors, resulting in improved encoding efficiency and reduced code amount.
Patent Information
- Application Number
- JP2020138187
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-08-18
- Publication Date
- 2024-10-24
- Estimated Expiration
- 2040-08-18
AI Technical Summary
RAW image data composed of four independent pixel types, including a fourth color, results in decreased compression encoding efficiency and increased code amount.
An image encoding device that generates data approximating the fourth color using at least two of the three primary colors and calculates a difference with the fourth color, then adjusts the gain of this data, and performs wavelet transform and entropy encoding on the generated difference data.
Improves encoding efficiency of RAW images by reducing the amount of code required, thereby enhancing data compression.
Smart Images

Figure 0007572811000001 
Figure 0007572811000002 
Figure 0007572811000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an image encoding technique. [Background technology]
[0002] An imaging device, such as a digital camera, performs de-Bayer processing (demosaic processing) on raw image information (RAW image) captured by an imaging sensor, converts it into signals consisting of luminance and color difference, and performs so-called development processing on each signal, such as noise removal, optical distortion correction, image optimization, etc. The imaging device then compresses and encodes the luminance signal and color difference signal obtained by the development processing, and records them as an image file on a recording medium such as a memory card.
[0003] On the other hand, there are also imaging devices that can record RAW images. Although RAW images require a huge amount of data to record, they have image quality that is closest to the original image captured by the imaging sensor immediately after it is taken. Therefore, RAW images are images that are not degraded due to computational losses during development processes, etc., and have the advantage that they can be edited to a high degree. For this reason, advanced users prefer to record RAW images.
[0004] An image sensor has pixels of the three primary colors, red (R), green (G), and blue (B), arranged periodically. In particular, an array in which one red pixel, one blue pixel, and two green pixels are arranged in a regular pattern per 2 x 2 pixel is generally called a Bayer array, and imaging devices use image sensors with this Bayer array.
[0005] Patent Document 1 describes a configuration in which white (W) is used as the fourth type of pixel in order to suppress the occurrence of moire and false colors and prevent a decrease in resolution. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2016-213650 A Summary of the Invention [Problem to be solved by the invention]
[0007] However, the RAW image data obtained by the technology of Patent Document 1 is composed of four independent types of pixels. In other words, there is no pixel data with high correlation such as two green pixels as in the Bayer array. Therefore, there is a problem that the compression encoding efficiency is deteriorated and the amount of code increases.
[0008] In view of the above problems, the present invention aims to provide a technique for improving the coding efficiency of a RAW image having a fourth color in addition to the three primary colors. [Means for solving the problem]
[0009] In order to solve this problem, for example, an image coding device of the present invention has the following arrangement. An image encoding device that encodes data obtained by an image sensor having filters for detecting a fourth color periodically arranged in addition to filters for the three primary colors, comprising: a generating means for generating data approximating the fourth color using data of at least two of the three colors representing the three primary colors, and generating difference data representing a difference between the generated data and the data of the fourth color; encoding means for encoding the three color data representing the three primary colors and the difference data; 、 an adjustment means for adjusting a gain of data approximating the fourth color; Have death, The generating means generates the difference data from a difference between data approximating the fourth color adjusted by the adjusting means and data of the fourth color. do. Effect of the Invention
[0010] According to the present invention, it is possible to improve the coding efficiency of a RAW image having a fourth color in addition to the three primary colors. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a block diagram showing the configuration of an imaging apparatus to which an embodiment is applied. [Diagram 2] FIG. 2 is a diagram showing an example of a pixel array. [Diagram 3] FIG. 2 is a block diagram showing the configuration of a RAW compression encoding unit. [Figure 4] Subband formation diagram for decomposition level 2 of the wavelet transform (DWT). [Diagram 5] FIG. [Figure 6] FIG. 1 is a block diagram of RAW compression decoding. [Figure 7] FIG. 13 is a diagram showing another example of a pixel array. [Figure 8] FIG. 11 is a diagram showing a pixel array according to a second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a number of features, not all of these features are essential to the invention, and the features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0013] [First embodiment] 1 is a block diagram showing an example of the configuration of an imaging device 100 according to the first embodiment. In the first embodiment, an example in which an image encoding device is implemented in an imaging device will be described, but it should be noted that image data to be encoded may be received via a storage device or a network, and is not particularly limited to an imaging device.
[0014] The imaging device 100 includes an imaging optical unit 101, an imaging sensor unit 102, a sensor signal processing unit 103, a RAW compression encoding unit 104, a buffer 105, a recording data control unit 106, an output terminal 107, and a control unit 150 that controls the entire device. The control unit 150 includes a CPU, a ROM that stores programs executed by the CPU, and a RAM used as a work area.
[0015] 1, an optical image is formed on an image sensor unit 102 via an imaging optical unit 101. When an instruction to start a photographing operation is input from an operation unit (not shown), a control unit 150 controls the image sensor unit 102. The image sensor unit 102 detects the intensity of light transmitted through various color filters arranged on its surface and obtains an electrical signal.
[0016] FIG. 2 shows the arrangement of color filters arranged in the image sensor unit 102 of the embodiment. Therefore, the figure also shows the pixel arrangement of image data to be encoded. As shown in FIG. 2, white (W), red (R), green (G), and blue (B) are arranged in a mosaic pattern for each pixel, and 2×2 four pixels are composed of one white pixel, one red pixel, one blue pixel, and one green pixel. These 2×2 four pixels are considered as one set, and this set is arranged regularly in a structure. Each RGB filter transmits its respective wavelength range, but the W filter transmits the entire visible light range.
[0017] The electrical signals converted by the imaging sensor unit 102 are subjected to pixel restoration processing by the sensor signal processing unit 103. The restoration processing includes processing for interpolating the pixel to be restored using surrounding pixel values or subtracting a predetermined offset value for missing pixels or low-reliability pixels in the imaging sensor unit 102. In this embodiment, the image information output from the sensor signal processing unit 103 is called a RAW image or RAW image data, which means a raw (undeveloped) image.
[0018] The RAW image is supplied to the RAW compression encoding unit 104. The RAW compression encoding unit 104 generates a plurality of sub-band data, which are frequency bands, by wavelet transforming the RAW image input from the sensor signal processing unit 103. The RAW compression encoding unit 104 then quantizes coefficient data included in each of the generated sub-band data, and encodes the data in sub-band units to generate encoded data. The RAW compression encoding unit 104 then stores the generated encoded data of each sub-band in a buffer 105. The encoding process of the RAW compression encoding unit 104 is an important part of this embodiment, and will be described in detail later.
[0019] A recording data control unit 106 inputs the coded data in subband units stored in the buffer 105, adds a predetermined header, and outputs the data to an output terminal 107 for recording on a recording medium, an external storage device, or the like.
[0020] Next, the process of the RAW compression encoding unit 104 in this embodiment will be described in detail.
[0021] 3 is a block diagram showing the configuration of the RAW compression encoding unit 104. The process of the RAW compression encoding unit 104 will be described with reference to FIG.
[0022] The plane division unit 302 inputs RAW image data via an input terminal 301. The plane division unit 302 generates four plane data, each of which is composed of pixel data of a single component, from the RAW image data. In the embodiment, the RAW image data is composed of four component pixels of W (white), R (red), G (green), and B (blue), so the plane division unit 302 generates four plane data of W, R, G, and B from the RAW image data. In the embodiment, the array in FIG. 2 is assumed, so each plane data has the same number of pixels, and the number of pixels in the horizontal and vertical directions is half that of the RAW image. The plane division unit 302 supplies each generated plane data to a plane conversion unit 303.
[0023] The plane conversion unit 303 uses the plane data R, G, and B to calculate plane data Y corresponding to the luminance component according to the following formula. Y = pr×R + pg×G + pb×B …(1) Here, the parameters pr, pg, and pb represent real-valued weighting coefficients and satisfy the following equation (2). pr + pg + pb = 1 … (2) The parameters pr, pg, and pb in equation (2) may be those specified in ITU-R BT.601, for example.
[0024] The plane data Y corresponding to the luminance component calculated by equation (1) has a high correlation with the plane data W. Therefore, it can be said that the plane data Y is plane data that is similar to the plane data W.
[0025] In order to reduce data by utilizing the correlation between the luminance component Y and white (W), it is necessary to adjust the gain. Yg = Y × ygain …(3) The gain is adjusted according to the above calculation. Here, ygain is an arbitrary integer that is set in advance. In addition, when the gain value can be fed back in continuous shooting, etc., it is calculated by using the W average value (Wavg) and Y average value (Yavg) of the entire screen as follows: ygain = Wavg / Yavg It is also possible to use the following.
[0026] The plane conversion unit 303 obtains a white / luminance difference plane WH using the gain-adjusted Yg according to the following equation (4). WH = W - Yg …(4) As described above, there is a high correlation between the plane data W and the plane data Yg. Therefore, although the pixel values constituting the difference plane data WH (more precisely, pixel difference values) have positive and negative signs, most of the values are close to zero, and a high compression rate can be expected.
[0027] The plane transformation unit 303 supplies the plane data WH calculated as described above and the plane data R, B, and G to the wavelet transformation unit 304. The order of supply is not particularly important, but the plane data WH is generated using the plane data R, G, and B. Therefore, in order to minimize the waiting time of the wavelet transformation unit 304, it is desirable to supply the plane data WH last.
[0028] The wavelet transform unit 304 generates transform coefficients by transforming the input plain data into a frequency domain signal.
[0029] Fig. 4 shows the subband formation diagram for decomposition level 2 when vertical and horizontal filtering of the wavelet transform (DWT) is performed twice. In the figure, "Lv" indicates the decomposition level including the number that follows, where "L" stands for low frequency and "H" for high frequency. Since the wavelet transform is a set of filtering in two directions, horizontal and vertical, the subbands are expressed by the two letters L and H.
[0030] The first wavelet transform (transformation at decomposition level 1) results in subbands LL, HL, LH, and HH. When performing a second or subsequent wavelet transform (transformation at decomposition level 2 or later), the subband LL obtained in the immediately preceding transform is the target. In other words, the wavelet transform may be performed recursively on the subband LL obtained in the immediately preceding transform. Therefore, regardless of the number of wavelet transforms, there will be only one subband LL. Furthermore, as wavelet transform is performed, the granularity of frequency decomposition becomes finer as shown in FIG. 4. There is no particular limit to the number of times that wavelet transform is performed, but in this embodiment, the wavelet transform by the wavelet transform unit 304 is performed twice as shown in FIG. 4.
[0031] The wavelet transform unit 304 performs wavelet transform twice on each of the plane data WH, R, B, and G. Then, the wavelet transform unit 304 generates subbands of decomposition level 2 for each of the plane data WH, R, G, and B, and supplies them to the quantization unit 305.
[0032] The quantization unit 305 quantizes the transform coefficients included in the subbands of each plane data using a preset quantization parameter for each subband, and supplies the quantized transform coefficients to the entropy coding unit 306. The entropy coding unit 306 entropy codes the quantized transform coefficients supplied from the quantization unit 305, and outputs the entropy codes to the buffer 105 via an output terminal 307. There is no particular limit to the type of entropy coding, and it may be, for example, Golomb coding, Huffman coding, or the like.
[0033] Next, the decoding side will be explained. Fig. 6 is a block diagram of a decoding device. The decoding process will be explained with reference to Fig. 6.
[0034] The coded data input from the input terminal 601 is supplied to the entropy decoding unit 602. The entropy decoding unit 602 performs entropy decoding processing, and supplies the data obtained by the coding processing (corresponding to the transform coefficients after quantization) to the inverse quantization unit 603. The inverse quantization unit 603 inverse quantizes the data input from the entropy decoding unit 602 according to the quantization parameters set for each subband, and supplies the inverse quantized data (corresponding to the wavelet transform coefficients) to the wavelet inverse transform unit 604. The wavelet inverse transform unit 604 performs inverse wavelet transform processing on the data input from the inverse quantization unit 603. As a result, the wavelet inverse transform unit 604 outputs the plane data WH', R', G', B' as decoded plane data. The plane inverse transform unit 605 inputs the plane data WH', R', G', B' from the wavelet inverse transform unit 604. Then, the plane inverse conversion unit 605 calculates plane data Y' representing luminance Y' from the plane data R', G', B' according to the following equation (5). Y' = pr×R' + pg×G' + pb×B' …(5) Next, the plane inverse transform unit 605 calculates the gain-adjusted plane data Yg'. Yg' = Y' × ygain Here, “gain” uses the value used in Equation 3.
[0035] Then, the plane inverse conversion unit 605 calculates plane data W' from the plane data Yg' and the plane data WH' obtained by decoding according to the following equation (6). W' = WH' + Yg' ... (6) The plane inverse conversion unit 605 supplies the plane data W′ calculated as described above and the plane data R′, G′, B′ obtained by the decoding process to the plane synthesis unit 606 .
[0036] A plane synthesis unit 606 synthesizes the plane data W', R', G', and B' to generate one piece of RAW image data.
[0037] In this way, by generating plain data WH with reduced information volume rather than the plain data W itself, and then encoding it, it is possible to improve the encoding efficiency of the RAW image and further reduce the amount of code.
[0038] FIG. 5 shows an arrangement of pixels similar to that of FIG. 2, with addresses assigned thereto.
[0039] Formula (1) shows a simple calculation formula. When the horizontal coordinate of plane data "P" (P is R, G, B, W, etc.) is i and the vertical coordinate is j, the pixel value of coordinate (i, j) of plane data P is expressed as P[i][j]. In this case, Y[i][j] for reducing the information of W[i][j] may be calculated by the following formula (6). Y[i][j] =pr*(R[j][i-1]+R[j][i+1]) / 2 + pg*(G[j-1][i-1]+ G[j-1][i+1]+ G[j+1][i-1]+ G[j+1][i+1])4 + pb*(B[j-1][i]+B[j+1][i]) / 2 …(6) In addition, formula (2) is transformed into the following formula (2'), and formulas (1), (2), and (3) are combined to obtain The following formula (1') may also be used. Yg = pr×R +pg×G +pb×B …(1') Furthermore, the parameters pr, pg, and pb may be multiplied by a white balance gain.
[0040] In the explanation of this embodiment, the pixel array in FIG. 2 has been used as an example, but the present invention can be applied to an array such as that in FIG. 7 or even to other arrays not shown, as long as the array is a combination of the three primary colors R, G, and B and white W.
[0041] [Second embodiment] A second embodiment will be described below. The device configuration in the second embodiment is the same as that in the first embodiment shown in FIG.
[0042] Fig. 8 shows an example of color filters arranged in the image sensor unit 102 in the second embodiment, which has a different arrangement from that in Fig. 2. In Fig. 8, yellow (Ye), red (R), green (G), and blue (B) are arranged in a mosaic pattern for each pixel, and one yellow pixel, one red pixel, one blue pixel, and one green pixel are arranged regularly in one set for every 2 x 2 four pixels.
[0043] In the case of the pixel arrangement shown in FIG. 8, the process of the plane conversion unit 303 is as follows.
[0044] The plane conversion unit 303 calculates plane data Yw, which corresponds to a yellow component that is a mixture of the plane data R and G, from among the plane data R, G, and B, in accordance with the following equation (7). Yw = sr × R + sg × G … (7) Here, the relationship between the parameters sr and sg is as shown in the following equation (8). sr + sg = 1 …(8) Here, in general, sr = sg.
[0045] The plain data Yw corresponding to the yellow component calculated from equation (7) is data highly correlated with yellow (Ye).
[0046] However, in order to reduce data by utilizing the correlation between the plane data Yw corresponding to the yellow component and yellow (Ye), it is necessary to perform gain adjustment. Therefore, the plane conversion unit 303 obtains the plane data Ywg after gain adjustment according to the following formula (9). Ywg = Yw × yegain …(9) Here, yegain is an arbitrary integer that is set in advance.
[0047] The plane conversion unit 303 obtains plane data YeH representing the difference according to the following equation (10) using the gain-adjusted plane data Ywg. YeH = Ye - Ywg … (10) In the manner described above, the plain data YeH is generated by reducing the information of the plain data Ye.
[0048] The plane transformation unit 303 supplies the plane data YeH obtained as described above and the plane data R, G, B of the three primary colors to a wavelet transformation unit 304. The subsequent steps are the same as those in the first embodiment.
[0049] In the above manner, by generating plain data YeH by reducing the amount of information from plain data Ye and encoding it, it is possible to further improve the encoding efficiency of the RAW image and reduce the amount of code.
[0050] In the above embodiment, white and yellow are shown as examples of colors other than the three primary colors, but any mixed color that can be expressed using at least two of the three primary colors may be used.
[0051] (Other Examples) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
[0052] The invention is not limited to the above-described embodiments, and various modifications and variations are possible without departing from the spirit and scope of the invention. Accordingly, the following claims are appended to apprise the public of the scope of the invention. [Explanation of symbols]
[0053] 100...imaging device, 101...imaging optical section, 102...imaging sensor section, 103...sensor signal processing section, 104...RAW compression encoding section, 105...buffer, 106...recording data control section, 107...output terminal, 150...control section, 302...plane division section, 303...plane conversion section, 304...wavelet conversion section, 305...quantization section, 306...entropy encoding section
Claims
1. 1. An image encoding device that encodes data obtained by an image sensor having filters for detecting a fourth color periodically arranged in addition to filters for the three primary colors, comprising: a generating means for generating data approximating the fourth color using data of at least two of the three colors representing the three primary colors, and generating difference data representing a difference between the generated data and the data of the fourth color; an encoding means for encoding the three color data representing the three primary colors and the difference data; an adjustment means for adjusting a gain of data approximating the fourth color; having The image encoding device according to claim 1, wherein the generating means generates the difference data from the difference between data approximating the fourth color adjusted by the adjusting means and data of the fourth color.
2. 2. The image encoding device according to claim 1, wherein said generating means generates data approximating said fourth color using data of said three colors.
3. The adjustment means adjusts a gain based on a ratio between an average value of data approximating the fourth color and an average value of data of the fourth color.
2. The image encoding device according to claim 1 .
4. a division means for dividing the data obtained by the image sensor into a plurality of plane data each composed of pixel data of a single component; the generating means generates plane data of difference data representing a difference between the data approximating the fourth color and the data of the fourth color; The encoding means encodes plane data of three colors representing the three primary colors and plane data of the difference data.
4. The image encoding device according to claim 1, wherein the first and second inputs are input to the first and second inputs.
5. The encoding means comprises: wavelet transform means for generating a plurality of subbands from plain data; quantization means for quantizing coefficient data included in each subband; an entropy coding means for entropy-coding coefficient data after quantization by said quantization means; 5. The image encoding device according to claim 4, further comprising:
6. 6. The image encoding device according to claim 1, wherein the fourth color is white or yellow.
7. 7. The image encoding device according to claim 1, further comprising the image sensor.
8. 1. A method for controlling an image encoding device that encodes image data obtained by an image sensor having filters for detecting a fourth color periodically arranged in addition to filters for the three primary colors, comprising the steps of: a generating step of generating data approximating the fourth color using data of at least two of the three colors representing the three primary colors, and generating difference data representing a difference between the generated data and the data of the fourth color; an encoding step of encoding the three color data representing the three primary colors and the difference data; an adjustment step of adjusting a gain of data approximating the fourth color; having A control method for an image encoding device, characterized in that in the generation process, the difference data is generated from the difference between data approximating the fourth color after adjustment in the adjustment process and data of the fourth color.
9. A program for causing a computer to execute each step of the control method according to claim 8 when the computer reads and executes the program.
Citation Information
Patent Citations
Method for compressing picture data
JP2000244935A
Compression of Color Images Based on Two-Dimensional Discrete Wavelet Transforms Leading to Perceptually Lossless Images
JP2002516540A
Output level estimation apparatus and method, photographing apparatus and control method of the same, and program
JP2010157951A
Apparatus and method for processing image, program and recording medium
JP2011015347A
Imaging apparatus, imaging system and signal processing method
JP2016213650A
