Image processing method, image processing apparatus, program, and image processing system

The image processing method enhances sharpening by using a weight map to adjust intensity, addressing the issue of insufficient sharpening in in-focus areas and reducing blur in out-of-focus regions.

JP2024149164APending Publication Date: 2024-10-18CANON KK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023062876
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing image sharpening methods fail to adequately address the issue of insufficient sharpening intensity in the edge portions of in-focus areas due to misclassification as out-of-focus areas, leading to potential blur in the sharpened image.

Method used

An image processing method that includes generating a first image by sharpening and acquiring a weight map based on object distance and image blur information, followed by generating a second image through weighted averaging using the weight map to adjust sharpening intensity.

Benefits of technology

This approach effectively generates a sharpened image with improved edge clarity while minimizing adverse effects in out-of-focus areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024149164000001_ABST
    Figure 2024149164000001_ABST
Patent Text Reader

Abstract

To generate a good sharpened image while suppressing the occurrence of adverse effects in an unfocused region when sharpening the image.SOLUTION: An image processing method is provided with: a step S202 of generating a first image 22 by sharpening an image 21; a step S214 of acquiring a weight map based on a map relating to a subject distance corresponding to the image 21 and information relating to blur in the image 21; and a step S215 of generating a second image 23 based on the image 21, the first image 22 and the weight map.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a technique for sharpening an image. [Background technology]

[0002] A method is known in which a sharpened image is generated by sharpening a captured image with different sharpness for each pixel according to the distance to a subject in focus in the captured image (focused subject). In this case, there is a risk of artifacts and other problems occurring in areas (out-of-focus areas) other than the area (focused area) corresponding to the focused subject in the captured image.

[0003] Patent Document 1 describes a method for determining whether each pixel in a captured image is in-focus or out-of-focus based on information about the subject distance, and performing sharpening processing so that the intensity is lower in the out-of-focus area than in the in-focus area. This method makes it possible to suppress the occurrence of problems in the out-of-focus area. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2011-44825 A Summary of the Invention [Problem to be solved by the invention]

[0005] In general, the edge portion of the in-focus area in a captured image has low contrast due to aberrations of the optical system used for capturing images. Therefore, when each pixel is judged based on information up to the subject distance in Patent Document 1, some of the edge portions of the in-focus area may be judged as out-of-focus areas. In this case, the strength of the sharpening process for some of the edge portions of the in-focus area may be insufficient, and a good sharpened image may not be obtained.

[0006] SUMMARY OF THE PRESENT EMBODIMENTS Accordingly, an object of the present invention is to generate a favorable sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas of a captured image. [Means for solving the problem]

[0007] The image processing method according to the present invention includes a step of generating a first image by sharpening the image, a step of acquiring a weight map based on a map relating to a subject distance corresponding to the image and information regarding blur of the image, and a step of generating a second image based on the image, the first image, and the weight map. Effect of the Invention

[0008] According to the present invention, when sharpening an image, it is possible to generate a satisfactory sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas. [Brief description of the drawings]

[0009] [Figure 1] FIG. 1 is a diagram showing the configuration of a machine learning model. [Diagram 2] FIG. [Diagram 3] 1 is a block diagram of an image processing system according to a first embodiment. [Figure 4] 1 is an external view of an image processing system according to a first embodiment. [Diagram 5] 1 is a flowchart for training a machine learning model. [Figure 6] 4 is a flowchart of generation of an output image in the first embodiment. [Figure 7] 4 is a flowchart of the sharpening strength adjustment in the first embodiment. [Figure 8] 1A and 1B are explanatory diagrams of a captured image and a defocus map. [Figure 9] FIG. 13 is an explanatory diagram of division points of optical performance indexes. [Figure 10] FIG. 2 is a schematic diagram of an imaging state space. [Figure 11] FIG. 13 is an explanatory diagram of a weight map. [Figure 12] FIG. 11 is a block diagram of an image processing system according to a second embodiment. [Figure 13] FIG. 11 is an external view of an image processing system according to a second embodiment. [Figure 14] 13 is a flowchart of the sharpening strength adjustment in the second embodiment. [Figure 15] 4 is an explanatory diagram of a captured image and information regarding the position of a focused subject; FIG. [Figure 16] FIG. 2 is an explanatory diagram of a depth map. [Figure 17] FIG. [Figure 18] FIG. 11 is a block diagram of an image processing system according to a third embodiment. [Figure 19] FIG. 11 is an external view of an image processing system according to a third embodiment. [Figure 20] 13 is a flowchart of the sharpening strength adjustment in the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. In each drawing, the same reference numerals are used to refer to the same components, and duplicated explanations will be omitted.

[0011] Before describing the specific examples, the gist of this embodiment will be described. The image processing method according to this embodiment includes a step of generating a first image by sharpening the image. The image processing method also includes a step of acquiring a weight map based on a map related to the subject distance corresponding to the image and information related to the blur of the image. The image processing method further includes a step of generating a second image based on the image, the first image, and the weight map.

[0012] Here, the blur in an image occurs due to aberration or diffraction of an optical system, an optical low-pass filter, a decrease in the aperture ratio of an image sensor, etc. Furthermore, the process of sharpening an image is a process of recovering the frequency components of a subject that have been reduced or lost due to the blur. Furthermore, the blur in an image may be a high-frequency component that has been added to the image by simulation or the like.

