Focusing degree acquisition method, full focus image generation method, and computer readable program
The method corrects local focus degrees in saturated images relative to the focus position, addressing erroneous evaluations and enabling accurate all-in-focus image generation.
Patent Information
- Application Number
- JP2024009874
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-08-07
AI Technical Summary
Existing methods for calculating local focus degrees in images with varying focus positions can erroneously evaluate out-of-focus images as having a higher focus due to saturated brightness, leading to incorrect identification of the focus position.
A method to calculate and correct local focus degrees in images with saturated regions by adjusting focus degrees in saturated and non-saturated images relative to the focus position, including reducing focus degrees in images closest to the saturated images.
Enables accurate comparison and correction of local focus degrees across multiple images, allowing for the generation of an all-in-focus image with improved focus assessment.
Smart Images

Figure 2025115425000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a technique for acquiring a local focus degree, which indicates the degree of focus in a local region, for a plurality of target images, which are a plurality of images of an object being imaged that are shifted from a focus position by different distances from each other. [Background technology]
[0002] In recent years, in medical and biological research, images of biological samples such as cells cultured in culture media have been observed and analyzed for the purpose of elucidating disease mechanisms, biological mechanisms, and drug action mechanisms.
[0003] In such a biological sample, cells and the like may be distributed three-dimensionally within the culture medium, and it may be impossible to obtain an image in which the entire biological sample is in focus. Therefore, Patent Document 1 proposes a technology for generating a so-called all-in-focus image (also called an in-focus image) by capturing multiple images while changing the focus position along the optical axis direction, and extracting and combining portions with a high degree of focus from each image based on the brightness change in each image.
[0004] Furthermore, Patent Documents 2 and 3 propose a technique for observing cells, etc., being cultured in each well of a well plate by irradiating the cells, etc., with illumination light from above and receiving the light transmitted downward from the bottom of each well with an imaging unit. Patent Document 3 also proposes a technique for capturing multiple images with the imaging unit while changing the focus position along the optical axis direction, determining a focus degree indicating the degree of focus of each image, and identifying an appropriate imaging position based on the focus degree. When determining the focus degree of each image, local focus degrees of multiple local regions on each image are calculated, and the focus degree of the image is calculated based on the local focus degrees of each local region. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Japanese Patent Application Laid-Open No. 2016-14974 [Patent Document 2] Japanese Patent Application Laid-Open No. 2017-5593 [Patent Document 3] Japanese Patent Publication No. 2021-135389 Summary of the Invention [Problem to be solved by the invention]
[0006] In Patent Document 3, the local focus degree of each local region is calculated based on the brightness of pixels in each image. However, among the multiple images with different focus positions, in an image acquired on the side where light is collected by cells or the like in the optical axis direction and with a low degree of focus (i.e., out of focus), the light collected by cells or the like may spread white, resulting in saturated brightness over a wide area of the image. In this case, the out-of-focus image may be evaluated as having a higher local focus degree of the local region than the other images. As a result, the focus degree of the out-of-focus image may be evaluated as being higher, which may result in an erroneous identification of the focus position.
[0007] The present invention has been made in consideration of the above-mentioned problems, and has as its object to suitably compare the local focus degrees of a plurality of target images. [Means for solving the problem]
[0008] A first aspect of the present invention is a focus degree acquisition method for acquiring a local focus degree indicating the degree of focus in a local region for multiple target images, which are multiple images of an object being imaged, each of which has a different deviation distance from a focus position. The multiple target images include a saturated image group in which the brightness in a predetermined local region is saturated, a first image group captured on one side of the optical axis direction where the deviation distance from the focus position is greater than the imaging position of the saturated image group, and a second image group captured on the other side of the optical axis direction from the imaging position of the saturated image group. The focus degree acquisition method includes: (a) calculating a local focus degree indicating the degree of focus in the local region for each of the multiple target images based on the brightness of the local region; (b) correcting and reducing the local focus degree of the local region in the saturated image group; and (c) correcting and reducing the local focus degree of the local region in one first image of the first image group, the imaging position of which is closest to the imaging position of the saturated image group.
[0009] A second aspect of the present invention is the focus degree acquisition method of the first aspect, wherein in step c), the local focus degree of another first image of the first image group, the image capture position of which is next closest to the image capture position of the saturated image group after the one first image, is also corrected and reduced, and the degree of reduction in the local focus degree of the other first image is smaller than the degree of reduction in the local focus degree of the one first image.
[0010] A third aspect of the present invention relates to the focus degree acquisition method of the first aspect, further comprising the step of correcting and reducing the local focus degree of one second image of the second image group whose imaging position is closest to the imaging position of the saturated image group, wherein the degree of reduction in the local focus degree of the one second image is smaller than the degree of reduction in the local focus degree of the one first image.
[0011] A fourth aspect of the present invention is the focus degree acquisition method of the third aspect, wherein in step c), the local focus degree of another first image of the first image group, the image capture position of which is next closest to the image capture position of the saturated image group after the one first image, is also corrected and reduced, and the degree of reduction in the local focus degree of the other first image is smaller than the degree of reduction in the local focus degree of the one first image.
[0012] A fifth aspect of the present invention is the focus degree acquisition method according to any one of the first to fourth aspects, wherein each of the plurality of target images is a transmission image of the image capture target.
[0013] A sixth aspect of the present invention is a method for generating an all-in-focus image from a plurality of target images, which are images of an object to be imaged that are shifted from a focus position by different distances from each other, and includes the steps of: d) acquiring the local focus degrees of the plurality of target images for each of a plurality of local regions corresponding to the entirety of each target image using the focus degree acquisition method of any one of aspects 1 to 4 (or any one of aspects 1 to 5); and e) determining the brightness for each of the plurality of local regions based on the local focus degrees of the plurality of target images to generate an all-in-focus image.
[0014] A seventh aspect of the present invention is a computer-readable program that causes a computer to execute a process of acquiring a local focus degree indicating the degree of focus in a local region for a plurality of target images, which are images of an object being imaged at different distances from a focus position. The plurality of target images include a saturated image group in which the brightness in a predetermined local region is saturated, a first image group captured on one side of the optical axis direction where the deviation from the focus position is greater than the imaging position of the saturated image group, and a second image group captured on the other side of the optical axis direction from the imaging position of the saturated image group. Execution of the program by a computer performs the following processes: (a) determining a local focus degree indicating the degree of focus in the local region for each of the plurality of target images based on the brightness of the local region; (b) correcting and reducing the local focus degree of the local region in the saturated image group; and (c) correcting and reducing the local focus degree of the local region in one first image of the first image group whose imaging position is closest to the imaging position of the saturated image group. [Effects of the Invention]
[0015] In the present invention, the local focus degrees of a plurality of target images can be suitably compared. [Brief explanation of the drawings]
[0016] [Figure 1] FIG. 1 is a diagram illustrating an embodiment of the configuration of an imaging device. [Figure 2] FIG. 1 is a perspective view showing an example of a well plate. [Figure 3] FIG. 2 is a diagram illustrating a configuration of a control unit. [Figure 4] FIG. 2 is a block diagram showing the functional configuration of a control unit. [Figure 5] FIG. 10 is a diagram showing a flow of generating an all-in-focus image. [Figure 6] FIG. 2 is an enlarged view of a part of the imaging device. [Figure 7] FIG. 1 is a diagram showing a plurality of target images. [Figure 8] FIG. 1 is a diagram showing a plurality of target images. [Figure 9A] 10 is a graph showing a local focus degree before correction. [Figure 9B] 10 is a graph showing a local focus degree after correction. [Figure 10] FIG. 10 is a diagram showing an all-in-focus image. [Figure 11] FIG. 10 is a diagram showing an all-in-focus image of a comparative example. [Figure 12] FIG. 10 is a diagram showing a part of the flow of generating an omnifocus image. [Figure 13] 10 is a graph showing a local focus degree after correction. [Figure 14A] 10 is a graph showing a local focus degree before correction. [Figure 14B] 10 is a graph showing a local focus degree after correction. [Figure 14C] 10 is a graph showing a local focus degree after correction. DETAILED DESCRIPTION OF THE INVENTION
[0017] FIG. 1 is a diagram showing an embodiment of an imaging device 1 in which a focus degree acquisition method according to the present invention is used. FIG. 1 shows a schematic configuration of the imaging device 1. FIG. 2 is a perspective view showing an example of a well plate 2 used in the imaging device 1. In FIGS. 1 and 2, three mutually orthogonal directions are indicated by arrows as the X direction, the Y direction, and the Z direction. In the example shown in FIGS. 1 and 2, the X direction and the Y direction are horizontal directions that are perpendicular to each other, and the Z direction is a vertical direction (i.e., an up-down direction).
[0018] The imaging device 1 is a device that images a sample 9 held in a well plate 2. The sample 9 is, for example, a cell, a cell mass such as a spheroid or an organoid, or a biological sample such as bacteria. In the following description, cells, cell masses, bacteria, etc. are collectively referred to as "cells, etc."
[0019] The well plate 2 is a sample container having a substantially flat shape. The well plate 2 is made of a light-transmitting material (for example, a transparent resin). One main surface of the well plate 2 (the main surface on the (+Z) side in the example shown in FIGS. 1 and 2) is provided with a plurality of wells 21, which are recesses. The multiple wells 21 are regularly arranged, for example, along the X and Y directions. The shape of each well 21 in a plan view is, for example, substantially circular. The number, arrangement, shape, etc. of the wells 21 in the well plate 2 may be changed as appropriate.
[0020] Each well 21 of the well plate 2 holds a sample 9, which is an object to be imaged by the imaging device 1, together with a liquid or gel culture medium 90. The sample 9 is, for example, light-transmitting cells cultured under predetermined culture conditions in the culture medium 90. The imaging device 1 may also be used to image a sample 9 held in a flat sample container called a dish, rather than in the well plate 2.
[0021] The imaging device 1 includes a holder 11, an illumination unit 12, an imaging unit 13, an elevation mechanism 14, a movement mechanism 15, and a control unit 5. The holder 11 is a holding unit that holds a well plate 2. The holder 11 abuts against the peripheral edge of the main surface (i.e., the lower surface) on the (-Z) side of the well plate 2 from below, and holds the well plate 2 in a substantially horizontal state.
[0022] The illumination unit 12 is disposed above the holder 11 and emits illumination light downward (i.e., toward the (-Z) side). The illumination light emitted from the illumination unit 12 is irradiated onto the well plate 2 held by the holder 11. As a result, the sample 9 in the well 21 is illuminated from above (i.e., toward the (+Z) side). The illumination unit 12 includes a light source and an illumination optical system (not shown). For example, a white LED (Light Emitting Diode) can be used as the light source.
[0023] The imaging unit 13 is disposed below the holder 11. The imaging unit 13 includes an imaging optical system 131 and an imaging element 132. The imaging optical system 131 includes a plurality of optical elements (not shown) including an objective lens. An optical axis J1 of the imaging optical system 131 extends substantially parallel to the Z direction (i.e., the up-down direction). The imaging element 132 is disposed below the imaging optical system 131. The imaging element 132 is an area image sensor having a two-dimensional light-receiving surface. For example, a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor) can be used as the imaging element 132.
[0024] In the example shown in FIG. 1 , the imaging unit 13 is disposed vertically below one well 21 of the well plate 2. The illumination unit 12 is disposed vertically above the one well 21 and faces the imaging unit 13 in the up-down direction, with the one well 21 sandwiched therebetween. Illumination light emitted from the illumination unit 12 enters the one well 21 from above, and the sample 9 in the well 21 is illuminated by the illumination light. Light that passes through the well plate 2 downward from the bottom surface of the well 21 (i.e., the surface on the (-Z) side) is incident on the light-receiving surface of the imaging element 132 via the imaging optical system 131 of the imaging unit 13. The imaging element 132 captures an image of the sample 9 formed on the light-receiving surface by the imaging optical system 131. The image acquired by the imaging unit 13 is a transmission image of the sample 9.
[0025] When imaging the sample 9, the elevator mechanism 14 moves the imaging unit 13 in the Z direction (i.e., in the optical axis direction), and adjusts the position of the imaging unit 13 in the Z direction so that the sample 9 is located at a focus position (hereinafter simply referred to as the "focus position") on the (+Z) side of the imaging unit 13. In other words, the elevator mechanism 14 adjusts the focus of the imaging unit 13. Furthermore, when generating an all-in-focus image (described later), the elevator mechanism 14 moves the imaging unit 13 in the Z direction, and multiple images in which the imaging unit 13 is positioned in different Z directions during imaging are acquired as original images for generating the all-in-focus image.
[0026] When the imaging of the sample 9 in one well 21 is completed, the illumination unit 12 and the imaging unit 13 are moved horizontally (i.e., in the X and Y directions) by the moving mechanism 15, and are positioned vertically above and below the other wells 21, respectively. Then, the imaging of the sample 9 in the other wells 21 is performed in substantially the same manner as described above. The moving mechanism 15 may move the illumination unit 12 and the imaging unit 13 together, or may move them individually. Note that in the imaging device 1, the imaging units 13 may simultaneously image the samples 9 in multiple wells 21.
[0027] The control unit 5 controls each component of the imaging device 1, such as the lighting unit 12, the imaging unit 13, the lifting mechanism 14, and the moving mechanism 15. The control unit 5 also stores images acquired by the imaging unit 13 and performs image processing on the images.
[0028] 3 is a diagram showing the configuration of a computer that functions as the control unit 5. The computer has a typical computer system configuration including a CPU 51, a ROM 52, a RAM 53, a fixed disk 54, a display 55, an input unit 56, a reading device 57, a communication unit 58, a GPU 59, and a bus 50. The CPU 51 performs various types of arithmetic processing. The GPU 59 performs various types of arithmetic processing related to image processing. The ROM 52 stores basic programs. The RAM 53 stores various types of information. The fixed disk 54 stores information. The display 55 is a display unit that displays various types of information such as images.
[0029] The input unit 56 includes a keyboard 56a and a mouse 56b that accept input from an operator. The reader 57 reads information from a computer-readable recording medium 571, such as an optical disk, a magnetic disk, a magneto-optical disk, or a memory card. The display 55, the keyboard 56a, the mouse 56b, and the reader 57 are connected to the bus 50 via an interface I / F. The communication unit 58 transmits and receives signals to and from devices external to the imaging device 1. The bus 50 is a signal circuit that connects the CPU 51, the GPU 59, the ROM 52, the RAM 53, the fixed disk 54, the display 55, the input unit 56, the reader 57, and the communication unit 58.
[0030] In the imaging device 1, a program 572 is read in advance from a recording medium 571 via a reading device 57 and stored on a fixed disk 54. The program 572 may be stored on the fixed disk 54 via a network. The CPU 51 and the GPU 59 execute arithmetic processing using the RAM 53 and the fixed disk 54 in accordance with the computer-readable program 572. The CPU 51 and the GPU 59 function as a calculation unit in the imaging device 1. Other components that function as a calculation unit may be employed in addition to the CPU 51 and the GPU 59.
[0031] 4 is a block diagram showing the functional configuration of the control unit 5 realized by the above-mentioned computer executing arithmetic processing and the like in accordance with the program 572. This functional configuration includes a storage unit 501, a focus level calculation unit 502, a focus level correction unit 503, and an all-in-focus image generation unit 504. All or part of these functions may be realized by dedicated electrical circuits. Furthermore, these functions may be realized by multiple computers.
[0032] 4, the storage unit 501 is mainly realized by the RAM 53 and the fixed disk 54. The focus degree calculation unit 502, the focus degree correction unit 503, and the omnifocus image generation unit 504 are realized by the CPU 51, the GPU 59, the ROM 52, the RAM 53, the fixed disk 54, and their peripheral components.
[0033] The storage unit 501 stores images of the sample 9 (hereinafter also referred to as "target images") acquired by the imaging unit 13 as digital image data. In the imaging device 1, multiple target images are acquired in which the imaging unit 13 is positioned in different Z directions at the time of image capture, and are stored in the storage unit 501. The focus degree calculation unit 502 calculates the focus degree of each of multiple local regions set on each target image (hereinafter also referred to as "local focus degree").
[0034] The degree of focus is an index that indicates the degree to which the sample 9, which is the object to be imaged, is in focus in the target image (i.e., indicates the degree of focus). When the sample 9 is located approximately at the in-focus position of the imaging unit 13 in the optical axis direction, the sample 9 is in focus, and therefore the degree of focus is relatively large. On the other hand, when the sample 9 is displaced from the in-focus position of the imaging unit 13 in the optical axis direction, the sample 9 is not in focus, and therefore the degree of focus is usually small. Furthermore, as the distance between the position of the sample 9 in the optical axis direction and the in-focus position of the imaging unit 13 (i.e., the distance displaced from the in-focus position of the sample 9) increases, the degree of focus decreases. On the other hand, as the distance displaced from the in-focus position of the sample 9 decreases, the degree of focus increases.
[0035] A local region is an area set on a target image that is smaller than the entire target image. In this embodiment, the entire rectangular target image is divided into a plurality of rectangular divided regions by grid-like dividing lines, and each divided region is defined as a local region. The multiple local regions are arranged in a matrix in the vertical and horizontal directions of the target image. The shapes of the multiple local regions are, for example, approximately the same. Each local region may include a plurality of pixels of the target image, or one pixel may be defined as a local region.
[0036] The local focus degree is the focus degree in a local region. In other words, the local focus degree is an index that indicates how focused the sample 9, which is the object to be imaged, is in one local region (i.e., indicates the degree of focus). When the sample 9 is located approximately at the in-focus position of the imaging unit 13 in the local region, the local focus degree is relatively large. On the other hand, when the sample 9 is deviated from the in-focus position of the imaging unit 13 in the local region, the local focus degree is usually small. Furthermore, as the deviation distance from the in-focus position of the sample 9 in the local region increases, the local focus degree decreases. On the other hand, as the deviation distance from the in-focus position of the sample 9 in the local region decreases, the local focus degree increases.
[0037] As described above, cells and the like constituting the sample 9 may be distributed three-dimensionally within the well 21 shown in FIG. 1. In this case, different local regions in a single target image may have different degrees of local focus. In other words, in a single target image, some parts of the sample 9 may be in focus, while other parts of the sample 9 may be out of focus.
[0038] The focus degree correction unit 503 corrects the local focus degrees of multiple local regions in each target image as necessary. The all-in-focus image generation unit 504 generates an all-in-focus image of the sample 9 from the multiple target images based on the corrected local focus degrees in each target image. An all-in-focus image is an image in which each part of the sample 9 is in focus.
[0039] Next, generation of an omnifocus image by the imaging device 1 will be described with reference to Fig. 5 and Fig. 6. Fig. 5 is a diagram showing the flow of generation of an omnifocus image. Fig. 6 is a diagram showing an enlarged view of a part of the imaging device 1.
[0040] In the imaging device 1, first, the control unit 5 (see FIG. 1) drives the moving mechanism 15, and the illumination unit 12 and the imaging unit 13 are positioned above and below one well 21, respectively. Next, the control unit 5 drives the lifting mechanism 14, and the vertical position of the imaging unit 13 is adjusted. Then, the control unit 5 controls the imaging unit 13, and an object image of the sample 9 is acquired. The object image acquired by the imaging unit 13 is sent to the memory unit 501 (see FIG. 4) and stored in the memory unit 501.
[0041] In the imaging device 1, the vertical position of the imaging unit 13 is changed by the lifting mechanism 14, and the imaging unit 13 repeatedly images the sample 9 (i.e., acquires target images). In this embodiment, images of the sample 9 are respectively taken with the vertical position of the objective lens (not shown) of the imaging unit 13 at six positions P1 to P6 indicated by black circles in FIG. 6, and target images G1 to G6 shown in FIG. 7 are acquired. In the example shown in FIG. 6, positions P1 to P6 are aligned at equal intervals in the vertical direction (i.e., in the Z direction). In the following description, positions P1 to P6 are also referred to as "imaging positions P1 to P6." Furthermore, the vertical interval between two adjacent imaging positions among the imaging positions P1 to P6 is assumed to be "d."
[0042] 7 is acquired with the objective lens of the imaging unit 13 positioned in the vertical direction at the same imaging position P1, and target image G2 is acquired with the objective lens positioned in the vertical direction at the same imaging position P2. Target image G3 is acquired with the objective lens of the imaging unit 13 positioned in the vertical direction at the same imaging position P3, and target image G4 is acquired with the objective lens positioned in the vertical direction at the same imaging position P4. Target image G5 is acquired with the objective lens of the imaging unit 13 positioned in the vertical direction at the same imaging position P5, and target image G6 is acquired with the objective lens positioned in the vertical direction at the same imaging position P6.
[0043] 7, when the objective lens is positioned at imaging position P4, the focal position of the imaging optical system 131 of the imaging unit 13 (i.e., the focal position on the (+Z) side) is approximately the same position in the vertical direction as the sample 9. In other words, the target image G4 is an image (i.e., an in-focus image) acquired when the sample 9 is approximately positioned at the focal position of the imaging optical system 131. Therefore, the sample 9 in image G4 is relatively clear and relatively bright.
[0044] 7, when the objective lens is located at imaging positions P1 to P3, the focal position of the imaging optical system 131 is located on the (-Z) side of the sample 9. In other words, the sample 9 is located farther away from the imaging optical system 131 on the (+Z) side than the focal position of the imaging optical system 131. In this case, due to the lens action of the translucent sample 9, the peripheral portion of the sample 9 in the target images G1 to G3 becomes dark (i.e., the brightness in the peripheral portion becomes low). Furthermore, as the light that has passed through the sample 9 is condensed, the central portion of the sample 9 in the target images G1 to G3 becomes bright (i.e., the brightness in the central portion becomes high). In particular, in the target images G2 and G3, the brightness in the central portion of the sample 9 is saturated over a wide range (so-called blown-out highlights).
[0045] The saturated state is a state in which the brightness (i.e., pixel value) of a pixel in the target image is at a gray level close to the maximum gray level. In this embodiment, each pixel in the target image is expressed in 256 gray levels (i.e., 0 to 255), and the saturated state means that the brightness of the pixel is 255 or is included within a predetermined range around 255. This predetermined range is 80% or more of the number of gray levels of the pixel (256 gray levels). In this embodiment, when the brightness of a pixel is 205 to 255, the brightness of the pixel is considered to be in a saturated state.
[0046] The imaging position P1 corresponding to the target image G1 is located on the (-Z) side (i.e., the side where the light that has passed through the sample 9 is collected) of the imaging positions P2 and P3 corresponding to the target images G2 and G3 where the brightness in the central part of the sample 9 is saturated. Therefore, in the target image G1, the brightness in the central part of the sample 9 is relatively high, although not as high as in the saturated state.
[0047] On the other hand, when the objective lens is located at imaging positions P5 and P6, the focal position of the imaging optical system 131 is located on the (+Z) side of the sample 9. In other words, the sample 9 is located closer to the imaging optical system 131 than the focal position of the imaging optical system 131. In this case, due to the lens action of the sample 9, the peripheral portion of the sample 9 in the target images G5 and G6 becomes brighter (i.e., the brightness in the peripheral portion becomes higher). Also, the central portion of the sample 9 in the target images G5 and G6 becomes darker (i.e., the brightness in the central portion becomes lower).
[0048] As described above, when the objective lens is positioned at imaging positions P1 to P3, P5, and P6, the focal position of the imaging optical system 131 is shifted in the Z direction from the sample 9. In the following description, "shift distance" is used as an index representing the amount of shift of the sample 9 in the Z direction from the focal position, including the direction of shift. The shift distance is the relative position of the sample 9 in the Z direction with respect to the focal position.
[0049] For example, when the objective lens is located at imaging position P1, the deviation distance of the sample 9 from the in-focus position is "+3d." When the objective lens is located at imaging positions P2 and P3, the deviation distances of the sample 9 from the in-focus position are "+2d" and "+d," respectively. On the other hand, when the objective lens is located at imaging positions P5 and P6, the deviation distances of the sample 9 from the in-focus position are "-d" and "-2d," respectively.
[0050] The plurality of target images G1 to G6 acquired by the imaging unit 13 are sent to the storage unit 501 and stored in the storage unit 501. As a result, a plurality of target images G1 to G6 of the sample 9 having different deviation distances from the in-focus position are prepared (step S11). In step S11, a noise removal process may be performed on the plurality of target images G1 to G6 acquired by the imaging unit 13, and the plurality of target images G1 to G6 after the process may be stored in the storage unit 501. The noise removal process may be performed by various known methods (for example, an opening process in which an expansion process is performed after an erosion process). Note that the number of the plurality of target images prepared in step S11, the imaging positions, etc. may be changed as appropriate.
[0051] Next, as shown in FIG. 8, the entire target images G1 to G6 are each divided into a plurality of (e.g., 36) rectangular divided regions by grid-like dividing lines indicated by dashed lines, and each divided region is set as a local region 61. The local regions 61 are arranged in a matrix (a 6×6 matrix in this embodiment) in the vertical and horizontal directions of the target images G1 to G6. In the example shown in FIG. 8, all of the local regions 61 in the target images G1 to G6 have the same size and are substantially square in shape. Each local region 61 includes a plurality of pixels. Note that a local region 61 may also be an area including only one pixel. Furthermore, the local regions 61 located at the same position in the target images G1 to G6 have the same shape, but the shapes of the local regions 61 included in each target image do not necessarily all need to be the same and may include local regions 61 of different shapes.
[0052] Next, one local region 61 located at the same position in each of the target images G1 to G6 is selected (step S12). In the example shown in Fig. 8, the fourth local region 61 from the left and the second local region 61 from the bottom is selected in each of the target images G1 to G6. In Fig. 8, the selected local region 61 is indicated by being surrounded by a thick line.
[0053] Next, in each of the target images G1 to G6, the luminance of each pixel included in the selected local region 61 is acquired. Then, the focus degree calculation unit 502 (see FIG. 4) calculates the focus degree of the local region 61 (i.e., the local focus degree) in each of the target images G1 to G6 based on the luminance of the local region 61 (step S13).
[0054] The local focus degree may be calculated using various known methods. For example, the local focus degree is an index value corresponding to the luminance of pixels constituting the local region 61. The index value may be, for example, the maximum luminance or minimum luminance of the pixels constituting the local region 61, or the arithmetic average of the luminance of all pixels constituting the local region 61. The index value may be the luminance contrast in the local region 61 (i.e., the difference between the maximum luminance and the minimum luminance). Alternatively, the index value may be the edge intensity in the local region 61. The local focus degree may be calculated by multiplying the index value by a coefficient corresponding to the area of the local region 61 or the like. Alternatively, the local focus degree may be analytically calculated from a luminance histogram of the pixels constituting the local region 61.
[0055] FIG. 9A is a graph showing the local focus degrees of the local regions 61 selected in step S12 for the target images G1 to G6 (i.e., the local focus degrees before the correction described below is performed). The horizontal axis of FIG. 9A represents the target images G1 to G6, and the vertical axis represents the local focus degrees before correction. As described above, in the target images G2 and G3, the brightness of the central portion of the sample 9 is saturated over a wide range due to the lens effect of the sample 9 (see FIG. 8), so the local focus degrees in the local regions 61 near the central portion are high. Also in the target image G1, the brightness of the central portion of the sample 9 is relatively high due to the lens effect of the sample 9, so the local focus degrees in the local regions 61 near the central portion are relatively high. On the other hand, in the target images G4 to G6, the local focus degrees decrease in the order of the target images G4, G5, and G6 (i.e., as the deviation distance from the in-focus position of the sample 9 increases).
[0056] When step S13 is completed, the focus degree correction unit 503 (see FIG. 4) checks whether the selected local region 61 in each of the target images G1 to G6 includes pixels whose brightness is saturated (hereinafter also referred to as "saturated pixels"). For example, in the example shown in FIG. 8, the target images G1, G4 to G6 do not include saturated pixels in the local region 61. On the other hand, the target images G2 and G3 include saturated pixels in the local region 61.
[0057] In the focus level correction unit 503, when a local region 61 includes saturated pixels, the luminance in the local region 61 is classified as "saturated," and the target images G2 and G3 including the local region 61 are classified as "saturated images." In the following description, the set of saturated images is also referred to as a "saturated image group." In this embodiment, the saturated image group includes the target images G2 and G3, which are saturated images.
[0058] On the other hand, if the local region 61 does not include saturated pixels, the brightness in the local region 61 is classified as "non-saturated," and the target images G1, G4 to G6 including the local region 61 are classified as "non-saturated images." In the following description, among the non-saturated images, a target image captured on one side of the optical axis direction (i.e., the (-Z) side away from the sample 9), which is the side where the deviation distance from the focal position of the sample 9 is greater than the imaging position of the saturated image group (i.e., saturated images G2 and G3), is also referred to as a "first image," and the set of the first images is also referred to as a "first image group." Furthermore, among the non-saturated images, a target image captured on the other side of the optical axis direction (i.e., the (+Z) side) is also referred to as a "second image," and the set of the second images is also referred to as a "second image group." In this embodiment, the first image group includes the target image G1, which is the first image. Furthermore, the second image group includes the target images G4 to G6, which are the second images.
[0059] In this way, the multiple target images G1 to G6 prepared in step S11 include a saturated image group (i.e., target images G2 and G3), a first image group (i.e., target image G1), and a second image group (i.e., target images G4 to G6). The number of target images included in each of the saturated image group, the first image group, and the second image group may be changed in various ways. Furthermore, if the position of the local region 61 on the target images G1 to G6 is different, the number of target images included in each of the saturated image group, the first image group, and the second image group corresponding to the local region 61 may also be different.
[0060] The focus degree corrector 503 corrects the local focus degree of the selected local region 61 in each of the target images G1 to G6, based on whether the selected local region 61 is saturated or not. Specifically, first, in the saturated image group in which the selected local region 61 is saturated (i.e., the target images G2 and G3), the local focus degree of the selected local region 61 is corrected and reduced using a predetermined correction method (step S14). Next, in the first image group, one first image (i.e., the target image G1) whose imaging position is closest to the imaging position of the saturated image group (i.e., imaging positions P2 and P3) is selected. Then, the local focus degree of the local region 61 in the one first image is corrected and reduced using a predetermined correction method (step S15).
[0061] 9B is a graph showing the local focus degree after correction of the local region 61 selected in step S12 for the target images G1 to G6. The horizontal axis of FIG. 9B represents the target images G1 to G6, and the vertical axis represents the local focus degree after correction. In FIG. 9B, the local focus degree before correction for the target images G1 to G3 is shown by a two-dot chain line.
[0062] The correction of the local focus degree of the saturated image group (i.e., target images G2 and G3) in step S14 may be performed, for example, by subtracting a value of a predetermined magnitude (i.e., correction amount) from the local focus degree, or by multiplying the local focus degree by a predetermined correction coefficient that is equal to or greater than 0 and less than 1. Furthermore, the correction of the local focus degree of one first image (i.e., target image G1) in step S15 may also be performed, for example, by subtracting a value of a predetermined magnitude (i.e., correction amount) from the local focus degree, or by multiplying the local focus degree by a correction coefficient that is equal to or greater than 0 and less than 1.
[0063] When the correction of the local focus degree in steps S14 and S15 is performed by subtracting a predetermined correction amount from the local focus degree, the correction amount in step S15 is, for example, smaller than the correction amount in step S14. When the correction of the local focus degree in steps S14 and S15 is performed by multiplying the local focus degree by a predetermined correction coefficient, the correction coefficient in step S15 is, for example, larger than the correction coefficient in step S14.
[0064] The correction amount in step S15 may be greater than or equal to the correction amount in step S14. The correction coefficient in step S15 may be smaller than or equal to the correction coefficient in step S14. Furthermore, step S15 may be performed before step S14 or in parallel with step S14.
[0065] After steps S14 and S15 are completed, the control unit 5 checks whether calculation and correction of the local focus degree for all local regions 61 have been completed (step S16). If there is a local region 61 for which calculation and correction of the local focus degree has not been completed, the process returns to step S12, and the next local region 61 is selected from the local regions 61 for which calculation and correction of the local focus degree has not been completed (step S12). Then, in the same manner as above, the local focus degree of the selected local region 61 is calculated in each of the target images G1 to G6 (step S13), and the local focus degree of that local region 61 in the saturated image group and the local focus degree of that local region 61 in one first image of the first image group are corrected (steps S14 to S15).
[0066] The imaging device 1 repeats the above steps S12 to S16 until calculation and correction of the local focus degrees are completed for all local regions 61. As a result, the corrected local focus degrees are obtained for all local regions 61 for each of the target images G1 to G6. The corrected local focus degrees for the multiple local regions 61 are sent to and stored in the storage unit 501 (see FIG. 4).
[0067] The omnifocus image generation unit 504 (see FIG. 4) determines the luminance for each of the local regions 61 based on the post-correction local focus degrees of the target images G1 to G6, and generates an omnifocus image (step S17). Specifically, for one local region 61, the post-correction local focus degrees of the local region 61 in the target images G1 to G6 are compared. Then, based on the post-correction local focus degrees in the target images G1 to G6, the luminance of each pixel constituting the local region 61 in the omnifocus image is determined.
[0068] For example, the omni-focus image generation unit 504 may set the luminance of each pixel of the local region 61 in the target image with the highest post-correction local focus level (target image G4 in the example shown in FIG. 9B ) as the luminance of each pixel of the local region 61 in the omni-focus image. Alternatively, the luminance of each pixel of the local region 61 in each of the target images G1 to G6 may be multiplied by a weighting coefficient corresponding to the post-correction local focus level of each of the target images G1 to G6, and the arithmetic mean value of the luminance values after multiplication (i.e., a weighted mean value using the weighting coefficient) may be set as the luminance of each pixel of the local region 61 in the omni-focus image. The weighting coefficient is set to increase as the post-correction local focus level increases. In this way, the luminance of each pixel of the local region 61 is set with a higher weight given to target images with a high local focus level. Note that if the post-correction local focus level is less than a predetermined threshold, the weighting coefficient may be set to 0.
[0069] The omnifocus image generating unit 504 performs the above-described processing on all local regions 61, and generates a single omnifocus image based on the corrected local focus degree using the target images G1 to G6 as original images. This makes it possible to suppress unintended effects of a saturated image group (i.e., target images G2 and G3) whose brightness is saturated due to the lens effect of the sample 9, and a first image (i.e., target image G1) in the first image group that is significantly affected by the lens effect, and to generate an omnifocus image appropriately.
[0070] Fig. 10 shows an all-in-focus image GA1 generated based on the local focus degree after correction, as described above. Meanwhile, Fig. 11 shows an all-in-focus image GA2 of a comparative example in which the corrections in steps S14 and S15 were not performed (i.e., generated based on the local focus degree before correction). Compared to the all-in-focus image GA2 of the comparative example, the all-in-focus image GA1 generated using the focus degree acquisition method according to the present invention suppresses the effects of brightness saturation (i.e., blown-out highlights) caused by the lens action of the sample 9, resulting in a preferable image in which the sample 9 is in focus overall.
[0071] In the imaging device 1, the focus degree calculation unit 502 and the focus degree correction unit 503 constitute a focus degree acquisition device that can suitably acquire the local focus degree of the local region 61 for the plurality of target images G1 to G6. Furthermore, the focus degree acquisition device and the omnifocus image generation unit 504 constitute an omnifocus image generation device that generates an omnifocus image GA1 from the plurality of target images G1 to G6.
[0072] As explained above, the focus degree acquisition method is a method for acquiring a local focus degree indicating the degree of focus of a local region 61 for a plurality of target images G1 to G6, which are a plurality of images of an imaging target (i.e., sample 9) having different deviation distances from the focus position. The plurality of target images G1 to G6 include a saturated image group (e.g., target images G2 and G3) in which the brightness in a predetermined local region 61 is saturated, a first image group (e.g., target image G1) captured on one side of the optical axis direction (the (-Z) side in the above example) where the deviation distance from the focus position is greater than the imaging position of the saturated image group, and a second image group (e.g., target images G4 to G6) captured on the other side of the optical axis direction (the (+Z) side in the above example) of the imaging position of the saturated image group.
[0073] The focus degree acquisition method includes the steps of: calculating, for each of a plurality of target images G1 to G6, a local focus degree indicating the degree of focus of the local region 61 based on the luminance of the local region 61 (step S13); correcting and reducing the local focus degree of the local region 61 in the saturated image group (step S14); and correcting and reducing the local focus degree of the local region 61 in one first image of the first image group whose imaging position is closest to the imaging position of the saturated image group (step S15). Therefore, by using the corrected local focus degree, it is possible to suppress the effect of increased luminance in the target images G1 to G3 due to the lens effect of the sample 9, and to suitably compare the local focus degrees of the plurality of target images G1 to G6.
[0074] Preferably, each of the multiple target images G1 to G6 is a transmission image of the sample 9. As described above, this focus degree acquisition method can suppress the effect of increased brightness due to the lens action of the sample 9, and therefore this focus degree acquisition method is particularly suitable for acquiring the local focus degree of a transmission image in which increased brightness due to the lens action of the sample 9 is likely to occur. Furthermore, in the case of a transmission image, it is easy to tell whether the side on which light that has passed through the sample 9 is focused is the up or down direction (i.e., the (+Z) side or the (-Z) side) for the imaging positions P1 to P6 of the multiple target images G1 to G6, and therefore this focus degree acquisition method is particularly suitable.
[0075] The above-described all-in-focus image generating method is a method for generating an all-in-focus image GA1 from a plurality of target images G1-G6, which are images of an imaging target (i.e., a sample 9) that are shifted at different distances from the in-focus position. The all-in-focus image generating method includes the steps of acquiring the local focus degrees of the plurality of target images G1-G6 for each of a plurality of local regions 61 corresponding to the entirety of each target image by the above-described focus degree acquiring method (steps S12-S16), and generating an all-in-focus image GA1 by determining the brightness of each of the plurality of local regions 61 based on the local focus degrees of the plurality of target images G1-G6 (step S17). This suppresses the influence of increased brightness due to the lens effect of the sample 9, making it possible to generate an all-in-focus image effectively.
[0076] The above-mentioned program 572 is a computer-readable program that causes a computer to acquire a local focus degree that indicates the degree of focus of a local region 61 for a plurality of target images G1 to G6, which are a plurality of images of an imaging target (i.e., sample 9) having different deviation distances from the focus position. The plurality of target images G1 to G6 include a saturated image group (e.g., target images G2 and G3) in which the brightness in a predetermined local region 61 is saturated, a first image group (e.g., target image G1) captured on one side of the optical axis direction (the (-Z) side in the above example) where the deviation distance from the focus position is greater than the imaging position of the saturated image group, and a second image group (e.g., target images G4 to G6) captured on the other side of the optical axis direction (the (+Z) side in the above example) of the imaging position of the saturated image group.
[0077] Execution of the program 572 by a computer performs the following steps for each of the plurality of target images G1 to G6: calculating a local focus degree indicating the degree of focus of the local region 61 based on the luminance of the local region 61 (step S13); correcting and reducing the local focus degree of the local region 61 in the saturated image group (step S14); and correcting and reducing the local focus degree of the local region 61 in one first image of the first image group whose imaging position is closest to the imaging position of the saturated image group (step S15). Therefore, by using the corrected local focus degree, the influence of increased luminance in the target images G1 to G3 due to the lens effect of the sample 9 can be suppressed, and the local focus degrees of the plurality of target images G1 to G6 can be suitably compared.
[0078] In the above example, correction is made to the local focus degree in the saturated image group (i.e., target images G2 and G3) and the local focus degree in one first image of the first image group (i.e., target image G1) whose imaging position is closest to the imaging position of the saturated image group, and no correction is made to the local focus degree in the second image group (i.e., target images G4 to G6), but this is not limited to this.
[0079] For example, the correction of the local focus degree may be performed on the second image included in the second image group in addition to the saturated image group and the one first image included in the first image group. Specifically, as shown in FIG. 12, following step S15, one second image (i.e., target image G4) in the second image group whose imaging position is closest to the imaging position of the saturated image group (i.e., imaging positions P2 and P3) is selected. Then, the local focus degree of the local region 61 in the one second image is corrected and reduced using a predetermined correction method (step S21). Note that step S21 may be performed before step S14 and / or step S15, or may be performed in parallel with step S14 and / or step S15, as long as it is performed before step S16.
[0080] FIG. 13 is a graph showing the local focus degree after correction of the local region 61 selected in step S12 for the target images G1 to G6. The horizontal axis of FIG. 13 represents the target images G1 to G6, and the vertical axis represents the local focus degree after correction. In FIG. 13, the local focus degree before correction for the target images G1 to G4 is indicated by a two-dot chain line. The correction of the local focus degree of the second image (i.e., target image G4) in step S21 may be performed, for example, by subtracting a value of a predetermined magnitude (i.e., correction amount) from the local focus degree, or by multiplying the local focus degree by a predetermined correction coefficient greater than or equal to 0 and less than 1.
[0081] When the correction of the local focus degree in step S21 and the above-described steps S14 and S15 is performed by subtracting a predetermined correction amount from the local focus degree, the correction amount in step S21 is smaller than the correction amount in step S14 and the correction amount in step S15. Furthermore, when the correction of the local focus degree in step S21 and steps S14 and S15 is performed by multiplying the local focus degree by a predetermined correction coefficient, the correction coefficient in step S21 is larger than the correction coefficient in step S14 and the correction coefficient in step S15.
[0082] In other words, the degree of decrease in the local focus degree of the one second image in step S21 (i.e., the degree of decrease from the local focus degree before correction) is smaller than the degree of decrease in the local focus degree of the saturated image group in step S14. Also, the degree of decrease in the local focus degree of the one second image in step S21 is smaller than the degree of decrease in the local focus degree of the one first image in step S15.
[0083] As described above, in the examples shown in FIGS. 12 and 13 , the focus degree acquisition method further includes a step (step S21) of correcting and reducing the local focus degree of one second image (target image G4 in the above example) from the second image group, the image capture position of which is closest to the image capture position of the saturated image group. This makes it possible to suppress the effect of increased brightness due to the lens effect of the sample 9 on the local focus degree in the one second image. Furthermore, the degree of reduction in the local focus degree in the one second image is smaller than the degree of reduction in the local focus degree in the one first image in step S15. This reduces the degree of correction of the local focus degree for the one second image (i.e., target image G4) that is shifted a short distance from the focus position of the sample 9 compared to the degree of correction of the local focus degree for the one first image (i.e., target image G1) that is shifted a relatively long distance. As a result, the influence of increased brightness in the target image G4 due to the lens action of the sample 9 can be suitably suppressed, and the local focus degrees of the multiple target images G1 to G6 can be more suitably compared. Also, the omnifocus image generating unit 504 can more suitably generate an omnifocus image.
[0084] In the above example, the first image group includes only one first image (i.e., target image G1), but the first image group may include multiple first images. For example, assume that target image G0 (not shown) is acquired in the same state as when the position of the objective lens of the imaging unit 13 in the vertical direction is shifted by d toward the (-Z) side from imaging position P1 (see FIG. 6). In this case, the first image group includes not only target image G1 but also target image G0. FIG. 14A is a graph showing the local focus degree before correction in local region 61 indicated by the thick line in FIG. 8 for target images G0, G1 to G6. The horizontal axis of FIG. 14A represents target images G0, G1 to G6, and the vertical axis represents the local focus degree before correction.
[0085] In step S15 shown in FIG. 5, in addition to one first image (i.e., target image G1) of the first image group whose imaging position is closest to the imaging position of the saturated image group, correction may be made to the local focus degree for another first image (i.e., target image G0) whose imaging position is next closest to the imaging position of the saturated image group after target image G1.
[0086] FIG. 14B is a graph showing the local focus degree after correction of local region 61 selected in step S12 for target images G0, G1 to G6. The horizontal axis of FIG. 14B represents target images G0, G1 to G6, and the vertical axis represents the local focus degree after correction. In FIG. 14B, the local focus degree before correction of target images G0, G1 to G3 is indicated by a two-dot chain line. Similar to the correction of the local focus degree of target image G1, the correction of the local focus degree of target image G0 may be performed by subtracting a value of a predetermined magnitude (i.e., a correction amount) from the local focus degree, or by multiplying the local focus degree by a predetermined correction coefficient greater than or equal to 0 and less than 1.
[0087] When the correction of the local focus degree of the two first images (i.e., target images G0, G1) in step S15 is performed by subtracting a predetermined correction amount from the local focus degree, the correction amount subtracted from the local focus degree of target image G0 is smaller than the correction amount subtracted from the local focus degree of target image G1. Also, when the correction of the local focus degree of the two first images (i.e., target images G0, G1) in step S15 is performed by multiplying the local focus degree by a predetermined correction coefficient, the correction coefficient multiplied by the local focus degree of target image G0 is larger than the correction coefficient multiplied by the local focus degree of target image G1.
[0088] In other words, in step S15, the degree of decrease in the local focus degree in target image G0 is smaller than the degree of decrease in the local focus degree in target image G1. In other words, in step S15, the degree of decrease in the local focus degree in each of the multiple first images included in the first image group decreases as the imaging position of the first image becomes farther away from the imaging position of the saturated image group.
[0089] As described above, in the example shown in FIGS. 14A and 14B , in step S15, the local focus degree of another first image (target image G0 in the above example) of the first image group, whose imaging position is next closest to the imaging position of the saturated image group after the one first image (target image G1 in the above example), is also corrected and reduced. This makes it possible to suppress the influence of increased brightness due to the lens effect of the sample 9 on the local focus degree of the other first image. Furthermore, the degree of reduction in the local focus degree of the other first image is smaller than the degree of reduction in the local focus degree of the one first image. This suppresses the degree of correction of the local focus degree of the other first image (i.e., target image G0), whose imaging position is relatively far from the imaging position of the saturated image group and for which the influence of the lens effect of the sample 9 is relatively small, compared to the degree of correction of the local focus degree of the one first image (i.e., target image G1), which is relatively influenced by the lens effect of the sample 9. As a result, the influence of increased brightness in the target image G0 due to the lens action of the sample 9 can be suitably suppressed, and the local focus degrees of the multiple target images G0, G1 to G6 can be more suitably compared. Also, the all-in-focus image generating unit 504 can more suitably generate an all-in-focus image.
[0090] 14C, in correcting the local focus degree of the target images G0, G1 to G6, the local focus degree of the target image G4 (i.e., one second image in the second image group whose imaging position is closest to that of the saturated image group) may also be corrected and reduced in addition to the local focus degrees of the target images G0, G1 to G3. In this case, the degree of reduction in the local focus degree of the target image G4 is smaller than the degree of reduction in the local focus degree of the target image G1.
[0091] This, similar to the above, effectively suppresses the effect of increased brightness due to the lens effect of the sample 9, allowing for more effective comparison of the local focus degrees of the multiple target images G0, G1 to G6. Furthermore, the all-in-focus image generating unit 504 can more effectively generate an all-in-focus image. Note that the degree of decrease in the local focus degree in the target image G4 is, for example, smaller than the degree of decrease in the local focus degree in the target image G0. Alternatively, the degree of decrease in the local focus degree in the target image G4 may be greater than or the same as the degree of decrease in the local focus degree in the target image G0.
[0092] The above-described focus degree obtaining method, omni-focus image generating method, and program 572 can be modified in various ways.
[0093] In the above example, the plurality of target images G0, G1 to G6 are transmission images of the sample 9, which is the object to be imaged, but this is not limiting. For example, the plurality of target images may be fluorescent images of the object to be imaged.
[0094] In step S21, in addition to correcting the local focus degree of one second image of the second image group whose imaging position is closest to the imaging position of the saturated image group (target image G4 in the above example), the local focus degree of another second image (target image G5 in the above example) whose imaging position is next closest to the imaging position of the saturated image group after the one second image may also be corrected. Also, in step S21, the local focus degree may be corrected for three or more second images of the second image group whose imaging positions are closest to the imaging position of the saturated image group.
[0095] In step S15, the local focus degrees may be corrected for three or more of the first images in the first image group whose imaging positions are closest to the imaging position of the saturated image group. Note that when the local focus degrees of the first images in the first image group are corrected and the local focus degrees of the second images in the second image group are corrected, the number of first images whose local focus degrees are corrected is, for example, greater than the number of second images whose local focus degrees are corrected.
[0096] The local focus degree acquired by the above-described focus degree acquisition method does not necessarily have to be used for generating an all-in-focus image, but may be used for various purposes. For example, an appropriate imaging position of the imaging unit 13 (i.e., an imaging position where the sample 9 is in focus) may be automatically obtained using the corrected local focus degrees of each local region 61 obtained in steps S12 to S16 for the multiple target images G1 to G6.
[0097] Specifically, for each of the multiple target images G1 to G6, the focus degree of the entire image is calculated based on the local focus degree after correction of each local region 61. The focus degree can be calculated by a known method, such as by adding up the local focus degrees after correction of each local region 61. Then, the target image with the highest focus degree is selected from the multiple target images G1 to G6, and the imaging position of that target image is determined as the appropriate imaging position. Alternatively, the relationship between the imaging position and focus degree of the multiple target images G1 to G6 may be plotted, and interpolated using quadratic approximation or the like, and the imaging position with the highest focus degree may be determined as the appropriate imaging position.
[0098] In this way, by determining an appropriate imaging position using the corrected local focus degree, it is possible to suppress the influence of increased brightness in the target image due to the lens action of the sample 9, and achieve highly accurate autofocus.
[0099] The configurations in the above-described embodiment and each modification may be combined as appropriate as long as they are not mutually contradictory. [Explanation of symbols]
[0100] 1. Imaging device 9 Samples 61 Local Area 572 Programs G0, G1 to G6 target images GA1 All focus image J1 optical axis P1~P6 imaging positions S11~S17,S21 steps
Claims
1. A focus degree acquisition method for acquiring a local focus degree indicating a degree of focus of a local region for a plurality of target images, which are a plurality of images of an object to be imaged, the images having different deviation distances from a focus position, the method comprising: The plurality of target images are A saturated image group in which the brightness in a predetermined local region is saturated; a first image group captured on one side in the optical axis direction, the side on which the deviation distance from the in-focus position is greater than the imaging position of the saturated image group; a second image group captured on the other side in the optical axis direction relative to the imaging position of the saturated image group; Including, The focus degree acquisition method includes: a) calculating a local focus degree indicating a degree of focus of the local region based on the luminance of the local region for each of the plurality of target images; b) correcting and reducing the local focus of the local region in the set of saturated images; c) correcting and reducing the local focus degree of the local region in one first image of the first image group, the image capture position of which is closest to the image capture position of the saturated image group; A focus degree obtaining method comprising:
2. The focus degree obtaining method according to claim 1 , In the step c), the local focus degree of another first image among the first image group, the imaging position of which is next closest to the imaging position of the saturated image group after the one first image, is also corrected and reduced; A focus degree acquisition method, wherein a degree of decrease in the local focus degree in the other first image is smaller than a degree of decrease in the local focus degree in the one first image.
3. The focus degree obtaining method according to claim 1 , correcting and reducing a local focus degree of one second image of the second image group, the image capture position of which is closest to the image capture position of the saturated image group; A focus degree obtaining method, wherein a degree of decrease in the local focus degree in the one second image is smaller than a degree of decrease in the local focus degree in the one first image.
4. The focus degree obtaining method according to claim 3, In the step c), the local focus degree of another first image among the first image group, the imaging position of which is next closest to the imaging position of the saturated image group after the one first image, is also corrected and reduced; A focus degree acquisition method, wherein a degree of decrease in the local focus degree in the other first image is smaller than a degree of decrease in the local focus degree in the one first image.
5. 5. The focus degree obtaining method according to claim 1, A focus degree acquisition method in which each of the plurality of target images is a transmission image of the object to be imaged.
6. 1. A method for generating an all-in-focus image from a plurality of target images, which are images of an object to be imaged that are shifted from a focus position by different distances from each other, comprising: d) acquiring a local focus degree of each of a plurality of local regions corresponding to the entirety of each of the plurality of target images by the focus degree acquisition method according to any one of claims 1 to 4; e) determining a brightness for each of the local regions based on the local focus degrees of the target images to generate an all-in-focus image; An all-in-focus image generating method comprising:
7. A computer-readable program that causes a computer to acquire a local focus degree that indicates a degree of focus in a local region for a plurality of target images that are a plurality of images of an object to be imaged, the target images being different from each other in deviation distance from a focus position, The plurality of target images are A saturated image group in which the brightness in a predetermined local region is saturated; a first image group captured on one side in the optical axis direction, the side on which the deviation distance from the in-focus position is greater than the imaging position of the saturated image group; a second image group captured on the other side in the optical axis direction relative to the imaging position of the saturated image group; Including, When the program is executed by a computer, a) calculating a local focus degree indicating a degree of focus of the local region based on the luminance of the local region for each of the plurality of target images; b) correcting and reducing the local focus of the local region in the set of saturated images; c) correcting and reducing the local focus degree of the local region in one first image of the first image group, the image capture position of which is closest to the image capture position of the saturated image group; A computer-readable program that performs the following:
Citation Information
Patent Citations
Image processing method and image processor
JP2016014974A
Imaging apparatus and imaging method
JP2017005593A
Focusing position detecting method, focusing position detecting device, and focusing position detecting program
JP2021135389A