EFFECT OF LOSSY JPEG COMPRESSION OF AN IMAGE WITH CHROMATIC ABERRATIONS ON TARGET MEASUREMENT ACCURACY

This paper reports an experiment conducted to investigate the effect of lossy JPEG compression of an image with chromatic aberrations on the measurement accuracy of target center by the intensity-weighted centroid method. I utilized six images shooting a white sheet with 30 by 20 black filled circles in the experiment. The images were acquired by a digital camera Canon EOS 20D. The image data were compressed by using two compression parameter sets of a downsampling ratio, a quantization table and a Huffman code table utilized in EOS 20D. The experiment results clearly indicate that lossy JPEG compression of an image with chromatic aberrations would produce a significant effect on measurement accuracy of target center by the intensity-weighted centroid method. The maximum displacements of red, green and blue components caused by lossy JPEG compression were 0.20, 0.09, and 0.20 pixels respectively. The results also suggest that the downsampling of the chrominance components Cb and Cr in lossy JPEG compression would produce displacements between uncompressed image data and compressed image data. In conclusion, since the author consider that it would be unable to correct displacements caused by lossy JPEG compression, the author would recommend that lossy JPEG compression before recording an image in a digital camera should not be executed in case of highly precise image measurement by using color images acquired by a non-metric digital camera.


INTRODUCTION
As performance of a digital camera becomes better and its price becomes lower in recent years, digital camera images are becoming more popular in diverse fields.The recent increase in number of pixels of images acquired by a non-metric digital camera encourages one to utilize it for image measurement.
However, a large number of pixels of an image bring difficulties in dealing with it.A high-resolution digital camera on board a mobile mapping system (MMS) often acquires several images per second.The data volume of images acquired by a MMS in a day sometimes reaches one terabyte (1 TB).The huge data volume of acquired images requires huge data storage for them, and makes the input time for processing them much longer.Therefore, lossy image compression before recording an image in a digital camera is still required.Moreover, almost all the recent digital cameras have the built-in function of lossy JPEG compression.
In the meantime the magnitude of displacements between different colors (red (R), green (G), blue (B)) caused by chromatic aberrations are smaller than 1 / 10 of the magnitude of radial lens distortions in most of non-metric digital cameras.However, as a pixel size on the focal plane of a non-metric digital camera becomes smaller, the influence of chromatic aberrations becomes greater and unable to be ignored.Currently, correction of chromatic aberrations would be indispensable for precise image measurement by using color images acquired by a non-metric digital camera.
Then a question has arisen.How much does lossy JPEG compression of an image with chromatic aberrations affect image measurement accuracy?
As for correction of chromatic aberration, Kaufmann and Ladstädter (2005), Luhmann et al. (2006a), Mallon and Whelan (2007), Hattori et al. (2011), and Matsuoka et al. (2012) reported experiments to correct chromatic aberrations.Their experiment results did not necessarily indicate that their proposed correction methods are able to provide satisfactory correction results equal to the measurement accuracy of single point features described in the literature by Luhmann et al. (2006b).
On the other hand, few papers reported on the effect of lossy JPEG compression of an image with chromatic aberrations on image measurement accuracy.Therefore, I decided to investigate the effect of lossy JPEG compression of an image with chromatic aberrations on image measurement accuracy.This paper reports an experiment conducted to investigate the effect of lossy JPEG compression of an image with chromatic aberrations on measurement accuracy of target center by the intensity-weighted centroid method.The experiment was conducted on the assumption that lossy JPEG compression is executed before recording an image in an ordinary digital camera.
Figure 1.Axial chromatic aberration and lateral chromatic aberration

CHROMATIC ABERRATION
Chromatic aberrations are caused by the variation of refractive index with wavelength, and produce lateral (oblique) distortions and axial (longitudinal) distortions (McGlone et al., 2004).Figure 1 shows the axial and lateral chromatic aberration.As for image measurement, the lateral chromatic aberrations that bring geometric errors are more influential than the axial chromatic aberrations that bring image blurs.Displacements between different colors caused by the lateral chromatic aberrations are point symmetric and the magnitude of the displacements is proportional to a radial distance from the principal point of a camera.Accordingly, the lateral chromatic aberration is often referred to as a chromatic difference in magnification.
A compound lens assembled from several lens elements made of substances with different refractive indexes can be utilized to reduce chromatic aberrations (Shibuya, 2005a, Shibuya, 2005b).The most common type is an achromatic doublet composed of two elements made of crown glass and flint glass.By combining more than two lenses of different composition, the degree of correction can be further increased.However, exact correction by using a compound lens can be made only at a small set of wavelengths, and it is impossible to correct chromatic aberrations perfectly at any wavelength over the visible range.
A zoom lens is a more complex optical system and may be expected to have a much higher level of chromatic aberrations than a fixed focal length lens that is a simpler optical system.However, the experiment results reported by Matsuoka et al. (2012) did not necessarily indicate that the magnitude of chromatic aberrations of a zoom lens Canon EF-S 18 -55 mm F 3.5 -5.6 USM was larger than that of a fixed focal length lens Olympus M.ZUIKO DIGITAL 17 mm F 2.8.

