# Low-cost, sub-micron resolution, wide-field computational microscopy using opensource hardware

## Abstract

The revolution in low-cost consumer photography and computation provides fertile opportunity for a disruptive reduction in the cost of biomedical imaging. Conventional approaches to low-cost microscopy are fundamentally restricted, however, to modest field of view (FOV) and/or resolution. We report a low-cost microscopy technique, implemented with a Raspberry Pi single-board computer and color camera combined with Fourier ptychography (FP), to computationally construct 25-megapixel images with sub-micron resolution. New image-construction techniques were developed to enable the use of the low-cost Bayer color sensor, to compensate for the highly aberrated re-used camera lens and to compensate for misalignments associated with the 3D-printed microscope structure. This high ratio of performance to cost is of particular interest to high-throughput microscopy applications, ranging from drug discovery and digital pathology to health screening in low-income countries. 3D models and assembly instructions of our microscope are made available for open source use.

## Introduction

Low-cost, high-performance portable microscopes are essential tools for disease diagnosis in remote and resource-limited communities1. A fundamental requirement is to combine wide field of view (FOV) with the high resolution necessary for imaging of sub-cellular features of biological samples. This underpins efficient inspection of extended, statistically-significant areas for screening of, for example, cancer, malaria, or sickle cell anemia2. In conventional imaging, the number of pixels in the detector array constitutes a hard limit on the space-bandwidth product (SBP – the number of pixels in a Nyquist-sampled image3,4) so that increased FOV can be achieved only at the expense of reduced spatial resolution. SBP can be increased using larger detector arrays coupled with higher-performance, wide-field aberration-corrected optics, or by mechanical scanning, but these approaches add complexity, cost and bulk5,6.

Several low-cost portable microscopes have been proposed7,8,9,10,11,12, but they all suffer from the problem of small SBP. Early progress towards low-cost microscopy has involved the use of a high-cost microscope objective lens coupled to a mobile-phone camera7 and such instruments tend to suffer from a higher system cost, vignetting, short working distance, small depth of field (DOF) and narrow FOV. Lower-cost implementations have been reported in which the microscope objective is replaced by a camera lens from a mobile phone8, or a ball lens9, but their resolving power is limited by the small numerical aperture (NA) and high aberrations. Of these implementations, the use of mobile-phone camera lenses as objectives places an upper limit on the SBP: for example a 4-μm spatial resolution across 9 mm2 FOV corresponding a SBP of 2.25-megapixels8. The 4-µm resolution is insufficient for observing sub-cellular features and while a higher NA can be obtained using ball lenses, providing a resolution around 1.5 μm, they suffer from small SBP8,13.

We report a low-cost, wide-field, high-resolution Fourier-ptychographic microscope (FPM)14, implemented with 3D-printed opto-mechanics and a Raspberry Pi single-board computer for data acquisition as shown in Fig. 1(a). High-SBP images are constructed from multiple low-resolution, detector-SBP limited images, captured in time-sequence using oblique illumination angles yielding a SBP that is much greater than that of the detector. We demonstrate 25-Megapixel microscopy using a 4-Megapixel detector array. The tilted illuminations provide translations of higher spatial-frequency bands into the passband of the objective lens15. Stitching of images in the frequency domain is implemented using an iterative phase-retrieval algorithm to recover high-resolution amplitude and phase of the sample image16,17, as well as aberrations due to the objective14. Recovery of phase information enables imaging of unstained transparent samples18 and computational calibration of illumination angles during image reconstruction is able to correct errors arising from misalignment of various components19,20, which is of particular importance for microscopy using low-cost 3D-printed devices.

In previous demonstrations of a low-cost 3D-printed FPM, the SBP was limited by the severe off-axis aberrations of the mobile-phone camera lens (1.5 µm resolution across 0.88 mm2 FOV giving a SBP of 1.56-megapixels), and employed a science-grade, high-cost monochrome sensor21. Exploiting the mass market for consumer color sensors in mobile phone cameras, we demonstrate the first use of a low-cost consumer color camera in FPM, to gain more than an order-of-magnitude cost reduction for an equivalent SBP. The main difference between the two sensor types is the spatial-spectral filtering provided by the Bayer filter array, which encodes recorded images into sparse red, green, and blue channels. While the decoding processes follows a standard demosaicing procedure (individual RGB channels are interpolated and stacked into a 3D matrix), the loss in image information due to sparse sampling requires special treatment within the FPM reconstruction algorithm. We address the sparse sampling problem and present new robust algorithms for calibrating the 3D printed system for high-quality image reconstruction. In addition, the Raspberry Pi single-board computer used for controlling the camera and illumination LEDs performs autonomous data acquisition, providing portability and compactness, such as is required for use inside incubation systems.

