• Non ci sono risultati.

Bringing the Digital Camera to the Physics Lab

N/A
N/A
Protected

Academic year: 2021

Condividi "Bringing the Digital Camera to the Physics Lab"

Copied!
4
0
0

Testo completo

(1)

Bringing the Digital Camera to the Physics Lab

M. Rossi, L. M. Gratton, and S. Oss

Citation: Phys. Teach. 51, 141 (2013); doi: 10.1119/1.4792005 View online: http://dx.doi.org/10.1119/1.4792005

View Table of Contents: http://tpt.aapt.org/resource/1/PHTEAH/v51/i3 Published by the American Association of Physics Teachers

Additional information on Phys. Teach.

Journal Homepage: http://tpt.aapt.org/

Journal Information: http://tpt.aapt.org/about/about_the_journal Top downloads: http://tpt.aapt.org/most_downloaded

Information for Authors: http://www.aapt.org/publications/tptauthors.cfm

(2)

DOI: 10.1119/1.4792005 The Physics Teacher◆ Vol. 51, March 2013 141

W

e discuss how compressed images created by modern digital cameras can lead to even severe problems in the quantitative analysis of experi-ments based on such images. Difficulties result from the nonlinear treatment of lighting intensity values stored in compressed files. To overcome such troubles, one has to adopt noncompressed, native formats, as we examine in this work.

Linearity is a well-known issue in an extremely wide field of concern when dealing with measurement techniques in science. There are of course countless circumstances in which linear response (i.e., the direct proportion relating input ver-sus output signals) is suited for modeling a given phenome-non. It is also evident that the analyzing apparatus itself needs to behave in a linear way if one wants to reproduce the actual response of the experiment at issue.

Here we address the behavior of light sensors, which are the active core of modern digital cameras. These devices, usu-ally referred to as CCDs (charge-coupled devices1), are built

with solid-state materials coupled to appropriate electronic circuitry capable of providing a linear response in terms of the input light, i.e., the number of photons.2 A feature that

is familiar to most photography professionals as well as to astronomers,3 but much less to physics and science educators

or to nonprofessional photographers, is that video or image recording hardware has built-in software that compresses the output video or image. All of us obviously appreciate the memory saving coming from JPEG compression. Depending on the native image size, related to the number of CCD single sensors/pixels, the produced file can be squeezed down from many to some megabytes, the reduction factor also being a function of the specific compression algorithm and of the specific nature of the image. As a welcome result, it is possible

to accommodate many more images in a single digital memo-ry card or hard disk. Yet, there is a counterpart to this advan-tage: JPEG compression algorithms, as well as other kinds of digital image processing addressing the aspect of size reduc-tion, act in a nonlinear way on the stored information. More specifically, one observes that in conditions of wide changes of light exposure, the JPEG file does not reproduce linearly these changes or, equivalently, in the case of doubling/halv-ing of light intensity, the JPEG file does not lead to doubldoubling/halv-ing/ halving of values associated with the digital information

ex-Bringing the Digital Camera to the

Physics Lab

M. Rossi, L. M. Gratton, and S. Oss,

University of Trento, Trento, Italy

Fig. 1. A “black hole” cut in a sheet of white paper (upper part) and its intensity profile (lower part) averaged through the red rectangle (size about 1000 x 50 pixels, 12 bit). Exposure values: 1 s, f/16.

Fig. 2. Digital light signal as a function of exposure time for a white sheet of paper (see text). JPEG, 8-bit, compressed format. All shots taken at f/16.

Fig. 3. Digital light signal as a function of exposure time for a white sheet of paper (see text). RAW, 12-bit, uncompressed for-mat. All shots taken at f/16.

(3)

142 The Physics Teacher◆ Vol. 51, March 2013

given by

(1)

We made a straightforward measurement of an actual diffraction through a slit (a = 4310-5 m) with a HeNe laser