[0013] Moreover, the process of sharpening an image is a process of correcting blur in an image by a process using a sharpening filter (restoration filter) such as a Wiener filter. The process of sharpening an image may be performed using a machine learning model. The machine learning model can be generated (learned) using, for example, a neural network, genetic programming, a Bayesian network, or the like. Moreover, as the neural network, a CNN (Convolutional Neural Network), a GAN (Generative Adversarial Network), an RNN (Recurrent Neural Network), or the like can be used.

[0014] In conventional techniques for sharpening an image based on the distance to a focused subject, the intensity in out-of-focus areas of the image can become too high, which can result in artifacts and other problems in the image after sharpening.

[0015] Therefore, in the method of Patent Document 1, whether a captured image is in-focus or out-of-focus is determined for each pixel based on information on the distance to the subject. At this time, the intensity in the out-of-focus area is smaller than the intensity in the in-focus area, thereby suppressing the occurrence of problems in the out-of-focus area.

[0016] Even when information about the distance of the subject is used, a part of the area (periphery of the focused subject) in the captured image where the subject has spread due to blurring that occurs during imaging may not be determined to be an in-focus area.

[0017] Next, the reason why a part of the edge portion of the in-focus area is not determined to be in-focus will be described with reference to FIG.

[0018] Fig. 2 is an explanatory diagram of the in-focus region in this embodiment, where the vertical axis of Fig. 2 is the signal value and the horizontal axis is the spatial coordinate. The solid line 111 indicates the in-focus subject before the region is expanded due to blurring generated during imaging, and the dotted line 112 indicates the in-focus subject after the region is expanded due to blurring generated during imaging. The hatched region 113 indicates the region that is determined to be out-of-focus when the captured image is determined based on information related to the subject distance.

[0019] When obtaining information about the subject distance based on a parallax image or a monocular image, the boundary for determining whether the region is in focus or out of focus is obtained based on, for example, a maximum value or a minimum value obtained by first-order differentiation of the dotted line 112. Specifically, in Fig. 2, the shaded region 113 corresponding to the coordinate range in which the signal value graph is downwardly convex is determined to be an out of focus region. Note that a machine learning model may be used to determine whether the region is in focus or out of focus.

[0020] If part of the edge of the in-focus area (corresponding to the diagonal line area 113) is determined to be an out-of-focus area during the process of sharpening the captured image, there is a risk that blurring will remain in the sharpened image because the strength of the sharpening process for that part of the edge of the in-focus area is reduced.

[0021] Therefore, an object of this embodiment is to generate a good sharpened image while suppressing the occurrence of adverse effects in the out-of-focus area in the process of sharpening an image.

[0022] [Example 1] An image processing system according to a first embodiment of the present invention will be described. The task of the machine learning model in this embodiment is a process of correcting degradation due to aberrations of the optical system in a captured image (a process of sharpening the captured image). Here, degradation due to aberrations of the optical system refers to blurring due to aberrations and diffraction occurring in the optical system, and blurring due to an optical low-pass filter. However, this is not limited to this, and may also be a process of correcting blurring due to pixel aperture or shaking. In the following, the process of learning the weights of the machine learning model is referred to as a learning phase, and the process of sharpening blurring using a machine learning model based on the learned weights is referred to as an estimation phase.

[0023] Fig. 3 shows a block diagram of the image processing system 100, and Fig. 4 shows an external view of the image processing system 100. The image processing system 100 has a learning device 101, an imaging device 102, an image processing device 103, a display device 104, a storage medium 105, and an output device 106. In the image processing system 100, the image processing device 103 is connected to the learning device 101, the imaging device 102, the display device 104, the storage medium 105, and the output device 106 by wire or wirelessly.

[0024] The learning device 101 has a storage unit 101a, an acquisition unit 101b, a calculation unit 101c, and an update unit 101d, and performs learning of a machine learning model that performs image processing. The learning device 101 can be implemented by one or more processors such as CPUs. The learning device 101 may also be a personal computer or a server. Details of the learning phase (learning method, manufacturing method of a machine learning model) will be described later.

[0025] The imaging device 102 has an optical system 102a and an imaging element 102b, and obtains a captured image by capturing an image of a subject space. The imaging element 102b is a photoelectric conversion element such as a CCD (Charge Coupled Device) sensor or a CMOS (Complementary Metal Oxide Semiconductor) sensor. Note that the captured image is blurred due to aberration and diffraction caused by the optical system 102a in the imaging device 102 and an optical low-pass filter of the imaging element 102b, and information about the subject is attenuated. The captured image is input to the image processing device 103 via communication.

[0026] The image processing device 103 includes a storage unit 103a, an acquisition unit 103b, and a processing unit 103c. The image processing device 103 can be implemented by one or more processors such as CPUs. Note that the image processing device 103 in this embodiment sharpens a captured image using a machine learning model to generate an estimated image (first image) 22. The machine learning model is learned by the learning device 101, and the image processing device 103 acquires information related to the machine learning model, such as weights and parameters obtained by learning, from the learning device 101 in advance and stores the information in the storage unit 103a.