Investigated image
Since chromatic aberrations do not depend on whether a target object to be imaged is 2D or 3D in principle, I utilized six images shooting a white sheet with 30 by 20 black filled circles, which were called evaluation points in the experiment.The images were acquired by a lens-interchangeable digital SLR (single lens reflex) camera Canon EOS 20D with a Canon EF-S 18 -55 mm F 3.5 -5.6 USM lens at the widest view of its zoom lens.The lens consists of 11 elements in 9 groups.The number of recording pixels and the pixel size on the focal plane of EOS 20D are 3504 pixels × 2336 pixels and 6.42 m × 6.42 m respectively.Figure 2 shows one of the images utilized in the experiment.These are called R+R+R data for a red color, G+G+G data for a green color, and B+B+B data for a blue color in the paper.

Lossy JPEG Compression
I compressed four sets of image data (R+G+B, R+R+R, G+G+G, B+B+B) using two compression parameter sets of a downsampling ratio, a quantization table and a Huffman code table utilized in two modes Fine and Normal of EOS 20D by the Independent JPEG Group's free JPEG software.The difference between the modes Fine and Normal of EOS 20D is the difference of the quantization tables utilized in quantization of DCT-coefficient data.
The lossy JPEG compression in EOS 20D is executed with the following process: Step 1: color space conversion Step 2: downsampling Step 3: block splitting Step 4: discrete cosine transformation (DCT) Step 5: quantization of DCT-coefficient data Step 6: entropy encoding (Huffman coding) Chromatic aberrations were expected to have an impact in Step 1: color space conversion and Step 2: downsampling.
A source image data represented in RGB (R: red, G: green, B: blue) color space is converted into an image data represented in YCbCr (Y: luminance component, Cb, Cr: chrominance components) color space in Step 1.The color space conversion from RGB color space to YCbCr color space in lossy JPEG compression is very common, and it is executed by using the following equation:

Measurement method
Image coordinates of the center of an evaluation point were measured by the intensity-weighted centroid method.
Centroid methods are relatively simple and theoretically independent of the image resolution.Furthermore, centroid methods do not require a template dependent on the image resolution.Accordingly, centroid methods are often utilized in measurement of the target location in image measurement.
The intensity-weighted centroid method in the experiment estimates the center location (x C , y C ) of an evaluation point by using the following equation: where w ij is the weight of the pixel (i, j).The weight w ij in the experiment was calculated by using the following equation: where g ij is the image value of the pixel (i, j), g I and g O are the mean image values of pixels located inside and outside the evaluation point respectively.

Evaluation of effect of lossy JPEG compression
I evaluated the effect of lossy JPEG compression by using differences of measured coordinates of the center of an evaluation point between a reference uncompressed image data and a target compressed image data.The reference uncompressed image data was the uncompressed R+G+B data, while the target compressed image data were the lossily compressed R+G+B, R+R+R, G+G+G, B+B+B data using two sets of compression parameters for the modes Fine and Normal of EOS 20D.Each investigated image had 600 evaluation points and 3600 evaluation points of the six investigated images were evaluated in the study.

Chromatic aberrations
Table 1 shows the root mean squares (RMSs) and the maxima of displacements of the 3600 evaluation points of the six investigated images between different colors caused by chromatic aberration in the uncompressed R+G+B data.Figure 4 shows displacement vectors GR and GB in the uncompressed R+G+B data of the image shown in Figure 2. The displacement vector GR means a vector from the position of the center of an evaluation point measured in the green color to that measured in the red color.

