JP2023088349A - 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
JP2023088349A
JP2023088349A JP2021202983A JP2021202983A JP2023088349A JP 2023088349 A JP2023088349 A JP 2023088349A JP 2021202983 A JP2021202983 A JP 2021202983A JP 2021202983 A JP2021202983 A JP 2021202983A JP 2023088349 A JP2023088349 A JP 2023088349A
Authority
JP
Japan
Prior art keywords
image
strength
correction
image processing
information
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
JP2021202983A
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 JP2021202983A priority Critical patent/JP2023088349A/en
Publication of JP2023088349A publication Critical patent/JP2023088349A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

To provide an image processing method for properly adjusting correction strength in accordance with settings configured by a user, in a regression task using machine learning on a blurred image, an image processing apparatus, an image processing system, and a program.SOLUTION: An image processing method includes: a step of inputting a captured image into a machine learning model to generate information on correction; a step of generating a strength-adjusted image on the basis of, the captured image, the correction information, and a weight map; and a step of adjusting correction strength of the strength-adjusted image by modifying the weight map on the basis of the set strength. The correction strength includes first correction strength in a first region of the strength-adjusted image, based on information on optical performance of an optical system used in imaging of the captured image and information on a saturated region, and second correction strength in a second region of the strength-adjusted image. A ratio of the second correction strength with respect to the first correction strength is varied on the basis of, the set strength.SELECTED DRAWING: Figure 8

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に開示された方法では、輝度飽和領域と非飽和領域の補正強度を一定の比率で強くすることになるため、非飽和領域の補正強度が不十分になるか、または輝度飽和領域の補正強度が過剰になる可能性がある。 By the way, there is a need for the user to set the sharpening strength (correction strength). When the correction strength is increased according to user settings, the method disclosed in Patent Document 1 increases the correction strength in the luminance saturated region and the non-saturated region at a constant ratio. Insufficient or excessive correction strength in luminance saturation areas may occur.

そこで本発明は、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ユーザの設定に応じて補正強度を適切に調整することが可能な画像処理方法を提供することを目的とする。 SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide an image processing method capable of appropriately adjusting correction strength according to user settings in a regression task using machine learning for a blurred image.

本発明の一側面としての画像処理方法は、撮像画像を機械学習モデルに入力し、補正に関する情報を生成する工程と、前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する工程と、設定強度に基づいて前記重みマップを変更することにより前記強度調整画像の補正強度を調整する工程とを有し、前記補正強度は、前記撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、前記強度調整画像の第1の領域における第1の補正強度と、前記強度調整画像の第2の領域における第2の補正強度とを含み、前記第1の補正強度に対する前記第2の補正強度の比率は、前記設定強度に基づいて変化する。 An image processing method as one aspect of the present invention includes steps of inputting a captured image into a machine learning model to generate information about correction, and generating an intensity-adjusted image based on the captured image, the information about correction, and a weight map. and adjusting the correction strength of the strength-adjusted image by changing the weight map based on the set strength, wherein the correction strength is the optical system used to capture the captured image. a first correction strength in a first region of the intensity-adjusted image and a second correction strength in a second region of the intensity-adjusted image based on information about the optical performance and information about the saturation region of A ratio of the second correction strength to the first correction strength varies based on the set strength.

本発明の他の目的及び特徴は、以下の実施例において説明される。 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 appropriately adjusting correction strength according to user settings in a regression task using machine learning for a blurred 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. 5 is an explanatory diagram of adverse effects caused by sharpening intensity adjustment 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~3における光学性能指標と重みとの関係を示す図である。FIG. 4 is a diagram showing the relationship between optical performance indices and weights in Examples 1 to 3; 実施例1における重みマップの説明図である。FIG. 4 is an explanatory diagram of a weight map in Example 1; 実施例1におけるユーザーインターフェースの説明図である。FIG. 4 is an explanatory diagram of a user interface in Example 1; 実施例1における補正強度の説明図である。FIG. 4 is an explanatory diagram of correction strength 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. 11 is an explanatory diagram of a user interface 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であれば、強度調整画像は撮像画像のままとなる。また、重みマップの値が1であれば、強度調整画像は、ぼけ先鋭化画像となる。 The gist of the present invention will be described before the specific description of the embodiments. The present invention generates an estimated image (blur sharpened image) by sharpening the blur caused by the optical system using a machine learning model from an image captured using the optical system. Then, the upper limit value of the weight map is determined based on the luminance saturation region where the luminance is saturated, and the captured image and the estimated image are weighted and added. The weight map is used to determine the proportion of each image in the weighted addition of the captured image and the estimated image, and has continuous signal values. For example, if the numerical value of the weight map determines the percentage of blurred sharpened images, a numerical value of 0 leaves the intensity adjusted image as the captured image. Also, if the value of the weight map is 1, the intensity-adjusted image becomes the blurred sharpened 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 blur is sharpened, undershoot, ringing, or the like cannot be suppressed depending on the captured image, and these adverse effects may occur in the estimated image. Specifically, when the subject is largely blurred due to the aberration of the optical system, or when the image has a brightness saturation area, a problem occurs. A luminance saturated region may occur in an image depending on the dynamic range of the image sensor and the exposure at the time of imaging. In the luminance saturated region, information about the structure of the subject space cannot be obtained, which tends to cause problems. These adverse effects can be suppressed by performing weighted addition of the captured image and the estimated image based on the luminance-saturated region and the optical performance.