[0027] Furthermore, the image processing device 103 generates an intensity-adjusted image (second image) 23 by calculating a weighted average of the captured image 21 and the first image 22. At this time, for the weighted average, a weight map obtained by modifying (correcting) information on the subject distance (a map on the subject distance) using information on blur is used. Details of the estimation phase will be described later.

[0028] The generated intensity-adjusted image 23 is stored in the storage unit 103a or the storage medium 105, and is output to the output device 106 as necessary. At this time, the captured image may be a grayscale image or an image having multiple color components. Also, the captured image may be an undeveloped RAW image or a developed image.

[0029] The storage medium 105 is, for example, a semiconductor memory, a hard disk, a server on a network, etc. The output device 106 is, for example, a printer.

[0030] Next, the training (learning) of the machine learning model executed by the learning device 101 will be described with reference to the flowchart in Fig. 5. Each of the following steps is executed by any of the memory unit 101a, the acquisition unit 101b, the calculation unit 101c, and the update unit 101d in the learning device 101.

[0031] In step S101, the acquisition unit 101b acquires one or more original images. At this time, it is desirable that the original images are images having various frequency components (edges with different directions and intensities, gradations, flat areas, etc.). The original images may be real images or CG (Computer Graphics).

[0032] In step S102, the calculation unit 101c blurs the original image to generate a blurred image (training image) 10. The training image 10 is an image input to a machine learning model during learning, and corresponds to a captured image 21 in an estimation process described later.

[0033] The blur in this embodiment includes at least one of the blur caused by the aberration and diffraction of the optical system 102a and the blur caused by the optical low-pass filter of the image sensor 102b. The shape of the blur caused by the aberration and diffraction of the optical system 102a may differ depending on the image plane coordinates (image height and azimuth). Furthermore, the shape of the blur may differ depending on the magnification, aperture, and focus state of the optical system 102a. The training image 10 may be generated by adding noise generated by the image sensor 102b.

[0034] If necessary, a machine learning model can be generated that can sharpen multiple blurs caused by different factors by learning using images that have multiple types of blur components among those described above.

[0035] In step S103, the acquisition unit 101b acquires a correct answer image 11 corresponding to the training image 10. The correct answer image 11 in this embodiment is an image with less blur than the training image 10, and is generated by adding blur in the same manner as the training image 10. If the original image lacks high-frequency components, an image obtained by reducing the original image may be used as the correct answer image 11. In this case, reduction is also performed when generating the training image 10 in step S102. Furthermore, step S103 may be executed at any time after step S101 and before step S104.

[0036] In step S104, the calculation unit 101c inputs the training image 10 to the machine learning model to generate an output image 12. In this embodiment, the machine learning model shown in Fig. 1(a) is used, but the invention is not limited to this.

[0037] The machine learning model shown in FIG. 1(a) has multiple layers, and in each layer, a linear sum of the input of the layer and the weight is taken. The initial value of the weight is determined by a random number or the like. In this embodiment, the machine learning model is trained by a CNN that uses the convolution of the input and the filter as the linear sum (the value of each element of the filter corresponds to the weight. The sum with the bias may also be included), but the invention is not limited to this. In addition, in each layer, nonlinear transformation is performed by an activation function such as a ReLU (Rectified Linear Unit) or a sigmoid function as necessary. Furthermore, the machine learning model may have a residual block or a Skip Connection (also called a Shortcut Connection) as necessary. The machine learning model generates an output image 12 as a result of performing a calculation through multiple layers based on an input training image 10.

[0038] In step S105, the update unit 101d updates the weights of the machine learning model based on the error function. The error function in this embodiment is based on the error between the output image 12 and the correct answer image 11. MSE (Mean Squared Error) can be used to calculate the error. However, the method of calculating the error is not limited to this. Backpropagation or the like can be used to update the weights. Also, the error may be an error with respect to the residual component. At this time, the error between the difference component between the output image 12 and the training image 10 and the difference component between the correct answer image 11 and the training image 10 can be used.

[0039] In step S106, the update unit 101d determines whether training of the machine learning model is complete. Completion of training can be determined based on whether the number of iterations of updating the weights reaches a preset number, whether the amount of change in the weights at the time of updating is smaller than a preset value, or the like. If it is determined in step S106 that training is not complete, the process returns to step S101, and the acquisition unit 101b acquires one or more new original images. On the other hand, if it is determined that training is complete, the update unit 101d ends training and stores the configuration of the machine learning model and information on the weights (weight information) in the storage unit 101a.

[0040] Next, a process of sharpening the captured image 21 using a trained machine learning model will be described with reference to the flowchart of Fig. 6. Note that the following steps of the sharpening process in this embodiment are executed by any one of the storage unit 103a, the acquisition unit 103b, and the processing unit 103c in the image processing device 103.

[0041] In step S201, the acquisition unit 103b acquires the captured image 21. In this embodiment, the captured image 21 is acquired from the imaging device 102. The acquisition unit 103b may acquire information on the configuration and weights of the machine learning model together with the captured image 21. It is preferable that the image processing device 103 acquires the information on the configuration and weights of the machine learning model in advance from the learning device 101 via communication and stores it in the storage unit 103a.