Horizontal
where (u C , v C ) and (u G , v G ) are image coordinates of the target color (C) and the reference color (G) respectively.(u 0C , v 0C ) and (u 0G , v 0G ) are image coordinates of the center of an image frame of the target color (C) and the reference color (G) respectively.r C and r G are radial distances from the center of an image frame of the target color (C) and the reference color (G) respectively.A displacement vector GC with a positive value of d C turns outward, while one with a negative value of d C turns inward.Solid lines in Figure 5 show the following approximate cubic functions estimated by means of least squares adjustment using the 600 evaluation points for reference: The results show that the magnitude of the displacements GR and GB caused by chromatic aberrations was considerably smaller than that of radial lens distortions in ordinary nonmetric digital cameras.On the contrary, since the results indicate that the displacements caused by chromatic aberrations were larger than the ordinary measurement errors of image coordinates, I concluded that the displacements caused by chromatic aberrations would be unable to be ignored in precise image measurement.
Moreover, the results indicate that magnitude of a displacement of an evaluation point would depend on a radial distance from the center of an image frame.The results also indicate that the magnitude of the displacements caused by chromatic aberrations would be unable to be approximated with a linear function of the radial distance.This would be caused by the fact that the lens utilized in the experiment was a compound lens assembled from several lens elements.

Effect of lossy JPEG compression
Table 2 shows compression ratios of the lossily compressed R+G+B, R+R+R, G+G+G, B+B+B data of the image shown in Figure 2 using two sets of compression parameters for the modes Fine and Normal of EOS 20D.The compression ratio in the study was defined as the ratio of the raw data size in bytes of an uncompressed image to the file size in bytes of a compressed image data.The compression ratios for an ordinary color image of the modes Fine and Normal with 2x1 1x1 1x1 sampling of EOS 20D are expected to be 6.5 and 13.0 respectively.2. Compression ratio of the image shown in Figure 2 Table 2 indicate that the difference of the downsampling factors would not produce a greater difference of compression ratios than the difference of the quantization tables utilized in quantization of DCT-coefficient data between the two modes: Fine and Normal of EOS 20D.

Mode
Table 3 shows the RMSs and the maxima of displacements of the 3600 evaluation points of the six investigated images between the uncompressed image data and the compressed image data by using the two compression parameter sets for the modes Fine and Normal of EOS 20D. Figure 6 shows 600 displacement vectors caused by lossy JPEG compression using the compression parameter set for the mode Normal in the image shown in Figure 2. Figure 7 shows signed displacements caused by lossy JPEG compression against radial distances .The signed displacements caused by lossy JPEG compression were calculated by using Equation (4) and Equation ( 5) in the same way as the signed displacements caused by chromatic aberration were calculated.Solid lines in Figure 7 show approximate cubic functions as well.Table 3 indicates that the magnitude of the displacements caused by lossy JPEG compression was considerably smaller than that by chromatic aberration shown in Table 1.However, Figure 6 and Figure 7 clearly indicate that lossy JPEG compression of an image with chromatic aberrations would produce an effect on measurement accuracy of target center by the intensity-weighted centroid method.Since the intensityweighted centroid method can reach an accuracy of 0.03-0.05pixel in practice (Luhmann et al., 2006b), the effect of lossy JPEG compression of an image with chromatic aberrations on measurement accuracy of target center by the intensityweighted centroid method would be unable to be ignored.
Figure 8 shows the displacements caused by lossy JPEG compression using the compression parameter set of the mode Normal against the displacements caused by chromatic In the meantime Figure 7 and Figure 8 indicate that it would be unable to correct displacements caused by lossy JPEG compression of an image with chromatic aberrations by using a function of the radial distance from the center of an image frame, or a function of the magnitude of chromatic aberrations.

Effect of downsampling in lossy JPEG compression
The horizontal displacements seem to be superior to the vertical displacements in the red color and the blue color in Figure 6.Since I guessed that the cause of the superiority of the horizontal displacements would be 2x1 1x1 1x1 sampling, I investigated additional two sets of lossily compressed R+G+B data which were compressed with 1x1 1x1 1x1 sampling and 2x2 1x1 1x1 sampling.
Table 4 shows the RMSs of displacements of 3600 evaluation points between the uncompressed R+G+B data and the compressed R+G+B data.The displacements were caused by lossy JPEG compression with three different downsampling factors.Figure 9 and Figure 10 show displacement vectors of the 600 evaluation points caused by lossy JPEG compression with 1x1 1x1 1x1 sampling and 2x2 1x1 1x1 sampling in the image shown in Figure 2 respectively.Figure 11 and Figure 12 show signed displacements caused by lossy JPEG compression with 1x1 1x1 1x1 sampling and 2x2 1x1 1x1 sampling against radial distances in the image shown in Figure 2 respectively.Solid lines in the figures show approximate cubic functions.
The results clearly indicate that the cause of the superiority of the horizontal displacements in Figure 6 would be the downsampling of 2x1 1x1 1x1 sampling.The results also indicate the effect of lossy JPEG compression with 1x1 1x1 1x1 sampling on measurement accuracy of target center would be negligible.That is to say, the reduction of the spatial resolution of the chrominance components Cb and Cr in lossy JPEG compression of an image with chromatic aberration would produce displacements between an uncompressed image data and a lossily JPEG compressed image data.

