Learning method and image processing device

By capturing images from multiple viewpoints in different domains to learn statistical models, calculating and transforming scales and camera parameters, it solves the problem of low distance calculation accuracy under a single-eye camera and achieves efficient learning and improved accuracy of the model.

CN115086628BActive Publication Date: 2024-09-06KK TOSHIBA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111200743.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-03-16
Filing Date
2021-10-13
Publication Date
2024-09-06
Estimated Expiration
2041-10-13

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively generate a high-precision statistical model to calculate the distance between the subject and the subject in the image captured by the monocular camera, mainly due to the challenge of preparing a data set for learning and the need for a large number of data sets.

Method used

By taking images of the same subject from multiple viewpoints in different domains, these images are used to learn statistical models, calculate uncertain scales and camera parameters, and transform them into blur values ​​for model training to achieve online learning.

Benefits of technology

It improves the accuracy and precision of statistical models in different environments, reduces the difficulty of data set preparation, and simplifies the learning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115086628B_ABST
    Figure CN115086628B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention relate to a learning method and an image processing device. According to the embodiment, a learning method is provided for learning a statistical model, the statistical model being generated by learning blur generated in a first image corresponding to a distance to a first subject included in the first image, the first image being an image captured in a first domain. The learning method includes: acquiring a plurality of second images obtained by capturing the same second subject from multiple viewpoints in a second domain different from the first domain; and learning the statistical model using the acquired plurality of second images.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is based on Japanese Patent Application No. 2021-042736 (filing date: March 16, 2021), and claims priority from that application. The present application incorporates the entire contents of that application by reference. Technical Field

[0002] Embodiments of the present invention relate to a learning method and an image processing device. Background Art

[0003] It is known that images captured by two imaging devices (cameras) or a stereo camera (a compound-eye camera) are used to obtain the distance to a subject. However, in recent years, a technology has been developed that uses images captured by a single imaging device (a monocular camera) to obtain the distance to a subject.

[0004] Here, in order to acquire the distance to the subject using an image as described above, it is conceivable to use a statistical model generated by applying a machine learning algorithm such as a neural network.

[0005] However, in order to generate a highly accurate statistical model, the statistical model needs to be trained on a huge learning data set (a set of learning images and correct answer values ​​related to the distance to the subject in the learning image), but preparing this data set is not easy. Summary of the invention

[0006] An object of the present invention is to provide a learning method and an image processing device capable of improving the ease of learning in a statistical model for acquiring a distance to a subject.

[0007] According to an embodiment, a learning method is provided for learning a statistical model generated by learning blur generated in a first image corresponding to a distance to a first subject included in the first image, the first image being an image captured in a first domain. The learning method includes: acquiring a plurality of second images captured from multiple viewpoints in a second domain different from the first domain, and learning the statistical model using the acquired plurality of second images. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 It is a diagram showing an example of the configuration of the distance measurement system in the first embodiment.

[0009] Figure 2 This is a diagram showing an example of a system configuration of an image processing device.

[0010] Figure 3 A diagram for explaining an overview of the operation of the distance measurement system.

[0011] Figure 4 This is a diagram for explaining the principle of obtaining the distance to a subject.

[0012] Figure 5 This is a diagram for explaining a patch method for predicting blur from a captured image.

[0013] Figure 6 This is a diagram showing an example of information related to an image block.

[0014] Figure 7 A diagram for explaining a method of predicting a blurred image from a captured image.

[0015] Figure 8 This is a diagram for explaining an overview of a general statistical model learning method.

[0016] Fig. 9 This is a diagram for explaining the dataset used for learning.

[0017] Fig.10 This is a diagram for explaining the dataset used for learning.

[0018] Fig.11 A diagram for explaining multi-viewpoint images.

[0019] Fig.12 This is a block diagram showing an example of the functional structure of the learning processing unit.

[0020] Fig.13 This is a diagram showing an example of the correspondence relationship between the distance calculated using the true scale parameter and the blur.

[0021] Fig.14 This is a diagram showing an example of the correspondence relationship between the distance calculated using the scale parameter with error and the blur.

[0022] Fig.15 This is a flowchart showing an example of a processing procedure of an image processing device when learning a statistical model.

[0023] Fig.16 It is a diagram showing an overview of SfM.

[0024] Fig.17 This is a diagram for explaining the relationship between the scale parameter and the fuzzy value.

[0025] Fig.18 This is a diagram showing the correspondence between the distance to the subject and the blur generated according to the distance for each focus position.

[0026] Fig.19 It is a diagram showing the formulas for perspective projection and lenses.

[0027] Fig. 20 is a diagram showing an overview of the linear regression problem for calculating scale parameters and camera parameters.

[0028] Fig.21 This is a flowchart showing an example of a processing procedure of the image processing device when acquiring distance information from a captured image.

[0029] Description of symbols

[0030] 1 distance measuring system, 2 shooting device, 3 image processing device, 21 lens, 22 image sensor, 31 statistical model storage unit, 32 image acquisition unit, 33 distance acquisition unit, 34 output unit, 35 learning processing unit, 35a distance acquisition unit, 35b parameter calculation unit, 35c conversion unit, 35d learning unit, 221 first sensor, 222 second sensor, 223 third sensor, 301 CPU, 302 non-volatile memory, 303 RAM, 303A image processing program, 304 communication device, 305 bus. DETAILED DESCRIPTION

[0031] Hereinafter, each embodiment will be described with reference to the drawings.

[0032] (First embodiment)

[0033] Figure 1 An example of the configuration of the distance measuring system in the first embodiment is shown. Figure 1 The distance measuring system 1 shown is used to capture an image and acquire (measure) the distance from a capture point to a subject using the captured image.

[0034] like Figure 1 As shown, the distance measuring system 1 includes a camera 2 and an image processing device 3. In the present embodiment, the distance measuring system 1 is described as including the camera 2 and the image processing device 3 as single devices, but the distance measuring system 1 may be implemented as one device (distance measuring device), in which the camera 2 functions as a camera unit and the image processing device 3 functions as an image processing unit. In addition, the image processing device 3 may also be a device that acts as a server that executes various cloud computing services, for example.

[0035] The imaging device 2 is used to capture various images. The imaging device 2 includes a lens 21 and an image sensor 22. The lens 21 and the image sensor 22 correspond to the optical system (single-lens camera) of the imaging device 2.

[0036] The light reflected by the subject enters the lens 21. The light entering the lens 21 passes through the lens 21. The light passing through the lens 21 reaches the image sensor 22 and is received (detected) by the image sensor 22. The image sensor 22 converts (photoelectrically converts) the received light into an electrical signal to generate an image composed of a plurality of pixels.

[0037] In addition, the image sensor 22 is implemented by, for example, a CCD (Charge Coupled Device) image sensor and a CMOS (Complementary Metal Oxide Semiconductor) image sensor. The image sensor 22 includes, for example, a first sensor (R sensor) 221 for detecting light in the red (R) band, a second sensor (G sensor) 222 for detecting light in the green (G) band, and a third sensor (B sensor) 223 for detecting light in the blue (B) band. The image sensor 22 can receive light in the corresponding bands through the first sensor 221 to the third sensor 223, and generate sensor images (R image, G image, and B image) corresponding to each band (color component). That is, the image captured by the camera 2 is a color image (RGB image), which includes an R image, a G image, and a B image.

[0038] In addition, in the present embodiment, the image sensor 22 is described as including the first sensor 221 to the third sensor 223, but the image sensor 22 may be configured to include at least one of the first sensor 221 to the third sensor 223. In addition, the image sensor 22 may be configured to include, for example, a sensor for generating a monochrome image instead of the first sensor 221 to the third sensor 223.

[0039] In the present embodiment, the image generated based on the light transmitted through the lens 21 is an image affected by the aberration of the optical system (lens 21 ), and includes blur caused by the aberration.

[0040] Figure 1 The image processing device 3 shown includes a statistical model storage unit 31 , an image acquisition unit 32 , a distance acquisition unit 33 , an output unit 34 , and a learning processing unit 35 as a functional configuration.

[0041] The statistical model storage unit 31 stores a statistical model used to obtain the distance to the subject from the image captured by the imaging device 2. The statistical model stored in the statistical model storage unit 31 is generated by learning the blur that changes nonlinearly according to the distance to the subject in the image, which is generated in the image affected by the aberration of the optical system. According to such a statistical model, when an image is input into the statistical model, a blur value that indicates the blur generated in the image according to the distance to the subject included in the image can be predicted (output) as a predicted value corresponding to the image.

[0042] In addition, the statistical model can be generated by applying various known machine learning algorithms such as neural networks or random forests. In addition, neural networks that can be applied in this embodiment may also include convolutional neural networks (CNN), fully connected neural networks, and recurrent neural networks.

[0043] The image acquisition unit 32 acquires an image captured by the above-mentioned imaging device 2 (image sensor 22 ).

[0044] The distance acquisition unit 33 acquires distance information indicating the distance to the subject in the image using the image acquired by the image acquisition unit 32. In this case, the distance acquisition unit 33 inputs the image to the statistical model stored in the statistical model storage unit 31, and acquires the distance to the subject based on the blur value (blur value indicating blur generated in the image according to the distance to the subject included in the image) output from the statistical model.