[0042] In step S202, the processing unit 103c uses a machine learning model to sharpen the blur of the captured image 21 to generate an estimated image (intermediate image, first image) 22. The machine learning model in this embodiment has a configuration shown in FIG. 1(b). Note that an image based on the difference between the captured image and the estimated image (difference image) may be the first image. The difference between the captured image and the estimated image represents a correction component corrected by sharpening.

[0043] In this embodiment, the first image 22 is generated by a machine learning model, but is not limited to this. The first image 22 may be obtained by correcting blur in the captured image by processing using a sharpening filter (restoration filter) such as a Wiener filter.

[0044] Next, the image processing method in this embodiment will be described with reference to the flowchart in Fig. 7. Each of the following steps is executed by any one of the storage unit 103a, acquisition unit 103b, and processing unit 103c in the image processing device 103.

[0045] First, in step S211, the acquisition unit 103b acquires information about the subject distance. In this embodiment, the information about the subject distance is a defocus map. Note that the information about the subject distance is not limited to a defocus map, and may be a depth map. Step S211 may be executed at any time before step S214.

[0046] A defocus map is a map that indicates information about the defocus blur that acts on a subject in a captured image, and has a numerical value that indicates the amount of defocus of the subject for each pixel of the captured image. A defocus map can be obtained using a parallax image or DFD (Depth from Defocus), etc. For example, the focus plane can be expressed as 0, with the direction away from the imaging device being negative and the direction approaching being positive.

[0047] 8(A) shows an example of a captured image 114, and FIG. 8(B) shows an example of a defocus map 118. In the captured image 114 and the defocus map 118, there are a focused subject 115, an unfocused subject 116 (small defocus amount), and an unfocused subject 117 (large defocus amount), and the numerical values ​​of the defocus map vary according to the defocus amount. The area surrounded by dots in FIG. 8(B) indicates an area where the focused subject in the captured image has expanded due to blurring generated during imaging. Note that when the amount of blurring generated during imaging is large, this area is not included in the focused area in the defocus map 118. At this time, an area corresponding to the hatched area 113 in FIG. 2 occurs.

[0048] In step S212, the acquisition unit 103b acquires the shooting state from the captured image. The shooting state is the zoom position of the optical system 102a, the aperture diameter, (z, f, d) indicating the state of the subject distance, and the pixel pitch of the image sensor 102b.

[0049] In step S213, the acquisition unit 103b acquires information about blur. In this embodiment, the optical characteristic (optical performance index) of the optical system used for imaging is acquired as the information about blur. The optical performance index in this embodiment is acquired based on the imaging state.

[0050] In this embodiment, a point spread function (PSF) is used as the optical performance index. Specifically, the peak value of the point spread function, which depends on the pixel pitch of the image sensor 102b used to acquire the captured image, is used as the index. Since the peak value of the PSF depends on the pixel pitch, optical performance indexes corresponding to a plurality of pixel pitches can be stored in, for example, the storage unit 103a, and the value of the optical performance index used in subsequent processing can be referenced based on the imaging state. In addition, when the stored index is a discrete value, an intermediate value can be obtained by interpolation and used as the optical performance index. Note that the optical performance index may be anything that can reflect the optical performance of the optical system 102, so for example, the optical transfer function (OTF) may be used as the optical performance index.

[0051] Here, FIG. 9 shows an explanatory diagram of the division points of the optical performance index. FIG. 9 shows an image circle 119 of the optical system 102a, an effective pixel area 120 of the image sensor 102b, and white points 122 indicating the optical performance index stored in the storage unit 103a. In this embodiment, the peak values ​​of the PSF for 10 points from on-axis to the most off-axis are acquired. Note that in this embodiment, the peak values ​​of the PSF for 10 points are acquired, but this is not limited thereto, and the number of divisions may be more than 10 points or less than 10 points. In addition, when the image sensor 102b has an effective pixel area 121 smaller than the effective pixel area 120, a necessary optical performance index can be acquired according to the size of the effective pixel area.

[0052] Here, in order to reduce the amount of data, the storage unit 103a stores (stores) only optical performance indexes for the imaging states discretely selected. Therefore, an optical performance index that corresponds to the imaging state acquired in step S212 or is as close as possible to the imaging state is selected. Then, the acquisition unit 103b acquires an optical performance index to be used in subsequent processes by correcting the selected optical performance index so as to optimize it for the imaging state acquired in step S212.

[0053] 10 is a schematic diagram showing optical performance indexes for discretely selected imaging states. Note that the optical performance indexes in this embodiment are stored in the storage unit 103a.

[0054] The optical performance indexes are discretely arranged in an imaging state space with three imaging states, namely, zoom position (state A), aperture diameter (state B), and subject distance (state C), as axes. The coordinates of each point (black circle) in the imaging state space indicate the optical performance indexes stored in the storage unit 103a. Note that, although the optical performance indexes are arranged at lattice points on a line perpendicular to each imaging state in FIG. 10, the optical performance indexes may be arranged away from the lattice points.

[0055] In addition, the types of imaging states are not limited to the zoom position, the aperture diameter, and the subject distance, and the number of them does not have to be three, and an imaging state space of four or more dimensions may be configured by four or more imaging states, and optical performance indexes may be discretely arranged therein. Also, the imaging state space may be configured by one of the zoom position, the aperture diameter, and the subject distance.

