JP2023104667A - Image processing method, image processing apparatus, image processing system, and program - Google Patents

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

Info

Publication number
JP2023104667A
JP2023104667A JP2022005803A JP2022005803A JP2023104667A JP 2023104667 A JP2023104667 A JP 2023104667A JP 2022005803 A JP2022005803 A JP 2022005803A JP 2022005803 A JP2022005803 A JP 2022005803A JP 2023104667 A JP2023104667 A JP 2023104667A
Authority
JP
Japan
Prior art keywords
image
captured image
value
image processing
map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2022005803A
Other languages
Japanese (ja)
Inventor
正和 小林
Masakazu Kobayashi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2022005803A priority Critical patent/JP2023104667A/en
Publication of JP2023104667A publication Critical patent/JP2023104667A/en
Pending legal-status Critical Current

Links

Abstract

To provide an image processing method capable of maintaining a blur correction effect while suppressing adverse effects caused by an aperture value of an optical system and a luminance value of a captured image.SOLUTION: The image processing method includes the steps of: generating information regarding the correction of a captured image based on the captured image; and generating an intensity-adjusted image based on the captured image, the information regarding correction, and a weight map, wherein the weight map is generated based on information regarding an aperture value of an optical system used to capture the captured image and information regarding a luminance value of the captured image.SELECTED DRAWING: Figure 16

Description

本発明は、画像処理方法、画像処理装置、画像処理システム、およびプログラムに関する。 The present invention relates to an image processing method, an image processing apparatus, an image processing system, and a program.

画像に対する認識または回帰のタスクにおいて、機械学習モデルを用いた手法は、仮定や近似を用いた理論ベースの手法に対して、高い精度を実現できる。理論ベースの手法では、仮定や近似によって無視された要素によって精度が低下する。しかし、機械学習モデルを用いた手法では、それらの要素も含む学習データを用いて機械学習モデルを学習することで、仮定や近似のない学習データに即した推定が実現できるため、タスクの精度が向上する。 In image recognition or regression tasks, methods using machine learning models can achieve higher accuracy than theory-based methods using assumptions and approximations. Theory-based methods suffer from inaccuracies due to factors neglected by assumptions and approximations. However, in the method using a machine learning model, by training the machine learning model using training data that includes these elements, it is possible to realize estimation that is based on the training data without assumptions or approximations, so task accuracy is improved. improves.

特許文献1には、機械学習モデルの1つである畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)を用いて、撮像画像のぼけを先鋭化する方法が開示されている。また特許文献1には、撮像画像と推定画像(ぼけ先鋭化画像)とを輝度飽和領域に基づいて重み付け平均し、先鋭化の強度を調整する方法が開示されている。 Patent Literature 1 discloses a method of sharpening blur in a captured image using a convolutional neural network (CNN), which is one of machine learning models. Further, Japanese Patent Application Laid-Open No. 2002-200000 discloses a method of weighted averaging a captured image and an estimated image (blurred sharpened image) based on a luminance saturation region to adjust the sharpening strength.

特開2020-166628号公報Japanese Patent Application Laid-Open No. 2020-166628

特許文献1に開示された方法では、光の回折現象に起因する弊害については述べられていない。光学系の絞り値(F値)を大きくして高輝度な被写体を撮像すると、光の回折現象によりエアリーディスクや光芒が発生する。機械学習モデルでエアリーディスクや光芒を補正した場合、学習画像の精度不足や機械学習モデルのパラメータ不足により、不自然な強調等の弊害が発生することがある。また、この弊害は、撮像画像における補正対象の周辺輝度値によって、目立ち具合が異なる。例えば、夜景のような暗い画像においては不自然な強調が目立つが、日中の屋外で撮影された明るい画像においては目立たない。 The method disclosed in Japanese Patent Laid-Open No. 2002-200012 does not mention the adverse effects caused by the light diffraction phenomenon. When the aperture value (F-number) of the optical system is increased and a high-brightness subject is imaged, an airy disk or a streak of light occurs due to the diffraction phenomenon of light. When the machine learning model is used to correct the Airy disk and the streak of light, the lack of precision in the training image and the lack of parameters in the machine learning model can cause adverse effects such as unnatural enhancement. Moreover, the degree of conspicuity of this adverse effect varies depending on the peripheral luminance value to be corrected in the captured image. For example, unnatural enhancement is conspicuous in a dark image such as a night scene, but is not conspicuous in a bright image taken outdoors in the daytime.

また、エアリーディスクや光芒の発生は、光学系の絞り値に依存しているため、弊害の発生していない絞り値で撮像された撮像画像の補正効果まで低減してしまう。また、撮像画像の輝度値で異なる弊害の目立ちやすさを考慮せず、決められた重みに応じて平均化される。つまり、暗い画像では飽和領域周辺で弊害が低減されるが、明るい画像においては、必要以上に飽和領域周辺の補正効果が低減してしまう。 Moreover, since the generation of the Airy disk and the streak of light depends on the aperture value of the optical system, the effect of correcting an image captured with an aperture value that does not cause adverse effects is also reduced. In addition, averaging is performed according to the determined weights without considering the conspicuousness of adverse effects that differ depending on the luminance value of the captured image. In other words, in a dark image, adverse effects are reduced around the saturated region, but in a bright image, the correction effect around the saturated region is reduced more than necessary.

そこで本発明は、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理方法を提供することを目的とする。 SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide an image processing method capable of maintaining a blur correction effect while suppressing adverse effects caused by the aperture value of an optical system and the luminance value of a captured image.

本発明の一側面としての画像処理方法は、撮像画像に基づいて該撮像画像の補正に関する情報を生成する工程と、前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する工程とを有し、前記重みマップは、前記撮像画像の撮像に用いた光学系の絞り値に関する情報と、前記撮像画像の輝度値に関する情報とに基づいて生成される。 An image processing method as one aspect of the present invention includes the steps of generating information regarding correction of the captured image based on the captured image, and generating an intensity adjusted image based on the captured image, the information regarding the correction, and a weight map. wherein the weight map is generated based on information about the aperture value of the optical system used to capture the captured image and information about the luminance value of the captured image.

本発明の他の目的及び特徴は、以下の実施例において説明される。 Other objects and features of the invention are illustrated in the following examples.

本発明によれば、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理方法を提供することができる。 According to the present invention, it is possible to provide an image processing method capable of maintaining the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image.

実施例1における機械学習モデルの説明図である。FIG. 4 is an explanatory diagram of a machine learning model in Example 1; 実施例1における画像処理システムのブロック図である。1 is a block diagram of an image processing system in Example 1. FIG. 実施例1における画像処理システムの外観図である。1 is an external view of an image processing system in Example 1. FIG. 実施例1~3における先鋭化による弊害の説明図である。FIG. 5 is an explanatory diagram of adverse effects caused by sharpening in Examples 1 to 3; 実施例1~3におけるエアリーディスクの説明図である。FIG. 2 is an explanatory diagram of an Airy disk in Examples 1 to 3; 実施例1~3における光芒の説明図である。FIG. 10 is an explanatory diagram of a beam of light in Examples 1 to 3; 実施例1~3における機械学習モデルの学習のフローチャートである。4 is a flow chart of learning of a machine learning model in Examples 1 to 3. FIG. 実施例1、2におけるモデル出力の生成のフローチャートである。4 is a flow chart of model output generation in Examples 1 and 2. FIG. 実施例1における先鋭化の強度調整のフローチャートである。5 is a flowchart of sharpening intensity adjustment in the first embodiment. 実施例1における撮像画像と飽和影響マップの説明図である。4A and 4B are explanatory diagrams of a captured image and a saturation effect map in Example 1. FIG. 実施例1における撮像画像と飽和影響マップの説明図である。4A and 4B are explanatory diagrams of a captured image and a saturation effect map in Example 1. FIG. 実施例1における重みマップの説明図である。FIG. 4 is an explanatory diagram of a weight map in Example 1; 実施例1における重みマップの説明図である。FIG. 4 is an explanatory diagram of a weight map in Example 1; 実施例2における画像処理システムのブロック図である。FIG. 11 is a block diagram of an image processing system in Example 2; 実施例2における画像処理システムの外観図である。FIG. 11 is an external view of an image processing system in Example 2; 実施例2における先鋭化の強度調整のフローチャートである。10 is a flowchart of sharpening intensity adjustment in Example 2. FIG. 実施例2における重みマップの説明図である。FIG. 10 is an explanatory diagram of a weight map in Example 2; 実施例3における画像処理システムのブロック図である。FIG. 11 is a block diagram of an image processing system in Example 3; 実施例3における画像処理システムの外観図である。FIG. 11 is an external view of an image processing system in Example 3; 実施例3におけるモデル出力および先鋭化の強度調整のフローチャートである。10 is a flowchart of model output and sharpening intensity adjustment in Example 3. FIG.

以下、本発明の実施例について、図面を参照しながら詳細に説明する。各図において、同一の部材については同一の参照符号を付し、重複する説明は省略する。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In each figure, the same members are denoted by the same reference numerals, and overlapping descriptions are omitted.

実施例の具体的な説明を行う前に、本発明の要旨を説明する。本発明は、光学系を用いて撮像された撮像画像から、光学系に起因するぼけを、機械学習モデルを用いて先鋭化した推定画像を生成する。そして、撮像画像の撮像に用いた光学系の絞り値に関する情報と、撮像画像の輝度値に関する情報とに基づいて重みマップを生成し、撮像画像と推定画像とを加重平均する。重みマップとは、撮像画像と推定画像を加重平均する際の、各画像の割合を決定するために用いられ、連続的な信号値を有する。例えば、重みマップの数値が撮像画像の割合を決定する場合、数値が0.5であれば、撮像画像とぼけ先鋭化画像の割合を50%で加重平均した強度調整画像となる。また、重みマップの値が1であれば、強度調整画像は撮像画像となる。 The gist of the present invention will be described before the specific description of the embodiments. According to the present invention, an estimated image is generated by using a machine learning model to sharpen the blur caused by the optical system from the captured image captured using the optical system. Then, a weight map is generated based on information about the aperture value of the optical system used to capture the captured image and information about the luminance value of the captured image, and the captured image and the estimated image are weighted averaged. A weight map is used to determine the proportion of each image in weighted averaging the captured image and the estimated image, and has continuous signal values. For example, when the numerical value of the weight map determines the ratio of the captured image, if the numerical value is 0.5, the weighted average of the ratio of the captured image and the sharpened blurred image by 50% is obtained as an intensity adjusted image. Also, if the value of the weight map is 1, the intensity adjusted image is the captured image.

光学系に起因するぼけとは、収差、回折、デフォーカスによるぼけや、光学ローパスフィルタによる作用、撮像素子の画素開口劣化などを含む。機械学習モデルは、例えば、ニューラルネットワーク、遺伝的プログラミング、ベイジアンネットワークなどを含む。ニューラルネットワークは、CNN(Convolutional Neural Network)、GAN(Generative Adversarial Network)、RNN(Recurrent Neural Network)などを含む。 Blurring caused by the optical system includes blurring due to aberration, diffraction, defocus, action of an optical low-pass filter, deterioration of the pixel aperture of the imaging element, and the like. Machine learning models include, for example, neural networks, genetic programming, Bayesian networks, and the like. Neural networks include Convolutional Neural Networks (CNNs), Generative Adversarial Networks (GANs), Recurrent Neural Networks (RNNs), and the like.