[0045] The output unit 34 outputs the distance information acquired by the distance acquisition unit 33 in the form of a map arranged in a position associated with the image. In this case, the output unit 34 can output image data composed of pixels having the distance represented by the distance information as pixel values ​​(that is, output the distance information as image data). When the distance information is output as image data in this way, the image data can be displayed as a distance image that represents the distance by color, for example. The distance information output by the output unit 34 can also be used, for example, to calculate the size of the subject in the image captured by the camera 2.

[0046] The learning processing unit 35 executes, for example, a process of learning the statistical model stored in the statistical model storage unit 31 using the image acquired by the image acquisition unit 32. Details of the process executed by the learning processing unit 35 will be described later.

[0047] In addition, Figure 1 In the example shown, the image processing device 3 is explained as including the units 31 to 35, but the image processing device 3 may also be composed of a distance measuring device including an image acquisition unit 32, a distance acquisition unit 33 and an output unit 34, and a learning device including a statistical model storage unit 31, an image acquisition unit 32 and a learning processing unit 35.

[0048] Figure 2 express Figure 1 An example of the system configuration of the image processing apparatus 3 is shown. The image processing apparatus 3 includes a CPU 301, a nonvolatile memory 302, a RAM 303, and a communication device 304. The image processing apparatus 3 also includes a bus 305 that connects the CPU 301, the nonvolatile memory 302, the RAM 303, and the communication device 304 to each other.

[0049] CPU 301 is a processor for controlling the operation of various components in image processing device 3. CPU 301 may be a single processor or may be composed of a plurality of processors. CPU 301 executes various programs loaded from nonvolatile memory 302 to RAM 303. These programs include an operating system (OS) and various application programs. Application programs include image processing program 303A.

[0050] The nonvolatile memory 302 is a storage medium used as an auxiliary storage device. The RAM 303 is a storage medium used as a main storage device. Figure 2 Although only the nonvolatile memory 302 and the RAM 303 are shown in the figure, the image processing device 3 may include other storage devices such as a HDD (Hard Disk Drive) and a SSD (Solid State Drive).

[0051] Furthermore, in this embodiment, Figure 1 The statistical model storage unit 31 shown is implemented by, for example, a nonvolatile memory 302 or other storage devices.

[0052] In addition, in this embodiment, it is assumed that Figure 1 The image acquisition unit 32, the distance acquisition unit 33, the output unit 34, and a part or all of the learning processing unit 35 are implemented by causing the CPU 301 (i.e., the computer of the image processing device 3) to execute the image processing program 303A, i.e., by software. The image processing program 303A can be stored in a computer-readable storage medium and distributed, or can be downloaded to the image processing device 3 via a network.

[0053] Here, the CPU 301 is assumed to execute the image processing program 303A for the purpose of explanation, but part or all of the components 32 to 35 may be implemented by, for example, using a GPU (not shown) instead of the CPU 301. In addition, part or all of the components 32 to 35 may be implemented by hardware such as an IC (Integrated Circuit) or by a combination of software and hardware.

[0054] The communication device 304 is a device configured to perform wired communication or wireless communication. The communication device 304 includes a transmission unit that transmits a signal and a reception unit that receives a signal. The communication device 304 performs communication with an external device via a network, communication with an external device existing in the surrounding area, and the like. The external device includes the camera 2. In this case, the image processing device 3 can receive an image from the camera 2 via the communication device 304.

[0055] exist Figure 2 Although omitted in the figure, the image processing device 3 may also include an input device such as a mouse or a keyboard and a display device such as a display.

[0056] Next, refer to Figure 3 An overview of the operation of the distance measuring system 1 in this embodiment will be described.

[0057] In the distance measuring system 1 , the imaging device 2 (image sensor 22 ) generates an image that is affected by the aberration of the optical system (lens 21 ) as described above.

[0058] The image processing device 3 (image acquisition unit 32 ) acquires the image generated by the imaging device 2 , and inputs the image into the statistical model stored in the statistical model storage unit 31 .

[0059] Here, according to the statistical model in this embodiment, a blur value (blur information) is output as described above, and the blur value indicates blur generated in the image according to the distance to the subject in the input image. As described later, the distance to the subject in the image has a correlation with the color, size, and shape of blur generated in the image according to the distance, and the image processing device 3 (distance acquisition unit 33) can acquire distance information indicating the distance to the subject by converting the blur value output from the statistical model into a distance. In addition, in this embodiment, the blur value output from the statistical model refers to a scalar indicating the blur amount including the color, size, and shape of blur generated in the image.

[0060] As described above, in the present embodiment, the distance information can be acquired from the image captured by the imaging device 2 using the statistical model.

[0061] Here, refer to Figure 4 The principle of acquiring the distance to the subject (distance information indicating the distance) in this embodiment will be briefly described.

[0062] In the image captured by the camera 2 (hereinafter referred to as the captured image), blurring occurs due to the aberration (lens aberration) of the optical system of the camera 2 as described above. Specifically, the refractive index of light passing through the lens 21 having aberrations differs for each wavelength band, so, for example, when the position of the subject is offset from the focus position (the position focused in the camera 2), the light of each wavelength band does not converge to one point but reaches different points. This appears as blurring (chromatic aberration) on the image.

[0063] In addition, in the captured image, blur (color, size, and shape) that changes nonlinearly according to the distance to the subject in the captured image (that is, the position of the subject relative to the imaging device 2 ) is observed.

[0064] Therefore, in this embodiment, by Figure 4 As shown, blur (blur value) 402 generated in the captured image 401 is analyzed using a statistical model as a physical clue related to the distance to the subject 403, thereby obtaining the distance to the subject 403.

[0065] Specifically, the statistical model in this embodiment estimates (predicts) the blur 402 generated in the captured image 401 by inputting the captured image 401, but in this embodiment, by converting the blur 402 into the distance to the subject 403, the distance to the subject 403 in the captured image 401 can be obtained.

[0066] Hereinafter, an example of a method of predicting blur (blur value indicating blur) generated in a captured image according to the distance to a subject in a statistical model will be described. Here, a block method and a screen-based method will be described.

[0067] First, refer to Figure 5 The block method is described below. In the block method, a local area (hereinafter referred to as an image block) 401 a is cut out (extracted) from a captured image 401 .

[0068] In this case, for example, the entire area of ​​the captured image 401 may be divided into a matrix shape and the divided partial areas may be cut out in sequence as image blocks 401a, or the captured image 401 may be recognized and image blocks 401a may be cut out so as to cover the area where the subject (image) is detected. In addition, the image blocks 401a may partially overlap with other image blocks 401a.

[0069] In the block method, the blur value is output as a prediction value corresponding to the image block 401a cut out as described above. That is, in the block method, the image blocks 401a cut out from the captured image 401 are respectively input, and the blur 402 generated in the subject included in each of the image blocks 401a is predicted.

[0070] Figure 6 An example of information related to the image block 401a input to the statistical model in the above-mentioned block method is shown.

[0071] In the block method, gradient data (gradient data of the R image, gradient data of the G image, and gradient data of the B image) of the image block 401a cut out from the captured image 401 are generated for each of the R image, the G image, and the B image included in the captured image 401. The gradient data generated in this way is input to the statistical model.

[0072] In addition, the gradient data is equivalent to the difference (difference value) between the pixel value of each pixel and the pixel adjacent to the pixel. For example, when the image block 401a is extracted as a rectangular area of ​​n pixels (X-axis direction)×m pixels (Y-axis direction), the gradient data (that is, the gradient data of each pixel) is generated by arranging the difference values ​​calculated for each pixel in the image block 401a, for example, with the pixel adjacent to the right side in a matrix of n rows×m columns.

[0073] The statistical model uses the gradient data of the R image, the gradient data of the G image, and the gradient data of the B image to predict the blur that will occur at the pixel. Figure 6 , the case where the gradient data of each of the R image, the G image, and the B image is input into the statistical model is shown, but the gradient data of the RGB image may also be input into the statistical model.

[0074] Furthermore, in the block method, when the gradient data of each pixel is input to the statistical model as described above, the statistical model outputs a blur value for each pixel.

[0075] Next, refer to Figure 7 The screen-integrated method is described below. In the screen-integrated method, the above-mentioned image block 401a is not cut out.

[0076] In the image-bundling method, the entire region of the captured image 401 (information related to the entire region) is input to the statistical model, and a blur value indicating blur is output from the statistical model as a predicted value corresponding to the entire region. That is, in the image-bundling method, the entire region of the captured image 401 is input, and blur 402 corresponding to the distance to the subject included in the entire region of the captured image 401 is predicted.

[0077] In addition, information related to the entire area input to the statistical model in the screen-integrated method is, for example, gradient data of the above-mentioned R image, G image and B image (each pixel constituting the R image, G image and B image).

[0078] In addition, in the image-by-image method, the entire region of the captured image 401 is input into the statistical model, so that the background (context) extracted from the captured image 401 (entire region) can be used in the above-mentioned distance prediction. In addition, the background corresponds to feature quantities related to the distribution of lines and colors in the captured image 401. In addition, the background also includes features related to the subject (the shape of a person and the shape of a building, etc.).

[0079] In addition, in the screen-bundling method, when the gradient data of each pixel is input to the statistical model as described above, the statistical model outputs a blur value for each pixel.