beam, green line at l = 542 nm. A typical result is shown in Fig. 4. The technique to obtain intensity values is the same adopted for the “black hole/white paper” of Fig. 1 and dis-cussed above.

In Fig. 5 we show the computed pattern of Eq. (1) along with the observed values emerging from the digital JPEG file associated with Fig. 4. A noticeable disagreement between computation and observation appears here. Such a disagree-ment is to be ascribed to the fact at issue in this work, i.e., that the JPEG image is affected by nonlinear pixel treatment in terms of their values at different exposure levels. If we had used the JPEG version of Fig. 4 to compute a numerical table giving intensities of light diffraction maxima, results would have been seriously “wrong” for post-processing reasons and not for other kinds of instrumental and procedural mistakes. pressing the image.

To show how these problems happen, we have taken a series of pictures4 of a hole cut in a sheet of white paper,

covering a black box. A typical shot is shown in Fig. 1, along with the light intensity profile obtained with a freeware photo editing software, ImageJ (rsbweb.nih.gov/ij/). The intensity values span ranges from 0 to 2n, where n is the number of bits adopted in the image digitalization. These values have been determined by adopting an averaging rectangular window as that shown in Fig. 1, whose size is of the order of 1000 x 50 pixels. We took several pictures with the corresponding “white” pixel values of Fig. 1 at various exposure times with fixed diaphragm at f/16. We plot in Fig. 2 the sequence of average “white” intensities for JPEG images when the expo-sure values—here time of expoexpo-sure—change in a linear way. We see in this plot a marked departure from linearity. Yet the very same photographs, saved in an uncompressed (RAW) format, show a completely different behavior, as depicted in Fig. 3, where linearity is preserved. In both pictures, Figs. 2 and 3, the plotted data are affected by a very low statistical er-ror, which is not shown. Moreover, notice the different ranges of the two plots, corresponding with 8- and 12-bit depths for JPEG and RAW formats: associated saturation values are 256 and 4096, respectively.

How could this phenomenon affect science educators’ lives? Pretty seriously, indeed. Digital cameras are nowadays and for quite a number of years a standard measuring device in didactic laboratories.5 Suppose we need to track the

posi-tion of a mass moving under the acposi-tion of gravity: a long time exposure along with a stroboscopic light unit, exactly as in the past of analog photography, will do the job. But suppose we need to make a quantitative measurement in which the intensity of light is of concern. We could be interested, for instance, in the determination of how light energy varies with the distance from the source or how electromagnetic radia-tion is dispersing its intensity through a prism or a diffracradia-tion grating.

We will consider here how problems in analysis can arise if one does not account for a possible nonlinear behavior of the camera/software instrument in a typical, well-known situa-tion taken from standard case studies in optics.

As a specific example, we address the diffraction of light through a single slit of width a. The intensity for monochro-matic radiation of wavelength l observed at the angle q is

Fig. 4. Single-slit diffraction image.

Fig. 5. Comparison between computed intensity diffraction curve [Eq. (1), blue line] and observed JPEG image (green line, taken from photo of Fig. 4, 8-bit version).

Fig. 6. Comparison between computed intensity diffraction curve [Eq. (1), blue line] and observed RAW image (red line, taken from photo of Fig. 4, 12-bit version).

(4)

The Physics Teacher◆ Vol. 51, March 2013 143 Mauro Rossi is a high school math and physics teacher. He is collabo-rating with physics department staff at the University of Trento on the construction of new school science projects and curricula, and the devel-opment of laboratory materials. mauro@science.unitn.it

Luigi M. Gratton is assistant professor of physics at the University of Trento, Italy. He is in charge of the experimental physics lab for pre- and in-service physics teachers for secondary medium and high schools. His background is in material science and ionic implantation processes.

luigi.gratton@unitn.it

Stefano Oss is associate professor of physics at the University of Trento, Italy. He is in charge of the Physical Sciences Communication Laboratory in the physics department and of the physical branch of the pre-service training center for secondary school physics teachers. His background is in atomic physics and theoretical molecular spectroscopy.