ぼけの先鋭化とは、ぼけによって低下または消失した被写体の周波数成分を復元する処理を指す。ぼけの先鋭化の際、光学系の絞り値を大きくして高輝度な被写体を撮像すると、光の回折現象によりエアリーディスクや光芒が発生する。機械学習モデルでエアリーディスクや光芒を補正した場合、学習画像の精度不足や機械学習モデルのパラメータ不足により、不自然な強調等の弊害が発生する。なお、エアリーディスクと光芒、学習画像の精度不足や機械学習モデルのパラメータ不足についての詳細は、後述する。 Blur sharpening refers to processing for restoring frequency components of an object that have been reduced or lost due to blur. When sharpening the blur, if the aperture value of the optical system is increased and a high-brightness subject is imaged, an airy disk or a streak of light will occur due to the diffraction phenomenon of light. When the machine learning model is used to correct the Airy disk and the streak of light, adverse effects such as unnatural enhancement occur due to insufficient accuracy of the learning image and insufficient parameters of the machine learning model. Details of the Airy disk and the beam of light, insufficient accuracy of the learning image, and insufficient parameters of the machine learning model will be described later.

また、この弊害は画像の明るさによって、目立ちやすさが異なる。例えば、夜景のような暗い画像においては不自然な強調が目立つが、日中の屋外で撮影された明るい画像においては目立たない。そこで、本発明は、撮像画像の撮像に用いた光学系の絞り値に関する情報と、撮像画像の輝度値に関する情報とに基づいて重みマップを生成し、撮像画像と推定画像とを加重平均する。これにより、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能になる。なお以下では、機械学習モデルのウエイトを学習する段階のことを学習フェーズとし、学習済みのウエイトを用いた機械学習モデルでぼけの先鋭化を行う段階のことを推定フェーズとする。 Moreover, the conspicuity of this adverse effect varies depending on the brightness of the image. For example, unnatural enhancement is conspicuous in a dark image such as a night scene, but is not conspicuous in a bright image taken outdoors in the daytime. Therefore, according to the present invention, a weight map is generated based on information regarding the aperture value of the optical system used to capture the captured image and information regarding the brightness value of the captured image, and weighted averaging of the captured image and the estimated image is performed. This makes it possible to maintain the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image. In the following, the stage of learning the weights of the machine learning model is referred to as the learning phase, and the stage of sharpening the blur by the machine learning model using the learned weights is referred to as the estimation phase.

まず、本発明の実施例1における画像処理システムに関して説明する。本実施例において、機械学習モデルによるタスクは、輝度飽和を含む撮像画像に対するぼけの先鋭化(撮像画像の高解像化)である。また、先鋭化するぼけは、光学系で発生する収差や回折、光学ローパスフィルタによるぼけを対象とする。ただし、画素開口やデフォーカス、ぶれによるぼけを先鋭化する場合も、同様に発明の効果を得ることができる。また、ぼけ先鋭化以外のタスクに関しても、同様に本実施例を適用し、効果を得ることが可能である。具体的には、撮像画像の画素数を上げるアップサンプリングや、撮像画像のデフォーカスぼけを変換(形状変換)するタスクなどである。デフォーカスぼけの変換とは、例えば、二線ぼけからガウスぼけや玉ぼけへの変換などが含まれる。二線ぼけは、ピークが分離した点像分布関数(PSF)を有する。これにより、本来は一本の線である被写体が、デフォーカスした際に二重にぼけているように見える。玉ぼけは、強度がフラットなPSFを有する。ガウスぼけは、ガウス分布のPSFを有する。変換の対象とする他のデフォーカスぼけには、例えば、ヴィネッティングによって欠けたデフォーカスぼけ、カタディオプトリックレンズなどの瞳遮蔽によるリング状のデフォーカスぼけなどが挙げられる。 First, an image processing system according to Embodiment 1 of the present invention will be described. In this embodiment, the task of the machine learning model is to sharpen the blur of a captured image including brightness saturation (increase the resolution of the captured image). Further, the sharpening blur refers to blur caused by aberration and diffraction generated in an optical system and an optical low-pass filter. However, the effect of the invention can be similarly obtained in the case of sharpening pixel aperture, defocus, and blur due to blurring. Moreover, it is possible to apply the present embodiment to tasks other than blur sharpening, and obtain effects. Specifically, tasks such as upsampling to increase the number of pixels in a captured image, and conversion (shape conversion) of defocus blur in the captured image. Defocus blur conversion includes, for example, conversion from bilinear blur to Gaussian blur or ball blur. Bilinear blur has a point spread function (PSF) with separated peaks. As a result, the subject, which is originally a single line, appears to be double-blurred when defocused. Ball blur has a PSF that is flat in intensity. Gaussian blur has a Gaussian-distributed PSF. Other defocus blur to be converted includes, for example, defocus blur caused by vignetting, ring-shaped defocus blur caused by pupil shielding such as a catadioptric lens, and the like.

図2は、本実施例における画像処理システム100のブロック図である。図3は、画像処理システム100の外観図である。画像処理システム100は、有線または無線のネットワークで接続された学習装置101と画像処理装置103とを有する。画像処理装置103には、有線または無線によって、撮像装置102、表示装置104、記録媒体105、および出力装置106が接続される。撮像装置102を用いて被写体空間を撮像した撮像画像は、画像処理装置103に入力される。撮像画像には、撮像装置102内の光学系102aによる収差および回折と、撮像素子102bの光学ローパスフィルタと、によってぼけが発生しており、被写体の情報が減衰している。 FIG. 2 is a block diagram of the image processing system 100 in this embodiment. FIG. 3 is an external view of the image processing system 100. As shown in FIG. The image processing system 100 has a learning device 101 and an image processing device 103 connected via a wired or wireless network. An imaging device 102, a display device 104, a recording medium 105, and an output device 106 are connected to the image processing device 103 by wire or wirelessly. A captured image obtained by capturing an object space using the imaging device 102 is input to the image processing device 103 . The captured image is blurred due to aberration and diffraction by the optical system 102a in the image capturing apparatus 102 and the optical low-pass filter of the image sensor 102b, and the subject information is attenuated.

画像処理装置103は、機械学習モデルを用いて、撮像画像に対してぼけ先鋭化を行い、飽和影響マップとぼけ先鋭化画像(モデル出力)を生成する。なお、飽和影響マップの詳細は後述する。機械学習モデルは学習装置101で学習されたものであり、画像処理装置103は機械学習モデルに関する情報を予め学習装置101から取得し、記憶部103aに記憶している。また画像処理装置103は、撮像画像とぼけ先鋭化画像の重み付け加算を取ることで、ぼけ先鋭化の強度を調整する機能を有する。機械学習モデルの学習と推定、ぼけ先鋭化の強度調整の詳細に関しては、後述する。ユーザは、表示装置104に表示された画像を確認しながら、ぼけ先鋭化の強度調整を行える。強度調整が施されたぼけ先鋭化画像は、記憶部103aまたは記録媒体105に保存され、必要に応じてプリンタなどの出力装置106に出力される。なお、撮像画像は、グレースケールでも、複数の色成分を有していてもよい。また、未現像のRAW画像でも、現像後の画像でもよい。 The image processing apparatus 103 uses a machine learning model to perform blur sharpening on the captured image, and generates a saturation effect map and a blur sharpened image (model output). The details of the saturation influence map will be described later. The machine learning model is learned by the learning device 101, and the image processing device 103 acquires information on the machine learning model in advance from the learning device 101 and stores it in the storage unit 103a. The image processing apparatus 103 also has a function of adjusting the intensity of blur sharpening by performing weighted addition of the captured image and the sharpened blur image. The details of the learning and estimation of the machine learning model and the adjustment of the blur sharpening intensity will be described later. The user can adjust the blur sharpening intensity while checking the image displayed on the display device 104 . The blurred and sharpened image that has undergone intensity adjustment is stored in the storage unit 103a or the recording medium 105, and is output to an output device 106 such as a printer as necessary. Note that the captured image may be grayscale or may have a plurality of color components. Further, it may be an undeveloped RAW image or an image after development.

次に、図4(A)~(C)および図5を参照して、機械学習モデルによって、ぼけ先鋭化を行う際に発生する、光の回折現象に起因する弊害について説明する。図4(A)、(B)は、光学系の絞り値を大きくした場合のPSFの断面図(縦軸は信号値、横軸は空間座標)であり、縦軸のスケールが異なる。図5は、PSFの平面図である。光の回折現象により、中央部に明るい領域を持ち、その周囲に暗い同心円状輪帯を有する回折パターンが生じている。これをエアリーディスクと呼ぶ。この回折パターンは微弱な信号値であるが、点光源や強い光を撮像すると、撮像画像上でも目視で確認できるようになる。図4(C)中の一点鎖線141に、上記のPSFを先鋭化し、回折パターンを低減した理想信号値、点線142に、先鋭化により回折パターンが強調された場合の信号値を示す。ぼけの先鋭化としては、一点鎖線141になることが好ましい。しかし、学習画像の精度不足や機械学習モデルのパラメータ不足により、点線142のように、回折パターンの強調が発生する場合がある。これは、回折パターンのエッジを被写体と誤認識して先鋭化してしまうためである。学習画像の精度不足や機械学習モデルのパラメータ不足については後述する。 Next, with reference to FIGS. 4A to 4C and FIG. 5, a description will be given of the adverse effect caused by the light diffraction phenomenon that occurs when blur sharpening is performed using a machine learning model. 4A and 4B are cross-sectional views of the PSF (the vertical axis is the signal value and the horizontal axis is the spatial coordinate) when the aperture value of the optical system is increased, and the scale of the vertical axis is different. FIG. 5 is a plan view of the PSF. The diffraction phenomenon of light produces a diffraction pattern with a bright central area surrounded by dark concentric ring zones. This is called an Airy disk. This diffraction pattern has a weak signal value, but when a point light source or strong light is captured, it can be visually confirmed even on the captured image. The dashed-dotted line 141 in FIG. 4C shows the ideal signal value obtained by sharpening the PSF and reducing the diffraction pattern, and the dotted line 142 shows the signal value when the diffraction pattern is emphasized by sharpening. As for the sharpening of the blur, it is preferable to use the one-dot chain line 141 . However, due to insufficient accuracy of the learning image or insufficient parameters of the machine learning model, the diffraction pattern may be emphasized as indicated by the dotted line 142 . This is because the edge of the diffraction pattern is erroneously recognized as an object and sharpened. Insufficient accuracy of training images and insufficient parameters of machine learning models will be described later.

次に、図6を参照して、光の回折現象に起因する光芒について説明する。光芒とは、点光源や強い光を撮像した際に発生する、細長く伸びる光の筋を意味する。図6は、光芒の例である。筋の数は、光学系102aの絞り羽根143の枚数に依存する。絞り羽根143の枚数が奇数である場合、枚数の2倍の筋が発生する。一方、絞り羽根143の枚数が偶数である場合、枚数の筋が発生する。図6に示される絞り羽根143の枚数は5枚であるため、光の筋144が10本発生している。光芒の鋭さは光学系の絞り値に依存する。絞り値が大きくなると、鋭さが増していく。また、同じ絞り値でも、光学系102aの種類によって光芒の現れ方が異なる。エアリーディスクと同様に、学習画像の精度不足や機械学習モデルのパラメータ不足により、光芒の不自然な強調が発生する場合がある。 Next, with reference to FIG. 6, the light beam caused by the diffraction phenomenon of light will be described. A streak of light means a long, narrow streak of light that occurs when a point light source or strong light is captured. FIG. 6 is an example of a beam of light. The number of streaks depends on the number of aperture blades 143 of the optical system 102a. If the number of diaphragm blades 143 is an odd number, streaks twice as many as the number are generated. On the other hand, when the number of aperture blades 143 is even, streaks are generated. Since the number of aperture blades 143 shown in FIG. 6 is five, ten streaks of light 144 are generated. The sharpness of the beam depends on the aperture value of the optical system. As the aperture value increases, sharpness increases. Also, even with the same aperture value, the appearance of the streak differs depending on the type of the optical system 102a. As with the Airy disk, unnatural enhancement of the light beam may occur due to insufficient accuracy of the training image or insufficient parameters of the machine learning model.