In the next section, simulations to study the impact of the Bayer filter array and the experimental results from our system are presented. Implications of the results and future directions are discussed in the later sections. The methods section includes descriptions of the experimental setup, data-acquisition, data processing and calibration procedures. We also include the necessary CAD files and an instruction set to build the FPM presented in this article (Supplementary Material S1).

## Results

The Raspberry Pi camera (a low-cost device that complements the Raspberry Pi computer) employs a low-cost CMOS sensor, such as is typically found in mobile phones. It employs a Bayer filter (red, green and blue filters arranged on a 2D matrix in a 2 × 2 RGGB pattern22 (Fig. 1(b))). This divides pixels on the sensor between the three color-filters resulting in sparsely sampled images: red channel −75% empty pixels, green channel −50% empty pixels and blue channel −75% empty pixels. The empty pixels are demosaiced (using bilinear interpolation) to produce a perceptually acceptable photographic image.

In FPM, the reconstruction algorithm18 (see Methods) involves a step to iteratively recover amplitude and phase of the low-resolution images, where the estimated amplitude is replaced by the experimentally obtained images. In color cameras, the experimental image has empty pixels (due to the Bayer filter) whose values are unknown. We have considered two approaches for mitigation of the sparse sampling due to the Bayer filter. The first, a sparsely-sampled reconstruction (SSR) algorithm23, updates only the non-empty image pixels, relying on the FPM reconstruction to estimate the empty image pixels. This approach increases the number of unknowns in the system and can have slower convergence or failure to converge. In a second approach, the empty pixels are estimated instead from demosaicing enabling the use of a conventional FPM recovery; we refer to this approach as demosaiced reconstruction (DR). With DR the interpolation errors introduced in demosaicing can introduce artefacts in the reconstruction. We report below a comparison of image-recovery accuracy using SSR and DR recovery applied to simulated data.

Convergence of the FPM reconstruction algorithms requires the experimental design conditions to satisfy Nyquist sampling of the image by the detector array and to have approximately 50% overlap between the frequency bands selected by adjacent illumination angles (Fig. 2(a))24. We assess here using simulations, how these requirements are modified by the reduced sampling rate associated with the sparse sampling of the Bayer matrix. Image quality is compared to recovery from non-Bayer-encoded images.

Using the far-field approximation15, the image intensity for a color channel can be written as

$$I(x,y)={|{ {\mathcal F} }^{-1}\{P({k}_{x},{k}_{y})\cdot {\mathcal F} \{A(x,y){e}^{i\varphi ({\rm{x}},{\rm{y}})}\}\}|}^{2}\cdot B(x,y)+N(x,y)$$
(1)

where (kx, ky) are coordinates in frequency space, (x, y) are coordinates in real space, P is the pupil function, A and ϕ are the amplitude and phase distributions of the input object respectively, B is a binary mask corresponding to the color channel’s filter arrangement on the RGGB Bayer matrix, N is the added Gaussian image noise and F is the Fourier transform operator. Since robustness of the reconstruction is strongly dependent on the aberrations present in the pupil plane, they were simulated by including defocus and spherical optical aberrations generated using Zernike polynomials. We employed the Root-Mean-Squared (RMS) error between high-resolution reconstructed image and the expected ideal simulated image as a metric of image quality. We employed 150 iterations, which was more than sufficient for the FPM algorithms to converge.

In an imaging system, the image-sampling frequency is defined as fsampling = M/PS, where M is the magnification and PS is the pixel size. This sampling frequency must satisfy the Nyquist sampling criterion, defined as twice the optical cut-off frequency, to avoid aliasing:

$${f}_{{sampling}}\ge {f}_{{Nyquist}}=2{f}_{{cut}-{off}}=2N{A}_{{obj}}/\lambda$$
(2)