[0080] Here, in this embodiment, by using a statistical model as described above, it is possible to predict from an image the blur generated in the image corresponding to the distance to the subject contained in the image (a blur value representing the blur), but in order to improve the accuracy of the blur value, it is necessary to learn the statistical model.

[0081] Below, refer to Figure 8 The following is an overview of a general statistical model learning method. Regardless of whether the block method or the screen-based method is used, the statistical model learning is basically based on Figure 8 The process is as shown. Specifically, for the learning of the statistical model, the information related to the image (hereinafter referred to as the learning image) 501 prepared for the learning is input into the statistical model, and the error between the blur value 502 output (predicted) from the statistical model and the correct answer value 503 is fed back to the statistical model, thereby performing the learning. In addition, the correct answer value 503 refers to a blur value representing the blur generated in the learning image 501 corresponding to the actual distance (measured value) from the shooting location of the learning image 501 to the subject contained in the learning image 501 (that is, a blur value obtained by transforming the actual distance), for example, also referred to as a correct answer label, etc. In addition, feedback refers to updating the parameters of the statistical model (such as weight coefficients) to reduce the error.

[0082] Specifically, when the block method is applied, information (gradient data) related to each image block (local area) cut out from the learning image 501 is input to the statistical model, and the statistical model outputs a blur value 502 representing the blur of the pixel corresponding to each image block. The error obtained by comparing the blur value 502 output in this way with the correct answer value 503 is fed back to the statistical model.

[0083] In addition, when the screen batch method is applied, information (gradient data) related to the entire area of ​​the learning image 501 is input to the statistical model at the same time, and the statistical model outputs a blur value 502 representing the blur of each pixel constituting the learning image 501. The error obtained by comparing the blur value 502 output in this way and the correct answer value 503 is fed back to the statistical model.

[0084] In order for a statistical model to learn, it is necessary to prepare Figure 8 The correct answer value learning image described in the previous section (that is, a learning data set including a learning image and a correct answer value obtained by transforming the actual distance to be obtained from the learning image) is provided. However, in order to obtain the correct answer value, it is necessary to measure the actual distance to the subject included in the learning image every time the learning image is taken, which is troublesome. In addition, in order to improve the accuracy of the statistical model, it is necessary to make the statistical model learn a large amount of learning data sets. Therefore, it is not easy to prepare such a large amount of learning data sets.

[0085] In order to prepare the above-mentioned learning data set relatively easily, for example, in an indoor environment such as a laboratory (the first domain), a dataset having Fig. 9 As shown in FIG. 1 , a moving mechanism for moving (sliding) the camera 2 in the horizontal direction is provided. Thus, for example, by taking a flat-surface television monitor or the like as a subject, the camera 2 is moved while photographing the subject so that the distance between the subject and the camera 2 becomes a predetermined value, and thus, it is possible to Fig.10 As shown, a learning data set including a learning image of the subject and a distance to the subject is obtained.

[0086] However, when predicting blur (a blur value indicating blur) from an image captured in an outdoor environment (the second domain) using a statistical model generated by learning blur produced in images captured in an indoor environment as described above, errors may occur in the prediction due to changes in physical cues caused by differences in the environment (domain) in which the image was captured.

[0087] In this case, it is preferable to further learn blur generated in an image captured in an outdoor environment. However, it is difficult to obtain a data set for learning while measuring the actual distance to the subject in the outdoor environment.

[0088] Therefore, in the present embodiment, it is assumed that the learning (re-learning) of the statistical model that does not require a correct answer value is achieved by using multi-viewpoint images captured by the camera 2 in a domain (e.g., an outdoor environment) that is an application target of the statistical model. Fig.11 As shown in FIG. 1 , multiple images are obtained by photographing the same object from different viewpoints (ie, multiple viewpoints). In addition, the multi-viewpoint image may be two or more images.

[0089] The following, Figure 1 The learning processing unit 35 included in the image processing device 3 shown in FIG. 3 will be described in detail. Fig.12 3 is a block diagram showing an example of the functional configuration of the learning processing unit 35 .

[0090] like Fig.12 As shown, the learning processing unit 35 includes a distance acquisition unit 35a, a parameter calculation unit 35b, a conversion unit 35c, and a learning unit 35d.

[0091] First, in the present embodiment, when the statistical model (preliminary learning statistical model) stored in the statistical model storage unit 31 is learned, the image acquisition unit 32 acquires the above-mentioned multi-viewpoint image (a plurality of images obtained by shooting the same subject from multiple viewpoints), and the distance acquisition unit 35a acquires the multi-viewpoint image from the image acquisition unit 32. The distance acquisition unit 35a acquires the distance (depth) to the second subject included in each of the multi-viewpoint images from the acquired multi-viewpoint image. In addition, the details of the distance acquired by the distance acquisition unit 35a will be described later.

[0092] Here, it is considered to use the distance to the second object obtained from the multi-viewpoint image as the correct answer value. However, the distance to the second object obtained from the multi-viewpoint image is a distance with an uncertain scale. For example, if a scale parameter is not used to calculate the distance based on the actual scale from the distance with an uncertain scale, it is impossible to obtain an appropriate blur value (that is, a correct answer value) from the distance.

[0093] Specifically, Fig.13 Indicates the correspondence between the distance calculated using the true scale parameter and the blur (size), but in the case where the scale parameter has an error (that is, when the scale parameter is unclear and the distance of the actual scale is calculated using the scale parameter with an error), such as Fig.14 As shown in , the correspondence between distance and blur will be offset. In addition, Fig.14 The correspondence between the distance and blur calculated using a scale parameter having an error relative to the true scale parameter is shown.

[0094] That is, in Fig.14 As shown, when the blur value obtained by distance transformation calculated using a scale parameter having an error is used as a correct answer value, it is impossible to learn a high-quality statistical model (that is, the accuracy of the statistical model may decrease).

[0095] Furthermore, when converting the distance into a blur value as described later, it is necessary to use the camera parameters in the imaging device 2 , but the camera parameters are also uncertain and an appropriate correct answer value (blur value) cannot be obtained.

[0096] Therefore, in order to utilize the distances obtained from multi-viewpoint images captured in the domain to which the statistical model is applied in learning, it is necessary to calculate the above-mentioned uncertain parameters.

[0097] Therefore, the parameter calculation unit 35b obtains the blur value output from the statistical model by inputting the multi-viewpoint images respectively into the statistical model stored in the statistical model storage unit 31 (that is, the pre-learned statistical model stored in the statistical model storage unit 31, for example, which is obtained by pre-learning the blur generated in the image captured in the indoor environment).

[0098] The parameter calculation unit 35 b calculates the above-mentioned uncertain parameters (scale parameter and camera parameter) by matching (calibrating) the distance to the subject acquired by the distance acquisition unit 35 a and the blur value acquired by the parameter calculation unit 35 b as described above.

[0099] The conversion unit 35c converts the distance acquired by the distance acquisition unit 35a into a blur value using the uncertain parameter calculated by the parameter calculation unit 35b.

[0100] The learning unit 35d causes the statistical model to learn the multi-viewpoint images and the blur value obtained by the distance transformation by the transformation unit 35c. The statistical model learned by the learning unit 35d is stored in the statistical model storage unit 31 (that is, the statistical model stored in the statistical model storage unit 31 is overwritten).

[0101] In this embodiment, the two uncertainties (uncertainty of scale parameters and uncertainty of camera parameters) existing between multi-viewpoint images and blur values ​​as described above are eliminated, thereby achieving online learning using multi-viewpoint images.

[0102] Reference Fig.15The flowchart of will now be described as an example of the processing steps of the image processing device 3 when learning the statistical model.

[0103] Here, it is assumed that a statistical model that has been learned in advance (preliminary learning statistical model) is stored in the statistical model storage unit 31, and the statistical model is generated by learning the blur generated in the image captured in the indoor environment. In addition, the statistical model stored in the statistical model storage unit 31 can be generated, for example, by learning the blur generated in the image captured by the camera 2, or by learning the blur generated in the image captured by a camera (or lens) different from the camera 2. That is, in this embodiment, at least a statistical model for taking an image as input and outputting (predicting) a blur value that represents the blur generated in the image corresponding to the distance to the subject included in the image is prepared in advance.

[0104] First, the distance acquisition unit 35a acquires the multi-viewpoint image (the image captured by the camera 2) acquired by the image acquisition unit 32 as a learning image (step S1). The multi-viewpoint image acquired in step S1 includes, for example, a plurality of images obtained by capturing the same subject from different viewpoints (multiple viewpoints) in an outdoor environment or the like (that is, a domain different from the indoor environment where blur has been learned in advance). The multi-viewpoint image is preferably an image obtained by capturing the same stationary subject from positions as different as possible. In addition, in the present embodiment, each of the plurality of images included in the multi-viewpoint image is set to be an image captured by the camera 2 in a state where the focus position (focus position) is fixed.

[0105] The imaging device 2 that captures multi-viewpoint images may be any camera system equipped with any lens, and does not need to be an imaging device that captures images blurred in advance using the statistical model described above.

[0106] After executing the process of step S1 , the distance acquisition unit 35 a acquires the distance (scale-indeterminate distance) to the subject included in each of the multi-viewpoint images acquired in step S1 (step S2 ).

[0107] In addition, for obtaining the distance from the multi-viewpoint images (estimating the depth) in step S2, a technique called SfM (Structure from Motion) and multi-view stereo can be used.