次に、学習画像の精度不足について詳細に説明する。機械学習モデルを用いてぼけの先鋭化を行う場合、先鋭化の精度は学習画像の精度に依存する。つまり、先鋭化の対象としている光学系102aのぼけを高精度に再現した学習画像が必要となる。しかし、撮像時に光学系102aが取り得るズーム位置、絞り値、被写体距離におけるぼけを網羅的に学習しようとすると、学習画像の枚数が膨大になる。その結果、個々のぼけ先鋭化精度の低下、学習が収束しない等の問題が生じる。そのため、光学系102aが取り得るズーム位置、絞り値、被写体距離におけるぼけを離散的に学習し、中間領域は機械学習モデルに予測させることが必要になる。しかし、その場合、学習画像に含まれていない中間領域のぼけを先鋭化すると、回折パターンのエッジを被写体と誤認識して先鋭化することがある。 Next, the lack of accuracy of learning images will be described in detail. When blur sharpening is performed using a machine learning model, the sharpening accuracy depends on the accuracy of the learning image. In other words, a learning image that reproduces the blurring of the optical system 102a to be sharpened with high accuracy is required. However, if an attempt is made to exhaustively learn blurring at zoom positions, aperture values, and object distances that can be taken by the optical system 102a during imaging, the number of learning images becomes enormous. As a result, problems such as deterioration in individual blur sharpening accuracy and learning failure to converge occur. Therefore, it is necessary to discretely learn the zoom position, the aperture value, and the blur at the subject distance that the optical system 102a can take, and have the machine learning model predict the intermediate region. However, in that case, sharpening the blur in the intermediate region not included in the learning image may cause the edge of the diffraction pattern to be erroneously recognized as an object and sharpened.

次に、機械学習モデルのパラメータ不足について詳細に説明する。機械学習モデルは複数の層を有し、各層で層の入力とウエイトの線型和が取られる。線型和として入力とフィルタの畳み込み(フィルタの各要素の値がウエイトに該当。また、バイアスとの和を含んでいてもよい)を用いるCNNを機械学習モデルとした場合、フィルタの層数がパラメータの数に対応する。つまり、パラメータ不足とは、フィルタの層数不足を意味している。フィルタの層数と学習時間および処理速度はトレードオフの関係になっているため、パラメータ不足が発生する場合がある。機械学習モデルの入力データとして、撮像画像と撮像画像に対応する輝度飽和マップを用いる手法と、飽和影響マップを生成する手法を盛り込んで学習した機械学習モデルを使用すると、弊害を低減させることは可能であるが、完全に弊害を消すことは難しい。輝度飽和マップを用いる手法と、飽和影響マップを生成する手法についてそれぞれ詳細に説明する。 Next, the lack of parameters in the machine learning model will be explained in detail. A machine learning model has multiple layers, and at each layer a linear sum of layer inputs and weights is taken. When a CNN that uses the convolution of the input and the filter as a linear sum (the value of each element of the filter corresponds to the weight, and may also include the sum with the bias) as a machine learning model, the number of layers of the filter is a parameter corresponds to the number of In other words, insufficient parameters means an insufficient number of filter layers. Since there is a trade-off relationship between the number of filter layers, learning time, and processing speed, parameter shortages may occur. It is possible to reduce adverse effects by using a machine learning model trained by incorporating a method of using a captured image and a brightness saturation map corresponding to the captured image as input data for the machine learning model, and a method of generating a saturation influence map. However, it is difficult to eliminate the harmful effects completely. A technique using a luminance saturation map and a technique for generating a saturation influence map will be described in detail.

次に、輝度飽和マップについて説明する。輝度飽和マップとは、撮像画像において輝度飽和領域を表すマップである。輝度飽和を起こした領域(輝度飽和領域)では、被写体空間の構造に関する情報が失われ、各領域の境界で偽エッジが出現することもあり、被写体の正しい特徴量を抽出できない。そこで、輝度飽和マップを入力することで、ニューラルネットワークが前述のような問題のある領域を特定できるため、推定精度の低下を抑制することができる。 Next, the brightness saturation map will be explained. A brightness saturation map is a map that represents a brightness saturation region in a captured image. In an area where brightness saturation occurs (brightness saturated area), information about the structure of the subject space is lost, and false edges may appear at the boundaries of each area, making it impossible to extract the correct feature amount of the subject. Therefore, by inputting the brightness saturation map, the neural network can identify the problem area as described above, so that the deterioration of the estimation accuracy can be suppressed.

次に、飽和影響マップについて説明する。輝度飽和マップを使用しても、機械学習モデルの判定が正しく行われない場合がある。例えば、輝度飽和した領域の近傍が注目領域だった場合、機械学習モデルは、注目領域の近傍に輝度飽和した領域があるため、注目領域が輝度飽和の影響を受けた領域と判定可能である。しかし、輝度飽和した領域から離れた位置が注目領域の場合、ここが輝度飽和の影響を受けているか否かを判定することは容易でなく、曖昧性が高くなる。その結果、輝度飽和した領域から離れた位置では、機械学習モデルが誤判定を起こすことがある。これによって、タスクがぼけの先鋭化の場合、非飽和ぼけ像に対して、飽和ぼけ像に対応する先鋭化処理を実行する。この際、ぼけを先鋭化した画像にアーティファクトが発生し、タスクの精度が低下する。そのため、機械学習モデルを用いて、ぼけが発生した撮像画像から飽和影響マップを生成することが好ましい。 Next, the saturation influence map will be described. Even with a luminance saturation map, machine learning models may not make correct decisions. For example, when a region of interest is in the vicinity of a region with saturated brightness, the machine learning model can determine that the region of interest is a region affected by saturation of brightness because there is a region with saturated brightness in the vicinity of the region of interest. However, if the region of interest is located at a position away from the luminance saturated region, it is not easy to determine whether or not this region is affected by luminance saturation, resulting in high ambiguity. As a result, the machine learning model may make an erroneous decision at a position away from the luminance saturated region. As a result, when the task is blur sharpening, the sharpening process corresponding to the saturated blurred image is performed on the non-saturated blurred image. At this time, artifacts are generated in the sharpened blur image, and the accuracy of the task is lowered. Therefore, it is preferable to generate a saturation effect map from a blurred captured image using a machine learning model.

飽和影響マップとは、撮像画像の輝度飽和した領域の被写体が、ぼけによって広がった信号値の大きさと範囲を表すマップ(空間的に配列された信号列)である。機械学習モデルに飽和影響マップを生成させることで、機械学習モデルは、撮像画像中の輝度飽和の影響の有無とその大きさを高精度に推定することができる。飽和影響マップが生成されることで、機械学習モデルは、輝度飽和の影響を受けた領域に実行すべき処理と、それ以外の領域に実行すべき処理を、それぞれ適切な領域に実行することができる。そのため、機械学習モデルに飽和影響マップを生成させることで、飽和影響マップの生成を介さない(撮像画像から直接、認識ラベルやぼけ先鋭化画像のみを生成する)場合に対して、タスクの精度が向上する。 A saturation influence map is a map (a signal sequence arranged spatially) representing the magnitude and range of signal values spread by blurring of an object in a luminance-saturated area of a captured image. By having the machine learning model generate the saturation influence map, the machine learning model can highly accurately estimate the presence or absence of the influence of luminance saturation in the captured image and the magnitude thereof. By generating the saturation influence map, the machine learning model can execute the processing to be executed on the regions affected by the luminance saturation and the processing to be executed on the other regions in each appropriate region. can. Therefore, by letting the machine learning model generate the saturation influence map, the accuracy of the task is improved compared to the case where the saturation influence map is not generated (only the recognition labels and the blur sharpened image are generated directly from the captured image). improves.

上記2つの手法は有効ではあるが、弊害を完全に消すことは難しい。そこで本実施例は、撮像画像の撮像に用いた光学系の絞り値に関する情報と、撮像画像の輝度値に関する情報とに基づいて重みマップを生成し、撮像画像と推定画像とを加重平均する。これにより、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能になる。 Although the above two methods are effective, it is difficult to completely eliminate the harmful effects. Therefore, in this embodiment, a weight map is generated based on information about the aperture value of the optical system used to capture the captured image and information about the luminance value of the captured image, and weighted averaging of the captured image and the estimated image is performed. This makes it possible to maintain the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image.

次に、図7を参照して、学習装置101で実行される機械学習モデルの学習に関して説明する。図7は、機械学習モデルの学習のフローチャートである。学習装置101は、記憶部101a、取得部101b、演算部101c、および更新部101dを有し、図7の各ステップは、主に、学習装置101の各部により実行される。 Next, learning of a machine learning model executed by the learning device 101 will be described with reference to FIG. FIG. 7 is a flowchart of learning of the machine learning model. The learning device 101 has a storage unit 101a, an acquisition unit 101b, a calculation unit 101c, and an update unit 101d, and each step in FIG. 7 is mainly executed by each unit of the learning device 101.

まずステップS101において、取得部101bは、記憶部101aから1枚以上の原画像を取得する。原画像は、第2の信号値より高い信号値を有する画像である。第2の信号値は、撮像画像の輝度飽和値に相当する信号値である。ただし、機械学習モデルに入力する際、信号値を規格化してもよいため、必ずしも第2の信号値と撮像画像の輝度飽和値が一致する必要はない。原画像を基にして機械学習モデルの学習を行うため、原画像は様々な周波数成分(異なる向きと強度のエッジ、グラデーション、平坦部など)を有する画像であることが望ましい。原画像は実写画像でもよいし、CG(Computer Graphics)でもよい。 First, in step S101, the acquisition unit 101b acquires one or more original images from the storage unit 101a. The original image is the image having signal values higher than the second signal value. The second signal value is a signal value corresponding to the luminance saturation value of the captured image. However, since the signal value may be normalized when inputting to the machine learning model, the second signal value and the luminance saturation value of the captured image do not necessarily match. Since the machine learning model is trained based on the original image, the original image should preferably be an image with various frequency components (edges with different orientations and strengths, gradations, flat areas, etc.). The original image may be a photographed image or CG (Computer Graphics).