The image-sampling frequency can be controlled in the experimental design by modifying the magnification since the pixel size is fixed by the camera sensor characteristics. To achieve the widest FOV possible without aliasing, the sampling factor (fsampling/fNyquist) must be unity. For Bayer sensors, intuitively the effective pixel width is 2× larger due to the empty pixels in each color channel of the Bayer filter array, hence, the magnification needs to be increased by a factor of two compared to a monochrome detector array to compensate, i.e., the required sampling factor will be two. Since increasing the magnification reduces the FOV, simulations were performed (Fig. 2(b)) to assess whether the FPM reconstruction methods could converge with under-sampling to achieve the highest SBP.

### Comparison of FPM reconstruction techniques for bayer images

Sparsely-sampled reconstruction has been shown to be effective for aliased images with 75% sparsity23, offering an advantage in terms of maximum achievable SBP compared to demosaiced reconstruction. However, as can be seen in Fig. 2(b), the image reconstruction from Nyquist-sampled Bayer images exhibited large RMS errors of 20–30% compared to 10% for non-Bayer images. Reduced image quality for reconstruction from Bayer-sampled images is expected due to aliasing artefacts; however, these findings differ from the conclusions in23: probably due to practical differences in implementation, which did not involve compensation of optical aberrations and benefitted from low-noise data recorded by science-grade cameras. This enabled reconstruction of high-resolution images from data with 75% sparsity. However, in our implementation recovering the system aberrations and dealing with the detector read noise is crucial, hence, both SSR and DR reconstruction methods require an additional 2× magnification to satisfy the Nyquist sampling criterion.

In Fig. 2(c), the requirement for overlap between the spatial frequencies recorded by two adjacent LEDs is assessed. It suggests that RMS errors for SSR start to converge at ~40% overlap compared to 50% for DR; this is in agreement with the requirements for non-Bayer sensors24. Since the additional 2× magnification is used in these simulations, the frequency overlap requirement achieved is similar to the requirement for non-Bayer systems. Using these two optimal system parameters (2× additional magnification and a 70% frequency overlap), the overall convergence for DR and SSR and non-Bayer systems is compared in Fig. 2(d). It can be observed that DR has better convergence and pupil recovery than SSR. The RMS errors in the final reconstructions are close for DR and SSR, hence it can be concluded that DR has better convergence properties despite both reconstruction techniques resulting in similar reconstruction quality. All reconstructed images are shown in the Supplementary Material S2.

### Algorithmic self-calibration of LED misalignment

Our system is implemented using 3D printed components and intended to be portable; hence, it may become easily misaligned, affecting primarily the illumination angles (LED positions). In addition, image distortion and field curvature change the relative LED positions distinctly across the FOV25. We have implemented a recently-developed self-calibration algorithm for LED position misalignment correction20, solving the issues of image distortion and misaligned components with relatively good computational efficiency (see Methods). In this algorithm the intensity image of an off-axis illuminated brightfield image is Fourier transformed to produce two overlapping circles, centered around the illumination direction. Using image processing techniques, we can find centers of these circles providing a better calibration for the LED positions; hence, the calibration accuracy depends on how well these circles are delineated.

While a sampling factor of two is sufficient (for a monochrome sensor), our simulations suggest (Fig. 2(e)) that artefacts introduced by the Bayer matrix require the sampling factor to be around three to produce an undistorted circular boundary, regardless of demosaicing. The Bayer pattern can be treated as a periodic grating; hence, it produces frequency replicas (similar to diffraction orders), a type of aliasing artefact, which distort circle boundaries indicated by Fig. 2(e). Hence, by increasing the sampling frequency, the separation between these frequency replicas is increased to preserve the boundaries. In practice, the change in illumination wavelength varies the sampling factor for a fixed magnification since the sampling frequency is fixed but the Nyquist frequency changes; hence, 3× sampling factor requirement for red (630 nm) (enough for calibrating LED positions) results in 2× sampling factor in blue, the minimum required for overcoming Bayer sampling. This suggests that the red channel can be used for LED position calibration without losing additional SBP due to the increased sampling requirement. The FOV is divided into several segments and processed independently in FPM, hence the distortion is tackled by calculating the relative LED positions for each of these segments independently (see methods for the recovered distortion of the system).

## Methods

### Experimental setup