[0108] Fig.16The outline of SfM is shown in FIG. In SfM, feature points of the object (feature points representing the shape of the object) are extracted from each of the multi-viewpoint images (the plurality of images included). Fig.16 It is shown in FIG. 1 that P1 to P7 are extracted from three images as feature points of the subject. The feature points extracted in this way are associated between multi-viewpoint images. According to SfM, the position and posture of the camera 2 when each learning image was taken (that is, the position and posture of the camera 2 at each viewpoint) can be calculated based on the three-dimensional point group (coordinates) based on the feature points associated in this way and the displacement between the associated feature points. In SfM, by using multi-viewpoint images, the offset of the coordinates of the three-dimensional point group can be minimized.

[0109] In addition, since the coordinates of a rough three-dimensional point group are calculated in SfM, in this embodiment, a more detailed three-dimensional origin group (coordinates) is calculated by multi-view stereo technology using the position and posture of the camera 2 at each viewpoint described above.

[0110] In this case, when the position (translation component) and posture (rotation component) of a viewpoint (camera 2) in the above-mentioned SfM and multi-view stereo technology are set to t and R, and the coordinates of the three-dimensional point calculated based on the multi-view image are set to (X, Y, Z), the coordinate position (x, y) in the multi-view image (image at each viewpoint) and the distance (depth) z0 to the subject existing at the coordinate position are in the relationship between the following equations (1) and (2).

[0111]

[0112]

[0113] In addition, K in the formula (1) is an internal parameter of the imaging device 21 , including, for example, the distance between the lens 21 and the image sensor 22 included in the imaging device 21 .

[0114] In step S2, by using the above-mentioned equations (1) and (2), the distance to the subject in the image included in the multi-viewpoint image is calculated for each of the above-mentioned feature points.

[0115] Here, the distance acquired (calculated) in step S2 is a distance with an uncertain scale. The distance z0 with an uncertain scale and the distance z based on the actual scale are in the relationship of the following equation (3).

[0116] z=βz0 Formula (3)

[0117] The β in the above formula (3) is a scale parameter used to transform the distance z0 of uncertain scale into the distance z based on the actual scale. Generally speaking, if there is no information (prior information) related to the size of the subject included in the image, information (value) obtained from other sensors, etc., and only the information of the camera 2 (monocular camera) is available, the scale parameter β cannot be calculated.

[0118] When learning the statistical model, the blur value obtained by using the camera parameters according to the distance transformation is used as the correct solution value. However, when the scale parameter β is uncertain, even in the case of Fig.17 As shown, for example, when a subject existing at the same distance is photographed, the blur values ​​may be converted into different values, and the statistical model may not be properly learned.

[0119] Return to Fig.15 The parameter calculation unit 35b uses the statistical model stored in the statistical model storage unit 31 to obtain a blur value (a predicted value of the blur amount) from the multi-view image obtained in step S1 (step S3). In step S3, the blur values ​​output from the statistical model are obtained by inputting the multi-view images to the statistical model respectively. Alternatively, a partial area (e.g., an area including a subject) of each multi-view image may be input to the statistical model.

[0120] Here, when each multi-viewpoint image is set to x and the statistical model with a parameter (for example, a weight coefficient) θ is set to f θ When the statistical model f θ Input the image x and from the statistical model f θ The output fuzzy value (prediction value) b is expressed as in the following formula (4).

[0121] b=f θ (x) Formula (4)

[0122] Furthermore, as described above, the image x is input to the statistical model f θ In the case of θ Each pixel of the image x is configured as described above and outputs a blur value. Therefore, when the above-mentioned process of step S3 is executed, a blur value b corresponding to the distance z0 obtained by each feature point extracted from each multi-viewpoint image can be obtained (that is, a blur value outputted for the pixel corresponding to the feature point).

[0123] Next, the parameter calculation unit 35b calculates the above-mentioned uncertain parameters (scale parameter and camera parameter) (step S4). In step S4, the uncertain parameters are calculated based on the distance (scale-uncertain distance) obtained in step S2 and the blur value obtained in step S3.

[0124] The processing of step S4 will be described in detail below. First, there exists a relationship of the following formula (5) between the distance z based on the actual scale and the blur value b.

[0125]

[0126] In the formula (5), f is the focal length, v is the distance between the lens 21 and the image sensor 22 of the imaging device 2, p is the pixel pitch, and F is the aperture (value).

[0127] Here, Fig.18 The correspondence between the distance to the subject and the blur (size) generated according to the distance is shown for each focus position (the position where the image capturing device 2 is in focus). Fig.18 As shown, for example, even if the blur value (blur amount) is the same, the distance corresponding to the blur value differs depending on the focus position.

[0128] This means that when the focus position (the position where the focus is achieved) is unclear, the distance cannot be appropriately converted into a blur value, and there is uncertainty in the focus.

[0129] also, Fig.19 A diagram showing the perspective projection and lens formulas used in SfM and other applications. Fig.19 The similarity of the triangular part in the first region 601 shown is calculated by the following equation (6) (perspective projection equation).

[0130]

[0131] In addition, it is possible to Fig.19 The similarity of the triangular parts of the first region 601 and the second region 602 shown in FIG. 6 derives the following equation (7) (lens equation).

[0132]

[0133] Here, it is assumed that each multi-viewpoint image in the present embodiment is captured by the camera 2 in a state where the focus position is fixed, and the distance (focus distance) v between the lens 21 and the image sensor 22 in the above-mentioned formula (6) is calculated in advance as an internal parameter of the camera 2 in SfM. The v in the formula (6) is the same as the v in the above-mentioned formulas (5) and (7).

[0134] That is, the uncertainty of focus in this embodiment means that the focal length f, which is a camera parameter, is uncertain.

[0135] In addition, other parameters (pixel pitch p and aperture F) in the formula (5) are assumed to be obtained in advance in the same manner as the distance v between the lens 21 and the image sensor 22 described above.

[0136] Here, when the above-mentioned formula (3) is substituted into the formula (5), the following formula (8) can be obtained.

[0137]

[0138] This equation (8) indicates that the scale-uncertain distance z0 is transformed into a blur value by parameters β and f (that is, scale parameters and camera parameters), and can be further expressed as the following equation (9).

[0139]

[0140] The blur value b(z0; β, f) obtained by transforming the scale-uncertain distance z0 obtained (calculated) by each feature point contained in each multi-view image and the blur value b output from the statistical model (that is, the blur value b corresponding to the distance z0) should be equal. Therefore, the problem of finding the scale parameter β and the camera parameter f, which are uncertain parameters, is reduced to a nonlinear regression problem as shown in the following equation (10).

[0141]

[0142] In formula (10), N represents a set (the entire sampling) of combinations of a scale-indeterminate distance (the distance obtained according to each feature point included in each multi-view image) z0 and a blur value b corresponding to the distance, and l represents an arbitrary distance function.

[0143] However, when the scale parameter β and the camera parameter f are calculated using the above formula (10), a nonlinear regression problem that cannot guarantee a global solution must be solved. Therefore, in this embodiment, a variable transformation is performed on formula (10) to calculate the scale parameter β and the camera parameter f through a linear regression problem.

[0144] First, by making the distance function in the above-mentioned equation (10) an L2 norm, a least squares problem such as the following equation (11) is considered.

[0145]

[0146] Next, when the inverse d of the distance z0 with uncertain scale is used as a new variable and the coefficients in the above formula (11) are rearranged, the above nonlinear regression problem is reduced to a linear regression problem with the new variable set as the unknown parameter as shown in the following formula (12): Fig. 20 ).

[0147]

[0148] In addition, the coefficient a0′ in the formula (12) is defined as the following formula (13), and a1′ is defined as the following formula (14).

[0149]

[0150]

[0151] In addition, when solving the above-mentioned equations (13) and (14) with respect to the camera parameter f, the camera parameter f is expressed by the following equation (15) using the coefficient a0′ in equation (12).

[0152] f=v-2pFa0′ Formula (15)

[0153] Furthermore, when solving the above equations (13) and (14) with respect to the scale parameter β, the scale parameter β is expressed by the following equation (16) using the coefficient a1′ in equation (12) and the camera parameter f in equation (15).

[0154]

[0155] That is, in this embodiment, the inverse of the distance z0 to the subject included in each of the multi-viewpoint images and the blur value b output from the statistical model by inputting the image into the statistical model are subjected to linear regression, and the regression parameters (coefficients a0′ and a1′) are obtained by the above-mentioned formula (12), thereby calculating the scale parameter β and the camera parameter f which are uncertain parameters.

[0156] When returning to Fig.15 When , the conversion unit 35c converts the scale-indeterminate distance obtained in the above-mentioned step S2 into a fuzzy value (step S5).

[0157] In addition, in step S5, the scale-uncertain distance z0 obtained in step S2, the pre-calculated parameters (the distance v between the lens 21 and the image sensor 22, the pixel pitch p, and the aperture F), the scale parameter β calculated in step S4, and the camera parameter f are applied to the above-mentioned formula (9), so that the scale-uncertain distance z0 is transformed into a blur value b.

[0158] In step S5, the distances obtained from each feature point included in the multi-viewpoint image are converted into blur values. In the following description, the blur values ​​obtained by converting the distances obtained from each feature point included in the multi-viewpoint image are referred to as blur values ​​b. GT .