続いてステップS102において、演算部101cは、原画像にぼけを付与し、ぼけ画像を生成する。ぼけ画像は、学習時に機械学習モデルに入力される画像であり、推定時の撮像画像に相当する。付与するぼけは、先鋭化の対象となるぼけである。本実施例では、光学系102aの収差と回折、および撮像素子102bの光学ローパスフィルタによって発生するぼけを付与する。光学系102aの収差と回折によるぼけの形状は、像面座標(像高とアジムス)によって変化する。また、光学系102aの変倍、絞り、フォーカスの状態によっても変化する。これらのぼけ全てを先鋭化する機械学習モデルを一括で学習したい場合、光学系102aで発生する複数のぼけを用いて、複数のぼけ画像を生成するとよい。また、ぼけ画像において、第2の信号値を超える信号値はクリップされる。これは、撮像画像の撮像過程で起きる輝度飽和を再現するために行う。必要に応じて、撮像素子102bで発生するノイズをぼけ画像に付与してもよい。 Subsequently, in step S102, the calculation unit 101c blurs the original image to generate a blurred image. A blurred image is an image input to a machine learning model during learning, and corresponds to a captured image during estimation. The blur to be given is the blur to be sharpened. In this embodiment, the blur generated by the aberration and diffraction of the optical system 102a and the optical low-pass filter of the imaging element 102b is applied. The shape of the blur due to aberration and diffraction of the optical system 102a changes depending on the image plane coordinates (image height and azimuth). It also changes depending on the state of zooming, aperture, and focus of the optical system 102a. When learning a machine learning model that sharpens all of these blurs at once, it is preferable to generate a plurality of blurred images using a plurality of blurs generated by the optical system 102a. Also, in the blurred image, signal values exceeding the second signal value are clipped. This is done in order to reproduce the brightness saturation that occurs during the imaging process of the captured image. If necessary, noise generated by the image sensor 102b may be added to the blurred image.

続いてステップS103において、演算部101cは、原画像に基づく画像と信号値の閾値とに基づいて、第1の領域を設定する。本実施例では、原画像に基づく画像として、ぼけ画像を用いるが、原画像そのものなどを用いてもよい。ぼけ画像の信号値と、信号値の閾値と、を比較することで、第1の領域を設定する。より具体的には、ぼけ画像の信号値が、信号値の閾値以上となっている領域を第1の領域とする。本実施例において、信号値の閾値は第2の信号値である。故に、第1の領域は、ぼけ画像の輝度飽和した領域(飽和領域)を表す。ただし、信号値の閾値と第2の信号値は、一致しなくてもよい。信号値の閾値を、第2の信号値よりやや小さい値(例えば、0.9倍)に設定してもよい。 Subsequently, in step S103, the calculation unit 101c sets the first region based on the image based on the original image and the threshold value of the signal value. In this embodiment, a blurred image is used as an image based on the original image, but the original image itself may be used. A first region is set by comparing the signal value of the blurred image and the threshold value of the signal value. More specifically, a region in which the signal value of the blurred image is equal to or greater than the signal value threshold is defined as the first region. In this embodiment, the signal value threshold is the second signal value. Therefore, the first region represents a brightness-saturated region (saturated region) of the blurred image. However, the signal value threshold and the second signal value do not have to match. The signal value threshold may be set to a value slightly smaller than the second signal value (for example, 0.9 times).

続いてステップS104において、演算部101cは、第1の領域に原画像の信号値を有する第1の領域画像を生成する。第1の領域画像は、第1の領域以外の領域において、原画像とは異なる信号値を有する。さらに望ましくは、第1の領域画像は、第1の領域以外の領域において、第1の信号値を有する。本実施例において、第1の信号値は0であるが、発明はこれに限定されない。本実施例では、第1の領域画像は、ぼけ画像が輝度飽和した領域のみに原画像の信号値を有し、それ以外の領域の信号値は0である。 Subsequently, in step S104, the calculation unit 101c generates a first area image having signal values of the original image in the first area. The first area image has signal values different from those of the original image in areas other than the first area. More desirably, the first area image has the first signal value in areas other than the first area. In this embodiment, the first signal value is 0, but the invention is not so limited. In this embodiment, the first area image has the signal value of the original image only in the area where the brightness of the blurred image is saturated, and the signal value is 0 in other areas.

続いてステップS105において、演算部101cは、第1の領域画像にぼけを付与し、飽和影響正解マップを生成する。付与されるぼけは、ぼけ画像に付与したぼけと同じである。これによって、ぼけ画像の輝度飽和した領域にある被写体から、撮像時のぼけ(劣化)によって広がった信号値の大きさと範囲を表すマップ(空間的に配列された信号列)である飽和影響正解マップが生成される。本実施例では、ぼけ画像と同様に、飽和影響正解マップを第2の信号値でクリップするが、必ずしもクリップを行う必要はない。 Subsequently, in step S105, the calculation unit 101c blurs the first area image and generates a saturation influence correct map. The added blur is the same as the blur added to the blurred image. As a result, a saturated effect correct map, which is a map (a spatially arranged signal sequence) representing the magnitude and range of signal values spread by blurring (degradation) at the time of imaging, from an object in a luminance-saturated area of a blurred image. is generated. In the present embodiment, the saturation effect correct map is clipped by the second signal value in the same manner as the blurred image, but clipping is not necessarily required.

続いてステップS106において、取得部101bは、正解モデル出力を取得する。本実施例のタスクはぼけ先鋭化のため、正解モデル出力はぼけ画像よりぼけの小さい画像である。本実施例では、原画像を第2の信号値でクリップすることで、正解モデル出力を生成する。原画像に高周波成分が不足している場合、原画像を縮小した画像を正解モデル出力としてもよい。この場合、ステップS102でぼけ画像を生成する際にも同様に縮小を行う。また、ステップS106は、ステップS101より後で、ステップS107より前であれば、いつ実行してもよい。 Subsequently, in step S106, the acquisition unit 101b acquires the correct model output. Since the task of this embodiment is blur sharpening, the correct model output is an image with less blur than the blurred image. In this embodiment, the correct model output is generated by clipping the original image with a second signal value. If the original image lacks high-frequency components, an image obtained by reducing the original image may be used as the correct model output. In this case, reduction is performed in the same way when generating a blurred image in step S102. Further, step S106 may be executed at any time after step S101 and before step S107.

続いてステップS107において、演算部101cは、機械学習モデルを用いて、ぼけ画像に基づき、飽和影響マップとモデル出力を生成する。本実施例では、図1に示される機械学習モデルを使用するが、発明はこれに限定されない。ぼけ画像201と輝度飽和マップ202が、機械学習モデルに入力される。輝度飽和マップ202は、ぼけ画像201の輝度飽和した(信号値が第2の信号値以上である)領域を示したマップである。例えば、第2の信号値で、ぼけ画像201を二値化することによって生成できる。ただし、輝度飽和マップ202は、必ずしも必須ではない。ぼけ画像201と輝度飽和マップ202は、チャンネル方向に連結されて、機械学習モデルに入力される。ただし、発明はこれに限定されない。例えば、ぼけ画像201と輝度飽和マップ202をそれぞれ特徴マップに変換し、それらの特徴マップをチャンネル方向に連結してもよい。また、輝度飽和マップ202以外の情報を入力に追加してもよい。 Subsequently, in step S107, the calculation unit 101c uses a machine learning model to generate a saturation influence map and a model output based on the blurred image. In this example, the machine learning model shown in FIG. 1 is used, but the invention is not limited to this. A blurred image 201 and a luminance saturation map 202 are input to a machine learning model. A brightness saturation map 202 is a map that indicates a brightness-saturated region (where the signal value is equal to or greater than the second signal value) of the blurred image 201 . For example, it can be generated by binarizing the blurred image 201 with the second signal value. However, the brightness saturation map 202 is not necessarily essential. The blurred image 201 and the brightness saturation map 202 are connected in the channel direction and input to the machine learning model. However, the invention is not limited to this. For example, the blurred image 201 and the brightness saturation map 202 may be converted into feature maps, and these feature maps may be linked in the channel direction. Also, information other than the luminance saturation map 202 may be added to the input.

機械学習モデルは複数の層を有し、各層で層の入力とウエイトの線型和が取られる。ウエイトの初期値は、乱数などで決定するとよい。本実施例は、線型和として入力とフィルタの畳み込み(フィルタの各要素の値がウエイトに該当。また、バイアスとの和を含んでいてもよい)を用いるCNNを機械学習モデルとするが、発明はこれに限定されない。また、各層では必要に応じて、ReLU(Rectified Linear Unit)やシグモイド関数などの活性化関数による非線型変換が実行される。さらに、機械学習モデルは必要に応じて、残差ブロックやSkip Connection(Shortcut Connectionともいう)を有していてもよい。複数の層(本実施例では畳み込み層16層)を介した結果、飽和影響マップ203が生成される。 A machine learning model has multiple layers, and at each layer a linear sum of layer inputs and weights is taken. The initial value of the weight should be determined by random numbers or the like. In this embodiment, the machine learning model is a CNN that uses the convolution of the input and the filter as the linear sum (the value of each element of the filter corresponds to the weight, and may include the sum with the bias). is not limited to this. Also, in each layer, nonlinear transformation is performed by an activation function such as a ReLU (Rectified Linear Unit) or a sigmoid function as necessary. Furthermore, the machine learning model may have residual blocks and Skip Connections (also called Shortcut Connections) as needed. As a result of going through multiple layers (16 convolutional layers in this example), a saturation influence map 203 is generated.

本実施例では、層211の出力と輝度飽和マップ202の要素毎の和を取ることで飽和影響マップ203とするが、構成はこれに限定されない。飽和影響マップが直接、層211の出力として生成されてもよい。或いは、層211の出力に対して任意の処理を施した結果を飽和影響マップ203としてもよい。次に、飽和影響マップ203とぼけ画像201をチャンネル方向に連結して後続の層に入力し、複数の層(本実施例では畳み込み層16層)を介した結果、モデル出力204を生成する。モデル出力204も、層212の出力とぼけ画像201の要素ごとの和を取ることで生成されるが、構成はこれに限定されない。なお本実施例では、各層で3×3のフィルタ64種類(ただし、層211と層212は、フィルタ種類の数がぼけ画像201のチャンネル数と同数)との畳み込みを実行するが、構成はこれに限定されない。 In this embodiment, the saturation effect map 203 is obtained by summing the output of the layer 211 and the brightness saturation map 202 for each element, but the configuration is not limited to this. A saturation influence map may be generated directly as an output of layer 211 . Alternatively, the saturation effect map 203 may be the result of performing arbitrary processing on the output of the layer 211 . Next, the saturation effect map 203 and the blurred image 201 are concatenated in the channel direction and input to subsequent layers to generate the model output 204 as a result of passing through multiple layers (16 convolution layers in this embodiment). The model output 204 is also generated by taking the element-by-element sum of the output of the layer 212 and the blurred image 201, but the configuration is not limited to this. In this embodiment, convolution with 64 types of 3×3 filters is executed in each layer (the number of filter types in the layers 211 and 212 is the same as the number of channels of the blurred image 201). is not limited to

続いてステップS108において、更新部101dは、誤差関数に基づいて、機械学習モデルのウエイトを更新する。本実施例において、誤差関数は、飽和影響マップ203と飽和影響正解マップの誤差と、モデル出力204と正解モデル出力の誤差と、の重み付き和である。誤差の算出には、MSE(Mean Squared Error)を使用する。重みは両者1とする。ただし、誤差関数と重みはこれに限定されない。ウエイトの更新には、誤差逆伝搬法(Backpropagation)などを用いるとよい。また、誤差は残差成分に対してとってもよい。残差成分の場合、飽和影響マップ203と輝度飽和マップ202の差分成分と、飽和影響正解マップと輝度飽和マップ202の差分成分と、の誤差を用いる。同様に、モデル出力204とぼけ画像201の差分成分と、正解モデル出力とぼけ画像201の差分成分と、の誤差を用いる。 Subsequently, in step S108, the updating unit 101d updates the weight of the machine learning model based on the error function. In this example, the error function is the weighted sum of the error between the saturation influence map 203 and the correct saturation influence map and the error between the model output 204 and the correct model output. MSE (Mean Squared Error) is used to calculate the error. Both weights are set to 1. However, the error function and weights are not limited to this. For updating the weight, it is preferable to use an error back propagation method (Backpropagation) or the like. An error may also be taken for the residual component. In the case of the residual component, the error between the difference component between the saturation effect map 203 and the brightness saturation map 202 and the difference component between the saturation effect correct map and the brightness saturation map 202 is used. Similarly, the error between the difference component between the model output 204 and the blurred image 201 and the difference component between the correct model output and the blurred image 201 are used.