CONCLUSIONS
The experiment results indicate that the magnitude of the displacements caused by lossy JPEG compression using the compression parameter sets utilized in EOS 20D was considerably smaller than that by chromatic aberration.The maximum displacements GR and GB caused by chromatic aberration were 1.57 and 2.00 pixels respectively, while the maximum displacements of R, G, and B caused by lossy JPEG compression were 0.20, 0.09, and 0.20 pixels respectively.However, since the displacements caused by lossy JPEG compression were larger than the ordinary measurement errors of image coordinates, I concluded that the effect of lossy JPEG compression of an image with chromatic aberrations on measurement accuracy of target center by the intensityweighted centroid method would be unable to be ignored.
Since I consider that it would be unable to correct displacements caused by lossy JPEG compression, I would recommend that lossy JPEG compression before recording an image in a digital camera should not be executed in case of highly precise image measurement.
The experiment results also suggest that the downsampling of the chrominance components Cb and Cr in lossy JPEG compression of an image with chromatic aberration would produce displacements between an uncompressed image data and a compressed image data.2x1 1x1 1x1 sampling, which is the common case of downsampling in lossy JPEG compression by most of the current digital cameras would cause horizontal displacements to be superior to vertical displacements.

Figure 2 .
Figure 2. Image utilized in the experiment The images were recorded in Canon raw data format, and the acquired raw data were developed without any correction by DxO Optics Pro v7.The developed image data are called R+G+B data in the paper.I prepared three sets of image data with no chromatic aberration by composing monochrome image data that were created by color separation of R+G+B data.These are called R+R+R data for a red color, G+G+G data for a green color, and B+B+B data for a blue color in the paper.
Downsampling, which is sometimes called chroma subsampling, is to reduce the spatial resolution of the chrominance components Cb and Cr.Data reduction of Cb and Cr in EOS 20D is performed by 2x1 1x1 1x1 sampling.2x1 1x1 1x1 sampling means that the luminance component Y is not downsampled and the chrominance components Cb, Cr are downsampled 2:1 horizontally and 1:1 vertically.2x1 1x1 1x1 sampling indicates that the horizontal resolution of Cb and Cr is half of that of Y and the vertical resolution of Cb and Cr is full of that of Y. 2x1 1x1 1x1 sampling is the common case of downsampling, and is conducted in lossy JPEG compression by most of the current digital cameras.Two additional downsampling factors of 1x1 1x1 1x1 and 2x2 1x1 1x1 were investigated in the experiment.1x1 1x1 1x1 sampling means that both the luminance component Y and the chrominance components Cb, Cr are not downsampled, while 2x2 1x1 1x1 sampling means that Y is not downsampled and Cb, Cr are 2:1 downsampled both horizontally and vertically.

Figure 4 .
Figure 4. Displacement vectors caused by chromatic aberration in the image shown in Figure 2

Figure 5 .Figure 7 .Figure 6 .
Figure 5. Signed displacements caused by chromatic aberration in the image shown in Figure 2

Figure 8 .
Figure 8. Displacements by chromatic aberration vs. displacements by lossy JPEG compression with 2x1 1x1 1x1 sampling in the image shown in Figure 2 (Mode: Normal)

Figure 9 .
Figure 9. Displacement vectors caused by lossy JPEG compression with 1x1 1x1 1x1 sampling in the image shown in Figure 2 (Mode: Normal)

Table 1 .
RMS and maximum of displacements caused by chromatic aberration of 3600 evaluation points (unit: pixel)

Table 3 .
RMS and maximum of displacements caused by lossy JPEG compression of 3600 evaluation points (unit: pixel)