Instructions for construction of our microscope shown in Fig. 1(a) can be found in Supplementary Material S1. To minimize the cost of our microscope we used easily accessible off-the-shelf, low-cost components. We chose a finite-conjugate microscope design because it requires only a single lens. Sample and focusing stages were custom designed and 3D-printed using a Ultimaker 2 + 3D printer. A Raspberry Pi V2 NOIR camera module was used (8 megapixels, 1.12um pixel size) which contains a 3-mm focal-length camera lens, which was remounted and displaced from the sensor to achieve ~1.5× magnification. Frequency overlap of ~70% was obtained by placing the Unicorn HAT HD 16 × 16 LED array (3.3 mm pitch) 60 mm below the sample stage. The RGB LED array has peak illumination wavelengths of 623 nm, 530 nm, and 470 nm. The low-resolution microscope has 0.15 NA (providing 5-µm resolution at 470 nm), 2.42 × 1.64-mm2 FOV, and a 7-mm working distance. The synthetic NA achieved after FPM reconstruction was 0.55. Since the lens is used away from the intended infinite-conjugate position, the aberrations become progressively more severe toward the edges of the FOV. This could be mitigated be use of two back-to-back, co-aligned lenses8 with the penalty of reduced working distance and added experimental complexity.

### Data acquisition

Experimental low-resolution images were obtained using all 256 LEDs in the LED array. The Python 3.6 programming language was used for the image acquisition via picamera package35, which enables the capture of raw 10-bit Bayer images36. Adaptive integration times for individual LEDs (longer for the off-axis LEDs towards the edges of the array) enabled enhancement of the dynamic range and image signal-to-noise ratio. We chose to transfer all 256 images obtained by the microscope from the Raspberry Pi 3 computer onto a desktop Windows computer to speed up the reconstruction. Reconstruction could also be performed on the Raspberry Pi with necessary optimization of recovery algorithms.

### Image reconstruction

Recorded images were demosaiced using bilinear interpolation from the OpenCV processing package37 within the Python 3.6 programming language. Before the reconstruction, the images were pre-processed by subtracting dark-frames to remove fixed pattern noise and all images were normalized according to their exposure times. The pre-processed images were divided into 128 × 128 pixel sub-images with an overlap of 28 pixels between adjacent image segments to aid in seamless stitching of the high-resolution reconstructions. Finally, LED-position calibration is performed independently on each image segment as described in the next section.

The FPM reconstruction algorithm is performed on each section of the FOV referred to as I(i)(r), where r is the coordinate vector in object space and i is the index corresponding to the LED used to illuminate and obtain the image. Before the reconstruction a high-resolution, wide-field object o(r) and its Fourier spectrum $$O({\boldsymbol{k}})= {\mathcal F} \{o({\boldsymbol{r}})\}$$ are initialized by interpolating one of the low-resolution images to the required dimensions, where k is the coordinate vector in k-space and $${\boldsymbol{ {\mathcal F} }}$$ is the Fourier-transform operator. The reconstruction steps described below are repeated for multiple iterations and within an nth iteration, images obtained from illumination angles i are stitched together using the following steps shown in Fig. 5:

Create a low-resolution target image Fourier spectrum estimate Ψ(k) by low-pass filtering the high-resolution, wide-field spectrum estimate with the pupil function P(k)

$${{\rm{\Psi }}}_{n}^{(i)}({\boldsymbol{k}})={O}_{n}({\boldsymbol{k}}-{{\boldsymbol{k}}}_{i}){P}_{n}({\boldsymbol{k}}),$$
(3)

where ki is the k-space vector corresponding to angular LED illumination with an index i. Therefore, $${{\rm{\Psi }}}_{n}^{(i)}({\boldsymbol{k}})$$ is the nth estimate of the recorded complex image spectrum at frequency k corresponding to the band of object frequencies centered on kki.

Create a low-resolution target estimate $${{\rm{\psi }}}_{n}^{(i)}({\boldsymbol{r}})={ {\mathcal F} }^{-1}\{{\Psi }_{n}^{(i)}({\boldsymbol{k}})\}$$ and use it to create the updated low-resolution estimate $${\varphi }_{n}^{(i)}({\boldsymbol{r}})$$ by replacing its amplitude with the experimentally obtained one:

$${\varphi }_{n,\,SSR}^{(i)}({\boldsymbol{r}})=(\sqrt{{I}^{(i)}({\boldsymbol{r}})\cdot B({\boldsymbol{r}})}+{| \psi }_{n}^{(i)}({\boldsymbol{r}})\cdot (1-B({\boldsymbol{r}}))| )\frac{{\psi }_{n}^{(i)}({\boldsymbol{r}})}{|{\psi }_{n}^{(i)}({\boldsymbol{r}})|},$$
(4)

where B(r) is the binary Bayer matrix for the color channel being reconstructed. This is required if SSR is used23, otherwise, if DR is being used then setting B(r) = 1 results in the standard amplitude update step

$${\varphi }_{n,\,DR}^{(i)}({\boldsymbol{r}})=\sqrt{{I}^{(i)}({\boldsymbol{r}})}\frac{{\psi }_{n}^{(i)}({\boldsymbol{r}})}{|{\psi }_{n}^{(i)}({\boldsymbol{r}})|}.$$
(5)

Create an updated low-resolution Fourier spectrum

$${{\rm{\Phi }}}_{n}^{(i)}({\boldsymbol{k}})= {\mathcal F} \{{\varphi }_{n}^{(i)}({\boldsymbol{r}})\}.$$
(6)

Update the high-resolution object Fourier spectrum O(k) using a second-order quasi Newton algorithm38 together with embedded pupil recovery (EPRY)16 and adaptive step-size39 schemes to improve convergence

$${O}_{n+1}({\boldsymbol{k}})={O}_{n}({\boldsymbol{k}})+{\alpha }^{n}\frac{|{P}_{n}({\boldsymbol{k}}+{{\boldsymbol{k}}}_{i})|{P}_{n}^{\ast }{\boldsymbol{k}}+{{\boldsymbol{k}}}_{i}}{{|{P}_{n}({\boldsymbol{k}})|}_{{\max }}\,({|{P}_{n}{\boldsymbol{k}}+{{\boldsymbol{k}}}_{i}|}^{2}+{\delta }_{1})}{\rm{\Delta }},$$
(7)
$${P}_{n+1}({\boldsymbol{k}})={P}_{n}({\boldsymbol{k}})+{\beta }^{n}\frac{|{O}_{n}({\boldsymbol{k}}-{{\boldsymbol{k}}}_{i})|{O}_{n}^{\ast }({\boldsymbol{k}}-{{\boldsymbol{k}}}_{i})}{{|{O}_{n}({\boldsymbol{k}})|}_{max}\,({|{O}_{n}({\boldsymbol{k}}-{{\boldsymbol{k}}}_{i})|}^{2}+{\delta }_{2})}{\rm{\Delta }},$$
(8)
$${\rm{\Delta }}={{\rm{\Phi }}}_{n}^{(i)}({\boldsymbol{k}})-{{\rm{\Psi }}}_{n}^{(i)}({\boldsymbol{k}}),$$
(9)

where δ1, δ2 are regularization parameters and α, β are adaptive-step size constants which are selected to improve convergence. More details on the pupil-aberration recovery framework are given in the following sections.

All reconstructed sections were stitched together to produce a full-FOV reconstructed image. Alignment and contrast variations were corrected prior to stitching. Histogram equalization with the central section is performed to remove contrast variations across the FOV for both amplitude and phase. Finally, all sections are blended together using ImageJ (using the Fiji plugin package)40 to produce full-FOV images with seamless stitching.

All steps described above were performed for each of the red, green and blue channels independently and the final color image was assembled using linear image alignment with the scale-invariant feature transform (SIFT, part of the Fiji plugin package within ImageJ)40 for each channel and mapping them into RGB color panes.

### Computational calibration of LED positions

An LED self-calibration method based on frequency-spectrum analysis of bright-field images20 was used to locate pupil positions in spatial-frequency space for every 128 × 128 pixel section of the image, in order to accurately estimate the angle of illumination at the sample associated with each LED. A microscope objective acts as a low-pass filter and off-axis illumination shifts the frequencies in the object plane corresponding to the frequencies transmitted by the objective, enabling recording of higher spatial frequencies. These higher frequencies within the brightfield region appear as two overlapping circles in the Fourier transform of the intensity image, centered at the spatial frequency of the illumination angle. Finding the center of these circles yields the LED positions with sub-pixel accuracy, for every brightfield illumination angle20 (Fig. 6(a)). After finding position displacements for each bright-field LED, a homographic transformation matrix that best represents the misalignment of the LED array is derived. This transformation matrix is applied to dark-field LEDs as well. However, non-linear distortions, such as field curvature25, make LED positions appear to be distorted differently across the FOV. To mitigate this problem, we split the full FOV image into 128 × 128 pixel sections and apply LED calibration for each section individually. If non-linear distortions are present, then each section will have a different LED array translation shown in Fig. 6(c). These distortions were corrected using an affine transformation that best represents corrections for each section of the FOV.