[0159] When executing the process of step S5, the learning unit 35d uses the multi-viewpoint image acquired in step S1 and the blur value b obtained by the distance transformation in step S5. GT , the statistical model stored in the statistical model storage unit 31 is learned (updated) (step S6). In the learning of the statistical model, the loss function L shown in the following formula (17) is used. θ .

[0160] L(θ)=∑ i∈N (b GT (i)-f θ (x(i))) 2 Formula (17)

[0161] In formula (17), N represents a set of feature points (pixels corresponding to the feature points) contained in each of the multi-view images with a scale-indeterminate distance, and i represents a feature point (a pixel corresponding to the feature point) contained in the set. GT (i) represents the blur value b obtained by the scale-indeterminate distance transformation for feature point i GT Furthermore, f in formula (17) θ (x(i)) represents a blur value outputted from the statistical model regarding the pixel when the image x including the feature point (the pixel corresponding to the feature point) i is inputted to the statistical model.

[0162] According to the above formula (17), the above b is calculated for each feature point (the pixel corresponding to the feature point) i. GT (i) and f θ In this embodiment, the parameter θ′ (that is, the updated parameter) of the statistical model that minimizes the total of the errors obtained by equation (17) is obtained by the following equation (18).

[0163] θ′=arf min θ L(θ) Formula (18)

[0164] In addition, when a neural network or a convolutional neural network is applied to the statistical model in this embodiment (that is, the statistical model is composed of a neural network or a convolutional neural network), the error back propagation method that calculates the above-mentioned equations (17) and (18) in the opposite direction is used in the learning of the statistical model (updating the parameter θ). According to the error back propagation method, the gradient of the loss is calculated, and the parameter θ is updated according to the gradient.

[0165] In step S6, by using the above formula (18) to update the parameter θ of the statistical model to the obtained parameter θ′, the statistical model can be made to be compatible with the multi-viewpoint image and the blur value b GT To study.

[0166] That is, in this embodiment, the blur value b obtained by using the scale parameter β and the camera parameter f according to the distance transformation with uncertain scale is GT As the correct answer value (supervisory data), the statistical model is continuously corrected to reduce the difference between the correct answer value and the fuzzy value output from the statistical model, thereby improving the accuracy of the statistical model for the application target domain (such as outdoor environment, etc.).

[0167] In addition, although the above-mentioned formula (17) shows a loss function (L2 loss) using the L2 norm, for example, a loss function (L1 loss) using the L1 norm as shown in the following formula (19) may also be used.

[0168] L(θ)=∑ i∈N | b GT(i)-f θ (x(i))| Formula (19)

[0169] Furthermore, in the present embodiment, various loss functions may be used as long as they are loss functions used for regression, such as the loss function called Huber loss. In addition, for example, a loss obtained by measuring the error of one image with respect to another image, such as photometric loss (Zhou, Tinghui, et al. "Unsupervised learning of depth and ego-motion from video." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017), may be used.

[0170] In addition, for example, there is a case where the statistical model is constructed to output the degree of unreliability (hereinafter referred to as unreliability) of the fuzzy value output from the statistical model (the fuzzy value predicted in the statistical model) together with the fuzzy value, but in such a case, a loss function that takes the unreliability into account can also be used.

[0171] Next, refer to Fig.21 Flowchart of the above Fig.15The following describes an example of the processing procedure of the image processing device 3 when acquiring distance information from a captured image using the learned statistical model.

[0172] First, the imaging device 2 (image sensor 22) captures a subject at a measured distance from the imaging device 2, thereby generating a captured image including the subject. As described above, the captured image is affected by aberrations of the optical system (lens 21) of the imaging device 2.

[0173] The image acquisition unit 32 included in the image processing device 3 acquires a captured image from the imaging device (step S11 ).

[0174] Next, the distance acquisition unit 33 inputs the information about the captured image acquired in step S11 into the statistical model stored in the statistical model storage unit 31 (step S12). The information about the captured image input into the statistical model in step S12 includes gradient data of each pixel constituting the captured image.

[0175] When the process of step S12 is executed, a blur value representing blur generated according to the distance to the subject is predicted in the statistical model, and the statistical model outputs the predicted blur value. Thus, the distance acquisition unit 33 acquires the blur value output from the statistical model (step S13). In addition, in step S13, the blur value of each pixel constituting the captured image acquired in step S11 is acquired.

[0176] When the process of step S13 is executed, the distance acquisition unit 33 converts the blur value obtained in step S13 into a distance (step S14). In addition, in step S14, the blur value obtained in step S13 is set to b, and the distance to the subject is set to z, and the distance can be calculated based on the blur value using the above-mentioned formula (5). As described above, the blur value of each pixel constituting the captured image is obtained in step S13, and therefore, the process of step S14 is performed on the blur value of each pixel. That is, in step S14, the blur value is converted into a distance for each pixel constituting the captured image. In addition, when the process of step S14 is executed, the parameters required for converting the blur value into the distance (the focal length f of the camera 2, the distance v between the lens 21 and the image sensor, the pixel pitch p, and the aperture F) are set to be obtained in advance.

[0177] When the process of step S14 is executed, the output unit 34 outputs the distance information indicating the distance obtained by transforming the blur value in step S14 in the form of a map, for example, arranged in a position associated with the captured image (step S15). In addition, in the present embodiment, the distance information is output in the form of a map, but the distance information may be output in other forms.

[0178] According to the configuration of converting the blur value output from the statistical model into the distance as described herein, by calibrating the distance during the conversion, it is possible to appropriately cope with images captured in various environments, thereby improving versatility.

[0179] As described above, in the present embodiment, multi-viewpoint images (multiple second images) are obtained by photographing the same subject from multiple viewpoints in a second domain (for example, an outdoor environment, etc.) different from a first domain (for example, an indoor environment, etc.) in which blur is previously learned by a previously learned statistical model (a statistical model stored in the statistical model storage unit 31), and the statistical model is learned using the multi-viewpoint images.

[0180] Specifically, the distance to the subject contained in each multi-viewpoint image is obtained from the multi-viewpoint image, and the distance to the subject contained in each multi-viewpoint image is transformed into a blur value representing the blur generated corresponding to the distance, so that the statistical model learns the multi-viewpoint image and the blur value obtained according to the distance transformation.

[0181] In this embodiment, through the above-mentioned configuration, multi-viewpoint images captured in the application target domain can be obtained (collected) to learn the statistical model in an online manner, thereby improving the ease of learning in the statistical model for obtaining the distance to the subject.

[0182] In addition, the distance to the subject obtained from the above-mentioned multi-view images is a distance with an uncertain scale, so the distance cannot be directly used for learning the statistical model. However, in this embodiment, the distance to the subject included in each multi-view image and each image of the multi-view image are input into the statistical model to match the blur value output from the statistical model, thereby calculating the scale parameter (first parameter) for converting the distance to a distance based on the actual scale and the camera parameter (second parameter) that is uncertain in the shooting device that captured the multi-view image. The distance to the subject included in each multi-view image (distance with an uncertain scale) is converted into a blur value using the scale parameter and camera parameter calculated in this way.

[0183] In addition, in this embodiment, the scale parameters and camera parameters are calculated by performing linear regression on the inverse of the distance to the subject included in each multi-view image and the blur value output from the statistical model by inputting each image of the multi-view image into the statistical model.

[0184] In this embodiment, as described above, even if the distance obtained from the multi-viewpoint images is a distance with an uncertain scale, the distance can be converted into an appropriate blur value, and by using the blur value as a correct answer value, a high-quality statistical model can be learned.

[0185] In addition, in this embodiment, a configuration in which the statistical model is learned using only learning images (multi-viewpoint images) to which correct labels (correct answer values) are not added is described, but such learning is generally referred to as unsupervised learning. However, in this embodiment, semi-supervised learning in which correct answer labels are added to a portion of the learning image (pixels constituting the portion) may also be adopted (that is, a configuration in which a third image whose distance to the subject is known is further used to learn the statistical model).

[0186] Specifically, in Fig.15 In step S5 shown, the scale-uncertain distance is converted into a blur value, but sometimes a bias (i.e., a learned bias) is generated in the blur value according to the multi-viewpoint image obtained (collected) in step S1. In this case, consider a case where the blur value obtained from the scale-uncertain distance conversion, for example, only represents the blur generated by the subject on the front side of the focus position or the blur generated by the subject on the depth side of the focus position, but when learning is performed using only such a blur value (data), it is impossible to cope with the case where an image that generates a blur different from the blur value (the blur represented by the blur value) is obtained as a captured image. Therefore, by using the correct answer value (correct answer label) obtained by collecting the blur value representing the blur generated by the subject on the front side of the above-mentioned focus position and the blur value representing the blur generated by the subject on the depth side of the focus position in a well-balanced manner simultaneously with the above-mentioned multi-viewpoint image, the above-mentioned bias (imbalance) of learning can be eliminated.

[0187] In addition, in the present embodiment, the statistical model may be learned using multi-viewpoint images as described above, and the loss function and the like described in the present embodiment may be changed as appropriate.