[0056] Next, a specific method for selecting and creating (correcting) the optical performance index will be described. In Fig. 10, the imaging state indicated by a large white circle is assumed to be the actual imaging state acquired in S212. The optical performance index is selected based on the actual imaging state or the imaging state that exists closest in the imaging state space. The optical performance index is selected from the optical performance indexes stored (stored) in the storage unit 103a. In addition, the optical performance index may be selected or created (corrected) by the following method.

[0057] First, the acquisition unit 103b calculates the distances in the imaging state space between the actual imaging state and imaging states corresponding to the plurality of optical performance indexes, and then selects the optical performance index corresponding to the imaging state that is the shortest distance from among the calculated distances.

[0058] By selecting such an optical performance index, the difference between the actual imaging state and the imaging state corresponding to the optical performance index (hereinafter referred to as the state difference amount) is minimized. It is assumed that the stored filter corresponding to the imaging state shown by the small white circle in Fig. 10 is selected.

[0059] Next, the acquisition unit 103b calculates state difference amounts ΔA, ΔB, and ΔC between the imaging state corresponding to the selected optical performance index and the actual imaging state. Then, a state correction coefficient is calculated based on these state difference amounts ΔA, ΔB, and ΔC. Furthermore, the acquisition unit 103b corrects the selected optical performance index using the state correction coefficient. In this way, an optical performance index corresponding to the actual imaging state can be created. Alternatively, as another method, a plurality of optical performance indexes located near the actual imaging state are selected, and the plurality of optical performance indexes are subjected to an interpolation process according to the state difference amount, thereby making it possible to create an optical performance index suitable for the imaging state.

[0060] In step S214, the processing unit 103c generates a weighting map from the information about the blur and the defocus map. In this embodiment, an optical performance index is used as the information about the blur.

[0061] The weight map determines the ratio of each image when taking a weighted average of the captured image 21 and the first image 22, and has continuous signal values ​​ranging from 0 to 1. For example, when the value of the weight map determines the ratio of the captured image, if the value is 1, the image obtained by weighted averaging is the same as the captured image 21, and if the value of the weight map is 0.5, the image obtained by weighted averaging is obtained by adding the pixel values ​​of the captured image 21 and the first image 22 after dividing them by 2 (50%). Note that the value of the weight map in this embodiment represents the weight for the first image 22.

[0062] In addition, the weight map in this embodiment is generated by blurring the in-focus area in the defocus map for each predetermined area of ​​the captured image 21 with a Gaussian filter. The Gaussian filter is a filter in which the weight in the kernel is calculated according to a Gaussian distribution. Note that the filter used for blurring is not limited to the Gaussian filter, and any filter capable of correcting the in-focus area in the defocus map may be used.

[0063] Figure 11(A) shows an example of a defocus map, Figure 11(B) shows an example of a weighting map when the amount of blur of the focused subject is large, and Figure 11(C) shows an example of a weighting map when the amount of blur of the focused subject is small.

[0064] The hatched areas 123 and 124 are areas in which the in-focus area in the defocus map has been changed (corrected) based on the amount of blur of the focused object. Specifically, when the optical performance index is small, the amount of blur of the focused object is large, so the amount of blur by the Gaussian filter is increased. On the other hand, when the optical performance index is large, the amount of blur of the focused object is small, so the amount of blur by the Gaussian filter is decreased. In other words, the greater the amount of blur in the captured image 21, the wider the in-focus area in the defocus map. With this configuration, it is possible to generate a map (weight map) in which the strength of the sharpening process of a part of the area that was determined to be an out-of-focus area in the pre-correction defocus map is increased. Therefore, when sharpening an image, it is possible to generate a good sharpened image while suppressing the occurrence of adverse effects in the out-of-focus area.

[0065] The method of generating the weight map is not limited to this. For example, the optical transfer function (OTF) data of the optical system acting on the captured image 21 may be stored, and the depth map may be blurred for each region based on the shooting conditions. Instead of blurring the depth map, the depth map may be enlarged and then trimmed to the original number of pixels.

[0066] In step S215, the processing unit 103c performs a weighted average of the captured image 21 and the first image 22 based on the weight map to generate an intensity-adjusted image (second image) 23. By acquiring the intensity-adjusted image 23 based on the weight map, it is possible to generate a favorable sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas when sharpening an image.

[0067] The method of adjusting the strength of the sharpening process for the captured image is not limited to the weighted average. For example, the captured image 21 may be subtracted from the first image (intermediate image) 22 obtained by the sharpening process to obtain a difference image representing the correction component in the sharpening process, and the difference image may be added to the captured image based on a weight map to generate the second image 23. The second image 23 may be generated by inputting information about the subject distance corrected based on information about blurring generated during imaging and the captured image 21 to a machine learning model. In this case, the machine learning model generates an output image 12 based on information about the subject distance and a training image 10 corresponding to the captured image 21 in the learning phase, and updates parameters based on the error between the correct image 11 and the output image 12.

[0068] With the above configuration, when sharpening an image, it is possible to generate a favorable sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas.

[0069] [Example 2] Second Embodiment An image processing system according to a second embodiment of the present invention will be described.

[0070] FIG. 12 shows a block diagram of the image processing system 200, and FIG.