### Computational aberration correction

Spatially-varying aberrations for each segment of the FOV are recovered using the EPRY algorithm16 to enable FPM reconstruction of the images. However, our microscope suffers from aberrations that increase progressively towards the edges of the FOV, and the EPRY algorithm fails for the more highly aberrated sections. A good initial estimate of the aberrations is required for the EPRY algorithm to converge. Therefore, starting with the central 128 × 128 section of the FOV, we run the EPRY recovery step for 40 iterations, reset the recovered image intensity and phase while retaining the aberrations, and iterate the algorithm for 3 more times. The reset step forces the algorithm to escape from local minima and enables convergence towards a global solution. We use the recovered central aberrations as an initial estimate for the surrounding sections (Fig. 6(b)). This update process continues until aberrations for every section of the FOV are recovered.

Low-cost lenses, such as the ones we have used, tend to suffer from severe chromatic aberrations. We found that when the microscope is focused using one color of LED, the chromatic aberration (primarily defocus) for images recorded using other colors was significant to cause the reconstruction algorithms to fail. The aberrations recovered from the central section of the color where the microscope is focused are used as an initial estimate for the defocused color that is being processed. This involved decomposition of recovered pupil aberrations into 30 Zernike coefficients using the singular value decomposition function in MATLAB from which the chromatically-aberrated pupil functions were estimated.

## Data Availability

Data acquisition codes and 3D-printed designs can be obtained from https://doi.org/10.5525/gla.researchdata.594. Raw data and computer codes for EPSRC-funded research requirements were uploaded to https://doi.org/10.5525/gla.researchdata.687.

## References

1. 1.

Petti, C. A., Polage, C. R., Quinn, T. C., Ronald, A. R. & Sande, M. A. Laboratory Medicine in Africa: A Barrier to Effective Health Care. Clin. Infect. Dis. 42, 377–382 (2006).

2. 2.

Imwong, M. et al. High-throughput ultrasensitive molecular techniques for quantifying low-density malaria parasitemias. J. Clin. Microbiol. 52, 3303–9 (2014).

3. 3.

Mendlovic, D., Lohmann, A. W. & Zalevsky, Z. Space–bandwidth product adaptation and its application to superresolution: examples. J. Opt. Soc. Am. A 14, 563 (1997).

4. 4.

Konda, P. C. Multi-Aperture Fourier Ptychographic Microscopy: Development of a high-speed gigapixel coherent computational microscope. Retrieved from http://theses.gla.ac.uk/9015/ (2018).

5. 5.

McConnell, G. et al. A novel optical microscope for imaging large embryos and tissue volumes with sub-cellular resolution throughout. Elife 5, 1–15 (2016).

6. 6.

Zheng, G., Ou, X. & Yang, C. 0.5 Gigapixel Microscopy Using a Flatbed Scanner. Biomed. Opt. Express 5, 1–8 (2013).

7. 7.

Breslauer, D. N., Maamari, R. N., Switz, N. A., Lam, W. A. & Fletcher, D. A. Mobile phone based clinical microscopy for global health applications. PLoS One 4, 1–7 (2009).

8. 8.

Switz, N. A., D’Ambrosio, M. V. & Fletcher, D. A. Low-cost mobile phone microscopy with a reversed mobile phone camera lens. PLoS One 9 (2014).

9. 9.

Smith, Z. J. et al. Cell-phone-based platform for biomedical device development and education applications. PLoS One 6 (2011).

10. 10.

Sharkey, J. P., Foo, D. C. W., Kabla, A., Baumberg, J. J. & Bowman, R. W. A one-piece 3D printed flexure translation stage for open-source microscopy. Rev. Sci. Instrum. 87 (2016).

11. 11.

Skandarajah, A., Reber, C. D., Switz, N. A. & Fletcher, D. A. Quantitative imaging with a mobile phone microscope. PLoS One 9 (2014).