続いてステップS109において、更新部101dは、機械学習モデルの学習が完了したか否かを判定する。学習の完了は、ウエイトの更新の反復回数が既定の回数に達したかや、更新時のウエイトの変化量が既定値より小さいかなどによって、判定することができる。ステップS109にて学習が完了していないと判定された場合、ステップS101へ戻り、取得部101bは1枚以上の新たな原画像を取得する。一方、学習が完了したと判定された場合、更新部101dは学習を終了し、機械学習モデルの構成とウエイトの情報を記憶部101aに記憶する。 Subsequently, in step S109, the updating unit 101d determines whether learning of the machine learning model is completed. Completion of learning can be determined based on whether the number of weight update iterations has reached a predetermined number, whether the amount of weight change during updating is smaller than a predetermined value, and the like. If it is determined in step S109 that learning has not been completed, the process returns to step S101, and the acquisition unit 101b acquires one or more new original images. On the other hand, when it is determined that the learning has been completed, the updating unit 101d ends the learning, and stores the configuration and weight information of the machine learning model in the storage unit 101a.

以上の学習方法によって、機械学習モデルは、ぼけ画像(推定時には撮像画像)の輝度飽和した領域の被写体がぼけによって広がった信号値の大きさと範囲を表す飽和影響マップを推定することができる。飽和影響マップを明示的に推定することで、機械学習モデルは、飽和ぼけ像と非飽和ぼけ像それぞれに対するぼけの先鋭化を、適切な領域に実行できるようになるため、アーティファクトの発生が抑制される。 With the above learning method, the machine learning model can estimate a saturation effect map representing the magnitude and range of signal values spread by the blur of the subject in the luminance-saturated area of the blurred image (captured image when estimating). Explicitly estimating the saturation influence map enables the machine learning model to perform blur sharpening for each saturated and non-saturated blurred image in appropriate regions, thus reducing artifacts. be.

次に、図8を参照して、画像処理装置103で実行される、学習済みの機械学習モデルを用いた撮像画像のぼけ先鋭化に関して説明する。図8は、モデル出力の生成のフローチャートである。画像処理装置103は、記憶部103a、取得部103b、および先鋭化部103cを有し、図8の各ステップは、主に、画像処理装置103の各部により実行される。 Next, blur sharpening of a captured image using a learned machine learning model, which is executed by the image processing apparatus 103, will be described with reference to FIG. FIG. 8 is a flowchart of model output generation. The image processing apparatus 103 has a storage unit 103a, an acquisition unit 103b, and a sharpening unit 103c, and each step in FIG. 8 is mainly executed by each unit of the image processing apparatus 103.

まずステップS201において、取得部103bは、撮像画像と機械学習モデルを取得する。機械学習モデルの構成とウエイトの情報は、記憶部103aから取得される。 First, in step S201, the acquisition unit 103b acquires a captured image and a machine learning model. The configuration and weight information of the machine learning model are acquired from the storage unit 103a.

続いてステップS202において、先鋭化部(第1の生成手段)103cは、機械学習モデルを用いて、補正に関する情報を生成する。本実施例において、補正に関する情報は、撮像画像から、撮像画像のぼけが先鋭化されたぼけ先鋭化画像(モデル出力)である。なお、ぼけ先鋭化画像(撮像画像を補正した画像)ではなく、ぼけ先鋭化の補正成分でもよい。機械学習モデルは、学習時と同様に、図1に示される構成を有する。学習時と同様に、撮像画像の輝度飽和した領域を表す輝度飽和マップを生成して入力し、飽和影響マップとモデル出力を生成する。例として、図10(A)および図11(A)にぼけ先鋭化画像(撮像画像)、図10(B)および図11(B)に飽和影響マップを示す。図10(A)、(B)は、撮像画像の平均輝度値が明るいシーンである。図11(A)、(B)は、撮像画像の平均輝度値が暗いシーンである。なお、平均輝度値の算出方法については後述する。 Subsequently, in step S202, the sharpening unit (first generating means) 103c generates information regarding correction using a machine learning model. In this embodiment, the information about correction is a sharpened blur image (model output) obtained by sharpening the blur of the captured image. It should be noted that correction components for blur sharpening may be used instead of blur sharpening images (images obtained by correcting captured images). The machine learning model has the configuration shown in FIG. 1, as during learning. As in the case of learning, a luminance saturation map representing a luminance-saturated region of a captured image is generated and input, and a saturation influence map and model output are generated. As an example, FIGS. 10A and 11A show blurred sharpened images (captured images), and FIGS. 10B and 11B show saturation effect maps. FIGS. 10A and 10B are scenes in which the average luminance value of the captured image is bright. FIGS. 11A and 11B are scenes in which the average luminance value of the captured image is dark. A method for calculating the average luminance value will be described later.

次に、図9を参照して、画像処理装置103で実行される、撮像画像とモデル出力との合成に関して説明する。図9は、先鋭化の強度調整のフローチャートである。図9の各ステップは、主に、画像処理装置103の各部により実行される。 Next, with reference to FIG. 9, synthesis of a captured image and a model output, which is executed by the image processing apparatus 103, will be described. FIG. 9 is a flow chart of sharpening intensity adjustment. Each step in FIG. 9 is mainly executed by each unit of the image processing apparatus 103 .

まずステップS211において、取得部103bは、撮像画像から撮像状態を取得する。撮像状態とは、例えば、光学系102aの絞り値(F値)と、撮像素子102bの画素ピッチである。撮像画像における光芒とエアリーディスクの見え方は、光学系102aの絞り値と、撮像素子102bの画素ピッチに依存する。具体的には、光学系102aの絞り値が大きくなるほど、そして画素ピッチが小さくなるほど、光芒とエアリーディスクは目立つようになる。そのため、ステップS211にて取得した絞り値と画素ピッチに応じて、重みマップを生成する。 First, in step S211, the acquisition unit 103b acquires the imaging state from the captured image. The imaging state is, for example, the aperture value (F number) of the optical system 102a and the pixel pitch of the imaging device 102b. How the streak of light and the Airy disk appear in the captured image depends on the aperture value of the optical system 102a and the pixel pitch of the image sensor 102b. Specifically, the larger the aperture value of the optical system 102a and the smaller the pixel pitch, the more conspicuous the streak of light and the Airy disk become. Therefore, a weight map is generated according to the aperture value and pixel pitch obtained in step S211.

続いてステップS212において、取得部103bは、撮像画像の輝度値に関する情報を取得する。ここで、撮像画像の輝度値に関する情報とは、撮像画像の輝度値に関する統計量であって、撮像画像の輝度値の平均値、中央値、分散、またはヒストグラムの少なくとも一つである。また、撮像画像の輝度値に関する情報である撮像画像の輝度値に関する統計量は、撮像画像全体に関するものでもよいし、撮像画像を分割した領域毎の統計量を用いてもよい。 Subsequently, in step S212, the acquisition unit 103b acquires information about the luminance value of the captured image. Here, the information about the brightness value of the captured image is a statistic about the brightness value of the captured image, and is at least one of the average value, the median value, the variance, or the histogram of the brightness value of the captured image. In addition, the statistic regarding the brightness value of the captured image, which is information regarding the brightness value of the captured image, may be related to the entire captured image, or may be a statistic for each region obtained by dividing the captured image.

本実施例では、撮像画像の輝度値に関する情報として、撮像画像の平均輝度値を取得する。ただし、撮像画像の平均輝度値を取得する場合、撮像画像に飽和領域が多く存在すると、夜景のような暗い画像であっても平均輝度値としては大きい値が取得され、明るい画像であると判定される場合がある。したがって、撮像画像から飽和影響マップを除いた第2の画像の平均輝度値を取得することが好ましい。この場合、撮像画像の輝度値に関する情報は、撮像画像から飽和影響マップを除いた第2の画像の輝度値に関する統計量に基づいて生成される。第2の画像において、撮像画像で飽和していない領域の平均輝度値を取得することで、撮像画像が明るいシーンなのか暗いシーンなのかを適切に判定することができる。なお、飽和影響マップの使用は必須ではなく、飽和領域に関する情報であればよい。例えば、撮像画像の輝度飽和に関する撮像画像から輝度飽和マップを除いて第2の画像を生成してもよい。 In this embodiment, the average luminance value of the captured image is acquired as the information on the luminance value of the captured image. However, when obtaining the average luminance value of the captured image, if there are many saturated areas in the captured image, a large average luminance value is obtained even for a dark image such as a night scene, and the image is determined to be bright. may be Therefore, it is preferable to obtain the average luminance value of the second image from which the saturation influence map is removed from the captured image. In this case, the information about the brightness value of the captured image is generated based on the statistic about the brightness value of the second image obtained by removing the saturation influence map from the captured image. By acquiring the average luminance value of the area not saturated in the captured image in the second image, it is possible to appropriately determine whether the captured image is a bright scene or a dark scene. It should be noted that the use of the saturation influence map is not essential, and any information relating to the saturation region may be used. For example, the second image may be generated by removing the luminance saturation map from the captured image regarding the luminance saturation of the captured image.

続いてステップS213において、先鋭化部103cは、光学系102aの絞り値に関する情報と撮像画像の輝度値に関する情報とに基づいて、重みマップを生成する。本実施例において、光学系102aの絞り値がF22(所定の絞り値)以上、かつ撮像素子102bの画素ピッチが6μm(所定の画素ピッチ)未満の場合、先鋭化部103cは強度調整を実行する。その他の場合、先鋭化部103cは、撮像画像の重みが全て0になる重みマップを生成する。または、重みマップを生成せずにステップS212~S215の処理を省略してもよい。なお、強度調整を実行する絞り値(所定の絞り値)と画素ピッチの閾値(所定の画素ピッチ)は、任意の数値に決定が可能である。例えば、光学系102aの絞り値がF16以上、かつ撮像素子102bの画素ピッチが4μm未満の場合に強度調整を実行してもよい。なお本実施例において、重みマップは、画素ピッチを考慮することなく、絞り値に基づいて生成されてもよい。 Subsequently, in step S213, the sharpening unit 103c generates a weight map based on the information regarding the aperture value of the optical system 102a and the information regarding the luminance value of the captured image. In this embodiment, when the aperture value of the optical system 102a is F22 (predetermined aperture value) or more and the pixel pitch of the image sensor 102b is less than 6 μm (predetermined pixel pitch), the sharpening unit 103c performs intensity adjustment. . In other cases, the sharpening unit 103c generates a weight map in which the weights of the captured images are all zero. Alternatively, the processing of steps S212 to S215 may be omitted without generating the weight map. Note that the aperture value (predetermined aperture value) and the pixel pitch threshold (predetermined pixel pitch) for performing intensity adjustment can be determined to be arbitrary numerical values. For example, intensity adjustment may be performed when the aperture value of the optical system 102a is F16 or more and the pixel pitch of the image sensor 102b is less than 4 μm. Note that in this embodiment, the weight map may be generated based on the aperture value without considering the pixel pitch.