[0188] In addition, the blur generated in the image due to the aberration of the optical system has position dependence (the size and shape of the blur differ depending on the position on the image), but in the present embodiment, the statistical model learns the blur obtained from the distance transformation obtained with respect to the feature point extracted in the SfM (the pixel corresponding to the feature point). Therefore, it is sometimes not possible to efficiently learn the statistical model for the blur generated in the area that does not contain the feature point (that is, the subject). In this case, it is also possible to set the following structure: the multi-view image used in the learning of the statistical model is stored, and based on the distribution of the feature points extracted from the multi-view image, the area with few feature points (for example, the area where the number of feature points is less than a predetermined value, etc.) is output. According to such a structure, for example, it is possible to instruct (notify) the user using the shooting device 2 so that the multi-view image is captured as if the output area contains the subject, and the statistical model can be efficiently learned. In addition, it is also possible to set: the multi-view image containing the feature point in the output area as described above is automatically selected, and the selected multi-view image is used for learning.

[0189] In addition, in the present embodiment, the distance information is obtained by learning a statistical model so that an image including a subject is input and a blur value representing blur generated in the image according to the distance to the subject is output, and the blur value output from the statistical model is converted into a distance. However, the statistical model may be learned so that an image is input and the distance to the subject included in the image is output. In the present embodiment, when such a statistical model that outputs distance is learned, the following configuration may be used: Fig.15 The scale parameter β calculated in step S4 shown is used to transform the distance to the object obtained from the multi-viewpoint image (distance with uncertain scale) into a distance of actual scale, and the statistical model is made to learn the distance of actual scale and the multi-viewpoint image.

[0190] In addition, in the present embodiment, it is described that a statistical model is generated by learning an image affected by the aberration of the optical system (blur that varies nonlinearly according to the distance to the subject included in the image), but the statistical model can also be generated, for example, by learning an image generated based on light passing through a filter (color filter, etc.) provided in the opening portion of the shooting device 2 (that is, blur that is intentionally generated in the image through the filter and varies nonlinearly according to the distance to the subject).

[0191] (Second embodiment)

[0192] Next, the second embodiment will be described. The structure of the distance measuring system (photographing device and image processing device) in this embodiment is the same as that of the first embodiment described above, so when describing the structure of the distance measuring system in this embodiment, the reference numerals are used appropriately. Figure 1 Etc. Here, the differences from the above-mentioned first embodiment will be mainly described.

[0193] In the aforementioned first embodiment, a case where a statistical model is learned using multi-viewpoint images captured in a single scene (i.e., a group of multi-viewpoint images) is described, but the present embodiment differs from the first embodiment in that, for example, a statistical model is learned using multi-viewpoint images captured in M ​​scenes (i.e., M groups of multi-viewpoint images).

[0194] In addition, the scene in this embodiment is a unit of a multi-view image captured by the camera 2 in order to obtain a distance (distance with an uncertain scale) to a specific subject. That is, in this embodiment, multi-view images are captured in M ​​scenes, including, for example, a case where multi-view images (multiple images) are captured for each of M subjects.

[0195] In addition, the M sets of multi-viewpoint images in this embodiment are assumed to be captured in a state where the focus is fixed. That is, in this embodiment, the scale parameter β is different for each set of multi-viewpoint images, but the camera parameter f is assumed to be the same.

[0196] Hereinafter, an example of the processing steps of the image processing device 3 when the statistical model is learned in this embodiment will be described. Fig.15 to explain.

[0197] First, the distance acquisition unit 35 a acquires M sets of multi-viewpoint images (images captured by the imaging device 2 ) acquired by the image acquisition unit 32 as learning images (step S1 ).

[0198] When the process of step S1 is executed, the distance acquisition unit 35 a acquires the distance (scale-indeterminate distance) to the subject included in each of the M sets of multi-viewpoint images from the multi-viewpoint images acquired in step S1 (step S2 ).

[0199] In this case, the process of step S2 described in the first embodiment may be performed for each group of multi-viewpoint images. The process of step S2 is as described in the first embodiment, and therefore, its detailed description is omitted here.

[0200] Here, in this embodiment, the distance is obtained (calculated) for each feature point included in each of the M groups of multi-viewpoint images, but the scale parameter used to convert the distance into the distance based on the actual scale is different for each group of multi-viewpoint images (that is, the scene in which the multi-viewpoint images are captured). In this case, the distance z0 obtained in step S2 and the distance z based on the actual scale are in the relationship of the following formula (20).

[0201] z=β j z0 Formula (20)

[0202] The β of the above formula (20) j (j=0, 1, ..., M-1) is a scale parameter independent of each scene.

[0203] After executing the process of step S2, the process of step S3 is executed. The process of step S3 is as described in the first embodiment, but in this embodiment, the blur value output from the statistical model is obtained by inputting each image of M sets of multi-viewpoint images into the statistical model.

[0204] Next, the parameter calculation unit 35b calculates the uncertain parameters (scale parameter β j and camera parameters f) (step S4).

[0205] Here, in the aforementioned first embodiment, the uncertain parameters can be calculated in a closed-form according to linear regression under the conditions of a single scene (that is, the scale parameter β is one) and a fixed focus (that is, the camera parameter f is one). However, in the case where multi-viewpoint images are captured in multiple (M) scenes as in the present embodiment, there are multiple scale parameters, and therefore, there is no closed-form solution as in the first embodiment.

[0206] Therefore, in this embodiment, in order to calculate the scale parameter β j and camera parameters f, the nonlinear regression problem is formalized as described below.

[0207] First, from the aforementioned equation (9), in the present embodiment, the following equation (21) can be obtained for calculating the blur value b from the distance z0 whose scale is uncertain.

[0208]

[0209] Here, the blur value b(z0; β) is obtained by transforming the scale-indeterminate distance z0 obtained (calculated) for each feature point included in each of the M sets of multi-viewpoint images. j , f) and the fuzzy value b output from the statistical model (that is, the fuzzy value b corresponding to the distance z0) should be equal. Therefore, the scale parameter β, which is an uncertain parameter, is obtained.j The problem of camera parameters f is reduced to a nonlinear regression problem as shown in the following equation (22).

[0210]

[0211] N in formula (22) j represents a set (sampling whole) of combinations of scale-indeterminate distances z0 obtained for each feature point included in each multi-view image captured for scene j among M scenes and blur values ​​b corresponding to the distances z0, and l represents an arbitrary distance function.

[0212] The above formula (22) is related to the uncertain parameters (scale parameter β j The nonlinear optimization problem related to the camera parameter f) becomes a nonlinear least squares problem as shown in the following equation (23) when the distance function l in equation (22) is set to the L2 norm.

[0213]

[0214] Such formula (23) can be solved by the Levenberg-Marquardt method (JJMore, "The Levenberg-Marquardt Algorithm: Implementation and Theory," Numerical Analysis, ed. G. A. Watson, Lecture Notes in Mathematics 630, Springer Verlag, pp. 105-116, 1977). In addition to the Levenberg-Marquardt method, for example, the Trust Region Reflective algorithm (MABranch, T. F. Coleman, and Y. Li, "A Subspace, Interior, and Conjugate Gradient Method for Large-Scale Bound-Constrained Minimization Problems," SIAM Journal on Scientific Computing, Vol. 21, Number 1, pp 1-23, 1999) can also be used. Furthermore, as the above-mentioned distance function, a robust function as disclosed in "B. Triggs et al., 'Bundle Adjustment-A Modern Synthesis', Proceedings of the International Workshop on Vision Algorithms: Theory and Practice, pp. 298-372, 1999" may be used.

[0215] Thus, in this embodiment, the scale parameter β can be calculated by nonlinear optimization based on the scale-indeterminate distance to the object included in each of the M sets of multi-viewpoint images (the distance obtained for each feature point) and the blur value output from the statistical model by inputting each of the M sets of multi-viewpoint images to the statistical model. j and camera parameters f.

[0216] In addition, the above nonlinear optimization problem is a problem that provides a local solution, not a problem that provides a global solution. Therefore, sometimes according to the scale parameter β j and the initial value of the camera parameter f and the error becomes larger.

[0217] Therefore, in the present embodiment, it is assumed that the initial value determined (calculated) by utilizing the linear regression problem described in the above-mentioned first embodiment is used.

[0218] Specifically, in the first embodiment described above, the scale parameter β and the camera parameter f can be calculated using the above-mentioned equations (12), (15), and (16) for a group of multi-viewpoint images captured in a single scene, but such calculation is performed for each group of multi-viewpoint images (that is, scene j = 0, 1, ..., M-1). Thus, as described above, the reciprocal of the distance to the subject included in each multi-viewpoint image and the blur value output from the statistical model are input into the statistical model and linearly regressed, thereby calculating the scale parameter β and the camera parameter f for each scene j.

[0219] In this case, the average value of the camera parameter f calculated for each scene j (that is, M camera parameters f) is determined as the initial value of the camera parameter f in the above formula (23). In addition, the scale parameter β calculated for each scene j is respectively used as the scale parameter β j The initial value to use.

[0220] In this embodiment, by using the scale parameter β determined (calculated) in this way j and the initial value of the camera parameter f to solve the above nonlinear optimization problem (i.e., Equation (23)) to calculate the scale parameter β j and camera parameters f.

[0221] When using such a scale parameter β j and the initial value of the camera parameter f, it is possible to suppress the scale parameter β calculated by solving the nonlinear optimization problem. j This produces a large error with the camera parameter f.

[0222] After the process of step S4 is executed, the processes of steps S5 and S6 are executed. The processes of steps S5 and S6 are as described in the first embodiment described above, and therefore, the detailed description thereof is omitted here.