しかし、多少の弊害を許容しても補正強度を上げたいニーズに対応するため、補正強度を調整する機能を有していることが好ましい。ここで、輝度飽和領域と非飽和領域とで補正強度の上限値を同一にする(輝度飽和領域と非飽和領域の補正強度を一定の比率で変化させる)と、ユーザの設定に応じた適切な強度調整を行うことができない。すなわち、補正強度を強くすると、非飽和領域の補正強度が不十分(上限値を飽和領域の許容弊害量に合わせた場合)、または輝度飽和領域の補正強度が過剰(上限値を非飽和領域の許容弊害量に合わせた場合)になる。 However, it is preferable to have a function of adjusting the correction strength in order to meet the needs of increasing the correction strength even if some adverse effects are allowed. Here, if the upper limit value of the correction strength is the same in the luminance saturated region and the non-saturated region (the correction strength in the luminance saturated region and the non-saturated region is changed at a constant ratio), an appropriate Intensity adjustments cannot be made. In other words, if the correction strength is increased, the correction strength in the non-saturated area is insufficient (when the upper limit is set to the allowable amount of adverse effects in the saturated area), or the correction strength in the luminance saturated area is excessive (the upper limit is set to the non-saturated area). (when it is adjusted to the allowable amount of harmful effects).

そこで各実施例は、輝度飽和領域および非飽和領域のそれぞれに重みマップの上限値を決定し(設定強度に基づいて輝度飽和領域と非飽和領域の補正強度の比率を変更し)、撮像画像と推定画像とを重み付け加算する。これにより、ぼけの先鋭度と弊害を制御することが可能になる。なお以下では、機械学習モデルのウエイトを学習する段階のことを学習フェーズとし、学習済みのウエイトを用いた機械学習モデルでぼけの先鋭化を行う段階のことを推定フェーズとする。 Therefore, in each embodiment, the upper limit value of the weight map is determined for each of the luminance saturated region and the non-saturated region (the ratio of the correction strength of the luminance saturated region and the non-saturated region is changed based on the set strength), and the captured image and Weighted addition is performed with the estimated image. This makes it possible to control the sharpness and harmful effects of blurring. 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 implement the present embodiment in the same manner for tasks other than blur sharpening, and to 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. A bilinear blur has a 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)を参照して、機械学習モデルによって、ぼけ先鋭化を行う際に発生する推定精度の低下(先鋭化による弊害)について説明する。図4(A)~(C)は、先鋭化による弊害の説明図であり、画像の信号値の空間変化を示す。ここで、画像は8bitに現像された画像であるため、飽和値は255である。図4(A)~(C)において、実線は撮像画像(ぼけ画像)、点線は、機械学習モデルを用いて、撮像画像のぼけを先鋭化したぼけ先鋭化画像をそれぞれ示す。図4(A)は光学系の収差によるぼけが大きい非輝度飽和被写体、図4(B)は光学系の収差によるぼけが小さい非輝度飽和被写体、図4(C)は光学系の収差によるぼけが小さい輝度飽和被写体を鮮鋭化した結果である。 Next, with reference to FIGS. 4A to 4C, a decrease in estimation accuracy (evil due to sharpening) that occurs when blur sharpening is performed by a machine learning model will be described. FIGS. 4A to 4C are explanatory diagrams of adverse effects caused by sharpening, and show spatial changes in signal values of an image. Here, the saturation value is 255 because the image is an 8-bit image. In FIGS. 4A to 4C, a solid line indicates a captured image (blurred image), and a dotted line indicates a sharpened blurred image obtained by sharpening the blur of the captured image using a machine learning model. FIG. 4A shows a non-saturated brightness subject with large blur due to optical system aberration, FIG. 4B shows a non-saturated brightness subject with small blur due to optical system aberration, and FIG. 4C shows blur due to optical system aberration This is the result of sharpening a luminance-saturated subject with a small .

光学系の収差によるぼけが大きい場合、エッジの暗部側でアンダーシュートが発生している。また、光学系の収差によるぼけが小さい場合でも、輝度飽和被写体を鮮鋭化した場合は、非輝度飽和被写体では発生していなかったアンダーシュートや、本来飽和していた画素値が減少する弊害が発生している。輝度飽和を起こした領域(輝度飽和領域)では、被写体空間の構造に関する情報が失われ、各領域の境界で偽エッジが出現することもあり、被写体の正しい特徴量を抽出できない。このため、機械学習モデルの推定精度が低下する。以上の結果より、先鋭化に伴う弊害は、光学系の性能と輝度飽和領域に依存していることがわかる。 When the blur due to the aberration of the optical system is large, undershoot occurs on the dark side of the edge. Also, even if the blur due to optical system aberrations is small, when sharpening a subject with saturated brightness, undershoots that do not occur with non-saturated subjects and pixel values that were originally saturated will decrease. are doing. 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, the estimation accuracy of the machine learning model is lowered. From the above results, it can be seen that the adverse effects associated with sharpening depend on the performance of the optical system and the brightness saturation region.

先述した補正には、機械学習モデルの入力データとして、撮像画像と撮像画像に対応する輝度飽和マップを用いる手法と、飽和影響マップを生成する手法を盛り込んで学習した機械学習モデルを使用している。つまり、これらの手法を用いることで弊害を低減させることは可能であるが、完全に弊害を消すことは難しい。輝度飽和マップを用いる手法と、飽和影響マップを生成する手法についてそれぞれ詳細に説明する。 For the above-mentioned correction, a machine learning model is used that incorporates a method that uses a captured image and a luminance saturation map corresponding to the captured image as input data for the machine learning model, and a method that generates a saturation effect map. . In other words, it is possible to reduce the harmful effects by using these methods, but 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.