[0071] The image processing system 200 includes a learning device 201, an imaging device 202, and an image processing device 203. The image processing device 203 is connected to each of the learning device 201 and the imaging device 202 via a wired or wireless network. The learning device 201 is similar to the learning device 101 of the first embodiment.

[0072] The imaging device 202 includes an optical system 221, an imaging element 222, a storage unit 223, a communication unit 224, and a display unit 225. The optical system 221 and the imaging element 222 correspond to the optical system 102a and the imaging element 102b in the first embodiment. In addition, a captured image 21 acquired using the imaging device 202 can be stored in the storage unit 223 or displayed on the display unit 225.

[0073] In addition, the imaging device 202 transmits the captured image 21 to the image processing device 203 via the communication unit 224.

[0074] The image processing device 203 includes a storage unit 231, a communication unit 232, an acquisition unit 233, and a processing unit 234. The image processing device 203 in this embodiment receives a captured image via the communication unit 232, and sharpens the captured image using information on the configuration and weights of the machine learning model stored in the storage unit 231. The information on the configuration and weights of the machine learning model is trained by the learning device 201, and is acquired in advance from the learning device 201 and stored in the storage unit 231. Furthermore, the processing unit 234 in the image processing device 203 has a function of adjusting the intensity of the sharpening process. An image (intensity-adjusted image 23) in which the intensity of the sharpening process has been adjusted as necessary is transmitted from the image processing device 203 to the imaging device 202, and can be stored in the storage unit 223 or displayed on the display unit 225.

[0075] The learning phase executed by the learning device 201 and the estimation phase executed by the image processing device 203 are the same as those in the first embodiment, and therefore will be omitted.

[0076] Next, the image processing method in this embodiment will be described with reference to the flowchart in Fig. 14. Each of the following steps is executed by any one of the storage unit 231, communication unit 232, acquisition unit 233, and processing unit 234 in the image processing device 203.

[0077] In step S311, the acquisition unit 333 acquires information related to the subject distance. The information related to the subject distance in this embodiment is a depth map.

[0078] A depth map is a map showing information about the subject distance in a captured image, and has a numerical value representing the distance to the subject for each pixel of the captured image. For example, when the pixel values ​​in the depth map range from 0 to 255, the distance to the subject is expressed as 255 when the distance to the subject is the farthest, and 0 when the distance to the subject is the closest. The distance between them is expressed as a standardized value in the range from 0 to 255. Note that the farthest distance to the subject may be 0, and the closest distance to the subject may be 255, and the range of pixel values ​​is not limited to 0 to 255.

[0079] The depth map can be obtained by using a distance measuring device such as a ToF sensor. When using the depth map as information related to the subject distance, information on which subject is in focus (information related to the position of the focused subject) may be obtained from focus information during shooting, etc., as necessary. With this configuration, the focused subject in the captured image can be identified using the depth map.

[0080] In step S312, the acquisition unit 333 acquires information about the position of the focused subject. In this embodiment, autofocus information recorded at the time of shooting is used as the information about the position of the focused subject. Here, Fig. 15(A) shows an example of a captured image, and Fig. 15(B) shows an example of the autofocus information.

[0081] 15(A) includes a focused subject 212, an unfocused subject 213, and an unfocused subject 214. The unfocused subject 213 is located in front of the focal position (focus plane) at the time of imaging, and is a blurred subject (foreground blur) in the acquired captured image 211. On the other hand, the unfocused subject 214 is located behind the focal position (focus plane) at the time of imaging, and is a blurred subject (background blur) in the acquired captured image 211.

[0082] 15(B) shows a dotted line area 215 and a solid line area 216 in a captured image 211. The dotted line area 215 represents a focusable area, and the solid line area 216 represents an area that was focused on when capturing the captured image 211. It can be seen from the autofocus information that the subject 212 was in focus when the captured image 211 was acquired.

[0083] In step S313, the processing unit 234 changes pixel values ​​of the depth map based on information about the position of the focused subject. Here, Fig. 16 shows an example of the depth map in this embodiment.

[0084] Fig. 16(A) is an example of the depth map acquired in step S311, and Fig. 16(B) is a depth map that has been modified (corrected) based on information about the position of the focused subject. Note that the pixel values ​​in the depth map in this embodiment are set to 1 in areas where a focused subject exists, and 0 in areas where an unfocused subject exists.

[0085] In step S314, the acquisition unit 233 acquires an image (difference image) based on the difference between the captured image 21 and the estimated image (intermediate image) 22. The difference image represents a correction component in the sharpening process. In this embodiment, the difference image is used as information related to blur. Note that a configuration may be adopted in which an image equivalent to the difference image is generated as an output image in image processing using a machine learning model.

[0086] In step S315, the processing unit 234 generates a weight map based on the difference image and the depth map. The weight map is generated by blurring the area in the depth map where the focused object exists using a Gaussian filter based on the difference image. When using a Gaussian filter, the weight map can be generated by calculating the sum of the difference image for each predetermined area, dividing it by the number of pixels in the predetermined area, and finding the average value.

[0087] Here, an explanatory diagram of a difference image is shown in Fig. 17. Fig. 17(A) is an example of a method for dividing a predetermined area in a captured image, and Fig. 17(B) is an example of a difference image. The difference image in this embodiment is represented by an average value of correction components calculated for each predetermined area.

