Image processing apparatus, image processing method, and computer readable storage medium
Through neural network processing technology, combined with convolutional neural network and feature integration, the problem of inaccurate focus in the existing technology is solved, the accurate estimation and focus control of the subject's defocus range are achieved, and the accuracy in complex environments is improved. Focus on stability.
Patent Information
- Application Number
- CN202410505945.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-25
- Filing Date
- 2024-04-25
- Publication Date
- 2024-10-25
AI Technical Summary
When focusing on a subject, the existing technology is difficult to accurately suppress the influence of obstructions and focus detection errors, especially when obstructions exist or the light environment is poor, resulting in inaccurate focusing.
Neural network processing technology is used to obtain the captured image and defocus map, and integrated features are generated to estimate the defocus range of the subject. Convolutional neural network and feature integration technology are used to improve the accuracy of focus adjustment.
It effectively reduces the impact of obstructions and focus detection errors, improves focusing accuracy in low-light environments or low-contrast situations, and ensures accurate focus on the subject.
Smart Images

Figure CN118842997A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an image processing device, an image processing method and a computer-readable storage medium, and in particular to focus control of a camera device. Background Art
[0002] Image processing is used for various purposes. For example, Liu (W. Liu et al. "SSD: Single Shot MultiBox Detector", ECCV 2016) disclosed a method for detecting a subject region from an image using a neural network.
[0003] On the other hand, an imaging device for performing focus adjustment to focus on a subject is known. For example, Japanese Patent Laid-Open No. 2022-137760 discloses a technology involving adjusting the focus based on the defocus amount in multiple autofocus (AF) areas. Japanese Patent Laid-Open No. 2022-137760 discloses a technology for focusing on a main subject by eliminating the influence of an obstruction crossing in front of the main subject. According to Japanese Patent Laid-Open No. 2022-137760, the area of the obstruction crossing in front of the main subject is determined by utilizing a statistical value of a distance value depending on the subject distance detected for each AF area. Summary of the invention
[0004] According to an embodiment of the present invention, an image processing device includes: an acquisition unit, which is configured to acquire input data, wherein the input data includes a captured image and / or information related to the captured image; a feature acquisition unit, which is configured to acquire features of the input data by processing the input data using a neural network; an integration unit, which is configured to generate an integrated feature by integrating the feature and at least some of the input data; and a post-processing unit, which is configured to generate an estimation result of at least one of a defocus range and a depth range of a subject in the captured image by processing the integrated feature.
[0005] According to another embodiment of the present invention, an image processing method includes: obtaining input data, wherein the input data includes a captured image and / or information related to the captured image; obtaining features of the input data by processing the input data using a neural network; generating an integrated feature by integrating the feature and at least some of the input data; and generating an estimation result of at least one of a defocus range and a depth range of a subject in the captured image by processing the integrated feature.
[0006] According to another embodiment of the present invention, a computer-readable storage medium stores a program, and when the program is executed by a computer, the computer performs the method as described above.
[0007] Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings). BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a diagram showing an example hardware configuration of an image processing apparatus according to one embodiment.
[0009] Figure 2 is a diagram showing an example functional configuration of an image processing apparatus according to one embodiment.
[0010] Figure 3 is a flowchart of a process performed using an image processing method according to one embodiment.
[0011] Figure 4 is a diagram illustrating an example of a method for generating features.
[0012] Figure 5 is a flow chart illustrating an example of a process for generating an integrated feature.
[0013] Figure 6 is a flow chart illustrating an example of a process for generating an integrated feature.
[0014] Figure 7 is a diagram illustrating an example of processing performed on an integration feature.
[0015] FIG. 8A to FIG. 8D exemplifies an input image and a defocus map.
[0016] Fig. 9 is a flowchart of a process in an image processing method according to one embodiment.
[0017] Fig.10 is a flow chart illustrating an example of a process for generating an integrated feature.
[0018] Fig.11 is a diagram illustrating a process for generating integrated features.
[0019] Fig. 12A and Fig. 12B is a diagram illustrating a process for generating integrated features.
[0020] Fig.13 is a diagram showing an example functional configuration of a learning device according to one embodiment.
[0021] Fig.14is a flow chart of a process performed using a learning method according to one embodiment. DETAILED DESCRIPTION
[0022] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments are not intended to limit the claims. Although multiple features are described in the embodiments, not all of these features are necessary, and multiple features may also be appropriately combined. In addition, in the accompanying drawings, the same reference numerals are given to the same or similar configurations, and their redundant descriptions will be omitted.
[0023] When focusing on the face of a person, their arms or hands may block their faces. For example, when the arms of the person block their faces, the facial area included in the field of view of the camera includes an area where the face does not exist (i.e., the area of the arm blocking the face). In this case, the focus detection result of the facial area changes continuously from the face to the arm. In such a situation, even using a technique using statistical values of distance values such as Japanese Patent Laid-Open No. 2022-137760, it is difficult to suppress the influence of the arm and focus on the face. In addition, for example, in situations such as shooting in a low-light environment, or when the contrast of the subject is low, or when the aperture value (f-stop value) of the photographic optical system is large, the focus detection results tend to vary greatly. In this case, the distance values detected for each area may be accompanied by a relatively large error that follows a predetermined distribution (such as a normal distribution). In this case, it is difficult to suppress the influence of errors using methods such as Japanese Patent Laid-Open No. 2022-137760 using statistical values of distance values.
[0024] We studied a method for accurately performing focus adjustment using a neural network. Generally, in a process using a neural network, feature extraction is performed in a preceding layer, and the result is output in a subsequent layer. We attempted to use a neural network to estimate the defocus amount of a subject (e.g., a person's face) based on a defocus map showing the defocus amount at various locations in an image. However, there is still a need to further improve the estimation accuracy. On the other hand, in other processes using a neural network, there are cases where the estimation accuracy needs to be further improved.
[0025] One embodiment of the present disclosure improves the accuracy of processing of input data related to an image.
[0026] The image processing device according to an embodiment of the present disclosure may be implemented by a computer or an information processing device provided with a processor and a memory. Figure 11 is a block diagram showing an example hardware configuration of an information processing device that can be used as an image processing device according to various embodiments described later. The image processing device according to various embodiments can be implemented by a single information processing device. On the other hand, the various functions of the information processing device described later can be distributed to multiple information processing devices as needed. In the case where the image processing device is composed of multiple information processing devices, the information processing devices are connected so as to be able to communicate with each other. For example, a local area network (LAN) can be used to achieve the connection.
[0027] exist Figure 1 In the example of , the information processing device 100 is connected to an input device 109, an output device 110, the Internet 111, and a camera 112. There is no particular limitation on the connection method. For example, at least some of these devices may be connected by cables. In addition, at least some of these devices may be connected via wireless communication. In addition, the input device 109 or the output device 110 may be an independent device separate from the information processing device 100. On the contrary, the input device 109 or the output device 110 may be integrally incorporated into the information processing device 100.
[0028] The information processing device 100 can perform processing according to various embodiments. The input device 109 is a device that receives user input to the information processing device 100. The input device can be, for example, a pointing device or a keyboard. The output device 110 is a device that can output images and characters. The output device 110 is, for example, a monitor. The output device 110 can display data held by the information processing device 100, data input by the user, or the execution result of a program.
[0029] The camera 112 is an imaging device capable of acquiring captured images. The camera 112 can acquire continuously captured images, for example, by capturing images at predetermined intervals Δt. The camera 112 can input the captured images thus acquired to the data acquisition unit 201 described later. There is no particular limitation on the number of cameras 112. For example, one camera 112 or a plurality of cameras 112 may be connected to the information processing device 100.
[0030] The CPU 101 is a central processing unit that performs overall control of the information processing apparatus 100. The CPU 101 can perform processing according to various embodiments and control the operation of the information processing apparatus 100 by executing various software (computer programs) stored in the external storage device 104, for example.
[0031] ROM 102 is a read-only memory. ROM 102 can store programs and parameters that do not need to be changed. RAM 103 is a random access memory. RAM 103 can temporarily store programs or data supplied from an external device or the like. External storage device 104 is an external storage device readable by the information processing apparatus 100. The external storage device 104 can store programs and data for a long time. The external storage device 104 can be, for example, a hard disk or a memory card fixedly installed in the information processing apparatus 100. In addition, the external storage device 104 can be an optical disk such as a flexible disk (FD) or a compact disk (CD), a magnetic card, an optical card, an IC card, or a memory card, etc., which is removable relative to the information processing apparatus 100.
[0032] The input interface 105 is an interface with an input device 109. The output interface 106 is an interface with an output device 110. The communication interface 107 is an interface for connecting to other devices. The information processing apparatus 100 can be connected to the Internet 111 or the camera 112 via the communication interface 107. The camera 112 can also be connected to the information processing apparatus 100 via the Internet 111. The system bus 108 connects the above-mentioned units so that these units can communicate with each other.
[0033] In this manner, a processor such as the CPU 101 can implement the functions described later by executing a program stored in a memory such as the ROM 102, the RAM 103, or the external storage device 104. Figure 2 For example, the program for realizing the functions of the various units stored in the external storage device 104 is read out to the RAM 103. Then, the functions of the various units are realized by the CPU 101 operating according to the program on the RAM 103. At this time, the device for storing the program and each setting data set is not limited to the external storage device 104. For example, the information processing apparatus 100 can obtain the program and the setting data set from other devices such as a server via a network such as the Internet 111.
[0034] Figure 2 is a block diagram showing an example functional configuration of the information processing device 100. The information processing device 100 includes a data acquisition unit 201, a parameter acquisition unit 202, and an inference unit 21. In addition, the functional units are each connected to a storage unit 206. On the other hand, the information processing device 100 may include the storage unit 206. Hereinafter, these functional units will be described.
[0035] The following description focuses on a case where the information processing device 100 performs a task of inferring the defocus range of a subject in an image. The defocus range of a subject is represented by the maximum and minimum values of the defocus amount in an area corresponding to a specific subject in the image. There is no particular limitation on the category of the subject. The subject may be any of a variety of objects such as a person, an animal (e.g., a dog or a cat), or a vehicle (e.g., a car or a train). On the other hand, the subject may be, for example, a part of an object such as a face or an eye. Hereinafter, a case of detecting a person will be described. However, as will be described later, the processing performed by the information processing device 100 according to the present embodiment is not limited to processing for inferring the defocus range. Note that, in this article, the defocus amount indicates the degree to which the focus is away from the focal plane.
[0036] The data acquisition unit 201 acquires input data. In the present embodiment, the input data is input data including an image and / or information related to the image. In the following example, the data acquisition unit 201 acquires a captured image of a subject. The captured image may be an image obtained by capturing an image of a subject using the camera 112.
[0037] In this embodiment, in addition to capturing an image, the data acquisition unit 201 also acquires a defocus map. The defocus map is a graph extended in the spatial direction, and shows the defocus amount of each position (e.g., each area) in the captured image. The defocus map can be generated based on the defocus amount calculated for each area of the image. The data acquisition unit 201 is capable of obtaining such a defocus map from the camera 112. There is no particular limitation on the method of generating a defocus map. For example, a camera 112 with an image plane phase difference AF function is capable of generating such a defocus map based on the defocus amount at each ranging point. For example, a defocus map can be generated according to the method described in Japanese Patent Laid-Open No. 2019-134431.
[0038] In the present embodiment, the data acquisition unit 201 also acquires a subject area map showing an area where a subject is located within a captured image. The subject area map can show the position and size of a subject. The data acquisition unit 201 can generate a subject area map based on a position input. For example, a user can specify a subject area by touching a subject on an image displayed on the output device 110. In this case, the data acquisition unit 201 can acquire information for specifying a subject area from the input device 109. In addition, the data acquisition unit 201 can determine the area of a subject using a method for automatically detecting a subject in an image. For example, the data acquisition unit 201 can detect a main subject in an image, etc. using the method described in Japanese Patent Laid-Open No. 2017-98900. In addition, the data acquisition unit 201 can determine the area of a subject based on both area designation and object detection processing. For example, the data acquisition unit 201 can use the area of an object detected from a specified area as the area of a subject. For example, the data acquisition unit 201 can detect objects from images using the method described by Liu.
[0039] Then, the data acquisition unit 201 is capable of generating a subject area map based on the information indicating the subject area thus obtained in the image. In the following example, the subject area in the image is represented by a bounding box (hereinafter abbreviated as BB). Note that in the present embodiment, the use of the subject area map is not mandatory. That is, the information processing device 100 can estimate the defocus range for a subject located at an arbitrary position within the captured image.
[0040] Fig. 8A 8 shows an example of an image 801 acquired by the data acquisition unit 201. The image 801 is an image captured by the camera 112. A person 802 as a subject appears in the image 801. Figure 8B , a defocus map 803 and a BB 804 of a subject are superimposed on an image 801 . Fig.8D The subject region map 805 is shown. The subject region map 805 is generated based on the BB 804. The subject region map 805 is a two-dimensional map. In the subject region map 805, a value greater than 0 (eg, 1) is recorded for pixels in the region inside the BB 804, and 0 is recorded for other pixels.
[0041] On the other hand, in addition to the subject, the background also appears in the BB 804 of the image 801. In addition, an obstacle that hides a part of the subject may appear in the BB 804 of the image 801. According to the present embodiment, the defocus range for a specific category of subjects appearing in the BB 804 is estimated. For example, the defocus range can be estimated for a part of the BB 804 in which a person's face appears and which is not a part of the background or a part in which an obstacle appears.
[0042] The parameter acquisition unit 202 acquires parameters related to processing performed by the feature generation unit 203 and the post-processing unit 205. The parameter acquisition unit 202 can acquire parameters related to the neural network used by the feature generation unit 203 and the post-processing unit 205. The parameter acquisition unit 202 can acquire parameters from the storage unit 206. As described later, the parameters are determined by learning.
[0043] The inference unit 21 infers the defocus range of the object based on the input data. The inference unit 21 includes a feature generation unit 203 , a feature integration unit 204 , and a post-processing unit 205 .
[0044] The feature generation unit 203 generates features of the input data based on the input data related to the image acquired by the data acquisition unit 201. In the present embodiment, the feature generation unit 203 generates features using the image 801, the defocus map 803, and the subject region map 805. For example, the feature generation unit 203 can generate features using a neural network such as a convolutional neural network (hereinafter referred to as CNN).
[0045] The feature integration unit 204 generates integrated features by integrating at least some of the input data acquired by the data acquisition unit 201 and the features generated by the feature generation unit 203. In this embodiment, the feature integration unit 204 integrates the features generated by the feature generation unit 203 and the defocus map acquired by the data acquisition unit 201.
[0046] The post-processing unit 205 generates a processing result corresponding to the input data acquired by the data acquisition unit 201 by processing the integrated features generated by the feature integration unit 204. In this embodiment, the post-processing unit 205 outputs information indicating the defocus range of the subject based on the features generated by the feature integration unit 204. Figure 8C A histogram showing the amount of defocus within BB 804 . Figure 8C804. The defocus range estimated by the post-processing unit 205 is shown. In the embodiment described below, the post-processing unit 205 outputs the maximum value and the minimum value of the defocus range. However, the output of the post-processing unit 205 is not limited to this format. For example, the post-processing unit 205 may output the defocus amount for each position where the subject appears in the BB 804.
[0047] Figure 3 1 is a flowchart showing the processing flow of the image processing method performed by the information processing device 100 in the present embodiment. In the following, each process (step) will be represented by a reference numeral starting with S, and the term "process (step)" will be omitted. However, the information processing device 100 may not perform all the processes shown in the flowchart. As described above, each process can be performed by the CPU 101.
[0048] In S301, the data acquisition unit 201 acquires a captured image of a subject as described above. In S302, the data acquisition unit 201 acquires a defocus map as described above. In S303, the data acquisition unit 201 acquires a subject region map as described above. The data acquisition unit 201 may acquire these data from the camera 112 connected to the information processing apparatus 100. In addition, the data acquisition unit 201 may acquire data held in the external storage device 104.
[0049] In S304, the parameter acquisition unit 202 acquires parameters related to the processing as described above. For example, the parameter acquisition unit 202 can acquire parameters used in calculations in the convolution layer (Convolution) and the fully connected layer (Fully-Connected).
[0050] In S305, the feature generation unit 203 generates features using the input data acquired in S301 to S303. For example, the feature generation unit 203 can generate features using CNN. The feature generation unit 203 can generate features using a multi-layer perceptron. The feature generation unit 203 can also generate features using multi-head self-attention. In this way, the process used by the feature generation unit 203 to generate features is not limited to a specific method.
[0051] On the other hand, in one embodiment, the processing of input data by the feature generation unit 203 to generate features includes nonlinear operations such as activation processing, etc. For example, the processing of input data by the feature generation unit 203 can be processing in a neural network including an activation layer.
[0052] In this embodiment, the feature generation unit 203 inputs the captured image, the defocus map, and the subject region map to the CNN. Then, the feature generation unit 203 obtains the output from the CNN as a feature by performing calculations in the CNN. Figure 4 An example of a CNN configuration is shown. Figure 4 The CNN shown has convolution layers (Convolution 401, 404) for performing convolution operations, activation layers (ReLu 402, 405) for applying activation functions, and pooling layers (MaxPooling 403) for performing pooling processing. However, there is no particular limitation on the configuration of the CNN (i.e., the number of layers and the connections between layers).
[0053] The feature generation unit 203 is capable of performing a process for aligning the resolutions of the captured image, the defocus map, and the subject area map before inputting the image and the map into the CNN. For example, the feature generation unit 203 is capable of downsampling or upsampling. As an example, the feature generation unit 203 is capable of upsampling the resolution of the defocus map to match the resolution of the captured image. At this time, the feature generation unit 203 is capable of inputting the captured image, the defocus map, and the subject area map having the same number of elements in the vertical and horizontal directions as data of multiple channels into the CNN.
[0054] In S306 , the feature integration unit 204 generates an integrated feature as described above. In this embodiment, the feature integration unit 204 integrates the defocus map acquired by the data acquisition unit 201 and the feature generated by the feature generation unit 203 .
[0055] Figure 5 is a flowchart showing an example of the processing in S306. In S501 and S502, the feature integration unit 204 performs processing for matching the number of elements of the data to be integrated. For example, the feature integration unit 204 can perform at least one of processing for matching spatial resolution and processing for matching the number of channels between the features and at least some of the input data.
[0056] First, in S501, the feature integration unit 204 performs processing for aligning the spatial resolutions (eg, vertical resolution and horizontal resolution) of the data to be integrated. Through such processing, the number of elements in the spatial direction of the data to be integrated can be aligned.
[0057] In this embodiment, the feature integration unit 204 downsamples the defocus map to match the resolution of the feature. There is no particular limitation on the method of downsampling. For example, the feature integration unit 204 can use a nearest neighbor method for downsampling. Note that the feature integration unit 204 can upsample the feature instead of downsampling the defocus map. In addition, the feature integration unit 204 can use a combination of downsampling and upsampling.
[0058] As an example, the feature integration unit 204 may use a combination of element rearrangement and convolution processing to perform downsampling. Fig. 12A and Fig. 12B Describes an example of a method for rearranging elements. Fig. 12A FIG. 1 shows a defocus map 1203 before downsampling. The feature integration unit 204 can obtain Fig. 12B Figures 1204 to 1207 are shown. Figures 1204 to 1207 are arranged to expand in the channel direction. Due to the rearrangement, the spatial resolution of Figures 1204 to 1207 is lower than that of the defocused figure 1203. When the elements are rearranged so that the resolution in the spatial direction (x, y direction) is reduced by half horizontally and vertically, the elements can be expanded four times in the channel direction. The feature integration unit 204 is also capable of performing convolution processing on the figures 1204 to 1207 obtained thereby. For example, the feature integration unit 204 is capable of generating a channel of figures from Figures 1204 to 1207 by performing convolution processing using a 1×1 filter.
[0059] Next, in S503, the feature integration unit 204 performs processing for matching the number of elements of the data to be integrated in the channel direction. Fig.11 An example of the processing of S503 is described. The feature integration unit 204 is capable of broadcasting the defocus map 1102 obtained after the processing in S501 in the channel direction. Specifically, the feature integration unit 204 is capable of generating a defocus map 1103 having data of multiple channels by copying the defocus map 1102 in the channel direction. The data of each channel of the defocus map 1103 corresponds to the defocus map 1102. Thus, the feature integration unit 204 is capable of matching the dimension of the feature 1101 in the channel direction with the dimension of the defocus map 1103 in the channel direction.
[0060] Finally, in S504, the feature integration unit 204 integrates the features and the defocus map obtained after the processing in S503. Fig.11In the example of , the feature integration unit 204 can integrate the feature 1101 and the defocus map 1103. In this embodiment, the feature integration unit 204 integrates by calculating the element-wise product of the feature 1101 and the defocus map 1103. That is, the value of the element of the integrated feature obtained in S504 is the product of the corresponding element of the feature 1101 and the corresponding element of the defocus map 1103.
[0061] As another example of the processing in S306, the feature integration unit 204 may perform processing for combining at least some of the features and input data in the channel direction. In addition, the feature integration unit 204 may perform a product-sum operation on the data obtained by the combination. Figure 6 is a flowchart showing another example of the processing in S306. In S601, the feature integration unit 204 performs processing for aligning the resolution of the data to be integrated in the vertical and horizontal directions. In the present embodiment, the feature integration unit 204 upsamples the features obtained in S305 to match the resolution of the defocus map. Next, in S602, the feature integration unit 204 combines the defocus map obtained in S302 and the features obtained after the processing in S601 in the channel direction. Finally, in S603, the feature integration unit 204 generates an integrated feature by performing a convolution operation on the data obtained by the combination in S602. For example, the feature integration unit 204 is able to use a 1×1 filter to perform convolution processing (i.e., weighted addition in the channel direction).
[0062] Note that the feature integration unit 204 can perform noise reduction processing on the defocus image. Then, the feature integration unit 204 can integrate the defocus image that has undergone noise reduction processing with the features generated by the feature generation unit 203. There is no particular limitation on the method of noise reduction processing. For example, a filter such as a median filter or a Gaussian filter can be used for noise reduction processing. In addition, a neural network can be used for noise reduction processing. In this way, by performing noise reduction processing on the defocus image, the accuracy of the defocus range estimation result obtained by the post-processing unit 205 can be improved.
[0063] In addition, the feature integration unit 204 can perform high-resolution processing on the defocus map. Then, the feature integration unit 204 can integrate the defocus map that has undergone high-resolution processing with the features generated by the feature generation unit 203. Examples of high-resolution processing include super-resolution processing as described in Yang (W. Yang et al. "Deep Learning for Single Image Super-Resolution: A Brief Review", arXiv: 1808.03344, 2018). In this way, by performing high-resolution processing on the defocus map, the accuracy of the defocus range estimation result can be improved in detail.
[0064] Next, in S307, the post-processing unit 205 generates a processing result by processing the integrated feature obtained in S306. In the present embodiment, the post-processing unit 205 outputs the defocus range of the subject by processing the integrated feature. In the present embodiment, the processing of the integrated feature by the post-processing unit 205 is a linear operation. In addition, in the present embodiment, nonlinear processing is not included in the processing of the integrated feature by the post-processing unit 205. In the following example, the processing used by the post-processing unit 205 to generate the processing result includes processing of a fully connected layer. In addition, the processing used by the post-processing unit 205 to generate the processing result includes pooling processing.
[0065] Figure 7 An example of the processing performed by the post-processing unit 205 in S307 is shown. First, the post-processing unit 205 performs pooling processing on the integrated features (global average pooling 701). In addition, the post-processing unit 205 performs a fully connected layer processing on the result of the pooling processing (fully connected 702). Due to the above processing, the defocus range of the object (i.e., the maximum value Def of the defocus amount) is output. max and minimum value Def min ). Note that the processing performed by the post-processing unit 205 is not limited to a specific method. For example, the post-processing unit 205 may perform multiple iterations of the processing of the fully connected layer. In one embodiment, the amount of computation performed by the post-processing unit 205 on the integrated features is less than the amount of computation performed by the feature generation unit 203 on the input data. The amount of computation may be the computation time or the number of product operations.
[0066] The result output by the post-processing unit 205 in this manner can be used to perform focus control of an imaging device (e.g., camera 112). Figure 3 The method is to obtain the maximum value of the defocus amount Def max and minimum value Def minBased on the result obtained in this way, the CPU 101 can control the optical system of the camera 112 via the communication interface 107. For example, the output device 110 can control the focusing operation of the camera 112 so that the focal position of the camera 112 is included in the Def max and Def min The CPU 101 can obtain, via the input interface 105, a command for indicating that the user is in the Def max and Def min Then, the CPU 101 can control the focusing operation of the camera 112 according to the designated focus position. In this case, the CPU 101 can limit the user input so that the focus position designated by the user is within the range of Def max and Def min between.
[0067] According to the present embodiment, the defocus amount of the main subject can be accurately inferred. That is, even if the subject area shown in the subject area diagram includes a background or an obstruction other than the subject, the defocus amount for the subject can be estimated. In this way, according to the present embodiment, when the focus control is performed so as to focus on the main subject, the influence of the obstruction or the focus detection error can be reduced. Therefore, it becomes easier to keep the focus on the main subject.
[0068] Next, a method for learning parameters related to processing performed by the information processing apparatus 100 to estimate the defocus range of a subject (for example, processing performed by the feature generation unit 203 and the post-processing unit 205 ) will be described. Fig.13 FIG. 1 shows an example functional configuration of a learning device 13 for performing a learning method according to the present embodiment. The functions of the learning device 13 can be realized by a processor executing a program stored in a memory. The learning device 13 may have Figure 1 The information processing device 100 shown has a similar hardware configuration.
[0069] The data acquisition unit 1301 acquires input data for learning. The input data for learning includes a captured image for learning, a defocus map, and a subject area map. The data acquisition unit 1301 also acquires correct answer data of a defocus range corresponding to a set of the captured image for learning, the defocus map, and the subject area map.
[0070] Note that the captured image, defocus map, and subject area map for learning can be acquired as described. The correct answer data for the defocus range can be generated based on the user input. In addition, the correct answer data can be generated based on the defocus amount detected by the camera 112 or the like.
[0071] For example, the camera 112 can calculate the defocus amount of each focus detection area based on the focus detection signal acquired at the same timing as the imaging of the subject. The calculation of the defocus amount can be performed by an external computing device such as a personal computer based on the focus detection signal and the image signal recorded by the imaging apparatus.
[0072] Then, in view of the defocus amount of the subject area within the captured image and the background of the subject or the obstacle that is the foreground of the subject, a defocus amount range suitable as the defocus amount of the subject can be used as correct answer data. For example, the correct answer data can be determined by excluding the range of the defocus amount of the background and the range of the defocus amount of the obstacle from the range of the defocus amount of the subject area. The determination of the correct answer data for such a defocus range can be performed while the user visually confirms the captured image and the defocus amount. As a different method, the captured image can be divided by segmentation processing. In addition, the defocus amount calculated for the focus detection area overlapping with the partial area of the subject that does not include obstacles in the background or foreground can be determined as the correct defocus amount for the partial area of the subject. Then, the correct answer data can be determined based on these correct defocus amounts determined for the respective partial areas of the subject.
[0073] The inference unit 21 infers the defocus range of the subject based on the input data for learning, similarly to the information processing device 100 . The inference unit 21 includes a feature generation unit 203 , a feature integration unit 204 , and a post-processing unit 205 , similarly to the information processing device 100 .
[0074] The loss calculation unit 1302 determines an error of the defocus range estimation result generated by the inference unit 21. For example, the data acquisition unit 1301 calculates the loss by comparing the defocus range generated by the inference unit 21 with the correct answer data for the defocus range acquired by the data acquisition unit 1301.
[0075] The parameter updating unit 1303 updates the parameters used in the processing performed by the inference unit 21 (for example, the parameters used in the processing performed by the feature generation unit 203 and the post-processing unit 205) based on the loss calculated by the loss calculation unit 1302. Thus, the learning of the parameters is performed. The parameter saving unit 1304 saves the parameters used in the processing performed by the inference unit 21 obtained by the learning to the storage unit 206. The parameters are used for the processing performed by the information processing device 100 (for example, the feature generation unit 203 and the post-processing unit 205).
[0076] Fig.14 An example of a flowchart of a learning process according to the present embodiment is shown. S301 to S303 are Figure 3In this example, in S301 to S303, the data acquisition unit 1301 acquires input data for learning. In S1401, the data acquisition unit 1301 acquires correct answer data for the defocus range as described above. S305 to S307 are similar to Figure 3 In this example, a defocus range inference result is generated for the input data used for learning.
[0077] In S1402, the loss calculation unit 1302 calculates the loss between the correct answer data of the defocus range acquired in S1401 and the defocus range inference result obtained in S307. The loss can be expressed by the L1 norm according to the following equation, for example.
[0078]
[0079] D GT max is the maximum value of the defocus range indicated by the correct answer data. inf max is the maximum value of the defocus range indicated by the inference result. GT min is the minimum value of the defocus range indicated by the correct answer data. inf min is the minimum value of the defocus range indicated by the inference result.
[0080] In S1403, the parameter updating unit 1303 updates the parameters based on the loss calculated in S1402. The parameters updated here are, for example, the weights of the elements in the neural network. For example, the updated parameters may be the weighting factors of the convolutional layer (convolution). In addition, the updated parameters may be the weighting factors of the fully connected layer (fully connected). There is no particular limitation on the parameter updating method. For example, the parameter updating unit 1303 can update the parameters using back propagation based on momentum SGD (Momentum SGD).
[0081] In S1404, the parameter storage unit 1304 stores the parameters updated in S1403. In the learning process, various input data for learning can be used to repeatedly perform Fig.14 The method shown.
[0082] In the above-described embodiment, the defocus range for one type of subject in the image is estimated. However, the subject is not limited to one type. For example, the defocus range for each type of subject in two or more types of subjects may be estimated. As a specific example, the information processing device 100 may estimate the defocus range of the entire person in the captured image, the defocus range of the pupil area of the person, and the defocus range of the head area of the person.
[0083] In addition, in another embodiment, the information processing device 100 may infer the depth range of the subject instead of the defocus range. The depth range can represent the range of distances from the camera device to various positions of the subject. In addition, the data acquisition unit 201 may acquire a depth map instead of a defocus map. The depth map can represent the depth values of various positions in the captured image (for example, the distance from the camera device to the subject corresponding to each position in the captured image). In this way, the input data acquired by the data acquisition unit 201 may include at least one of the defocus map and the depth map. In addition, in this case, at least one of the defocus map and the depth map is used to generate an integrated feature. In addition, the post-processing unit 205 can output an estimation result of at least one of the defocus range and the depth range of the subject.
[0084] In the above-mentioned embodiment, the feature integration unit 204 generates an integrated feature by integrating the feature generated by the feature generation unit 203 and the defocus map. At this time, the feature integration unit 204 is able to perform the integration without converting the size of the value shown in the defocus map or the unit of the value. Then, the post-processing unit 205 infers the defocus range based on the integrated feature. According to such a configuration, even if the processing performed by the feature generation unit 203 includes processing that tends to change the value, such as nonlinear operations, etc., it is possible to maintain the value of the defocus map in the processing performed by the post-processing unit 205. For example, the integrated feature used by the post-processing unit 205 can better reflect the value of the defocus map. Thus, the inference accuracy of the defocus range of the subject is improved. According to the present embodiment, by integrating the defocus map with the feature generated by the feature generation unit 203, the inference accuracy of the defocus range can be improved. In particular, for captured images in which the subject is out of focus, the inference accuracy of the defocus range can be improved.
[0085] In this way, in the present embodiment, the features of the input data obtained by processing the input data are integrated with at least some of the input data (e.g., a defocus map). Such features obtained by processing the input data generally do not directly indicate the corresponding values of the input data (e.g., a defocus map). On the other hand, the integrated features thus obtained better reflect the values (especially the absolute values) of at least some of the input data (e.g., a defocus map) than the features obtained by processing the input data. Therefore, using the present embodiment, the accuracy of inference based on the processing of the integrated features can be improved. Such a configuration is particularly effective in the case of making an inference so that the values indicated by the input data to be integrated and the values indicated by the inference result are similar. In one embodiment, at least some of the statistical values of the values indicated by the integrated input data (e.g., a maximum value, a minimum value, an average value, or a weighted average value) indicate the desired inference result. For example, in one embodiment, the maximum and minimum values indicated by the defocus map in the area corresponding to the subject can indicate the desired defocus range as the inference result. The defocus range expected to be the inference result can be represented by correct answer data (for example, the maximum value or minimum value of the defocus value) of the defocus range used in learning.
[0086] Furthermore, in one embodiment, the integrated feature generated by the feature integration unit 204 is obtained based on the element-by-element product of at least some of the input data (e.g., the defocus map) and the feature. In this case, regardless of how the defocus value to be inferred changes, learning of the parameters used by the feature generation unit 203 is performed so that the feature generated by the feature generation unit 203 represents the portion corresponding to the subject. That is, learning can be performed so that the feature generated by the feature generation unit 203 shows a high value in the portion of the defocus map that is likely to indicate the defocus amount of the subject, and shows a value close to 0 in the portion where this is not the case. Such a configuration makes it easier to learn the features required to obtain the defocus range of the subject. According to the present embodiment, by integrating the defocus map based on the element-by-element product, the accuracy of defocus range inference can be improved, compared to the case where the defocus map is integrated by combining the combination in the channel direction with the product and sum operation.
[0087] Furthermore, in one embodiment, the post-processing unit 205 generates a processing result corresponding to the input data without using a nonlinear operation. Such a configuration makes it easier to maintain the absolute value indicated by the integrated feature in the processing performed by the post-processing unit 205. Thus, the post-processing unit 205 easily outputs a value reflecting the absolute value indicated by the integrated feature (i.e., the value indicated by the integrated input data). Therefore, with such an embodiment, the inference accuracy of the processing result (e.g., defocus range) is stable.
[0088] The information processing device 100 according to the above-described embodiment can be used to perform various processes other than estimation of the defocus range. Fig. 9 The flowchart in describes a case where the information processing device 100 performs a task of reducing noise in an image.
[0089] In S901, the data acquisition unit 201 acquires a captured image of a subject as input data. In S902, similarly to S304, the parameter acquisition unit 202 acquires parameters related to processing. The parameter acquisition unit 202 can acquire parameters used in calculations of the convolution layer (Convolution) and the fully connected layer (Fully Connected). In S903, the feature generation unit 203 generates features using the captured image acquired in S901. The feature generation unit 203 can use Figure 4 The CNN shown is used to generate features.
[0090] In S904, the feature integration unit 204 generates an integrated feature by integrating the captured image acquired in S901 and the feature generated in S903. The feature integration unit 204 generates the integrated feature using a technique similar to S306. For example, the feature integration unit 204 can perform processing for matching the number of elements of the data to be integrated and processing for integrating the elements.
[0091] Fig.10 is a flowchart showing an example of the processing performed in S904. In S1001, the feature integration unit 204 performs processing for aligning the resolution of the captured image and the resolution of the feature. For example, the feature integration unit 204 is capable of upsampling the feature. Next, in S1002, the feature integration unit 204 performs processing for aligning the number of channels of the captured image and the number of channels of the feature. For example, the feature integration unit 204 is capable of convolution processing on the captured image. Note that the processing order of S1001 and S1002 can be exchanged. Next, in S1003, the feature integration unit 204 generates an integrated feature by calculating the element-by-element product of the feature obtained after the processing of S1001 and S1002 and the input image.
[0092] In S905, the post-processing unit 205 processes the features generated in S904. For example, the post-processing unit 205 can perform convolution processing. The convolution processing can be a process for converting and integrating features so as to obtain an output having the number of channels of the final desired output (for example, RGB 3 channels in the case of an image). Thus, the post-processing unit 205 can obtain a noise reduction result corresponding to the captured image.
[0093] As described, the parameters used by the information processing device 100 in such processing are learned, which can be performed by the learning device 13. The correct answer data indicating the noise reduction result of the captured image used for learning can be obtained by any method. For example, the correct answer data can be obtained by applying the noise reduction processing described in Chen (L. Chen et al. "Simple Baselines for Image Restoration", arXiv: 2204.04676, 2022) to the captured image used for learning.
[0094] Even according to the present embodiment, the integrated feature reflects the data of the captured image better than the feature obtained by processing the captured image. Therefore, with the present embodiment, the accuracy of the noise reduction process is improved. In particular, in one embodiment, the captured image and the feature are integrated using the element-by-element product. In this case, learning of the parameters used by the feature generation unit 203 is performed so that the feature generated by the feature generation unit 203 represents the ratio between the captured image and the output image. Thus, learning can be performed regardless of the size of the value indicated by the captured image. According to such a configuration, learning is promoted and noise reduction performance is improved.
[0095] Other embodiments
[0096] The embodiments of the present invention may also be implemented by providing software (program) for performing the functions of the above-described embodiments to a system or device via a network or various storage media, and a computer or a central processing unit (CPU) or a microprocessing unit (MPU) of the system or device reads and executes the program.
[0097] While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments.The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
Claims
1. An image processing device, include: an acquisition unit configured to acquire input data, wherein the input data includes a captured image and / or information related to the captured image; a feature acquisition unit, configured to acquire features of the input data by processing the input data using a neural network; an integration unit configured to generate an integrated feature by integrating the feature and at least some of the input data; as well as A post-processing unit is configured to generate an estimation result of at least one of a defocus range and a depth range of the object in the captured image by processing the integrated feature.
2. The image processing device according to claim 1, in, The integration unit is further configured to integrate the features and the at least some of the input data by computing element-wise products.
3. The image processing device according to claim 1, in, The integration unit is further configured to perform a process for matching spatial resolutions between the feature and at least some of the input data, and to integrate the feature and at least some of the input data after the process for matching.
4. The image processing device according to claim 1, in, The integration unit is further configured to perform a process for matching the number of channels between the feature and the at least some of the input data, and to integrate the feature and the at least some of the input data after the process for matching.
5. The image processing device according to claim 1, in, The integration unit is also configured to generate the integrated feature by performing a process for combining the feature and the at least some of the input data in a channel direction, and perform a product-sum operation on the data obtained by the process for combining.
6. The image processing device according to claim 1, in, The integration unit is further configured to perform noise reduction processing on at least some of the input data, and generate the integrated feature by integrating the feature and at least some of the input data after the noise reduction processing.
7. The image processing device according to claim 1, in, The integration unit is further configured to perform high-resolution processing on at least some of the input data, and to generate the integrated feature by integrating the feature and at least some of the input data obtained after the high-resolution processing.
8. The image processing device according to claim 1, in, The processing performed on the integrated features is a linear operation.
9. The image processing device according to claim 1, in, The processing performed on the integrated features includes processing in a fully connected layer.
10. The image processing device according to claim 1, in, The processing performed on the integrated features does not include non-linear operations.
11. The image processing device according to claim 1, in, The processing performed on the input data includes non-linear operations.
12. The image processing device according to claim 1, in, The processing performed on the input data is processing in a neural network including an activation layer.
13. The image processing device according to claim 1, in, The amount of computation performed on the integrated features is less than the amount of computation performed on the input data.
14. The image processing device according to claim 1, in, The input data also includes data for specifying a region in the captured image where the subject is located.
15. The image processing apparatus according to claim 1, in, The input data includes the captured image, and The at least some of the input data are the captured images.
16. The image processing device according to any one of claims 1 to 15, in, The input data includes the captured image, and at least one of a defocus map showing a defocus amount at each position in the captured image and a depth map showing a depth value at each position in the captured image, and The at least some of the input data is at least one of the defocus map and the depth map.
17. An image processing method, include: Acquiring input data, wherein the input data includes a captured image and / or information related to the captured image; Processing the input data using a neural network to obtain features of the input data; generating an integrated feature by integrating the feature and at least some of the input data; as well as By processing the integrated features, an estimation result of at least one of a defocus range and a depth range of the object in the captured image is generated. 18 . A computer-readable storage medium storing a program, which, when executed by a computer, causes the computer to perform the method according to claim 17 .