まず、輝度飽和マップについて説明する。輝度飽和マップとは、撮像画像において輝度飽和領域を表すマップである。輝度飽和を起こした領域(輝度飽和領域)では、被写体空間の構造に関する情報が失われ、各領域の境界で偽エッジが出現することもあり、被写体の正しい特徴量を抽出できない。そこで、輝度飽和マップを入力することで、ニューラルネットワークが前述のような問題のある領域を特定できるため、推定精度の低下を抑制することができる。 First, the luminance 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 effect map is a map (a signal sequence arranged spatially) that represents the magnitude and range of signal values that have spread due to blurring (degradation) during imaging of an object in a luminance saturation region 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つの手法は有効ではあるが、図4(A)~(C)を参照して説明したように、弊害を完全に消すことは難しい。そこで、撮像画像とぼけ先鋭化画像の重み付け加算を取ることで弊害を抑制することができる。図4(A)、(C)中の一点鎖線は、撮像画像とぼけ先鋭化画像を重み付け加算した信号値である。重み付け加算により、ぼけの先鋭化効果を保ちつつ、暗部のアンダーシュートや本来飽和していた画素値が減少する弊害が軽減されている。本実施例では、撮像画像とぼけ先鋭化画像を重み付け加算する際に使用する重みマップを、光学系の性能と輝度飽和領域に基づいて生成する。光学系の性能と輝度飽和領域に基づくことで、弊害の発生していない図4(B)の先鋭度は保ちつつ、弊害の発生している図4(A)、(C)のみ弊害を抑制することができるため、ぼけの先鋭度と弊害を制御することが可能になる。 Although the above two methods are effective, it is difficult to completely eliminate the harmful effects as described with reference to FIGS. Therefore, the adverse effect can be suppressed by performing weighted addition of the captured image and the sharpened blurred image. The dashed-dotted lines in FIGS. 4A and 4C are signal values obtained by weighting and adding the captured image and the sharpened blurred image. The weighted addition reduces undershoot in dark areas and decreases in pixel values that were originally saturated, while maintaining the sharpening effect of blurring. In this embodiment, a weight map used for weighted addition of the captured image and the sharpened blurred image is generated based on the performance of the optical system and the brightness saturation region. Based on the performance of the optical system and the brightness saturation region, while maintaining the sharpness of FIG. Therefore, it is possible to control the sharpness and adverse effects of blurring.

次に、補正強度の強度調整機能について説明する。多少の弊害を許容しても補正強度を上げたいニーズに対応するため、補正強度を調整する機能を有していることが好ましい。その場合、補正強度の上限値を決定する必要があるが、輝度飽和領域と非飽和領域で同一の上限値を設定すると、前述のとおり、非飽和領域の補正強度が不十分、または輝度飽和領域の補正強度が過剰になる。輝度飽和領域とは、飽和影響マップを含む。 Next, the intensity adjusting function of the correction intensity will be described. It is preferable to have a function of adjusting the correction strength in order to meet the need to increase the correction strength even if some adverse effects are allowed. In that case, it is necessary to determine the upper limit of the correction strength. is excessive. A luminance saturation region includes a saturation influence map.

図5(A)、(B)は、先鋭化の強度調整による弊害の説明図であり、撮像画像とぼけ先鋭化画像を重み付け加算する際に使用する重みマップを変化させ、先鋭化強度を調整した場合の信号値の変化(画像の信号値の空間変化)を示す。画像は8bitに現像された画像であるため、飽和値は255である。図5(A)は輝度飽和領域(輝度が飽和している領域)の信号値変化、図5(B)は非飽和領域(輝度が飽和していない領域)の信号値変化をそれぞれ示す。破線1001は、撮像画像の信号値である。点線1002は、重みマップを用いてぼけの先鋭度の強度を調整した強度調整画像の信号値である。一点鎖線1003は、強度調整画像に対して補正強度を2倍にした最大強度画像である。 FIGS. 5A and 5B are explanatory diagrams of the adverse effect of sharpening intensity adjustment, and the sharpening intensity is adjusted by changing the weight map used when performing weighted addition of the captured image and the blurred sharpened image. shows the change in signal value (spatial change in the signal value of the image) in each case. Since the image is an 8-bit image, the saturation value is 255. FIG. 5A shows signal value changes in a saturated luminance region (region where luminance is saturated), and FIG. 5B shows signal value changes in a non-saturated region (region where luminance is not saturated). A dashed line 1001 is the signal value of the captured image. A dotted line 1002 is the signal value of an intensity-adjusted image obtained by adjusting the sharpness intensity of blur using the weight map. A dashed-dotted line 1003 is the maximum intensity image obtained by doubling the corrected intensity with respect to the intensity adjusted image.

図5(A)の場合、最大強度画像でエッジの暗部側でアンダーシュートが発生している。一方、図5(B)では、最大強度画像でもアンダーシュートは発生していない。つまり、補正強度を上げていくと、先に輝度飽和領域で弊害が発生する。二点鎖線1004は、輝度飽和領域を補正強度100%でクリップし、非飽和領域は補正強度200%にした強度調整画像の信号値である。補正強度100%とは、機械学習モデルで出力されたぼけ先鋭化画像であり、補正強度200%とは、ぼけ先鋭化画像と撮像画像の差分の絶対値を2倍して、撮像画像に加算することを意味する。二点鎖線1004によれば、非飽和領域の補正強度を保ちつつ、輝度飽和領域の弊害を抑えることができる。 In the case of FIG. 5A, an undershoot occurs on the dark side of the edge in the maximum intensity image. On the other hand, in FIG. 5B, no undershoot occurs even in the maximum intensity image. That is, when the correction strength is increased, adverse effects occur first in the luminance saturation region. A two-dot chain line 1004 is the signal value of the intensity-adjusted image in which the brightness saturation region is clipped with a correction strength of 100% and the non-saturation region is clipped with a correction strength of 200%. The correction strength of 100% is the sharpened blur image output by the machine learning model, and the correction strength of 200% means that the absolute value of the difference between the sharpened blur image and the captured image is doubled and added to the captured image. means to According to the two-dot chain line 1004, it is possible to suppress the adverse effect of the luminance saturated region while maintaining the correction strength of the non-saturated region.

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

まずステップ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 given. 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 signal train arranged spatially) representing the magnitude and range of signal values spread due to degradation during imaging, is generated from the subject in the luminance saturated area of the blurred image. be. 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.