[0088] In this embodiment, the method of dividing the predetermined area in the captured image is to divide it vertically into 10 and horizontally into 12. However, the method of dividing the predetermined area is not limited to this, and it may be divided into 20 vertically and 24 horizontally.

[0089] In an area where the average value of the correction component is large, a large amount of blurring occurs during imaging, so the amount of blurring in the Gaussian filter is increased in that area, whereas in an area where the average value of the correction component is small, a small amount of blurring occurs during imaging, so the amount of blurring in the Gaussian filter is decreased.

[0090] The weight map may be generated by blurring the entire depth map with the same filter. When the depth map is blurred with the same filter, the pixel values ​​of the entire image are reduced according to the strength of the blurring. Therefore, it is preferable to perform a process to bring the pixel values ​​closer to the original pixel values ​​by replacing the pixel values ​​with the original pixel values ​​in the area where the pixel values ​​are reduced.

[0091] In step S316, the processing unit 234 generates the intensity-adjusted image 23 based on the weight map generated in step S315.

[0092] With the above configuration, when sharpening an image, it is possible to generate a favorable sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas.

[0093] [Example 3] An image processing system 300 according to a third embodiment of the present invention will be described.

[0094] FIG. 18 shows a block diagram of the image processing system 300, and FIG. 19 shows an external view of the image processing system 300.

[0095] The image processing system 300 includes a learning device 301, a lens device 302, an imaging device 303, a control device 304, an image processing device 305, and networks 306 and 307. In this embodiment, the learning device 301 and the image processing device 305 are servers. The control device 304 is a device operated by a user, such as a personal computer or a mobile terminal.

[0096] The learning device 301 has a storage unit 301a, an acquisition unit 301b, a calculation unit 301c, and an update unit 301d, and learns weights of a machine learning model that sharpens an image captured using a lens device 302 and an imaging device 303. The learning phase in the learning device 301 is omitted because it is the same as in the first embodiment.

[0097] The imaging device 303 has an imaging element 303a, and the lens device 302 has an optical system 302a. The imaging element 303a photoelectrically converts an optical image formed by the optical system to obtain a captured image. The lens device 302 and the imaging device 303 are detachable, and can be combined with a plurality of types of devices. The lens device 302 and the imaging device 303 may be attached via an adapter.

[0098] The control device 304 includes a communication unit 304a, a display unit 304b, a storage unit 304c, and an acquisition unit 304d. The control device 304 controls processing performed on captured images acquired from the imaging device 303 connected by wire or wirelessly in accordance with a user's operation. Note that captured images acquired by capturing images with the imaging device 303 may be stored in advance in the storage unit 304c, and the captured images may be read out.

[0099] The image processing device 305 includes a communication unit 305a, an acquisition unit 305b, a storage unit 305c, and a processing unit 305d. The image processing device 305 executes processing on a captured image in response to a request from a control device 304 connected via a network 306. The image processing device 305 also acquires information on the weights of a machine learning model from a learning device 301 connected via a network 307, and sharpens the captured image. The information on the weights of the machine learning model may be acquired when sharpening the captured image, or may be acquired in advance.

[0100] The intensity-adjusted image 23 generated by the image processing device 305 is transmitted to the control device 304, and may be stored in the memory unit 304c as necessary, or may be displayed on the display unit 304b.

[0101] Next, the image processing method in this embodiment will be described with reference to the flowchart of Fig. 20. Each of the following steps is executed by either the control device 304 or the image processing device 305.

[0102] In step S401, the acquisition unit 304d acquires the captured image 21. At this time, the captured image 21 is acquired by imaging using the imaging device 303 and the lens device 302.

[0103] In step S402, the communication unit 304a transmits the captured image 21 and a request for execution of processing on the captured image 21 to the image processing device 305.

[0104] In step S403, the communication unit 305a receives (acquires) the captured image 21 and a processing request.

[0105] In step S404, the acquisition unit 305b acquires, from the storage unit 405c, information on the learned weights corresponding to the captured image 21. The weight information in this embodiment is read out in advance from the storage unit 301a and stored in the storage unit 405c.

[0106] In step S405, the processing unit 305d uses the machine learning model to generate an estimated image 22. The estimated image 22 in this embodiment is an intermediate image obtained by sharpening the blur of the captured image 21. The machine learning model in this embodiment has a configuration shown in FIG. 1(b).

[0107] In step S406, the acquisition unit 305b acquires a defocus map as information related to the subject distance.

[0108] In step S407, the acquisition unit 305b acquires an optical performance index corresponding to the shooting conditions as information related to blur.

[0109] In step S408, the processing unit 305d generates a weighting map based on the optical performance index and the defocus map.

[0110] In step S409, the processing unit 305d generates the intensity-adjusted image 23 based on the captured image 21, the estimated image 22, and the weighting map.

[0111] In step S410, the communication unit 305a transmits the intensity-adjusted image 23 to the control device 304.

[0112] In step S411, the communication unit 304a acquires the intensity-adjusted image 23 that has been transmitted.

[0113] With the above configuration, when sharpening an image, it is possible to generate a favorable sharpened image while suppressing the occurrence of adverse effects in out-of-focus areas.

