OpenScienceOpenScience
PROPOSE A CHALLENGE PT
← Blog
Dec 7, 2024 · Raíssa Vanessa · 5 min read

Reconstructed Focus in Spectral Images

At OpenScience, we are constantly innovating to deliver accessible, high-impact solutions to the challenges of the agricultural and scientific sectors. We recently developed a focus correction method that transforms images with different levels of sharpness into a detailed 3D representation. These images are captured using the multispectral microscope also developed by OpenScience.

Multispectral Microscope

The technology of our multispectral microscope is capable of capturing images across several bands of the electromagnetic spectrum, ranging from the visible regions (the colors we can perceive with the naked eye) to the ultraviolet (UV) and the near-infrared (NIR). Each of these bands provides unique information about the properties of the sample, such as its chemical composition and surface structure. The microscope employs specific LED light sources to illuminate the sample at different wavelengths. Equipped with an automatic sampler, the system allows continuous analysis of multiple samples. The samples, such as grains or particles, are positioned on an analysis platform, and the microscope can be configured to capture images at different positions along the X, Y and Z axes (different heights).

    Image of the OpenScience multispectral microscope

    Why is focus correction necessary?

    The need to implement a focus correction method in a multispectral microscope is related to the characteristics of the different bands of the electromagnetic spectrum and to the properties of the samples. The main reasons for developing a focus correction method are presented below:

    Dispersion and Chromatic Aberration

    Different wavelengths of light are refracted differently as they pass through lenses, causing a shift of the focal plane. For example, an image acquired in the near-infrared (NIR) may have a different focal plane from an image acquired in the visible range. Focus correction ensures that all images are sharp and aligned, regardless of wavelength.

    Variation in Sample Structure

    Samples may have irregular surfaces or different layers of interest (for example, particles with roughness or grains with height variation). Focus correction makes it possible to adjust the focal plane to observe specific details of each layer or feature of the sample.

    Multiplane Configurations

    In some applications, it is necessary to capture images at different focal planes for 3D reconstruction or to study the depth of structures. Focus correction is essential to ensure that each plane is captured accurately.

    Improved Data Quality

    Focusing correctly in each spectral band improves image sharpness and the accuracy of information extraction, such as chemical spectra or structural features. Out-of-focus images can compromise the analysis and lead to erroneous interpretations.

    Automation and Efficiency

    Automatic focus correction methods (such as contrast-based or laser autofocus) reduce the need for manual intervention, speeding up data acquisition and improving reproducibility.

    Experiment conducted to evaluate the effectiveness of the method

    To develop the focus correction algorithm for the multispectral microscope, an experiment was carried out using a coffee bean damaged by the coffee berry borer as the sample. This choice was strategic, given that OpenScience already has extensive experience and several studies related to the analysis of coffee beans.

    Experimental Procedures

    Multispectral Image Acquisition

    Images of the bean were captured at different heights. This approach made it possible to record images at multiple focal planes, creating a robust dataset to evaluate the algorithm's effectiveness in identifying the ideal focal plane.

    Specific Relevance of the Borer-Damaged Coffee Bean

    In the selected bean, the presence of the borer and of internal tunnels represented an ideal condition for testing the ability of the microscope and the algorithm to detect structural details and variations that directly affect coffee quality. This damage is difficult to identify with the naked eye or in superficial analyses, but it is critical for the industry, as it affects the flavor and the price of the final product.

      Example of an out-of-focus image of the borer-damaged coffee bean

      Objective of the Experiment

      The main objectives of the experiment were:

      • To capture multispectral images of the bean at different heights, in order to reconstruct the image in 3D and 2D, recovering information about the structure of the bean, such as texture, roughness, height and other physical characteristics.

      • To assess whether it is possible to obtain a fully focused image by combining the information from images acquired at different heights.

      Focus correction method

      After the experiment, the images were divided into several parts and the focus quality was evaluated for each one. From these data, a three-dimensional representation was created, reflecting the best-focused areas for each region analyzed.

      In addition, the process preserves the spectral information of the images, ensuring that important information can still be extracted. A crucial step in the image reconstruction was to ensure that all spectral layers were correctly aligned. This alignment was performed using methods that ensure all the information was synchronized, allowing the images to be reconstructed with optimized focus. The final result is a three-dimensional representation of the best focus heights for each part of the sample, providing a more detailed and accurate analysis.

        Focus-reconstructed image of the borer-damaged coffee bean

        Results and Impact

        The developed algorithm offers several advantages that make it a robust and versatile solution for multispectral applications. In terms of accuracy and reliability, it is able to automatically identify the optimal heights for each region of the sample, enabling the reconstruction of images with optimized focus, even in samples with different heights. In addition, spectral information is preserved, ensuring that the reconstructions maintain the integrity of the information across all the wavelengths analyzed.

        In terms of applicability, the algorithm stands out particularly in agricultural and scientific analyses, such as the assessment of grain and food quality. It also enables the reconstruction of focused multispectral data cubes, which are essential for chemical and quality analyses, preserving with high fidelity the spectral information required for these purposes.

        Another highlight is the automation and precision of the system, which minimize the need for human intervention, increasing the efficiency and reproducibility of the analyses. Furthermore, this method can be applied to a wide variety of samples, such as grains in general damaged by insects, making it possible to identify structural and qualitative defects.

        Future Perspectives

        The next steps of the project include the full integration of the algorithm into OpenScience's multispectral instruments, enabling the automation of the entire process of capturing and reconstructing focused images. This integration aims to significantly increase analytical efficiency, reduce the need for manual intervention and broaden the range of applications, especially in the agricultural and scientific sectors.

        With this technology, OpenScience's instruments will be prepared to provide robust, automated multispectral solutions, optimizing the quality of the data obtained and accelerating analysis processes. This approach not only enables advances in the evaluation of grains and foods, but also paves the way for new applications in other areas, such as industrial inspection, environmental monitoring and scientific research.

        We are committed to collaborating with the scientific and industrial communities to maximize the impact of this innovation. For more information or partnerships, we are available to discuss the advances of this technology and its transformative potential in multispectral analysis.

        ← All blog articles