また本実施例において、強度調整は、所定の絞り値(例えばF22)を基準として実行されるか否かに限定されるものではない。例えば、絞り値に基づいて撮像画像の重みが連続的に(段階的に)変化する重みマップを用いてもよい。すなわち、絞り値が、第1の絞り値、または第1の絞り値よりも大きい第2の絞り値に設定可能である場合、重みマップは、第1の絞り値よりも第2の絞り値のほうが撮像画像の重みが大きいデータである。 Further, in this embodiment, the intensity adjustment is not limited to whether or not it is performed with reference to a predetermined aperture value (for example, F22). For example, a weight map may be used in which the weight of the captured image changes continuously (stepwise) based on the aperture value. That is, if the aperture value can be set to the first aperture value or to a second aperture value that is larger than the first aperture value, the weight map will be set to the second aperture value rather than the first aperture value. The weight of the captured image is higher in the data.

次に、輝度値に基づく重みマップについて説明する。本実施例において、重みマップは、輝度値が小さいほど撮像画像の重みが大きいデータである。例えば、撮像画像の輝度値に関する情報として撮像画像の平均輝度値を用いる場合、平均輝度値が小さいほど、撮像画像の重みが大きくなるようにする。具体的には、平均輝度値に対する重みマップの重みとの関係を一次関数として保持しておき、撮像画像の平均輝度値に応じた重みを取得して、重みマップを生成する。 Next, a weight map based on luminance values will be described. In this embodiment, the weight map is data in which the smaller the luminance value, the larger the weight of the captured image. For example, when the average luminance value of the captured image is used as the information about the luminance value of the captured image, the smaller the average luminance value, the greater the weight of the captured image. Specifically, the relationship between the average brightness value and the weight of the weight map is held as a linear function, the weight corresponding to the average brightness value of the captured image is obtained, and the weight map is generated.

例えば、図12に示されるような関係式から取得された、平均輝度値に対応する撮像画像の重みを用いる。図12は重みマップの説明図であり、横軸は平均輝度値、縦軸は撮像画像の重みをそれぞれ示す。ただし、平均輝度値に対する重みマップの調整値との関係はこれに限定されない。図12は未現像のRAW画像における平均輝度値を示すが、現像後の平均輝度値を使用してもよい。RAW画像における平均輝度値を算出する際は、撮像素子102bにおけるオプティカルブラック領域における信号値を減算してから平均輝度値を算出することが好ましい。これにより、ISO感度や撮像素子102bに依存しない平均輝度値の算出が可能となる。また、平均輝度値を、撮像画像を分割した領域毎に取得した場合、各領域の平均輝度値から重みを取得して、重みマップを生成してよい。この詳細は、実施例2において後述する。 For example, the weight of the captured image corresponding to the average luminance value obtained from the relational expression shown in FIG. 12 is used. FIG. 12 is an explanatory diagram of the weight map, in which the horizontal axis indicates the average luminance value and the vertical axis indicates the weight of the captured image. However, the relationship between the weight map adjustment value and the average luminance value is not limited to this. Although FIG. 12 shows average luminance values in an undeveloped RAW image, average luminance values after development may be used. When calculating the average luminance value in the RAW image, it is preferable to calculate the average luminance value after subtracting the signal value in the optical black area in the image sensor 102b. This makes it possible to calculate an average luminance value that does not depend on the ISO sensitivity or the image sensor 102b. Further, when the average luminance value is obtained for each region obtained by dividing the captured image, a weight may be obtained from the average luminance value of each region to generate a weight map. Details of this will be described later in the second embodiment.

なお、撮像画像の信号値に関する統計量として、撮像画像の輝度値の平均値、中央値、分散、またはヒストグラムを取得した場合にも、統計量が小さいほど撮像画像の重みが大きくなるように、重みマップを生成する。例えば、撮像画像の輝度値のヒストグラムを用いる場合、ヒストグラムの重心やピークが小さいほど撮像画像の重みが大きくなるように、重みマップを生成する。 Note that even when the average value, median value, variance, or histogram of the luminance values of the captured image is obtained as the statistic regarding the signal value of the captured image, the smaller the statistic, the greater the weight of the captured image. Generate a weight map. For example, when using a histogram of luminance values of a captured image, a weight map is generated such that the smaller the center of gravity or peak of the histogram, the greater the weight of the captured image.

続いて、図9のステップS214において、先鋭化部103cは、撮像画像の飽和領域に関する情報に基づいて重みマップを調整する。本実施例において、飽和領域に関する情報は飽和影響マップであり、RGBの全てが飽和していなくてもよい。また、飽和影響マップは、設定した信号値で0から1に規格化し、これを重みマップの調整に使用する。具体的には、ステップS213にて生成された重みマップに規格化後の重みマップを適用(乗算)する。これにより、飽和領域影響にステップS213で生成した重みマップの重みが作用することになり、光芒とエアリーディスクが目立ちやすい飽和影響領域のみ強度調整が可能になる。なお、飽和影響マップの適用は必須ではなく、撮像画像全体を強度調整の対象としてもよい。飽和影響マップを使用することで、飽和影響領域まで補正強度の調整が可能となる。なお、飽和影響マップではなく、輝度飽和マップでもいいし、輝度飽和マップを像高ごとにぼかしたものを使用してもよい。 Subsequently, in step S214 of FIG. 9, the sharpening unit 103c adjusts the weight map based on the information regarding the saturated region of the captured image. In this example, the information about the saturated region is a saturation influence map, and not all of the RGB may be saturated. Also, the saturation influence map is normalized from 0 to 1 by the set signal value, and this is used for adjustment of the weight map. Specifically, the normalized weight map is applied (multiplied) to the weight map generated in step S213. As a result, the weight of the weight map generated in step S213 acts on the saturation area influence, and intensity adjustment is possible only for the saturation influence area where the light streak and Airy disk are conspicuous. Note that application of the saturation influence map is not essential, and the entire captured image may be subject to intensity adjustment. Using a saturation influence map allows adjustment of the correction strength up to the saturation influence region. A luminance saturation map may be used instead of the saturation influence map, or a luminance saturation map obtained by blurring each image height may be used.

例として、図13(A)、(B)に最終的な重みマップを示す。本実施例において、重みマップは、画素値が大きいほど撮像画像の重みが大きく、画素値が小さいほど撮像画像の重みが小さい。図13(A)は、平均輝度値の明るいシーンを示し、図13(B)は平均輝度値の暗いシーンを示す。弊害の目立ちやすい領域である、図13(B)の飽和影響領域において、撮像画像の重みが大きい。 As an example, FIGS. 13A and 13B show final weight maps. In this embodiment, in the weight map, the larger the pixel value, the larger the weight of the captured image, and the smaller the pixel value, the smaller the weight of the captured image. FIG. 13A shows a scene with a bright average luminance value, and FIG. 13B shows a scene with a dark average luminance value. In the saturation effect region of FIG. 13B, which is a region in which adverse effects are more noticeable, the weight of the captured image is large.

重みマップは、さらに撮像画像の撮像に用いた光学系の光学性能に関する情報に基づいて生成されることが好ましい。具体的には、光学性能が低い場合には撮像画像の重みを上げ、光学性能が高い場合には撮像画像の重みを下げる。光学性能に関する情報とは、撮像画像の撮像時のズーム位置、絞り径、または被写体距離の少なくとも一つと、光学系の像高ごとのPSFの信号値の大きさと範囲とに基づいて算出することができる。なお、PSFを用いることは必須ではなく、光学性能に関する情報であればよい。例えば、光学伝達関数を用いてもよい。 Preferably, the weight map is further generated based on information regarding the optical performance of the optical system used to capture the captured image. Specifically, when the optical performance is low, the weight of the captured image is increased, and when the optical performance is high, the weight of the captured image is decreased. The information about the optical performance can be calculated based on at least one of the zoom position, the aperture diameter, or the object distance when the captured image is captured, and the magnitude and range of the signal value of the PSF for each image height of the optical system. can. It should be noted that the use of the PSF is not essential, and any information relating to optical performance may be used. For example, an optical transfer function may be used.

続いて、図9のステップS215において、先鋭化部(第2の生成手段)103cは、ステップS214にて生成された重みマップを用いて、撮像画像とぼけ先鋭化画像を加重平均(合成)し、強度調整画像205を生成する。 Subsequently, in step S215 in FIG. 9, the sharpening unit (second generating means) 103c uses the weight map generated in step S214 to perform a weighted average (synthesis) of the captured image and the blurred sharpened image, An intensity adjusted image 205 is generated.

以上の構成により、本実施例によれば、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理システムを提供することができる。 With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of maintaining the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image. can.

次に、本発明の実施例2における画像処理システムに関して説明する。本実施例では、平均輝度値を、撮像画像を分割した領域毎に取得し、各領域で平均輝度値に応じた重みを取得して、重みマップを生成する。図14は、本実施例における画像処理システム300のブロック図である。図15は、画像処理システム300の外観図である。画像処理システム300は、学習装置301、撮像装置302、および画像処理装置303を有する。学習装置301と画像処理装置303、画像処理装置303と撮像装置302はそれぞれ、有線または無線のネットワークで接続される。 Next, an image processing system according to Embodiment 2 of the present invention will be described. In this embodiment, an average brightness value is obtained for each region obtained by dividing the captured image, and a weight corresponding to the average brightness value is obtained for each region to generate a weight map. FIG. 14 is a block diagram of the image processing system 300 in this embodiment. FIG. 15 is an external view of the image processing system 300. As shown in FIG. The image processing system 300 has a learning device 301 , an imaging device 302 and an image processing device 303 . The learning device 301 and the image processing device 303, and the image processing device 303 and the imaging device 302 are connected by a wired or wireless network.

撮像装置302は、光学系321、撮像素子322、記憶部323、通信部324、および表示部325を有する。撮像画像は、通信部324を介して画像処理装置303へ送信される。画像処理装置303は、通信部332を介して撮像画像を受信し、記憶部331に記憶された機械学習モデルの構成とウエイトの情報を用いて、ぼけ先鋭化を行う。機械学習モデルの構成とウエイトの情報は、学習装置301によって学習されたものであり、予め学習装置301から取得され、記憶部331に記憶されている。さらに、画像処理装置303は、ぼけ先鋭化の強度を調整する機能を有する。撮像画像のぼけが先鋭化されたぼけ先鋭化画像(モデル出力)および強度が調整された強度調整画像は、撮像装置302に送信され、記憶部323に記憶、表示部325に表示される。 The imaging device 302 has an optical system 321 , an imaging element 322 , a storage section 323 , a communication section 324 and a display section 325 . The captured image is transmitted to the image processing device 303 via the communication unit 324 . The image processing apparatus 303 receives the captured image via the communication unit 332 and sharpens the blur using the machine learning model configuration and weight information stored in the storage unit 331 . The configuration of the machine learning model and the weight information are learned by the learning device 301 , are obtained from the learning device 301 in advance, and are stored in the storage unit 331 . Furthermore, the image processing device 303 has a function of adjusting the intensity of blur sharpening. The sharpened blur image (model output) in which the blur of the captured image is sharpened and the intensity-adjusted image in which the intensity is adjusted are transmitted to the imaging device 302 , stored in the storage unit 323 , and displayed on the display unit 325 .