12. 12.

Maia Chagas, A., Prieto-Godino, L. L., Arrenberg, A. B. & Baden, T. The €100 lab: A 3D-printable open-source platform for fluorescence microscopy, optogenetics, and accurate temperature control during behaviour of zebrafish, Drosophila, and Caenorhabditis elegans. PLOS Biol. 15, e2002702 (2017).

13. 13.

Cybulski, J. S., Clements, J. & Prakash, M. Foldscope: Origami-based paper microscope. PLoS One 9 (2014).

14. 14.

Zheng, G., Horstmeyer, R. & Yang, C. Wide-field, high-resolution Fourier ptychographic microscopy. Nat. Photonics 7, 739–745 (2013).

15. 15.

Goodman, J. W. Introduction to Fourier Optics, Vol. 8 (2005).

16. 16.

Ou, X., Zheng, G. & Yang, C. Embedded pupil function recovery for Fourier ptychographic microscopy. Opt. Express 22, 4960–72 (2014).

17. 17.

L.-H. Yeh et al. Experimental robustness of Fourier Ptychographic phase retrieval algorithms. Imaging Appl. Opt. 2015 23, CW4E.2 (2015).

18. 18.

Tian, L. et al. Computational illumination for high-speed in vitro Fourier ptychographic microscopy. Optica 2, 904–911 (2015).

19. 19.

Bian, Z., Dong, S. & Zheng, G. Adaptive system correction for robust Fourier ptychographic imaging. Opt. Express 21, 32400–10 (2013).

20. 20.

Eckert, R., Phillips, Z. F. & Waller, L. Efficient illumination angle self-calibration in Fourier ptychography. Appl. Opt. 57, 5434 (2018).

21. 21.

Dong, S., Guo, K., Nanda, P., Shiradkar, R. & Zheng, G. FPscope: a field-portable high-resolution microscope using a cellphone lens. Biomed. Opt. Express 5, 3305–10 (2014).

22. 22.

Pagnutti, M. et al. Laying the foundation to use Raspberry Pi 3 V2 camera module imagery for scientific and engineering purposes. J. Electron. Imaging 26, 013014 (2017).

23. 23.

Dong, S., Bian, Z., Shiradkar, R. & Zheng, G. Sparsely sampled Fourier ptychography. Opt. Express 22, 5455 (2014).

24. 24.

Sun, J., Chen, Q., Zhang, Y. & Zuo, C. Sampling criteria for Fourier ptychographic microscopy in object space and frequency space. Opt. Express 24, 15765 (2016).

25. 25.

Waller, L. & Tian, L. 3D Phase Retrieval with Computational Illumination, in Imaging and Applied Optics 2015, OSA Technical Digest (Online), p. CW4E.1.(Optical Society of America, 2015).

26. 26.

Guo, K., Dong, S. & Zheng, G. Fourier Ptychography for Brightfield, Phase, Darkfield, Reflective, Multi-Slice, and Fluorescence Imaging. IEEE J. Sel. Top. Quantam Electron. 22, 1–12 (2016).

27. 27.

Liu, Z., Tian, L., Liu, S. & Waller, L. Real-time brightfield, darkfield, and phase contrast imaging in a light-emitting diode array microscope. J. Biomed. Opt. 19, 106002 (2014).

28. 28.

Dong, S., Shiradkar, R., Nanda, P. & Zheng, G. Spectral multiplexing and coherent-state decomposition in Fourier ptychographic imaging. Biomed. Opt. Express 5, 22817–22825 (2014).

29. 29.

Tian, L., Li, X., Ramchandran, K. & Waller, L. Multiplexed coded illumination for Fourier Ptychography with an LED array microscope. Biomed. Opt. Express 162, 4960–4972 (2014).

30. 30.

Nguyen, T., Xue, Y., Li, Y., Tian, L. & Nehmetallah, G. Convolutional neural network for Fourier ptychography video reconstruction: learning temporal dynamics from spatial ensembles (2018).

31. 31.

Tu, J. V. Advantages and disadvantages of using artificial neural networks versus logistic regression for predicting medical outcomes. J. Clin. Epidemiol. 49, 1225–1231 (1996).

32. 32.

Phillips, Z. F., Eckert, R. & Waller, L. Quasi-Dome: A Self-Calibrated High-NA LED Illuminator for Fourier Ptychography, in Imaging and Applied Optics 2017 (2017).