[0223] In step S5, the scale-indeterminate distance z0 obtained in step S2, the predetermined parameters (the distance v between the lens 21 and the image sensor 22, the pixel pitch p, and the aperture F), and the scale parameter β calculated in step S4 are applied to the above-mentioned equation (21). j As well as the camera parameters f, the scale-uncertain distance z0 is transformed into a blur value b.

[0224] Furthermore, even when M multi-viewpoint images are captured as described in the present embodiment, it is considered that the statistical model is learned using the scale parameter β and the camera parameter f calculated by performing the same processing as the first embodiment for each scene (that is, the scale parameter β and the camera parameter f calculated independently for each scene). However, in the case of such a configuration, different camera parameters f are calculated for each scene, and the constraint that the camera parameters f are fixed (common) is not reflected, which reduces the accuracy of learning. Therefore, in the present embodiment, the scale parameter β calculated by solving the above-mentioned nonlinear optimization problem is used. j and camera parameters f to achieve high-precision learning.

[0225] The processing of the image processing device 3 when acquiring distance information from a captured image is the same as that of the first embodiment described above, and therefore a detailed description thereof will be omitted here.

[0226] As described above, in this embodiment, the scale parameter β is calculated by nonlinear optimization based on the distance to the subject included in each of the M sets of multi-viewpoint images (plural second images) and the blur value output from the statistical model (preliminary learning statistical model) when each image of the multi-viewpoint images is input to the statistical model. j And camera parameters f (1st and 2nd parameters).

[0227] In the present embodiment, by such a configuration, even in the case where multi-viewpoint images are captured in multiple (for example, M) scenes in the application target domain, the captured multi-viewpoint images can be acquired (collected) and the statistical model can be learned in an online manner. Therefore, compared with the case of learning according to each multi-viewpoint image captured in a single scene, for example, the ease and efficiency of learning can be further improved.

[0228] Furthermore, in the present embodiment, the scale parameter β is calculated by executing the processing described in the first embodiment (that is, linear regression is performed on the inverse of the distance in which the scale is uncertain and the blur value output from the statistical model by inputting each image of the multi-viewpoint image to the statistical model). j and the initial value of the camera parameter f, and use the calculated initial value to calculate the scale parameter β j and camera parameter f. According to this configuration, a scale parameter β with a small error can be obtained. j and camera parameters f, therefore, as a result, the learning accuracy can be improved.

[0229] (Third embodiment)

[0230] Next, the third embodiment will be described. The configuration of the distance measuring system (photographing device and image processing device) in this embodiment is the same as that of the first embodiment described above, and therefore, when describing the configuration of the distance measuring system in this embodiment, the third embodiment will be described as appropriate. Figure 1 Etc. Here, the differences from the above-mentioned first embodiment will be mainly described.

[0231] In the aforementioned first embodiment, a case where a statistical model is learned using multi-viewpoint images captured with the focus fixed is described, but the present embodiment is different from the first embodiment in that a statistical model is learned using multi-viewpoint images (K images) captured while changing the focus using an autofocus function, for example.

[0232] In addition, the multi-viewpoint images in this embodiment are assumed to be captured in a single scene. That is, in this embodiment, it is assumed that the scale parameter β of each multi-viewpoint image is the same, but the camera parameter f is different.

[0233] Hereinafter, an example of the processing steps of the image processing device 3 when the statistical model is learned in this embodiment will be described. Fig.15 to explain.

[0234] First, the distance acquisition unit 35a acquires the multi-viewpoint images (images captured by the imaging device 2) acquired by the image acquisition unit 32 as learning images (step S1). The multi-viewpoint images acquired in step S1 are assumed to be K images.

[0235] After executing the process of step S1 , the distance acquisition unit 35 a acquires the distance (scale-indeterminate distance) to the subject included in each of the multi-viewpoint images acquired in step S1 (step S2 ).

[0236] In addition, the processing of step S2 is as described in the above-mentioned first embodiment, and therefore its detailed description is omitted here.

[0237] After the process of step S2 is executed, the process of step S3 is executed. The process of step S3 is as described in the first embodiment above, and therefore, the detailed description thereof is omitted here.

[0238] Next, the parameter calculation unit 35b calculates the uncertain parameters (scale parameter β and camera parameter f k )(Step S4). In addition, the camera parameter f k(k=0, 1, . . . , K-1) is the focal length of the imaging device 2 when imaging image k among the multi-viewpoint images (K images) captured while changing the focus.

[0239] Here, in the aforementioned first embodiment, the uncertain parameters can be calculated in a closed form based on linear regression under the conditions of a single scene (that is, the scale parameter β is one) and a fixed focus (that is, the camera parameter f is one). However, in the case where multi-viewpoint images are captured while changing the focus as in the present embodiment, the camera parameter f differs for each image of the multi-viewpoint image (that is, there are multiple camera parameters), and therefore, there is no closed solution like in the first embodiment.

[0240] When the focus is changed by the autofocus function as described above, the distance v between the lens 21 and the image sensor 22 and the camera parameter f change for each image, but the distance v is set to be able to be obtained for each image as an internal parameter of the imaging device 2 (camera).

[0241] Therefore, in this embodiment, in order to calculate the scale parameter β and the camera parameter f k , the nonlinear regression problem is formalized as follows.

[0242] First, from the aforementioned equation (9), in this embodiment, the following equation (24) can be obtained for calculating the blur value b from the distance whose scale is uncertain.

[0243]

[0244] Here, the blur value b (z0; β, f) is obtained by transforming the scale-indeterminate distance z0 obtained (calculated) for each feature point included in each multi-viewpoint image. k ) and the blur value b output from the statistical model (that is, the blur value b corresponding to the distance z0) should be equal. Therefore, the scale parameter β and the camera parameter f, which are uncertain parameters, are obtained. k The problem is reduced to a nonlinear regression problem as shown in the following equation (25).

[0245]

[0246] N in formula (25) k represents a set (sampling whole) of combinations of scale-indeterminate distance z0 obtained for each feature point included in one image k among K images (multi-viewpoint images) and blur value b corresponding to the distance z0, and l represents an arbitrary distance function.

[0247] The above formula (25) is related to the uncertain parameters (scale parameter β and camera parameter fk ) is a nonlinear optimization problem related to , when the distance function l in equation (25) is made the L2 norm, it becomes a nonlinear least squares problem as shown in the following equation (26).

[0248]

[0249] Such equation (26) can be solved by, for example, the above-mentioned Levenberg-Marquardt method. In addition to the Levenberg-Marquardt method, for example, the Trust Region Reflective algorithm can also be used. Furthermore, as the above-mentioned distance function, a robust function can also be used.

[0250] Thus, in this embodiment, the scale parameter β and the camera parameter f can be calculated by nonlinear optimization based on the scale-indeterminate distance (the distance obtained for each feature point) to the object included in each of the multi-view images (K images) and the blur value output from the statistical model by inputting each image of the multi-view images into the statistical model. k .

[0251] In addition, the above nonlinear optimization problem is to provide a local solution, not a global solution. Therefore, sometimes the error depends on the scale parameter β and the camera parameter f k increases as the initial value increases.

[0252] Therefore, in the present embodiment, it is assumed that the initial value determined (calculated) by utilizing the linear regression problem described in the above-mentioned first embodiment is used.

[0253] Specifically, in the first embodiment described above, the scale parameter β and the camera parameter f can be calculated using the above-mentioned equations (12), (15), and (16) for a set of multi-viewpoint images captured in a single scene, but such calculation is performed for each of the multi-viewpoint images (K images). Thus, as described above, the reciprocal of the distance to the subject included in each of the multi-viewpoint images and the blur value output from the statistical model by inputting the image into the statistical model are subjected to linear regression, thereby calculating the scale parameter β and the camera parameter f for each image k.

[0254] In this case, the average value of the scale parameter β calculated for each image k (that is, K scale parameters β) is determined as the initial value of the scale parameter β in the above formula (24). In addition, the camera parameter f calculated for each image k is respectively used as the camera parameter f k The initial value to use.

[0255] In this embodiment, by using the scale parameter β and camera parameter f determined (calculated) in this way k The initial value of is used to solve the above nonlinear optimization problem (that is, equation (26)), thereby calculating the scale parameter β and the camera parameter f k .

[0256] Using the scale parameter β and camera parameter f k In the case of an initial value of , it is possible to suppress the scale parameter β and camera parameter f calculated by solving the nonlinear optimization problem. k Produce larger errors.

[0257] After the process of step S4 is executed, the processes of steps S5 and S6 are executed. The processes of steps S5 and S6 are as described in the first embodiment described above, and therefore, the detailed description thereof is omitted here.

[0258] In addition, in step S5, the scale-indeterminate distance z0 obtained in step S2, the predetermined parameters (the distance v between the lens 21 and the image sensor 22, the pixel pitch p, and the aperture F), the scale parameter β calculated in step S4, and the camera parameter f are applied to the above-mentioned formula (24). k , the scale-uncertain distance z0 is transformed into a fuzzy value b.