[0114] (Other Examples) The present invention can also be realized by supplying a program for realizing one or more functions of the above-mentioned embodiments to a system or device via a network or a storage medium, and having one or more processors in the computer of the system or device read and execute the program. It can also be realized by a circuit (e.g., ASIC) for realizing one or more functions. The image processing device can be any device having the image processing function of the present invention, and can be realized in the form of an imaging device or a PC.

[0115] According to each embodiment, it is possible to provide an image processing method, an image processing device, an image processing system, a program, and a storage medium that are capable of generating a good sharpened image while suppressing the occurrence of problems in out-of-focus areas when sharpening an image.

[0116] Although the preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments, and various modifications and changes are possible within the scope of the gist of the present invention.

[0117] The embodiments of the present invention include the following methods, configurations, and programs.

[0118] [Method 1] sharpening the image to generate a first image; obtaining a weight map based on a map relating to object distances corresponding to the image and information relating to blur of the image; generating a second image based on the image, the first image, and the weight map.

[0119] [Method 2] The image processing method described in Method 1, characterized in that in the step of acquiring the weight map, the weight map is acquired by changing the focus region in the map related to the subject distance based on the information regarding the blur.

[0120] [Method 3] The image processing method described in Method 1 or 2, characterized in that in the step of generating the first image, an intermediate image is generated by sharpening the image, and the first image is generated based on the difference between the intermediate image and the image.

[0121] [Method 4] 4. The image processing method according to any one of Methods 1 to 3, characterized in that the information regarding blur is obtained based on a difference between the first image and the image.

[0122] [Method 5] The image is an image obtained by imaging using an optical system, 4. The image processing method according to any one of Methods 1 to 3, characterized in that the information about the blur is obtained based on optical characteristics of the optical system.

[0123] [Method 6] The image processing method according to any one of Methods 1 to 5, characterized in that the greater the blur, the larger the in-focus area in the map relating to the subject distance becomes.

[0124] [Method 7] 6. The image processing method according to any one of methods 1 to 5, characterized in that the map relating to the subject distance is obtained based on the image.

[0125] [Method 8] The image processing method according to any one of Methods 1 to 7, wherein the map relating to the subject distance includes at least one of a depth map and a defocus map.

[0126] [Method 9] 9. The image processing method according to any one of methods 1 to 8, wherein in the step of generating the first image, the image is sharpened using a machine learning model.

[0127] [Configuration 1] A means for acquiring an image; means for sharpening the image to generate a first image; means for obtaining a weight map based on a map relating to a subject distance corresponding to the image and information relating to blur of the image; and generating a second image based on the image, the first image, and the weight map.

[0128] [Configuration 2] An image processing system having the image processing device according to configuration 1 and a control device capable of communicating with the image processing device, the control device has a transmission means for transmitting a request for processing a captured image to the image processing device, The image processing device includes: A receiving means for receiving the request; an image processing system comprising: a processor for executing processing on the captured image based on the request.

[0129] [Program 1] 10. A program for causing a computer to execute the image processing method according to any one of Methods 1 to 9.

[0130] [Configuration 3] A storage medium storing the program described in Program 1. [Explanation of symbols]

[0131] 21 Captured images 22 First image 23 Second Image S202: generating a first image S214: Obtaining a weight map S215: generating a second image

Claims

1. sharpening the image to generate a first image; obtaining a weight map based on a map relating to object distances corresponding to the image and information relating to blur of the image; generating a second image based on the image, the first image, and the weight map.

2. 2. The image processing method according to claim 1, wherein in the step of acquiring the weight map, the weight map is acquired by changing a focus region in the map relating to the subject distance based on the information regarding the blur.

3. The image processing method according to claim 1, wherein in the step of generating the first image, an intermediate image is generated by sharpening the image, and the first image is generated based on a difference between the intermediate image and the image.

4. 4. The image processing method according to claim 1, wherein the information regarding the blur is acquired based on a difference between the first image and the image.

5. The image is an image obtained by imaging using an optical system, 4. The image processing method according to claim 1, wherein the information regarding the blur is acquired based on optical characteristics of the optical system.

6. 4. The image processing method according to claim 1, wherein the in-focus area in the map relating to the subject distance becomes wider as the blur becomes larger.

7. 4. The image processing method according to claim 1, wherein the map relating to the subject distance is acquired based on the image.

8. 4. The image processing method according to claim 1, wherein the map relating to the subject distance includes at least one of a depth map and a defocus map.

9. 4. The image processing method according to claim 1, wherein in the step of generating the first image, the image is sharpened using a machine learning model.

10. A means for acquiring an image; means for sharpening the image to generate a first image; means for obtaining a weight map based on a map relating to a subject distance corresponding to the image and information relating to blur of the image; means for generating a second image based on said image, said first image, and said weight map.

11. 11. An image processing system comprising the image processing device according to claim 10 and a control device capable of communicating with the image processing device, the control device has means for transmitting a request for processing the image to the image processing device; 2. An image processing system according to claim 1, wherein the image processing device comprises means for executing processing on the image based on the request.

12. A program for causing a computer to execute the image processing method according to any one of claims 1 to 3.

13. A storage medium storing the program according to claim 12.

Citation Information

Patent Citations

  • Image processing apparatus, image processing method, and computer program

    JP2011044825A