次に、図7を参照して、画像処理装置103で実行される、学習済みの機械学習モデルを用いた撮像画像のぼけ先鋭化に関して説明する。図7は、モデル出力の生成のフローチャートである。画像処理装置103は、記憶部103a、取得部103b、および先鋭化部103cを有し、図7の各ステップは、主に、画像処理装置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. 7 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. 7 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に示される構成を有する。学習時と同様に、撮像画像の輝度飽和した領域を表す輝度飽和マップを生成して入力し、飽和影響マップとモデル出力を生成する。例として、図9(A)にぼけ先鋭化画像(撮像画像)、図9(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 in 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, FIG. 9A shows a blurred sharpened image (captured image), and FIG. 9B shows a saturation effect map.

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

まずステップS211において、取得部103bは、撮像画像から撮影状態を取得する。撮影状態とは、光学系102aのズーム位置、絞り開口径、および被写体距離のそれぞれの状態を示す(z,f,d)と、撮像素子102bの画素ピッチである。 First, in step S211, the acquisition unit 103b acquires the shooting state from the captured image. The photographing state is (z, f, d) indicating the zoom position, aperture diameter, and object distance of the optical system 102a, and the pixel pitch of the image sensor 102b.

続いてステップS212において、取得部103bは、ステップS211で取得した撮影状態に基づいて、光学系102aの光学性能に関する情報(光学性能指標)を取得する。光学性能指標は、記憶部103aに記憶されている。光学性能指標は、撮像画像の撮像に用いた光学系102aの被写体空間とは独立した光学性能に関する情報であり、例えば飽和影響マップのような被写体空間とは独立していない情報を含まない。本実施例では、点像分布関数(PSF)の大きさ(ピーク値)と範囲(拡がり具合)を光学性能指標として用いる。ピーク値とは、PSFが有する最大の信号値であり、範囲とは、ある閾値以上の値を有する画素の数を意味する。機械学習モデルでぼけの先鋭化を行う際は、ピーク値が同じでも、ある閾値以上の値を有する画素の数が小さいぼけの方が弊害の発生量が小さいため、本実施例では光学性能指標を用いる。また、PSFのピーク値と範囲は、撮像装置102の画素ピッチに依存するため、複数の画素ピッチに対応する光学性能指標を記憶しておき、中間値は補間で作成する。 Subsequently, in step S212, the acquisition unit 103b acquires information (optical performance index) on the optical performance of the optical system 102a based on the shooting state acquired in step S211. The optical performance index is stored in the storage unit 103a. The optical performance index is information about the optical performance of the optical system 102a used to capture the captured image that is independent of the subject space, and does not include information that is not independent of the subject space, such as a saturation effect map. In this embodiment, the magnitude (peak value) and range (spreading degree) of the point spread function (PSF) are used as the optical performance index. A peak value is the maximum signal value that the PSF has, and a range means the number of pixels having a value equal to or greater than a certain threshold. When sharpening blur with a machine learning model, even if the peak value is the same, blur with a smaller number of pixels having a value equal to or greater than a certain threshold produces less adverse effects. Use Also, since the peak value and range of the PSF depend on the pixel pitch of the imaging device 102, optical performance indices corresponding to a plurality of pixel pitches are stored and intermediate values are created by interpolation.

なお光学性能指標は、光学性能を反映できたものであればよいため、光学伝達関数(OTF)など、別の数値を光学性能指標としてもよい。例えば、光学性能指標は、撮像画像の撮像時のズーム位置、絞り径、または被写体距離の少なくとも一つと、光学系の像高ごとの点像分布関数の信号値の大きさと範囲とに基づいて算出される。 Note that the optical performance index may be any index that reflects the optical performance, so another numerical value such as an optical transfer function (OTF) may be used as the optical performance index. For example, the optical performance index is calculated based on at least one of the zoom position, aperture diameter, and subject distance when capturing the captured image, and the magnitude and range of the signal value of the point spread function for each image height of the optical system. be done.

記憶部103aには、光学性能指標の数(データ数)を低減するために、離散的に選択された撮像状態に対する光学性能指標のみが記憶(格納)されている。このため、ステップS211で取得した撮像状態に対応する光学性能指標、または撮像状態に近い撮像状態に対応する光学性能指標が記憶部103aに格納されていない場合、その撮像状態にできるだけ近い光学性能指標を選択する。そして、その光学性能指標を、ステップS211で取得した撮像状態に最適化するように補正することで、実際に使用する光学性能指標を作成する。 The storage unit 103a stores (stores) only optical performance indices for discretely selected imaging states in order to reduce the number of optical performance indices (the number of data). Therefore, if the optical performance index corresponding to the imaging state acquired in step S211 or the optical performance index corresponding to the imaging state close to the imaging state is not stored in the storage unit 103a, the optical performance index that is as close as possible to the imaging state is stored in the storage unit 103a. to select. Then, by correcting the optical performance index so as to optimize it for the imaging state acquired in step S211, an optical performance index to be actually used is created.

続いてステップS213において、先鋭化部103cは、光学性能指標から、第1の重みマップおよび第2の重みマップを生成する。重みを決定する際には、ステップS212で取得した光学性能指標に基づき、図10に示される関係式から、像高ごとにぼけ先鋭化画像の重みを決定する。図10は、光学性能指標と重みとの関係を示す図である。図10において、横軸は光学性能指標、縦軸はぼけ先鋭化画像の重みをそれぞれ示す。 Subsequently, in step S213, the sharpening unit 103c generates a first weight map and a second weight map from the optical performance index. When determining the weight, the weight of the blurred sharpened image is determined for each image height from the relational expression shown in FIG. 10 based on the optical performance index acquired in step S212. FIG. 10 is a diagram showing the relationship between optical performance indices and weights. In FIG. 10, the horizontal axis indicates the optical performance index, and the vertical axis indicates the weight of the sharpened blurred image.

実線121は非飽和領域用であり、点線122は輝度飽和領域用である。同じ光学性能指標でも、弊害の発生しやすい輝度飽和領域はぼけ先鋭化画像の重みを下げておく。本実施例では、1次式としているが、関係式は1次式に限らない。また、関係式も自由に変更が可能である。なお、光学性能指標を保持していない像高は、保持している像高点からの補間で生成する。実線121から非飽和領域用の第1の重みマップを生成し、点線122から輝度飽和領域用の第2の重みマップを生成する。 A solid line 121 is for the non-saturated region, and a dotted line 122 is for the luminance saturated region. Even if the optical performance index is the same, the weight of the blurred sharpened image is lowered in the luminance saturated region where adverse effects are likely to occur. Although a linear expression is used in this embodiment, the relational expression is not limited to a linear expression. Also, the relational expression can be freely changed. An image height for which no optical performance index is held is generated by interpolation from the held image height point. A first weight map for the non-saturated region is generated from the solid line 121, and a second weight map for the luminance saturated region is generated from the dotted line 122. FIG.

続いて、図8のステップS214において、先鋭化部103cは、第1の重みマップ、第2の重みマップ、および飽和影響マップに基づいて、重みマップを生成する。すなわち重みマップは、光学性能に関する情報(第1の重みマップ、第2の重みマップ)と、撮像画像の飽和領域に関する情報とに基づいて生成される。本実施例において、飽和領域に関する情報は飽和影響マップであり、RGBの全てが飽和していなくてもよい。また、飽和影響マップは、第2の信号値で規格化し、これを第1の重みマップと第2の重みマップの合成に使用する。すなわち、規格化後の数値が0から1の間になった場合、第1の重みマップと第2の重みマップの両方が寄与する。飽和影響マップを使用することで、飽和影響領域まで補正強度の調整が可能となる。なお、飽和影響マップを使用するのは必須ではなく、輝度飽和マップでもいいし、輝度飽和マップを像高ごとにぼかしたものを使用してもよい。 Subsequently, in step S214 of FIG. 8, the sharpening unit 103c generates weight maps based on the first weight map, the second weight map, and the saturation influence map. That is, the weight map is generated based on information on optical performance (first weight map, second weight map) and information on 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. The saturation influence map is also normalized by the second signal value and used to combine the first weight map and the second weight map. That is, when the normalized numerical value falls between 0 and 1, both the first weight map and the second weight map contribute. Using a saturation influence map allows adjustment of the correction strength up to the saturation influence region. It should be noted that it is not essential to use a saturation influence map, and a brightness saturation map may be used, or a brightness saturation map obtained by blurring each image height may be used.

図11(A)~(C)は、一例としての重みマップの説明図である。本実施例において、重みマップは画素値が大きいほど補正強度が強く、画素値が小さいほど補正強度が弱い。一般的な光学系では、軸外に向かうほど光学性能は低下するため、図11(B)のようなグラデーションの重みマップになることが多い。また、同じ光学性能でも飽和影響領域は弊害が発生しやすいため、同じ像高でも補正強度を小さくしている。なお、重みマップは画素値が小さいほど補正強度が強く、画素値が大きいほど補正強度が弱くしてもよい。 FIGS. 11A to 11C are explanatory diagrams of weight maps as an example. In this embodiment, in the weight map, the larger the pixel value, the stronger the correction strength, and the smaller the pixel value, the weaker the correction strength. In a general optical system, the optical performance degrades as it goes off-axis, so a gradation weight map such as that shown in FIG. 11B is often used. In addition, even if the optical performance is the same, the saturation effect area is likely to be detrimental, so the correction strength is reduced even if the image height is the same. In the weight map, the smaller the pixel value, the stronger the correction strength, and the larger the pixel value, the weaker the correction strength.

続いて、図8のステップS215において、取得部103bは、ユーザにより指定(設定)された先鋭化の強度を取得する。図12を参照して、ユーザによる強度調整の例を説明する。図12は、ユーザーインターフェースの説明図である。ユーザはスライダーを動かして設定強度を変更することで、補正強度の調整が可能である。あるいは、設定強度の数値を入力してもよい。例えば、設定強度が1.0の場合、ステップS214にて生成した重みマップに基づき、撮像画像とモデル出力を合成したデフォルトの強度調整画像となる。設定強度を1.5にした場合、デフォルト強度から補正強度を1.5倍にした強度調整画像が生成される。 Subsequently, in step S215 of FIG. 8, the acquiring unit 103b acquires the sharpening strength specified (set) by the user. An example of intensity adjustment by the user will be described with reference to FIG. FIG. 12 is an explanatory diagram of the user interface. The user can adjust the correction strength by moving the slider to change the set strength. Alternatively, a numerical value for the set intensity may be entered. For example, if the set strength is 1.0, the default strength adjusted image is obtained by synthesizing the captured image and the model output based on the weight map generated in step S214. When the set intensity is set to 1.5, an intensity-adjusted image is generated in which the corrected intensity is 1.5 times the default intensity.

続いてステップS216において、先鋭化部103cは、取得した先鋭化の強度に応じて重みマップを変更する。図11は、重みマップの変更例であり、図11(B)は設定強度が1.0の場合の重みマップを示し、ステップS211にて生成したデフォルトの重みマップである。図11(C)は設定強度2.0の場合の重みマップを示し、デフォルトの重みマップを画面一律に2倍にしている。図11(A)は、設定強度0の場合の重みマップを示し、重みが全て0になっている。 Subsequently, in step S216, the sharpening unit 103c changes the weight map according to the acquired sharpening strength. FIG. 11 shows a modified example of the weight map, and FIG. 11B shows the weight map when the set strength is 1.0, which is the default weight map generated in step S211. FIG. 11(C) shows a weight map in the case of a set strength of 2.0, in which the default weight map is uniformly doubled on the screen. FIG. 11A shows a weight map when the set strength is 0, and the weights are all 0. FIG.

ここで、図13を参照して、補正強度の変化を説明する。図13は、補正強度の説明図である。1101は非飽和領域における補正強度の変化、1102は輝度飽和領域における補正強度の変化をそれぞれ示す。両者は同一の像高であり、光学性能が高い領域である。本実施例において、非飽和領域における補正強度を第1の補正強度、輝度飽和領域における補正強度を第2の補正強度とする。飽和影響領域の補正強度は100%でクリップする。設定強度1.0を第1の設定強度、設定強度2.0を第2の設定強度とすると、第1の設定強度と第2の設定強度において、第1の補正強度と第2の補正強度の比率が異なる。すなわち、第1の補正強度に対する第2の補正強度の比率は、設定強度に基づいて変化する。 Here, changes in correction strength will be described with reference to FIG. FIG. 13 is an explanatory diagram of correction strength. Reference numeral 1101 denotes changes in correction strength in non-saturated regions, and reference numeral 1102 denotes changes in correction strength in luminance saturated regions. Both have the same image height and are areas with high optical performance. In this embodiment, the correction strength in the non-saturated region is defined as the first correction strength, and the correction strength in the luminance saturated region is defined as the second correction strength. The correction strength of the saturation influence region clips at 100%. Assuming that the set strength of 1.0 is the first set strength and the set strength of 2.0 is the second set strength, the first correction strength and the second correction strength are obtained at the first set strength and the second set strength. ratio is different. That is, the ratio of the second correction strength to the first correction strength changes based on the set strength.

また図13において、1103は非飽和領域における補正強度の変化、1104は輝度飽和領域における補正強度の変化をそれぞれ示す。両者は同一の像高であり、光学性能が低い領域である。光学性能が低いため、デフォルトの補正強度が低く、設定強度が2.0でも輝度飽和領域の補正強度は100%まで達していない。このように、光学性能に応じて、補正強度の上限値は異なる。なお、図13に示される補正強度と設定強度との関係式はこれに限らない。例えば、クリップする代わりに、1102を設定強度2.0で補正強度100%に漸近する式を用いてもよい。また、設定強度の上限に決まりはなく、設定強度2.0以上を設定できるようにしてもよい。 In FIG. 13, reference numeral 1103 denotes changes in correction strength in non-saturated regions, and 1104 denotes changes in correction strength in luminance saturated regions. Both have the same image height and are regions with low optical performance. Since the optical performance is low, the default correction strength is low, and even with the set strength of 2.0, the correction strength in the luminance saturation region does not reach 100%. As described above, the upper limit of the correction strength differs depending on the optical performance. Note that the relational expression between the correction strength and the set strength shown in FIG. 13 is not limited to this. For example, instead of clipping, a formula for asymptotically approximating 1102 to a correction strength of 100% at a set strength of 2.0 may be used. Further, there is no upper limit to the set strength, and a set strength of 2.0 or more may be set.

続いて、図8のステップS217において、先鋭化部103cは、重みマップに基づいて、撮像画像とぼけ先鋭化画像(モデル出力)を重み付け加算し、強度調整画像205を生成する。なお、ステップS216は省略が可能であり、スライダーで設定可能な強度調整画像を事前に全て生成しておき、ユーザの指定した強度に合わせて画像を表示してもよい。 Subsequently, in step S217 in FIG. 8, the sharpening unit 103c performs weighted addition of the captured image and the sharpened blurred image (model output) based on the weight map to generate the intensity adjusted image 205. FIG. Note that step S216 can be omitted, and all intensity adjustment images that can be set with a slider may be generated in advance, and the images may be displayed according to the intensity specified by the user.

本実施例において、先鋭化部103cは、第1の生成手段、第2の生成手段、および調整手段としての機能を有する。第1の生成手段は、撮像画像を機械学習モデルに入力し、補正に関する情報を生成する。第2の生成手段は、撮像画像と補正に関する情報と重みマップとに基づいて強度調整画像を生成する。調整手段は、設定強度に基づいて重みマップを変更することにより強度調整画像の補正強度を調整する。また本実施例において、補正強度は、撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、強度調整画像の第1の領域における第1の補正強度と、強度調整画像の第2の領域における第2の補正強度とを含む。第1の補正強度に対する第2の補正強度の比率は、設定強度に基づいて変化する。好ましくは、設定強度が第1の設定強度である場合、比率は第1の比率であり、設定強度が第1の設定強度よりも強い第2の設定強度である場合、比率は第1の比率よりも低い第2の比率である。 In this embodiment, the sharpening section 103c functions as a first generator, a second generator, and an adjuster. The first generating means inputs the captured image to the machine learning model and generates information regarding correction. The second generating means generates an intensity-adjusted image based on the captured image, information on correction, and the weight map. The adjuster adjusts the correction strength of the strength-adjusted image by changing the weight map based on the set strength. Further, in the present embodiment, the correction strength is a first correction strength in the first region of the intensity-adjusted image based on information about the optical performance of the optical system used to capture the captured image and information about the saturation region; and a second correction intensity in a second region of the intensity adjusted image. A ratio of the second correction strength to the first correction strength varies based on the set strength. Preferably, when the set intensity is a first set intensity, the ratio is the first ratio, and when the set intensity is a second set intensity stronger than the first set intensity, the ratio is the first ratio is a second ratio that is lower than

以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of controlling the sharpness of blur and adverse effects in a regression task using machine learning for a blurred image. .

次に、本発明の実施例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, the intensity of the non-saturated area and the brightness saturated area are adjusted with separate sliders. 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において、先鋭化部334は、重みマップを生成する。なお、重みマップの生成方法は、実施例1と同様のため、省略する。続いてステップS312において、取得部333は、ユーザが指定した先鋭化の強度を取得する。図17を参照して、ユーザによる強度調整の例を説明する。図17は、ユーザーインターフェースの説明図である。ユーザはスライダーを動かすことで、補正強度の調整が可能である。実施例2では、ユーザは輝度飽和領域と非飽和領域の補正強度を個別に調整できる。 First, in step S311, the sharpening unit 334 generates a weight map. Note that the method of generating the weight map is the same as that of the first embodiment, so the description thereof is omitted. Subsequently, in step S312, the acquisition unit 333 acquires the sharpening strength specified by the user. An example of intensity adjustment by the user will be described with reference to FIG. FIG. 17 is an explanatory diagram of the user interface. The user can adjust the correction strength by moving the slider. In Example 2, the user can individually adjust the correction strengths of the luminance saturated region and the non-saturated region.

続いてステップS313において、先鋭化部334は、取得した先鋭化の強度に応じて重みマップを変更する。続いてステップS314において、先鋭化部334は、重みマップに基づいて、撮像画像とぼけ先鋭化画像(モデル出力)を重み付け加算し、強度調整画像を生成する。 Subsequently, in step S313, the sharpening unit 334 changes the weight map according to the acquired sharpening strength. Subsequently, in step S314, the sharpening unit 334 performs weighted addition of the captured image and the blurred sharpened image (model output) based on the weight map to generate an intensity adjusted image.

以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of controlling the sharpness of blur and adverse effects in a regression task using machine learning for a blurred image. .

次に、本発明の実施例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 performs weighted addition of 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 .

以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 With the above configuration, according to this embodiment, it is possible to provide an image processing system capable of controlling the sharpness of blur and adverse effects in a regression task using machine learning for a blurred image. .

(その他の実施例)
本発明は、上述の実施例の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(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.

各実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ユーザの設定に応じて補正強度を適切に調整することが可能な画像処理方法、画像処理装置、画像処理プログラム、および、記憶媒体を提供することができる。 According to each embodiment, an image processing method, an image processing apparatus, and an image processing capable of appropriately adjusting correction strength according to user settings in a regression task using machine learning for a blurred image. A program and a storage medium can be provided.

以上、本発明の好ましい実施例について説明したが、本発明はこれらの実施例に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。 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, adjusting means)

Claims (14)

撮像画像を機械学習モデルに入力し、補正に関する情報を生成する工程と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する工程と、
設定強度に基づいて前記重みマップを変更することにより前記強度調整画像の補正強度を調整する工程と、を有し、
前記補正強度は、前記撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、前記強度調整画像の第1の領域における第1の補正強度と、前記強度調整画像の第2の領域における第2の補正強度とを含み、
前記第1の補正強度に対する前記第2の補正強度の比率は、前記設定強度に基づいて変化することを特徴とする画像処理方法。
inputting the captured image into a machine learning model to generate information about the correction;
generating an intensity-adjusted image based on the captured image, the information about the correction, and a weight map;
adjusting the correction strength of the strength-adjusted image by changing the weight map based on a set strength;
The correction strength is a first correction strength in a first region of the strength-adjusted image and the strength adjustment based on information about the optical performance of an optical system used to capture the captured image and information about the saturation region. a second correction intensity in a second region of the image;
The image processing method, wherein a ratio of the second correction strength to the first correction strength is changed based on the set strength.
前記設定強度が第1の設定強度である場合、前記比率は第1の比率であり、
前記設定強度が前記第1の設定強度よりも強い第2の設定強度である場合、前記比率は前記第1の比率よりも低い第2の比率であることを特徴とする請求項1に記載の画像処理方法。
when the set intensity is a first set intensity, the ratio is a first ratio;
2. The method according to claim 1, wherein said ratio is a second ratio lower than said first ratio when said setting intensity is a second setting intensity stronger than said first setting intensity. Image processing method.
前記設定強度は、ユーザにより設定された強度であることを特徴とする請求項1または2に記載の画像処理方法。 3. The image processing method according to claim 1, wherein the set intensity is an intensity set by a user. 前記補正強度は、前記重みマップに基づいて前記撮像画像に重み付け加算される前記補正に関する情報の重みであることを特徴とする請求項1乃至3のいずれか一項に記載の画像処理方法。 4. The image processing method according to any one of claims 1 to 3, wherein the correction strength is a weight of information regarding the correction that is weighted and added to the captured image based on the weight map. 前記第1の領域は、非飽和領域であり、
前記第2の領域は、飽和領域であることを特徴とする請求項1乃至4のいずれか一項に記載の画像処理方法。
The first region is a non-saturated region,
5. The image processing method according to claim 1, wherein the second area is a saturated area.
前記飽和領域に関する情報は、前記撮像画像の飽和領域の被写体が、撮像時のぼけによって広がった信号値の大きさと範囲を表す飽和影響マップであることを特徴とする請求項1乃至5のいずれか一項に記載の画像処理方法。 6. The information about the saturation region is a saturation effect map representing the magnitude and range of signal values spread by the subject in the saturation region of the captured image due to blurring during imaging. 1. The image processing method according to item 1. 前記飽和影響マップは、前記機械学習モデルで生成されることを特徴とする請求項6に記載の画像処理方法。 7. The image processing method of claim 6, wherein the saturation influence map is generated with the machine learning model. 前記光学性能に関する情報は、前記撮像画像の撮像時のズーム位置、絞り径、または被写体距離の少なくとも一つと、前記光学系の像高ごとの点像分布関数の信号値の大きさと範囲とに基づいて算出されることを特徴とする請求項1乃至7のいずれか一項に記載の画像処理方法。 The information about the optical performance is based on at least one of a zoom position, an aperture diameter, or a subject distance at the time of capturing the captured image, and the magnitude and range of the signal value of the point spread function for each image height of the optical system. 8. The image processing method according to any one of claims 1 to 7, wherein the image processing method is calculated by 前記補正に関する情報は、前記撮像画像を補正した画像または補正成分であることを特徴とする請求項1乃至8のいずれか一項に記載の画像処理方法。 9. The image processing method according to any one of claims 1 to 8, wherein the information about the correction is an image obtained by correcting the captured image or a correction component. 前記補正は、前記撮像画像の高解像化、または前記撮像画像のデフォーカスぼけの形状変換であることを特徴とする請求項1乃至9のいずれか一項に記載の画像処理方法。 10. The image processing method according to any one of claims 1 to 9, wherein the correction is to increase the resolution of the captured image or to transform the shape of defocus blur of the captured image. 前記補正強度の上限値は、前記光学性能に関する情報に基づいて決定されることを特徴とする請求項1乃至10のいずれか一項に記載の画像処理方法。 11. The image processing method according to any one of claims 1 to 10, wherein the upper limit value of the correction strength is determined based on information regarding the optical performance. 撮像画像を機械学習モデルに入力し、補正に関する情報を生成する第1の生成手段と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する第2の生成手段と、
設定強度に基づいて前記重みマップを変更することにより前記強度調整画像の補正強度を調整する調整手段と、を有し、
前記補正強度は、前記撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、前記強度調整画像の第1の領域における第1の補正強度と、前記強度調整画像の第2の領域における第2の補正強度とを含み、
前記第1の補正強度に対する前記第2の補正強度の比率は、前記設定強度に基づいて変化することを特徴とする画像処理装置。
a first generating means for inputting a captured image into a machine learning model and generating information about correction;
a second generation means for generating an intensity-adjusted image based on the captured image, the information about the correction, and a weight map;
adjusting means for adjusting the correction strength of the strength-adjusted image by changing the weight map based on the set strength;
The correction strength is a first correction strength in a first region of the strength-adjusted image and the strength adjustment based on information about the optical performance of an optical system used to capture the captured image and information about the saturation region. a second correction intensity in a second region of the image;
The image processing apparatus, wherein a ratio of the second correction strength to the first correction strength is changed based on the set strength.
互いに通信可能な第1の装置と第2の装置とを有する画像処理システムであって、
前記第1の装置は、撮像画像に対する処理の実行に関する要求を前記第2の装置へ送信する送信手段を有し、
前記第2の装置は、
前記要求を受信する受信手段と、
前記撮像画像を機械学習モデルに入力し、補正に関する情報を生成する第1の生成手段と、
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する第2の生成手段と、
設定強度に基づいて前記重みマップを変更することにより前記強度調整画像の補正強度を調整する調整手段と、を有し、
前記補正強度は、前記撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、前記強度調整画像の第1の領域における第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 generation means for inputting the captured image into a machine learning model and generating information on correction;
a second generation means for generating an intensity-adjusted image based on the captured image, the information about the correction, and a weight map;
adjusting means for adjusting the correction strength of the strength-adjusted image by changing the weight map based on the set strength;
The correction strength is a first correction strength in a first region of the strength-adjusted image and the strength adjustment based on information about the optical performance of an optical system used to capture the captured image and information about the saturation region. a second correction intensity in a second region of the image;
An image processing system, wherein a ratio of the second correction strength to the first correction strength varies based on the set strength.
請求項1乃至11のいずれか一項に記載の画像処理方法をコンピュータに実行させることを特徴とするプログラム。 A program for causing a computer to execute the image processing method according to any one of claims 1 to 11.
JP2021202983A 2021-12-15 2021-12-15 Image processing method, image processing apparatus, image processing system, and program Pending JP2023088349A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021202983A JP2023088349A (en) 2021-12-15 2021-12-15 Image processing method, image processing apparatus, image processing system, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021202983A JP2023088349A (en) 2021-12-15 2021-12-15 Image processing method, image processing apparatus, image processing system, and program

Publications (1)

Publication Number Publication Date
JP2023088349A true JP2023088349A (en) 2023-06-27

Family

ID=86935517

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021202983A Pending JP2023088349A (en) 2021-12-15 2021-12-15 Image processing method, image processing apparatus, image processing system, and program

Country Status (1)

Country Link
JP (1) JP2023088349A (en)

Similar Documents

Publication Publication Date Title
US11188777B2 (en) Image processing method, image processing apparatus, learnt model manufacturing method, and image processing system
JP7439145B2 (en) Image processing method, image processing device, image processing system, learned weight generation method, and program
JP7455542B2 (en) Image processing method, program, image processing device, learned model manufacturing method, and image processing system
JP2021168048A (en) Image processing method, image processing device, image processing system, and program
JP2023055848A (en) Image processing method, image processing apparatus, image processing system, and program
US11830173B2 (en) Manufacturing method of learning data, learning method, learning data manufacturing apparatus, learning apparatus, and memory medium
JP2024059927A (en) Image processing method and apparatus, and program
WO2022215375A1 (en) Image processing method, method for producing machine learning model, image processing device, 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
JP2020030569A (en) Image processing method, image processing device, imaging device, lens device, program, and storage medium
JP2021189929A (en) Image processing method, program, image processing device and image processing system
JP2021140758A (en) Method for producing learning data, learning method, device for producing learning data, learning device, and program
JP2023104667A (en) Image processing method, image processing apparatus, image processing system, and program
JP2023069527A (en) Image processing device and image processing method
JP2024032621A (en) Image processing method, image processing apparatus, and program
JP2021190814A (en) Learning method, image processing method, and program
JP2021174070A (en) Image processing method, producing method of learned model, program, and image processing apparatus
JP2021086272A (en) Image processing method, program, learnt model manufacturing method, image processing apparatus, and image processing system
JP2015129990A (en) Image processor, imaging device, image processing method, image processing program, and storage medium