[0259] Furthermore, even when multi-viewpoint images (K images) are captured using the autofocus function as described in the present embodiment, it is considered that the statistical model is learned using the scale parameter β and camera parameter f calculated by performing the same processing as in the first embodiment for each image (that is, the scale parameter β and camera parameter f calculated independently for each image). However, in the case of such a configuration, a different scale parameter β is calculated for each image, and the constraint that the scale parameter β is fixed (common) is not reflected, which reduces the accuracy of learning. Therefore, in the present embodiment, the scale parameter β and camera parameter f calculated by solving the above-mentioned nonlinear optimization problem are used. k , achieving high-precision learning.

[0260] The processing of the image processing device 3 when acquiring distance information from a captured image is the same as that of the first embodiment described above, and therefore a detailed description thereof will be omitted here.

[0261] As described above, in this embodiment, the scale parameter β and the camera parameter f are calculated by nonlinear optimization based on the distance to the subject included in each of the multi-viewpoint images (K images) and the blur value output from the statistical model by inputting each image of the multi-viewpoint images to the statistical model (preliminary learning statistical model). k (1st and 2nd parameters).

[0262] In the present embodiment, by such a configuration, even when multi-viewpoint images are captured while the focus is changed in the application target domain by an autofocus function or the like, the captured multi-viewpoint images can be acquired (collected) to learn the statistical model in an online manner. Therefore, compared with the case of learning multi-viewpoint images captured with the focus fixed, for example, the ease and efficiency of learning can be further improved.

[0263] Furthermore, in this embodiment, the scale parameter β and the camera parameter f are calculated by executing the processing described in the first embodiment (that is, linear regression is performed on the inverse of the scale-indefinite distance and the blur value output from the statistical model by inputting each image of the multi-viewpoint image to the statistical model). k The initial value is used to calculate the scale parameter β and the camera parameter f k According to this configuration, it is possible to obtain a scale parameter β and a camera parameter f with a small error. k , therefore, as a result, the learning accuracy can be improved.

[0264] According to at least one of the embodiments described above, it is possible to provide a learning method, a program, and an image processing device capable of improving the ease of learning in a statistical model for acquiring a distance to a subject.

[0265] Several embodiments of the present invention have been described, but these embodiments are provided as examples and are not intended to limit the scope of the invention. These embodiments can be implemented in various other ways, and various omissions, substitutions, and changes can be made without departing from the scope of the purpose of the invention. These embodiments and / or their variations are included in the scope and purpose of the invention, and are included in the invention described in the claims and the scope of their equivalents.

[0266] In addition, the above-mentioned implementation modes can be summarized as the following technical solutions.

[0267] [Technical solution 1]

[0268] A learning method for learning a statistical model generated by learning blur generated in a first image corresponding to a distance to a first subject included in the first image, wherein the first image is an image captured in a first domain, the learning method comprising:

[0269] acquiring a plurality of second images obtained by photographing the same second object from multiple viewpoints in a second domain different from the first domain; and

[0270] The statistical model is trained using the plurality of second images obtained.

[0271] [Technical Solution 2]

[0272] According to the above technical solution 1, it also includes:

[0273] acquiring the distance to the second object from each of the plurality of acquired second images; and

[0274] converting the distances obtained from the plurality of second images into blur values ​​indicating blur generated according to the distances,

[0275] The performing of learning includes causing the statistical model to learn the plurality of second images and the blur values ​​obtained by the transformation.

[0276] [Technical Solution 3]

[0277] According to the above technical solution 2,

[0278] It also involves performing calculations,

[0279] The distances obtained from the plurality of second images are respectively distances with uncertain scales.

[0280] The calculating includes: calculating a first parameter for converting the distance into a distance based on an actual scale and a second parameter that is uncertain in a shooting device that shoots the plurality of second images by matching the distances respectively obtained from the plurality of second images with blur values ​​output from the statistical model by inputting each of the plurality of second images into the statistical model,

[0281] The conversion includes converting the distances respectively acquired from the plurality of second images into blur values ​​indicating blur generated according to the distances, using the first parameter and the second parameter.

[0282] [Technical Solution 4]

[0283] According to the above technical solution 3,

[0284] The calculation includes calculating the first parameter and the second parameter by performing linear regression on the inverse of the distances respectively obtained from the plurality of second images and the blur value output from the statistical model by inputting each of the plurality of second images into the statistical model.

[0285] [Technical Solution 5]

[0286] According to the above technical solution 3,

[0287] The calculating includes calculating the first parameter and the second parameter by nonlinear optimization based on distances respectively obtained from the plurality of second images and blur values ​​output from the statistical model by inputting each of the plurality of second images into the statistical model.

[0288] [Technical Solution 6]

[0289] According to the above technical solution 5,

[0290] The calculation includes: calculating the initial values ​​of the first parameter and the second parameter by performing linear regression on the inverse of the distances respectively obtained from the multiple second images and the blur values ​​output from the statistical model by inputting each of the multiple second images into the statistical model, and calculating the first parameter and the second parameter using the calculated initial values.

[0291] [Technical Solution 7]

[0292] According to the above technical solutions 2 to 6,

[0293] extracting feature points of the second object included in each of the plurality of second images; and

[0294] outputting a region in each of the second images where the number of feature points of the second object is less than a predetermined value,

[0295] Acquiring the distance includes acquiring the distance to the second subject for each feature point of the extracted second subject.

[0296] [Technical Solution 8]

[0297] According to the above technical solutions 1 to 7,

[0298] The method further includes obtaining a third image whose distance to the third subject is known.

[0299] The performing of learning includes: performing of learning of the statistical model using the plurality of second images and the third image.

[0300] [Technical Solution 9]

[0301] A program for learning a statistical model generated by learning blur generated in a first image according to a distance to a first subject included in the first image, the first image being an image captured in a first domain,

[0302] The program is used to make the computer execute:

[0303] acquiring a plurality of second images obtained by photographing the same second object from multiple viewpoints in a second domain different from the first domain; and

[0304] The statistical model is trained using the plurality of second images obtained.

[0305] [Technical Solution 10]

[0306] An image processing device that learns a statistical model generated by learning blur generated in a first image according to a distance to a first subject included in the first image, wherein the first image is an image captured in a first domain, the image processing device comprising:

[0307] an acquisition unit that acquires a plurality of second images obtained by photographing the same second object from multiple viewpoints in a second domain different from the first domain; and

[0308] A learning unit that uses the acquired plurality of second images to learn the statistical model.

Claims

1. A learning method, executed by an image processing device, for learning a statistical model, wherein the statistical model is generated by learning blur generated in a first image corresponding to a distance to a first subject included in the first image, wherein the first image is an image captured in a first domain, the learning method comprising: acquiring a plurality of second images obtained by photographing the same second object from multiple viewpoints in a second domain different from the first domain; acquiring, from each of the plurality of second images, a distance to the second object with an indefinite scale; By matching the distances respectively obtained from the plurality of second images with blur values ​​output from the statistical model by inputting each of the plurality of second images into the statistical model, a first parameter for converting the distance into a distance based on an actual scale and a second parameter that is uncertain in a photographing device that photographed the plurality of second images are calculated; using the first parameter and the second parameter, converting the distances obtained from the plurality of second images into blur values ​​indicating blur generated in accordance with the distances; as well as The statistical model is caused to learn the plurality of second images and the blur values ​​obtained by the transformation.

2. The learning method according to claim 1, The calculations include: The first parameter and the second parameter are calculated by subjecting the reciprocals of the distances respectively obtained from the plurality of second images to linear regression with blur values ​​output from the statistical model by inputting each of the plurality of second images into the statistical model.

3. The learning method according to claim 1, The calculations include: The first parameter and the second parameter are calculated by nonlinear optimization based on the distances respectively obtained from the plurality of second images and blur values ​​output from the statistical model by inputting each of the plurality of second images to the statistical model.

4. The learning method according to claim 3, The calculations include: The initial values ​​of the first parameter and the second parameter are calculated by performing linear regression on the inverse of the distances respectively obtained from the plurality of second images and the blur value output from the statistical model by inputting each of the plurality of second images into the statistical model, and the first parameter and the second parameter are calculated using the calculated initial values.

5. The learning method according to any one of claims 1 to 4, further comprising: extracting feature points of the second subject contained in each of the plurality of second images; and outputting a region in each of the second images where the number of feature points of the second object is less than a predetermined value, Acquiring the distance includes acquiring the distance to the second subject for each feature point of the extracted second subject.

6. The learning method according to any one of claims 1 to 4, The method further includes obtaining a third image whose distance to the third subject is known. The learning includes: The statistical model is trained using the plurality of second images and the third image.

7. An image processing device that learns a statistical model generated by learning blur generated in a first image according to a distance to a first subject included in the first image, the first image being an image captured in a first domain, the image processing device comprising: a first acquisition unit that acquires a plurality of second images obtained by photographing the same second subject from multiple viewpoints in a second domain different from the first domain; a second acquisition unit that acquires, from each of the plurality of second images, a distance to the second object whose scale is not fixed; a calculation unit that calculates a first parameter for converting the distance into a distance based on an actual scale and a second parameter that is uncertain in a photographing device that photographed the plurality of second images by matching the distances respectively obtained from the plurality of second images with blur values ​​output from the statistical model by inputting each of the plurality of second images into the statistical model; a conversion unit that converts the distances obtained from the plurality of second images into blur values ​​representing blurs generated according to the distances, using the first parameter and the second parameter; as well as The learning unit causes the statistical model to learn the plurality of second images and the blur values ​​obtained by the transformation.