33. 33.

Konda, P. C., Taylor, J. M. & Harvey, A. R. Scheimpflug multi-aperture Fourier ptychography: coherent computational microscope with gigapixels/s data acquisition rates using 3D printed components. In High-Speed Biomedical Imaging and Spectroscopy: Toward Big Data Instrumentation and Management II 10076, 100760R (2017).

34. 34.

Konda, P. C., TaylorJ. M. & Harvey, A. R. Parallelized aperture synthesis using multi-aperture Fourier ptychographic microscopy, arXiv Prepr. arXiv ID 1806.02317 (2018).

35. 35.

Jones, D. Picamera 1.13 Documentation, https://picamera.readthedocs.io/en/release-1.13/.

36. 36.

van der Walt, S., Colbert, S. C. & Varoquaux, G. The NumPy Array: A Structure for Efficient Numerical Computation,. Comput. Sci. Eng. 13, 22–30 (2011).

37. 37.

Bradski, G. R. & Kaehler, A. Learning OpenCV: Computer Vision with the OpenCV Library (O’Reilly, 2008).

38. 38.

Yeh, L.-H. et al. Experimental robustness of Fourier Ptychography phase retrieval algorithms. Opt. Express 23, 38–43 (2015).

39. 39.

Zuo, C., Sun, J. & Chen, Q. Adaptive step-size strategy for noise-robust Fourier ptychographic microscopy. Opt. Express 24, 4960–4972 (2016).

40. 40.

Schindelin, J. et al. Fiji: an open-source platform for biological-image analysis. Nat. Methods 9, 676–682 (2012).

## Acknowledgements

We thank Victor Lovic for his help in 3D printing and building the setup, Nicholas Nugent for his help in writing the tutorial and we are grateful to Dr. Jonathan Taylor for his feedback on the manuscript. This research was funded by Engineering and Physical Sciences Research Council (EPSRC) under the grant EP/L016753/1.

## Author information

Authors

### Contributions

T.A. designed and performed the experiments, contributed to the development of the theory and developed the final reconstruction and calibration algorithms. P.C.K. conceived the idea, contributed to the design, development of the algorithms and theory. P.C.K. and A.H. oversaw the experiments. R.E. and L.W. provided code and support for misalignment calibration. All authors participated in the writing and the revisions of the manuscript.

### Corresponding author

Correspondence to Andrew R. Harvey.

## Ethics declarations

### Competing Interests

The authors declare no competing interests.

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Aidukas, T., Eckert, R., Harvey, A.R. et al. Low-cost, sub-micron resolution, wide-field computational microscopy using opensource hardware. Sci Rep 9, 7457 (2019). https://doi.org/10.1038/s41598-019-43845-9

• Accepted:

• Published:

• ### Multi-aperture Fourier ptychographic microscopy, theory and validation

• Pavan Chandra Konda
• , Jonathan M. Taylor
•  & Andrew R. Harvey

Optics and Lasers in Engineering (2021)

• ### Concept, implementations and applications of Fourier ptychography

• Guoan Zheng
• , Cheng Shen
• , Shaowei Jiang
• , Pengming Song
•  & Changhuei Yang

Nature Reviews Physics (2021)

• ### A Low-Cost, Ear-Contactless Electronic Stethoscope Powered by Raspberry Pi for Auscultation of Patients With COVID-19: Prototype Development and Feasibility Study

• Chuan Yang
• , Wei Zhang
• , Zhixuan Pang
• , Jing Zhang
• , Deling Zou
• , Xinzhong Zhang
• , Sicong Guo
• , Jiye Wan
• , Ke Wang
•  & Wenyue Pang

JMIR Medical Informatics (2021)

• ### Miscalibration-Tolerant Fourier Ptychography

• Vittorio Bianco
• , Biagio Mandracchia
• , Jaromr Bhal
• , Dario Barone
• , Pasquale Memmolo
•  & Pietro Ferraro

IEEE Journal of Selected Topics in Quantum Electronics (2021)

• ### Structure-dependent amplification for denoising and background correction in Fourier ptychographic microscopy

• Rémy Claveau
• , Petru Manescu
• , Delmiro Fernandez-Reyes
•  & Michael Shaw

Optics Express (2020)