学習装置301で行う学習データの生成とウエイトの学習(学習フェーズ)と画像処理装置303で実行される、なお、学習済みの機械学習モデルを用いた撮像画像のぼけ先鋭化(推定フェーズ)は実施例1と同様のため、省略する。 Learning data generation and weight learning (learning phase) performed by the learning device 301, and blur sharpening (estimation phase) of the captured image using the learned machine learning model performed by the image processing device 303 are performed. Since it is the same as Example 1, it is omitted.

次に、図16を参照して、画像処理装置303で実行される、撮像画像とモデル出力の合成に関して説明する。図16は、先鋭化の強度調整のフローチャートである。図16の各ステップは、主に、画像処理装置303の各部により実行される。 Next, with reference to FIG. 16, synthesis of a captured image and a model output, which is executed by the image processing device 303, will be described. FIG. 16 is a flowchart of sharpening intensity adjustment. Each step in FIG. 16 is mainly executed by each unit of the image processing apparatus 303 .

まずステップS311において、取得部333は、撮像画像から撮像状態を取得する。撮像状態は、撮像装置302における光学系321の絞り値、および撮像素子322の画素ピッチの状態を含むが、これらに限定されるものではない。本実施例において、光学系321の絞り値がF16以上、かつ撮像素子322の画素ピッチが4μm以上の場合に強度調整を実行する。その他の場合、後述する重みマップの生成において、撮像画像の重みが全て0になる重みマップを生成し、強度調整を実行しない。または、重みマップを生成せずにステップS312~S314の処理を省略してもよい。 First, in step S311, the acquisition unit 333 acquires the imaging state from the captured image. The imaging state includes, but is not limited to, the aperture value of the optical system 321 in the imaging device 302 and the state of the pixel pitch of the imaging device 322 . In this embodiment, the intensity adjustment is performed when the aperture value of the optical system 321 is F16 or more and the pixel pitch of the imaging element 322 is 4 μm or more. In other cases, in generating a weight map to be described later, a weight map is generated in which the weights of the captured images are all 0, and intensity adjustment is not performed. Alternatively, the processing of steps S312 to S314 may be omitted without generating the weight map.

続いてステップS312において、取得部333は、撮像画像の輝度値に関する情報を取得する。本実施例では、平均輝度値を、撮像画像を分割した領域毎に取得し、各領域で平均輝度値に応じた重みを取得して、重みマップを生成する。図17(A)、(B)は重みマップの説明図であり、図17(A)は撮像画像、図17(B)は領域毎の平均輝度値をそれぞれ示す。図17(B)において、2001は平均輝度値の低い領域、2002は平均輝度値の高い領域、2003は平均輝度値の中間領域である。 Subsequently, in step S312, the acquisition unit 333 acquires information about the luminance value of the captured image. In this embodiment, an average brightness value is obtained for each region obtained by dividing the captured image, and a weight corresponding to the average brightness value is obtained for each region to generate a weight map. 17A and 17B are explanatory diagrams of weight maps, FIG. 17A showing a captured image, and FIG. 17B showing an average luminance value for each area. In FIG. 17B, 2001 is a low average brightness value area, 2002 is a high average brightness value area, and 2003 is an intermediate average brightness value area.

続いて、図16のステップS313において、先鋭化部334は、光学系321の絞り値と撮像画像の輝度値に関する情報とに基づいて、重みマップを生成する。なお、重みマップの生成方法は実施例1と同様のため、その説明を省略する。続いてステップS314において、先鋭化部334は、ステップS312にて生成された重みマップを用いて、撮像画像とぼけ先鋭化画像(モデル出力)を加重平均(合成)し、強度調整画像205を生成する。 Subsequently, in step S313 of FIG. 16, the sharpening unit 334 generates a weight map based on the aperture value of the optical system 321 and the information on the brightness value of the captured image. Note that the method of generating the weight map is the same as that of the first embodiment, so the description thereof will be omitted. Subsequently, in step S314, the sharpening unit 334 uses the weight map generated in step S312 to perform a weighted average (synthesis) of the captured image and the blurred sharpened image (model output) to generate the intensity adjusted image 205. .

以上の構成により、本実施例によれば、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理システムを提供することができる。 With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of maintaining the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image. can.

次に、本発明の実施例3における画像処理システムに関して説明する。図18は、本実施例における画像処理システム400のブロック図である。図19は、画像処理システム400の外観図である。画像処理システム400は、学習装置401、レンズ装置402、撮像装置403、制御装置(第1の装置)404、画像推定装置(第2の装置)405、およびネットワーク406、407を有する。 Next, an image processing system in Example 3 of the present invention will be described. FIG. 18 is a block diagram of an image processing system 400 in this embodiment. FIG. 19 is an external view of the image processing system 400. As shown in FIG. The image processing system 400 has a learning device 401 , a lens device 402 , an imaging device 403 , a control device (first device) 404 , an image estimation device (second device) 405 , and networks 406 and 407 .

学習装置401および画像推定装置405はそれぞれ、例えばサーバである。制御装置404は、パーソナルコンピュータやモバイル端末などのユーザが操作する機器である。学習装置401は、記憶部401a、取得部401b、演算部401c、および更新部401dを有し、レンズ装置402と撮像装置403を用いて撮像された撮像画像からぼけの先鋭化をする機械学習モデルのウエイトを学習する。なお、学習方法、すなわち学習装置401で行う学習データの生成とウエイトの学習(学習フェーズ)は、実施例1と同様のため省略する。 Each of the learning device 401 and the image estimation device 405 is, for example, a server. A control device 404 is a device operated by a user such as a personal computer or a mobile terminal. The learning device 401 has a storage unit 401a, an acquisition unit 401b, a calculation unit 401c, and an update unit 401d, and is a machine learning model for sharpening blur from an image captured using the lens device 402 and the imaging device 403. learn the weights of Note that the learning method, that is, the generation of learning data and the learning of weights (learning phase) performed by the learning device 401 are the same as those in the first embodiment, and therefore will be omitted.

撮像装置403は撮像素子403aを有し、撮像素子403aがレンズ装置402の形成した光学像を光電変換して撮像画像を取得する。レンズ装置402と撮像装置403とは着脱可能であり、互いに複数種類と組み合わることが可能である。制御装置404は、通信部404a、表示部404b、記憶部404c、および取得部404dを有し、有線または無線で接続された撮像装置403から取得した撮像画像に対して、実行する処理をユーザの操作に従って制御する。或いは、撮像装置403で撮像した撮像画像を予め記憶部404cに記憶しておき、撮像画像を読み出してもよい。 The imaging device 403 has an imaging device 403a, and the imaging device 403a photoelectrically converts an optical image formed by the lens device 402 to obtain a captured image. The lens device 402 and the imaging device 403 are detachable and can be combined with each other. The control device 404 includes a communication unit 404a, a display unit 404b, a storage unit 404c, and an acquisition unit 404d. Control according to the operation. Alternatively, the captured image captured by the imaging device 403 may be stored in the storage unit 404c in advance, and the captured image may be read.

画像推定装置405は、通信部405a、取得部405b、記憶部405c、および先鋭化部405dを有し、制御装置404と通信可能に構成されている。画像推定装置405は、ネットワーク406を介して接続された制御装置404の要求に応じて、撮像画像のぼけの先鋭化処理を実行する。画像推定装置405は、ネットワーク406を介して接続された学習装置401から、学習済みのウエイトの情報をぼけ先鋭化の推定時または予め取得し、撮像画像のぼけ先鋭化の推定に用いる。ぼけ先鋭化の推定後の推定画像は、先鋭化の強度調整が行われた後に再び制御装置404へ伝送されて、記憶部404cに記憶され、表示部404bに表示される。 The image estimation device 405 has a communication unit 405a, an acquisition unit 405b, a storage unit 405c, and a sharpening unit 405d, and is configured to communicate with the control device 404. FIG. The image estimating device 405 executes blur sharpening processing of the captured image in response to a request from the control device 404 connected via the network 406 . The image estimating device 405 acquires learned weight information from the learning device 401 connected via the network 406 at the time of estimating blur sharpening or in advance, and uses it for estimating blur sharpening of the captured image. The estimated image after estimating blur sharpening is transmitted to the control device 404 again after sharpening intensity adjustment, stored in the storage unit 404c, and displayed on the display unit 404b.

次に、図20を参照して、制御装置404と画像推定装置405で実行される撮像画像のぼけ先鋭化に関して説明する。図20は、モデル出力および先鋭化の強度調整のフローチャートである。図20の各ステップは、主に、制御装置404または画像推定装置405の各部により実行される。 Next, with reference to FIG. 20, blur sharpening of the captured image executed by the control device 404 and the image estimation device 405 will be described. FIG. 20 is a flowchart of model output and sharpening intensity adjustment. Each step in FIG. 20 is mainly executed by each part of the control device 404 or the image estimation device 405 .

まずステップS401において、制御装置404の取得部404dは、撮像画像とユーザが指定した先鋭化の強度を取得する。続いてステップS402において、通信部(送信手段)404aは、画像推定装置405へ撮像画像とぼけ先鋭化の推定処理の実行に関する要求を送信する。 First, in step S401, the acquisition unit 404d of the control device 404 acquires the captured image and the sharpening intensity specified by the user. Subsequently, in step S<b>402 , the communication unit (transmitting means) 404 a transmits to the image estimating device 405 a request regarding execution of the captured image and blur sharpening estimation processing.

続いてステップS403において、画像推定装置405の通信部(受信手段)405aは、制御装置404から送信された撮像画像と処理の要求を受信し、取得する。続いてステップS404において、取得部405bは、撮像画像に対応する学習済みのウエイトの情報を記憶部405cから取得する。ウエイトの情報は、予め記憶部401aから読み出され、記憶部405cに記憶されている。続いてステップS405において、先鋭化部405dは、機械学習モデルを用いて、撮像画像から、撮像画像のぼけが先鋭化されたぼけ先鋭化画像(モデル出力)を生成する。機械学習モデルは、学習時と同様に、図1に示される構成を有する。学習時と同様に、撮像画像の輝度飽和した領域を表す輝度飽和マップを生成して入力し、飽和影響マップとモデル出力を生成する。 Subsequently, in step S403, the communication unit (receiving means) 405a of the image estimation device 405 receives and acquires the captured image and the processing request transmitted from the control device 404. FIG. Subsequently, in step S404, the acquisition unit 405b acquires the learned weight information corresponding to the captured image from the storage unit 405c. The weight information is read in advance from the storage unit 401a and stored in the storage unit 405c. Subsequently, in step S405, the sharpening unit 405d uses a machine learning model to generate a blurred sharpened image (model output) in which the blur of the captured image is sharpened from the captured image. The machine learning model has the configuration shown in FIG. 1, as during learning. As in the case of learning, a luminance saturation map representing a luminance-saturated region of a captured image is generated and input, and a saturation influence map and model output are generated.

