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 PDFInfo
- 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
Links
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
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.
ところで、先鋭化の強度(補正強度)をユーザが設定したいというニーズがある。ユーザの設定により補正強度を強くする場合、特許文献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.
以下、本発明の実施例について、図面を参照しながら詳細に説明する。各図において、同一の部材については同一の参照符号を付し、重複する説明は省略する。 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
画像処理装置103は、機械学習モデルを用いて、撮像画像に対してぼけ先鋭化を行い、飽和影響マップとぼけ先鋭化画像(モデル出力)を生成する。なお、飽和影響マップの詳細は後述する。機械学習モデルは学習装置101で学習されたものであり、画像処理装置103は機械学習モデルに関する情報を予め学習装置101から取得し、記憶部103aに記憶している。また画像処理装置103は、撮像画像とぼけ先鋭化画像の重み付け加算を取ることで、ぼけ先鋭化の強度を調整する機能を有する。機械学習モデルの学習と推定、ぼけ先鋭化の強度調整の詳細に関しては、後述する。ユーザは、表示装置104に表示された画像を確認しながら、ぼけ先鋭化の強度調整を行える。強度調整が施されたぼけ先鋭化画像は、記憶部103aまたは記録媒体105に保存され、必要に応じてプリンタなどの出力装置106に出力される。なお、撮像画像は、グレースケールでも、複数の色成分を有していてもよい。また、未現像のRAW画像でも、現像後の画像でもよい。
The
次に、図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
図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-
次に、図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
まずステップS101において、取得部101bは、記憶部101aから1枚以上の原画像を取得する。原画像は、第2の信号値より高い信号値を有する画像である。第2の信号値は、撮像画像の輝度飽和値に相当する信号値である。ただし、機械学習モデルに入力する際、信号値を規格化してもよいため、必ずしも第2の信号値と撮像画像の輝度飽和値が一致する必要はない。原画像を基にして機械学習モデルの学習を行うため、原画像は様々な周波数成分(異なる向きと強度のエッジ、グラデーション、平坦部など)を有する画像であることが望ましい。原画像は実写画像でもよいし、CG(Computer Graphics)でもよい。
First, in step S101, the
続いてステップS102において、演算部101cは、原画像にぼけを付与し、ぼけ画像を生成する。ぼけ画像は、学習時に機械学習モデルに入力される画像であり、推定時の撮像画像に相当する。付与するぼけは、先鋭化の対象となるぼけである。本実施例では、光学系102aの収差と回折、および撮像素子102bの光学ローパスフィルタによって発生するぼけを付与する。光学系102aの収差と回折によるぼけの形状は、像面座標(像高とアジムス)によって変化する。また、光学系102aの変倍、絞り、フォーカスの状態によっても変化する。これらのぼけ全てを先鋭化する機械学習モデルを一括で学習したい場合、光学系102aで発生する複数のぼけを用いて、複数のぼけ画像を生成するとよい。また、ぼけ画像において、第2の信号値を超える信号値はクリップされる。これは、撮像画像の撮像過程で起きる輝度飽和を再現するために行う。必要に応じて、撮像素子102bで発生するノイズをぼけ画像に付与してもよい。
Subsequently, in step S102, the
続いてステップS103において、演算部101cは、原画像に基づく画像と信号値の閾値とに基づいて、第1の領域を設定する。本実施例では、原画像に基づく画像として、ぼけ画像を用いるが、原画像そのものなどを用いてもよい。ぼけ画像の信号値と、信号値の閾値と、を比較することで、第1の領域を設定する。より具体的には、ぼけ画像の信号値が、信号値の閾値以上となっている領域を第1の領域とする。本実施例において、信号値の閾値は第2の信号値である。故に、第1の領域は、ぼけ画像の輝度飽和した領域(飽和領域)を表す。ただし、信号値の閾値と第2の信号値は、一致しなくてもよい。信号値の閾値を、第2の信号値よりやや小さい値(例えば、0.9倍)に設定してもよい。
Subsequently, in step S103, the
続いてステップS104において、演算部101cは、第1の領域に原画像の信号値を有する第1の領域画像を生成する。第1の領域画像は、第1の領域以外の領域において、原画像とは異なる信号値を有する。さらに望ましくは、第1の領域画像は、第1の領域以外の領域において、第1の信号値を有する。本実施例において、第1の信号値は0であるが、発明はこれに限定されない。本実施例では、第1の領域画像は、ぼけ画像が輝度飽和した領域のみに原画像の信号値を有し、それ以外の領域の信号値は0である。
Subsequently, in step S104, the
続いてステップS105において、演算部101cは、第1の領域画像にぼけを付与し、飽和影響正解マップを生成する。付与されるぼけは、ぼけ画像に付与したぼけと同じである。これによって、ぼけ画像の輝度飽和した領域にある被写体から、撮像時の劣化によって広がった信号値の大きさと範囲を表すマップ(空間的に配列された信号列)である飽和影響正解マップが生成される。本実施例では、ぼけ画像と同様に、飽和影響正解マップを第2の信号値でクリップするが、必ずしもクリップを行う必要はない。
Subsequently, in step S105, the
続いてステップS106において、取得部101bは、正解モデル出力を取得する。本実施例のタスクはぼけ先鋭化のため、正解モデル出力はぼけ画像よりぼけの小さい画像である。本実施例では、原画像を第2の信号値でクリップすることで、正解モデル出力を生成する。原画像に高周波成分が不足している場合、原画像を縮小した画像を正解モデル出力としてもよい。この場合、ステップS102でぼけ画像を生成する際にも同様に縮小を行う。また、ステップS106は、ステップS101より後で、ステップS107より前であれば、いつ実行してもよい。
Subsequently, in step S106, the
続いてステップS107において、演算部101cは、機械学習モデルを用いて、ぼけ画像に基づき、飽和影響マップとモデル出力を生成する。本実施例では、図1に示される機械学習モデルを使用するが、発明はこれに限定されない。ぼけ画像201と輝度飽和マップ202が、機械学習モデルに入力される。輝度飽和マップ202は、ぼけ画像201の輝度飽和した(信号値が第2の信号値以上である)領域を示したマップである。例えば、第2の信号値で、ぼけ画像201を二値化することによって生成できる。ただし、輝度飽和マップ202は、必ずしも必須ではない。ぼけ画像201と輝度飽和マップ202は、チャンネル方向に連結されて、機械学習モデルに入力される。ただし、発明はこれに限定されない。例えば、ぼけ画像201と輝度飽和マップ202をそれぞれ特徴マップに変換し、それらの特徴マップをチャンネル方向に連結してもよい。また、輝度飽和マップ202以外の情報を入力に追加してもよい。
Subsequently, in step S107, the
機械学習モデルは複数の層を有し、各層で層の入力とウエイトの線型和が取られる。ウエイトの初期値は、乱数などで決定するとよい。本実施例は、線型和として入力とフィルタの畳み込み(フィルタの各要素の値がウエイトに該当。また、バイアスとの和を含んでいてもよい)を用いる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
本実施例では、層211の出力と輝度飽和マップ202の要素毎の和を取ることで飽和影響マップ203とするが、構成はこれに限定されない。飽和影響マップが直接、層211の出力として生成されてもよい。或いは、層211の出力に対して任意の処理を施した結果を飽和影響マップ203としてもよい。次に、飽和影響マップ203とぼけ画像201をチャンネル方向に連結して後続の層に入力し、複数の層(本実施例では畳み込み層16層)を介した結果、モデル出力204を生成する。モデル出力204も、層212の出力とぼけ画像201の要素ごとの和を取ることで生成されるが、構成はこれに限定されない。なお本実施例では、各層で3×3のフィルタ64種類(ただし、層211と層212は、フィルタ種類の数がぼけ画像201のチャンネル数と同数)との畳み込みを実行するが、構成はこれに限定されない。
In this embodiment, the
続いてステップS108において、更新部101dは、誤差関数に基づいて、機械学習モデルのウエイトを更新する。本実施例において、誤差関数は、飽和影響マップ203と飽和影響正解マップの誤差と、モデル出力204と正解モデル出力の誤差と、の重み付き和である。誤差の算出には、MSE(Mean Squared Error)を使用する。重みは両者1とする。ただし、誤差関数と重みはこれに限定されない。ウエイトの更新には、誤差逆伝搬法(Backpropagation)などを用いるとよい。また、誤差は残差成分に対してとってもよい。残差成分の場合、飽和影響マップ203と輝度飽和マップ202の差分成分と、飽和影響正解マップと輝度飽和マップ202の差分成分と、の誤差を用いる。同様に、モデル出力204とぼけ画像201の差分成分と、正解モデル出力とぼけ画像201の差分成分と、の誤差を用いる。
Subsequently, in step S108, the updating
続いてステップS109において、更新部101dは、機械学習モデルの学習が完了したか否かを判定する。学習の完了は、ウエイトの更新の反復回数が既定の回数に達したかや、更新時のウエイトの変化量が既定値より小さいかなどによって、判定することができる。ステップS109にて学習が完了していないと判定された場合、ステップS101へ戻り、取得部101bは1枚以上の新たな原画像を取得する。一方、学習が完了したと判定された場合、更新部101dは学習を終了し、機械学習モデルの構成とウエイトの情報を記憶部101aに記憶する。
Subsequently, in step S109, the updating
以上の学習方法によって、機械学習モデルは、ぼけ画像(推定時には撮像画像)の輝度飽和した領域の被写体がぼけによって広がった信号値の大きさと範囲を表す飽和影響マップを推定することができる。飽和影響マップを明示的に推定することで、機械学習モデルは、飽和ぼけ像と非飽和ぼけ像それぞれに対するぼけの先鋭化を、適切な領域に実行できるようになるため、アーティファクトの発生が抑制される。 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
まずステップS201において、取得部103bは、撮像画像と機械学習モデルを取得する。機械学習モデルの構成とウエイトの情報は、記憶部103aから取得される。
First, in step S201, the
続いてステップ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
まずステップS211において、取得部103bは、撮像画像から撮影状態を取得する。撮影状態とは、光学系102aのズーム位置、絞り開口径、および被写体距離のそれぞれの状態を示す(z,f,d)と、撮像素子102bの画素ピッチである。
First, in step S211, the
続いてステップS212において、取得部103bは、ステップS211で取得した撮影状態に基づいて、光学系102aの光学性能に関する情報(光学性能指標)を取得する。光学性能指標は、記憶部103aに記憶されている。光学性能指標は、撮像画像の撮像に用いた光学系102aの被写体空間とは独立した光学性能に関する情報であり、例えば飽和影響マップのような被写体空間とは独立していない情報を含まない。本実施例では、点像分布関数(PSF)の大きさ(ピーク値)と範囲(拡がり具合)を光学性能指標として用いる。ピーク値とは、PSFが有する最大の信号値であり、範囲とは、ある閾値以上の値を有する画素の数を意味する。機械学習モデルでぼけの先鋭化を行う際は、ピーク値が同じでも、ある閾値以上の値を有する画素の数が小さいぼけの方が弊害の発生量が小さいため、本実施例では光学性能指標を用いる。また、PSFのピーク値と範囲は、撮像装置102の画素ピッチに依存するため、複数の画素ピッチに対応する光学性能指標を記憶しておき、中間値は補間で作成する。
Subsequently, in step S212, the
なお光学性能指標は、光学性能を反映できたものであればよいため、光学伝達関数(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
続いてステップS213において、先鋭化部103cは、光学性能指標から、第1の重みマップおよび第2の重みマップを生成する。重みを決定する際には、ステップS212で取得した光学性能指標に基づき、図10に示される関係式から、像高ごとにぼけ先鋭化画像の重みを決定する。図10は、光学性能指標と重みとの関係を示す図である。図10において、横軸は光学性能指標、縦軸はぼけ先鋭化画像の重みをそれぞれ示す。
Subsequently, in step S213, the sharpening
実線121は非飽和領域用であり、点線122は輝度飽和領域用である。同じ光学性能指標でも、弊害の発生しやすい輝度飽和領域はぼけ先鋭化画像の重みを下げておく。本実施例では、1次式としているが、関係式は1次式に限らない。また、関係式も自由に変更が可能である。なお、光学性能指標を保持していない像高は、保持している像高点からの補間で生成する。実線121から非飽和領域用の第1の重みマップを生成し、点線122から輝度飽和領域用の第2の重みマップを生成する。
A
続いて、図8のステップS214において、先鋭化部103cは、第1の重みマップ、第2の重みマップ、および飽和影響マップに基づいて、重みマップを生成する。すなわち重みマップは、光学性能に関する情報(第1の重みマップ、第2の重みマップ)と、撮像画像の飽和領域に関する情報とに基づいて生成される。本実施例において、飽和領域に関する情報は飽和影響マップであり、RGBの全てが飽和していなくてもよい。また、飽和影響マップは、第2の信号値で規格化し、これを第1の重みマップと第2の重みマップの合成に使用する。すなわち、規格化後の数値が0から1の間になった場合、第1の重みマップと第2の重みマップの両方が寄与する。飽和影響マップを使用することで、飽和影響領域まで補正強度の調整が可能となる。なお、飽和影響マップを使用するのは必須ではなく、輝度飽和マップでもいいし、輝度飽和マップを像高ごとにぼかしたものを使用してもよい。
Subsequently, in step S214 of FIG. 8, the sharpening
図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
続いてステップS216において、先鋭化部103cは、取得した先鋭化の強度に応じて重みマップを変更する。図11は、重みマップの変更例であり、図11(B)は設定強度が1.0の場合の重みマップを示し、ステップS211にて生成したデフォルトの重みマップである。図11(C)は設定強度2.0の場合の重みマップを示し、デフォルトの重みマップを画面一律に2倍にしている。図11(A)は、設定強度0の場合の重みマップを示し、重みが全て0になっている。
Subsequently, in step S216, the sharpening
ここで、図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.
また図13において、1103は非飽和領域における補正強度の変化、1104は輝度飽和領域における補正強度の変化をそれぞれ示す。両者は同一の像高であり、光学性能が低い領域である。光学性能が低いため、デフォルトの補正強度が低く、設定強度が2.0でも輝度飽和領域の補正強度は100%まで達していない。このように、光学性能に応じて、補正強度の上限値は異なる。なお、図13に示される補正強度と設定強度との関係式はこれに限らない。例えば、クリップする代わりに、1102を設定強度2.0で補正強度100%に漸近する式を用いてもよい。また、設定強度の上限に決まりはなく、設定強度2.0以上を設定できるようにしてもよい。
In FIG. 13,
続いて、図8のステップS217において、先鋭化部103cは、重みマップに基づいて、撮像画像とぼけ先鋭化画像(モデル出力)を重み付け加算し、強度調整画像205を生成する。なお、ステップS216は省略が可能であり、スライダーで設定可能な強度調整画像を事前に全て生成しておき、ユーザの指定した強度に合わせて画像を表示してもよい。
Subsequently, in step S217 in FIG. 8, the sharpening
本実施例において、先鋭化部103cは、第1の生成手段、第2の生成手段、および調整手段としての機能を有する。第1の生成手段は、撮像画像を機械学習モデルに入力し、補正に関する情報を生成する。第2の生成手段は、撮像画像と補正に関する情報と重みマップとに基づいて強度調整画像を生成する。調整手段は、設定強度に基づいて重みマップを変更することにより強度調整画像の補正強度を調整する。また本実施例において、補正強度は、撮像画像の撮像に用いられた光学系の光学性能に関する情報と飽和領域に関する情報とに基づく、強度調整画像の第1の領域における第1の補正強度と、強度調整画像の第2の領域における第2の補正強度とを含む。第1の補正強度に対する第2の補正強度の比率は、設定強度に基づいて変化する。好ましくは、設定強度が第1の設定強度である場合、比率は第1の比率であり、設定強度が第1の設定強度よりも強い第2の設定強度である場合、比率は第1の比率よりも低い第2の比率である。
In this embodiment, the sharpening
以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 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
撮像装置302は、光学系321、撮像素子322、記憶部323、通信部324、および表示部325を有する。撮像画像は、通信部324を介して画像処理装置303へ送信される。画像処理装置303は、通信部332を介して撮像画像を受信し、記憶部331に記憶された機械学習モデルの構成とウエイトの情報を用いて、ぼけ先鋭化を行う。機械学習モデルの構成とウエイトの情報は、学習装置301によって学習されたものであり、予め学習装置301から取得され、記憶部331に記憶されている。さらに、画像処理装置303は、ぼけ先鋭化の強度を調整する機能を有する。撮像画像のぼけが先鋭化されたぼけ先鋭化画像(モデル出力)および強度が調整された強度調整画像は、撮像装置302に送信され、記憶部323に記憶、表示部325に表示される。
The
学習装置301で行う学習データの生成とウエイトの学習(学習フェーズ)と画像処理装置303で実行される、なお、学習済みの機械学習モデルを用いた撮像画像のぼけ先鋭化(推定フェーズ)は実施例1と同様のため、省略する。
Learning data generation and weight learning (learning phase) performed by the
次に、図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
まずステップS311において、先鋭化部334は、重みマップを生成する。なお、重みマップの生成方法は、実施例1と同様のため、省略する。続いてステップS312において、取得部333は、ユーザが指定した先鋭化の強度を取得する。図17を参照して、ユーザによる強度調整の例を説明する。図17は、ユーザーインターフェースの説明図である。ユーザはスライダーを動かすことで、補正強度の調整が可能である。実施例2では、ユーザは輝度飽和領域と非飽和領域の補正強度を個別に調整できる。
First, in step S311, the sharpening
続いてステップS313において、先鋭化部334は、取得した先鋭化の強度に応じて重みマップを変更する。続いてステップS314において、先鋭化部334は、重みマップに基づいて、撮像画像とぼけ先鋭化画像(モデル出力)を重み付け加算し、強度調整画像を生成する。
Subsequently, in step S313, the sharpening
以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 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
学習装置401および画像推定装置405はそれぞれ、例えばサーバである。制御装置404は、パーソナルコンピュータやモバイル端末などのユーザが操作する機器である。学習装置401は、記憶部401a、取得部401b、演算部401c、および更新部401dを有し、レンズ装置402と撮像装置403を用いて撮像された撮像画像からぼけの先鋭化をする機械学習モデルのウエイトを学習する。なお、学習方法、すなわち学習装置401で行う学習データの生成とウエイトの学習(学習フェーズ)は、実施例1と同様のため省略する。
Each of the
撮像装置403は撮像素子403aを有し、撮像素子403aがレンズ装置402の形成した光学像を光電変換して撮像画像を取得する。レンズ装置402と撮像装置403とは着脱可能であり、互いに複数種類と組み合わることが可能である。制御装置404は、通信部404a、表示部404b、記憶部404c、および取得部404dを有し、有線または無線で接続された撮像装置403から取得した撮像画像に対して、実行する処理をユーザの操作に従って制御する。或いは、撮像装置403で撮像した撮像画像を予め記憶部404cに記憶しておき、撮像画像を読み出してもよい。
The
画像推定装置405は、通信部405a、取得部405b、記憶部405c、および先鋭化部405dを有し、制御装置404と通信可能に構成されている。画像推定装置405は、ネットワーク406を介して接続された制御装置404の要求に応じて、撮像画像のぼけの先鋭化処理を実行する。画像推定装置405は、ネットワーク406を介して接続された学習装置401から、学習済みのウエイトの情報をぼけ先鋭化の推定時または予め取得し、撮像画像のぼけ先鋭化の推定に用いる。ぼけ先鋭化の推定後の推定画像は、先鋭化の強度調整が行われた後に再び制御装置404へ伝送されて、記憶部404cに記憶され、表示部404bに表示される。
The
次に、図20を参照して、制御装置404と画像推定装置405で実行される撮像画像のぼけ先鋭化に関して説明する。図20は、モデル出力および先鋭化の強度調整のフローチャートである。図20の各ステップは、主に、制御装置404または画像推定装置405の各部により実行される。
Next, with reference to FIG. 20, blur sharpening of the captured image executed by the
まずステップS401において、制御装置404の取得部404dは、撮像画像とユーザが指定した先鋭化の強度を取得する。続いてステップS402において、通信部(送信手段)404aは、画像推定装置405へ撮像画像とぼけ先鋭化の推定処理の実行に関する要求を送信する。
First, in step S401, the
続いてステップS403において、画像推定装置405の通信部(受信手段)405aは、制御装置404から送信された撮像画像と処理の要求を受信し、取得する。続いてステップS404において、取得部405bは、撮像画像に対応する学習済みのウエイトの情報を記憶部405cから取得する。ウエイトの情報は、予め記憶部401aから読み出され、記憶部405cに記憶されている。続いてステップS405において、先鋭化部405dは、機械学習モデルを用いて、撮像画像から、撮像画像のぼけが先鋭化されたぼけ先鋭化画像(モデル出力)を生成する。機械学習モデルは、学習時と同様に、図1に示される構成を有する。学習時と同様に、撮像画像の輝度飽和した領域を表す輝度飽和マップを生成して入力し、飽和影響マップとモデル出力を生成する。
Subsequently, in step S403, the communication unit (receiving means) 405a of the
続いてステップ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
以上の構成により、本実施例によれば、ぼけの発生した画像に対する機械学習を用いた回帰のタスクにおいて、ぼけの先鋭度と弊害を制御することが可能な画像処理システムを提供することができる。 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
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の設定強度よりも強い第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.
前記第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.
前記撮像画像と前記補正に関する情報と重みマップとに基づいて強度調整画像を生成する第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の装置へ送信する送信手段を有し、
前記第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.
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) |
-
2021
- 2021-12-15 JP JP2021202983A patent/JP2023088349A/en active Pending
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 |