stefano.oss@unitn.it

We can also see from Fig. 5 that the widths of the diffraction peaks (FWHM, for example) do not agree with the computed values, once again for the very same reason as above.

As already suggested in this work, the solution to this problem consists of avoiding a compression treatment of the native (RAW) file produced by the CCD/electronic ampli-fier. The unmodified file, even if expectedly larger than the compressed one, is a linear representation of the actual light intensity coming from the photographed image, as already discussed when comparing Figs. 2 and 3. This can clearly also be seen in Fig. 6, in which we compare the theoretical pattern of Eq. (1) with the observed uncompressed RAW file coming from the same digital camera. We stress that the used photo is always that shown in Fig. 4, i.e., the same as that analyzed in Fig. 5, the only, key difference being the compression format.

Similar conclusions can be drawn for other quite typical standard optics experiments at the introductory high school or college level. We mention, for example, the quantitative study of line spectra coming from a dispersing device such as a prism or a diffraction grating. In this case one has to be very careful in considering how the different wavelengths building the spectrum are treated by the sensing device. In the case of nonprofessional digital cameras, the CCD has a highly linear response for the independent RGB pixels, which are the same physical sensors covered with different colored filters. As a result, with the aim of avoiding false intensity measurements of peaks at various wavelengths, it is very much appropriate to use RAW files that are the superposition of the three RGB components automatically made by the camera. The easiest way to do so is to instruct either the camera or the tracking/ analyzing software to work in black and white modality and not to analyze the independent RGB channels.

References

1. J. D. E. Beynon and D. R. Lamb, Charge-Coupled Devices and Their Applications (McGraw-Hill, London, 1980); en.wikipedia.org/wiki/Charge-coupled_device (and references therein); and Albert J. P. Theuwissen, Solid-State Imaging With Charge-Coupled Devices (Springer, New York, 1995).

2. David B. Goldstein, “Physical Limits in Digital Photography” (Northlight Images, 2009). Free pdf at www.northlight-images. co.uk/downloadable_2/Physical_Limits_2.pdf.

3. C. D. Mackay, “Charge-coupled devices in astronomy,” Ann. Rev. Astron. Astrophys. 24, 255–283 (1986).

4. All the pictures in this work were taken with a reflex digital camera Nikon D80 with intensity calibration at the native value (ISO 100) to avoid electrical amplification after the sensing unit. The lens used is a Nikkor 200 mm set at fixed f/16 dia-phragm value. The focus was adjusted in manual mode. 5. M. F. Santillo, “A simple illustrative model of a charge-coupled

device (CCD),” Phys. Teach. 47, 454–455 (Oct. 2009).

Riferimenti

Documenti correlati

Certamente la maggior parte delle famiglie che negli anni Trenta ospitavano famuli li hanno ancora nel 1459, e queste stesse famiglie sono ugualmente ricche di braccia e di animali,

Here we introduce graphene in Si CMOS circuits to exploit favorable electronic properties of both technologies and realize a new class of simple oscillators using only a GFET, Si CMOS

Knockdown of Mevalonate Kinase in a murine microglial cellular model (BV-2 cells) results in neither augmented NALP3 expression nor increase of apoptosis.. On the contrary,

At this third stage, the study of community and the Internet began to focus not only on expressions of religious community online, but also on how religious communities

The aim of this thesis work was to modify one of most versatile way to obtain nanoparticle imbedded into polymer matrices in order to better control the physical properties

Proceeding from the foregoing, an objective need arises to justify a new concept for the formation of a promising innovation policy and the development of a strategy of a

In this paper are listed the methods, that were used during the research, the results of the laboratory tests of anionic flocculants Magnaflock, that were conducted on various

of Mathematics, Computer Science, and Physics University of Udine, Italy. Course on Data Management for