続いてステップS406において、先鋭化部405dは、重みマップを生成する。重みマップの生成方法は、実施例1と同様である。ユーザが指定した先鋭化の強度に合わせて、デフォルトの重みマップを調整する。なお、事前に調整済みの重みマップを強度調整可能な範囲で保持しておいてもよい。続いてステップS407において、先鋭化部405dは、重みマップに基づいて、撮像画像とぼけ先鋭化画像(モデル出力)とを合成する。続いてステップS408において、通信部405aは、合成画像を制御装置404へ送信する。続いてステップS409において、制御装置404の通信部404aは、画像推定装置405から送信された推定画像を取得する。 Subsequently, in step S406, the sharpening unit 405d generates a weight map. The weight map generation method is the same as in the first embodiment. Adjust the default weight map for the user-specified sharpening strength. Note that a pre-adjusted weight map may be held within a range in which the intensity can be adjusted. Subsequently, in step S407, the sharpening unit 405d synthesizes the captured image and the blurred sharpened image (model output) based on the weight map. Subsequently, in step S408, the communication unit 405a transmits the composite image to the control device 404. FIG. Subsequently, in step S<b>409 , the communication unit 404 a of the control device 404 acquires the estimated image transmitted from the image estimation device 405 .

以上の構成により、本実施例によれば、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理システムを提供することができる。
(その他の実施例)
本発明は、上述の実施例の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。そして、画像処理装置は本発明の画像処理機能を有する装置であれば足り、撮像装置やPCの形態で実現可能である。
With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of maintaining the blur correction effect while suppressing the adverse effects caused by the aperture value of the optical system and the luminance value of the captured image. can.
(Other examples)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in the computer of the system or apparatus reads and executes the program. It can also be realized by processing to It can also be implemented by a circuit (for example, ASIC) that implements one or more functions. The image processing apparatus is sufficient as long as it has the image processing function of the present invention, and can be implemented in the form of an imaging apparatus or a PC.

各実施例によれば、光学系の絞り値と撮像画像の輝度値に起因する弊害を抑制しつつ、ぼけの補正効果を保つことが可能な画像処理方法、画像処理装置、画像処理プログラム、および、記憶媒体を提供することができる。 According to each embodiment, an image processing method, an image processing apparatus, an image processing program, and an image processing method capable of maintaining blur correction effects while suppressing adverse effects caused by the aperture value of an optical system and the brightness value of a captured image. , can provide a storage medium.

以上、本発明の好ましい実施例について説明したが、本発明はこれらの実施例に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。 Although preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments, and various modifications and changes are possible within the scope of the gist.

103 画像処理装置
103c 先鋭化部(第1の生成手段、第2の生成手段)
103 Image processing device 103c sharpening unit (first generating means, second generating means)

Claims (16)

撮像画像に基づいて該撮像画像の補正に関する情報を生成する工程と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する工程と、を有し、
前記重みマップは、前記撮像画像の撮像に用いた光学系の絞り値に関する情報と、前記撮像画像の輝度値に関する情報とに基づいて生成されることを特徴とする画像処理方法。
generating information about correction of the captured image based on the captured image;
generating an intensity-adjusted image based on the captured image, the information about the correction, and a weight map;
An image processing method, wherein the weight map is generated based on information regarding an aperture value of an optical system used to capture the captured image and information regarding a luminance value of the captured image.
前記重みマップは、前記撮像画像における飽和領域に関する情報に基づいて生成されることを特徴とする請求項1に記載の画像処理方法。 2. The image processing method according to claim 1, wherein said weight map is generated based on information regarding a saturated region in said captured image. 前記飽和領域に関する情報は、前記撮像画像の前記飽和領域の被写体が、撮像時のぼけによって広がった信号値の大きさと範囲を表す飽和影響マップであることを特徴とする請求項2に記載の画像処理方法。 3. The image according to claim 2, wherein the information about the saturated region is a saturation effect map representing the magnitude and range of signal values spread by the subject in the saturated region of the captured image due to blurring during imaging. Processing method. 前記飽和影響マップは、機械学習モデルで生成されることを特徴とする請求項3に記載の画像処理方法。 4. The image processing method of claim 3, wherein the saturation influence map is generated with a machine learning model. 前記重みマップは、前記撮像画像の撮像に用いた光学系の光学性能に関する情報に基づいて生成されることを特徴とする請求項1乃至4のいずれか一項に記載の画像処理方法。 5. The image processing method according to claim 1, wherein the weight map is generated based on information regarding optical performance of an optical system used to capture the captured image. 前記光学性能に関する情報は、前記撮像画像の撮像時のズーム位置、前記絞り値、または被写体距離の少なくとも一つと、前記光学系の像高ごとの点像分布関数の信号値の大きさと範囲とに基づいて算出されることを特徴とする請求項5に記載の画像処理方法。 The information about the optical performance includes at least one of the zoom position of the captured image, the aperture value, or the subject distance, and the magnitude and range of the signal value of the point spread function for each image height of the optical system. 6. The image processing method according to claim 5, wherein the calculation is performed based on 前記補正に関する情報は、前記撮像画像を補正した画像、または補正成分であることを特徴とする請求項1乃至6のいずれか一項に記載の画像処理方法。 7. The image processing method according to claim 1, wherein the information about the correction is an image obtained by correcting the captured image or a correction component. 前記補正は、前記撮像画像の高解像化、または前記撮像画像のデフォーカスぼけの形状変換であることを特徴とする請求項1乃至7のいずれか一項に記載の画像処理方法。 8. The image processing method according to any one of claims 1 to 7, wherein the correction is to increase the resolution of the captured image or to transform the shape of defocus blur of the captured image. 前記撮像画像の輝度値に関する情報は、前記撮像画像から前記飽和影響マップを除いた第2の画像の輝度値に関する統計量に基づいて生成されることを特徴とする請求項3または4に記載の画像処理方法。 5. The method according to claim 3, wherein the information about the brightness value of the captured image is generated based on statistics about the brightness value of a second image obtained by removing the saturation effect map from the captured image. Image processing method. 前記統計量は、平均値、中央値、分散、またはヒストグラムのうち少なくとも一つであることを特徴とする請求項9に記載の画像処理方法。 10. The image processing method according to claim 9, wherein said statistic is at least one of an average value, a median value, a variance, or a histogram. 前記重みマップは、前記輝度値が小さいほど前記撮像画像の重みが大きいデータであることを特徴とする請求項1乃至8のいずれか一項に記載の画像処理方法。 9. The image processing method according to any one of claims 1 to 8, wherein the weight map is data in which the smaller the luminance value, the larger the weight of the captured image. 前記重みマップは、前記第2の画像における平均輝度値が小さいほど前記撮像画像の重みが大きいデータであることを特徴とする請求項9または10に記載の画像処理方法。 11. The image processing method according to claim 9 or 10, wherein the weight map is data in which the smaller the average brightness value in the second image, the larger the weight of the captured image. 前記絞り値は、第1の絞り値、または前記第1の絞り値よりも大きい第2の絞り値に設定可能であり、
前記重みマップは、前記第1の絞り値よりも前記第2の絞り値のほうが前記撮像画像の重みが大きいデータであることを特徴とする請求項1乃至12のいずれか一項に記載の画像処理方法。
The aperture value can be set to a first aperture value or a second aperture value larger than the first aperture value,
13. The image according to any one of claims 1 to 12, wherein the weight map is data in which the weight of the captured image is greater at the second aperture value than at the first aperture value. Processing method.
撮像画像に基づいて該撮像画像の補正に関する情報を生成する第1の生成手段と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する第2の生成手段と、を有し、
前記重みマップは、前記撮像画像の撮像に用いた光学系の絞り値に関する情報と、前記撮像画像の輝度値に関する情報とに基づいて生成されることを特徴とする画像処理装置。
a first generating means for generating information regarding correction of the captured image based on the captured image;
a second generation means for generating an intensity-adjusted image based on the captured image, the information about the correction, and the weight map;
The image processing apparatus, wherein the weight map is generated based on information regarding an aperture value of an optical system used to capture the captured image and information regarding a luminance value of the captured image.
互いに通信可能な第1の装置と第2の装置とを有する画像処理システムであって、
前記第1の装置は、撮像画像に対する処理の実行に関する要求を前記第2の装置へ送信する送信手段を有し、
前記第2の装置は、
前記要求を受信する受信手段と、
撮像画像に基づいて該撮像画像の補正に関する情報を生成する第1の生成手段と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する第2の生成手段と、を有し、
前記重みマップは、前記撮像画像の撮像に用いた光学系の絞り値に関する情報と、前記撮像画像の輝度値に関する情報とに基づいて生成されることを特徴とする画像処理システム。
An image processing system having a first device and a second device communicable with each other,
The first device has transmission means for transmitting a request for executing processing on the captured image to the second device,
The second device is
receiving means for receiving the request;
a first generating means for generating information regarding correction of the captured image based on the captured image;
a second generation means for generating an intensity-adjusted image based on the captured image, the information about the correction, and the weight map;
The image processing system, wherein the weight map is generated based on information regarding an aperture value of an optical system used to capture the captured image and information regarding a luminance value of the captured image.
請求項1乃至13のいずれか一項に記載の画像処理方法をコンピュータに実行させることを特徴とするプログラム。 A program that causes a computer to execute the image processing method according to any one of claims 1 to 13.
JP2022005803A 2022-01-18 2022-01-18 Image processing method, image processing apparatus, image processing system, and program Pending JP2023104667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022005803A JP2023104667A (en) 2022-01-18 2022-01-18 Image processing method, image processing apparatus, image processing system, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022005803A JP2023104667A (en) 2022-01-18 2022-01-18 Image processing method, image processing apparatus, image processing system, and program

Publications (1)

Publication Number Publication Date
JP2023104667A true JP2023104667A (en) 2023-07-28

Family

ID=87379588

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022005803A Pending JP2023104667A (en) 2022-01-18 2022-01-18 Image processing method, image processing apparatus, image processing system, and program

Country Status (1)

Country Link
JP (1) JP2023104667A (en)

Similar Documents

Publication Publication Date Title
US11188777B2 (en) Image processing method, image processing apparatus, learnt model manufacturing method, and image processing system
CN110858871B (en) Image processing method, image processing apparatus, imaging apparatus, lens apparatus, storage medium, and image processing system
US10410327B2 (en) Shallow depth of field rendering
US11508038B2 (en) Image processing method, storage medium, image processing apparatus, learned model manufacturing method, and image processing system
US20210319537A1 (en) Image processing method, image processing apparatus, image processing system, and memory medium
KR20070097550A (en) Electronic device and method in an electronic device for processing image data
Chang et al. Beyond camera motion blur removing: How to handle outliers in deblurring
JP2023055848A (en) Image processing method, image processing apparatus, image processing system, and program
JP2017103756A (en) Image data processing apparatus and method
JP2023104667A (en) Image processing method, image processing apparatus, image processing system, and program
JP7225316B2 (en) Image processing method, image processing apparatus, image processing system, and program
JP2023088349A (en) Image processing method, image processing apparatus, image processing system, and program
JP7451443B2 (en) Image processing method and device, machine learning model training method and device, and program
JP2021189929A (en) Image processing method, program, image processing device and image processing system
JP6487008B1 (en) High resolution imaging device
WO2022215375A1 (en) Image processing method, method for producing machine learning model, image processing device, image processing system, and program
WO2024029224A1 (en) Image processing method, image processing device, program, and image processing system
JP2024059927A (en) Image processing method, device, and program
JP2022121775A (en) Image processing method, program, image processing apparatus, and method for manufacturing learned model
JP2024038523A (en) Image processing method, learned model manufacturing method, program, and image processing device
JP2023069527A (en) Image processing device and image processing method
JP2021190814A (en) Learning method, image processing method, and program