JP2011259342A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2011259342A
JP2011259342A JP2010133622A JP2010133622A JP2011259342A JP 2011259342 A JP2011259342 A JP 2011259342A JP 2010133622 A JP2010133622 A JP 2010133622A JP 2010133622 A JP2010133622 A JP 2010133622A JP 2011259342 A JP2011259342 A JP 2011259342A
Authority
JP
Japan
Prior art keywords
angle
histogram
unit
calculation
angle histogram
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
JP2010133622A
Other languages
Japanese (ja)
Inventor
Atsushi Omiya
淳 大宮
Hitoshi Yamada
整 山田
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.)
Panasonic Corp
Original Assignee
Panasonic Corp
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 Panasonic Corp filed Critical Panasonic Corp
Priority to JP2010133622A priority Critical patent/JP2011259342A/en
Publication of JP2011259342A publication Critical patent/JP2011259342A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus capable of correcting a tilt included in an imaged image.SOLUTION: An image processing apparatus extracts tilt information included in images as an angle histogram to calculate relative tilt angles between two or more images. While a matching is performed by similarity between the angle histograms and a movement is corrected, the angle histograms are added cumulatively, and noise components are suppressed and tilt angle information is sharpened. From this result, a tilt angle is estimated to correct the tilt of the image.

Description

本発明は画像処理装置及び画像処理方法に関し、特に画像補正の技術に関するものである。   The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image correction technique.

近年、カメラ、ムービーなどの撮影装置における手ブレ補正技術において、画像の傾きを補正する技術が提案されている。   In recent years, a technique for correcting the tilt of an image has been proposed as a camera shake correction technique in a photographing apparatus such as a camera or a movie.

特許文献1には、撮像装置に加速度センサを設け、加速度センサにより重力加速度を測定することで撮像装置の地軸に対する傾きを検出し、検出した傾き角度に基づいて撮影した画像の傾きを補正する方法が開示されている。また特許文献2には、撮像画像の上部に存在する線分を検出し、それらの線分の傾き角から画像全体の傾き角を推定し、撮像画像の傾きを補正する方法が開示されている。また特許文献3には、センサと画像処理とを組み合わせて使用することで、傾き角度算出の精度を向上させる手法が示されている。   Japanese Patent Application Laid-Open No. 2004-228688 provides a method in which an acceleration sensor is provided in an imaging apparatus, the inclination of the imaging apparatus with respect to the earth axis is detected by measuring gravitational acceleration, and the inclination of an image captured based on the detected inclination angle is corrected. Is disclosed. Patent Document 2 discloses a method for detecting line segments existing above a captured image, estimating the tilt angle of the entire image from the tilt angles of those line segments, and correcting the tilt of the captured image. . Patent Document 3 discloses a method for improving the accuracy of tilt angle calculation by using a combination of a sensor and image processing.

さらに特許文献4には、画像処理を用いて画像の傾き角度を算出する際には、画像を小ブロックに分割し、個々のブロックにおけるテクスチャが示す方向性を判定し、そのテクスチャが一方向性を有する領域のみを対象として傾き角度を算出する方法が示されている。この方法は画像中の構造物のみから傾き情報を抽出することと等価であり、傾き角度算出の精度と安定性の向上に寄与するものである。   Further, in Patent Document 4, when calculating the tilt angle of an image using image processing, the image is divided into small blocks, the directionality indicated by the texture in each block is determined, and the texture is unidirectional. A method for calculating an inclination angle only for a region having a curve is shown. This method is equivalent to extracting the tilt information from only the structure in the image, and contributes to improving the accuracy and stability of the tilt angle calculation.

特開2006−245726号公報JP 2006-245726 A 特許第3676360号公報Japanese Patent No. 3676360 国際公開第2009−001512号International Publication No. 2009-001512 国際公開第2009−008174号International Publication No. 2009-008174

しかしながら、特許文献1に開示されているセンサを用いる方式では、センサの出力値に慣性ノイズや他軸感度などの変動成分が含まれるため、ムービーなど撮影者が移動しながら撮像を行う場合には高精度な傾き補正が困難であった。また、特許文献2では撮像された画像の構図に制限があり、一般的な使用状況では実用的ではなかった。   However, in the method using the sensor disclosed in Patent Document 1, the sensor output value includes fluctuation components such as inertia noise and other-axis sensitivity. Highly accurate tilt correction was difficult. Further, in Patent Document 2, there is a limitation on the composition of the captured image, which is not practical in a general use situation.

特許文献3および特許文献4では、上記の欠点を補うため、センサと画像処理を組み合わせて使用することが提案されている。しかし、これらの方式では単一の画像から傾き角度を算出することを目的としているため、画像に写っている構造物の占める面積が、自然物や人物などの非構造物に比して小さい場合には、非構造物からの傾き情報は傾き角度を算出するためのノイズ成分となり、正しい傾き角度を算出することが不可能である。この課題は、撮像装置の撮像画角が広くなるほど顕著になる。図1の(a)および(b)は同じ方向を画角を変えて撮影した画像の例であり、太線が傾き角度算出に寄与する成分である。ここでは傾き角度をθとする。図2の(a)および(b)は図1の(a)および(b)の傾き角度情報を累積した角度ヒストグラムを示しており、本来であれば図2(a)のように角度θの値が最大となる。ところが図1の(b)の太線は図1の(a)にくらべその長さが短かいため、図2の(b)のように自然物から抽出した傾き角度情報(図2における斜線部が自然物から抽出した傾き角度情報)によって抽出したい傾き角度情報を抽出できなくなっている。特許文献4ではこの課題解決のため、あらかじめ自然物を除去することで、ヒストグラム形状を保持する手法として開示されている。しかしながら、分割された小ブロックが一方向に方向性を持っていてもそれ以外の領域に乱雑な方向を持った被写体が写っている場合があること、広角撮影を行った場合には方向性を持った被写体そのものが小さく写ってしまい角度ヒストグラムのピーク検出が困難になること、などの課題を有する。   In Patent Document 3 and Patent Document 4, it is proposed to use a sensor and image processing in combination in order to compensate for the above-described drawbacks. However, since these methods aim to calculate the tilt angle from a single image, the area occupied by structures in the image is smaller than that of non-structures such as natural objects and people. The tilt information from the non-structure is a noise component for calculating the tilt angle, and it is impossible to calculate the correct tilt angle. This problem becomes more prominent as the imaging angle of view of the imaging apparatus becomes wider. (A) and (b) of FIG. 1 are examples of images taken in the same direction with different angles of view, and the thick line is a component that contributes to the calculation of the tilt angle. Here, the inclination angle is θ. FIGS. 2A and 2B show angle histograms obtained by accumulating the tilt angle information of FIGS. 1A and 1B. Originally, as shown in FIG. The value is the maximum. However, since the length of the thick line in FIG. 1B is shorter than that in FIG. 1A, the tilt angle information extracted from the natural object as shown in FIG. 2B (the shaded area in FIG. 2 is the natural object). The tilt angle information to be extracted cannot be extracted by the tilt angle information extracted from (1). In order to solve this problem, Patent Document 4 discloses a technique for maintaining a histogram shape by removing natural objects in advance. However, even if the divided small block has directionality in one direction, there may be a subject with a messy direction in other areas. The subject itself has a small size and it is difficult to detect the peak of the angle histogram.

本発明は、画像から得られる傾き角度情報が相対的に少ない場合であっても、ノイズ成分を抑制し、傾き角度推定を可能として、画像の傾きを補正することを目的とする。   An object of the present invention is to correct a tilt of an image by suppressing a noise component and enabling tilt angle estimation even when tilt angle information obtained from an image is relatively small.

画像取得部と、画像取得部で取得した画像の各画素に対して画像の傾きを推定するための情報を抽出する傾き情報算出部と、傾き情報算出部で算出した傾き情報を用いてその傾き角度ごとの度数分布である角度ヒストグラムを生成する角度ヒストグラム生成部と、角度ヒストグラム生成部で生成された前記角度ヒストグラムのうち、2個以上の角度ヒストグラムを格納する角度ヒストグラム格納部と、角度ヒストグラム格納部に格納された2個以上の角度ヒストグラムのうち、基準角度ヒストグラム1個と、基準角度ヒストグラムとは異なる比較対象角度ヒストグラム1個を選択し、角度ヒストグラム格納部から読み出す読み出し部と、基準角度ヒストグラムと比較対象角度ヒストグラムとの形状の類似度と移動量を調べるマッチング部と、マッチング部の出力する類似度を用いて、基準角度ヒストグラムと比較対象角度ヒストグラム間で演算が可能かどうかを判定する演算可否判定部と、演算可否判定部の判定結果が可であった場合に、基準角度ヒストグラムと比較対象角度ヒストグラム間で移動量を用いて演算を行って演算後角度ヒストグラムを生成し、判定結果が否であった場合には演算を行わずに基準角度ヒストグラムを演算後角度ヒストグラムとする、角度ヒストグラム演算部と、演算後角度ヒストグラムの最大値あるいは極大値を検出するピーク検出部と、ピーク検出部が検出した最大値あるいは極大値が示す傾き角度から画像の傾き角度を推定する傾き推定部と、推定された傾き角度を用いて画像の傾きを補正する画像補正部とを備える画像処理装置である。   An image acquisition unit, an inclination information calculation unit that extracts information for estimating an image inclination with respect to each pixel of the image acquired by the image acquisition unit, and the inclination using the inclination information calculated by the inclination information calculation unit An angle histogram generation unit that generates an angle histogram that is a frequency distribution for each angle, an angle histogram storage unit that stores two or more angle histograms among the angle histograms generated by the angle histogram generation unit, and an angle histogram storage A reading unit that selects one reference angle histogram and one comparison target angle histogram different from the reference angle histogram from two or more angle histograms stored in the unit, and reads out from the angle histogram storage unit; and a reference angle histogram And a matching unit for examining the degree of similarity and movement amount of the comparison target angle histogram, When the determination result of the calculation enable / disable determining unit and the calculation enable / disable determining unit for determining whether the calculation is possible between the reference angle histogram and the comparison target angle histogram using the similarity output by the hatching unit is possible, A calculated angle histogram is generated by performing an operation using the amount of movement between the reference angle histogram and the comparison target angle histogram, and if the determination result is negative, the reference angle histogram is calculated without performing the calculation. An angle histogram calculation unit, a peak detection unit that detects the maximum value or maximum value of the calculated angle histogram, and an inclination angle of the image are estimated from the inclination angle indicated by the maximum value or maximum value detected by the peak detection unit. An image processing apparatus includes an inclination estimation unit and an image correction unit that corrects the inclination of an image using an estimated inclination angle.

本構成によって、ある画像の傾き角度を推定する際に、対象画像のみでなく複数の画像の傾き角度情報を利用することができる。   With this configuration, when estimating the tilt angle of a certain image, the tilt angle information of a plurality of images as well as the target image can be used.

本発明の画像処理装置および方法によれば、画像の傾き角度を推定する際に画像に含まれる傾き角度情報が少なく従来であれば傾き角度の推定、補正が困難であった画像であってもその傾き角度を推定、補正することができる。   According to the image processing apparatus and method of the present invention, even when an inclination angle of an image is estimated, there is little inclination angle information included in the image, and it is difficult to estimate and correct the inclination angle in the past. The tilt angle can be estimated and corrected.

通常画角画像(a)と広角画像(b)とを比較した図である。It is the figure which compared the normal view angle image (a) and the wide angle image (b). 図1の(a)および(b)の画像の角度ヒストグラムにおける構造物、自然物それぞれの影響を示した図である。It is the figure which showed the influence of each structure and natural thing in the angle histogram of the image of (a) and (b) of FIG. 本発明の実施の形態1における画像処理装置の構成を示す図である。It is a figure which shows the structure of the image processing apparatus in Embodiment 1 of this invention. 本発明の実施の形態1における画像処理方法を示すフローチャートである。It is a flowchart which shows the image processing method in Embodiment 1 of this invention. 線分上の点における輝度勾配を説明する図である。It is a figure explaining the brightness | luminance gradient in the point on a line segment. Sobelフィルタで用いられる係数行列を示す図である。It is a figure which shows the coefficient matrix used with a Sobel filter. Hough変換における線分を特徴付けるパラメータを説明する図である。It is a figure explaining the parameter which characterizes the line segment in Hough conversion. 画像、角度ヒストグラムとその累積加算の流れを説明する図である。It is a figure explaining the flow of an image, an angle histogram, and its accumulation addition. 本発明の実施の形態2における画像処理装置の構成を示す図である。It is a figure which shows the structure of the image processing apparatus in Embodiment 2 of this invention. 加速度センサの3軸の出力値の一例を示す図である。It is a figure which shows an example of the output value of 3 axes | shafts of an acceleration sensor. 加速度センサを用いて傾き検出を行う再のx方向、y方向の出力値の一例を示す図である。It is a figure which shows an example of the output value of the re-x direction and y direction which perform inclination detection using an acceleration sensor. 加速度センサの出力値から鉛直方向を指し示すベクトルを生成する一例を示す図である。It is a figure which shows an example which produces | generates the vector which points to a perpendicular direction from the output value of an acceleration sensor.

以下本発明の実施の形態の構成と動作について、図面を参照しながら説明する。   The configuration and operation of the embodiment of the present invention will be described below with reference to the drawings.

(実施の形態1)
図3は、本発明の実施の形態1における画像処理装置の構成を示す図である。また、図4は、本発明の実施の形態1における画像処理方法を示すフローチャートである。
(Embodiment 1)
FIG. 3 is a diagram showing the configuration of the image processing apparatus according to Embodiment 1 of the present invention. FIG. 4 is a flowchart showing the image processing method according to Embodiment 1 of the present invention.

画像取得部301は撮像部307で取得した画像データを画像処理装置300に取り込み、傾き情報算出部302に送る(S401)。傾き情報算出部302では、取り込んだ画像に対して傾き情報を算出する(S402)。その手法としては、画像をグレースケール変換し、画素ごとに縦方向、横方向のSobelフィルタを作用させ、その結果を合成して勾配ベクトルを算出する方法や、画像から線分抽出を行うHough変換を作用させ、線分長さとその傾き角度を算出する方法などがあるが、本発明はこれに限定するものではない。   The image acquisition unit 301 takes the image data acquired by the imaging unit 307 into the image processing apparatus 300 and sends it to the tilt information calculation unit 302 (S401). The inclination information calculation unit 302 calculates inclination information for the captured image (S402). As the method, grayscale conversion is performed on the image, a vertical and horizontal Sobel filter is applied to each pixel, and the result is combined to calculate a gradient vector, or Hough conversion that extracts a line segment from the image However, the present invention is not limited to this method.

ここで、勾配ベクトルの算出について図5、図6を用いて説明する。図5において位置Pにおける画像の画素値をI(P)とし、Pにおけるx方向、y方向のコントラスト変化をそれぞれdx、dyとしたとき、   Here, calculation of the gradient vector will be described with reference to FIGS. In FIG. 5, when the pixel value of the image at the position P is I (P) and the contrast changes in the x and y directions at P are dx and dy, respectively.

と表せる。このとき、コントラスト変化の方向をθとすると、 It can be expressed. At this time, if the direction of contrast change is θ,

が成り立ち、これが前述の勾配ベクトルの方向に相当する。dx、dyを求めるには図6に示すSobelフィルタを用いる。図6の(a)および(b)は、それぞれx方向、y方向のコントラスト変化を測定するためのフィルタ要素である。次にHough変換による線分検出について図7を用いて説明する。図7の(a)において、点(x_i、y_i)を通る直線は次式を満たす。 And this corresponds to the direction of the gradient vector. The Sobel filter shown in FIG. 6 is used to obtain dx and dy. 6A and 6B are filter elements for measuring contrast changes in the x direction and the y direction, respectively. Next, line segment detection by Hough transform will be described with reference to FIG. In FIG. 7A, a straight line passing through the point (x_i, y_i) satisfies the following equation.

なお、ρは直線と原点との距離、θは原点から直線への垂線とx軸のなす角を表す。   Here, ρ represents the distance between the straight line and the origin, and θ represents the angle between the perpendicular line from the origin to the straight line and the x axis.

これは点(x_i、y_i)を通る直線群が図7の(b)における一本の曲線に対応付けられることを意味する。一方、同じ直線状にある複数の点について同様の対応を行うと、得られる複数の曲線は一点で交わり、この交点(ρ、θ)がこれらの点を通る直線を示している。すなわち、あるθに着目し、ρの数をカウントすることで傾きθの線分の数が取得できる。   This means that a group of straight lines passing through the point (x_i, y_i) is associated with one curve in (b) of FIG. On the other hand, when the same correspondence is performed with respect to a plurality of points on the same straight line, a plurality of obtained curves intersect at one point, and this intersection (ρ, θ) indicates a straight line passing through these points. That is, paying attention to a certain θ, the number of line segments of the inclination θ can be acquired by counting the number of ρ.

角度ヒストグラム生成部303は勾配ベクトルうち同じ方向成分を持つものを累積する、あるいはHough変換で求めた線分のうち同じ方向成分を持つものをその長さ分加算する、といった処理を行うことによって角度ヒストグラムを生成する(S403)。この角度ヒストグラムは「ある角度方向のエッジがどれほど存在するか」を表す指標となり、一般に画像に傾きがない状態で構造物のみが写っている場合(歪がない場合)には水平線や垂直線成分が多くなるため、0度および90度の角度ヒストグラムの値が強いピークを持つ形状となる。図1および図2の(a)のようにθだけ傾いた画像であれば、傾きがない場合の角度ヒストグラムがθだけ平行移動した角度ヒストグラムが得られる。   The angle histogram generator 303 accumulates the gradient vectors having the same direction component, or adds the lengths of the line segments obtained by the Hough transform having the same direction component. A histogram is generated (S403). This angle histogram is an index that represents "how many edges exist in a certain angle direction". Generally, when only the structure is shown in the image with no tilt (when there is no distortion), the horizontal and vertical line components Therefore, the angle histogram values of 0 degree and 90 degrees have a strong peak. If the image is tilted by θ as shown in FIGS. 1 and 2, an angle histogram obtained by translating the angle histogram when there is no tilt by θ is obtained.

従来の画像処理による傾き角度推定では、ピーク検出部304によって角度ヒストグラムの最大値を示す角度を探索し、傾き推定部305によって角度ヒストグラムの最大値を示す角度をそのまま画像の傾き角度として、画像補正部306においてその傾き角度を補正する処理を行っていた。あるいはピーク検出部304において最大値を含む極大値数点を選択し、傾き推定部305ではその極大値を滑らかにつなぐような包絡線を多項式内挿、最少二乗法、勾配法などで算出したうえで最大値を解析的に算出し、これを画像の傾き角度として、画像補正部306においてその傾きを補正していた。一般に画像補正部306ではアフィン変換によって回転が補正される。本発明においても角度ヒストグラムからの傾き角度の推定とアフィン変換による補正は同様の処理を行う。   In the tilt angle estimation by the conventional image processing, the peak detection unit 304 searches for the angle indicating the maximum value of the angle histogram, and the tilt estimation unit 305 directly uses the angle indicating the maximum value of the angle histogram as the image tilt angle to perform image correction. The unit 306 performs processing for correcting the tilt angle. Alternatively, the peak detection unit 304 selects several local maximum points including the maximum value, and the slope estimation unit 305 calculates an envelope that smoothly connects the local maximum values by polynomial interpolation, the least square method, the gradient method, and the like. The maximum value is calculated analytically, and this is used as the tilt angle of the image, and the tilt is corrected by the image correction unit 306. In general, the image correction unit 306 corrects rotation by affine transformation. In the present invention, the same processing is performed for the estimation of the tilt angle from the angle histogram and the correction by the affine transformation.

角度ヒストグラム格納部310は撮像部307で撮像される画像あるいはムービーの各フレームを301から303の各処理ブロックで処理した後の角度ヒストグラムを一時的に格納する(S411)。読み出し部311は傾き補正を行いたい画像の角度ヒストグラムを基準角度ヒストグラム、その画像に時間的に隣接する画像の角度ヒストグラムを比較対象角度ヒストグラムとして、両者を角度ヒストグラム格納部310から読み出し、マッチング部312に送る(S412)。   The angle histogram storage unit 310 temporarily stores an angle histogram after each frame of the image or movie captured by the imaging unit 307 is processed by the processing blocks 301 to 303 (S411). The reading unit 311 reads the angle histogram of the image to be tilt-corrected as the reference angle histogram, the angle histogram of the image temporally adjacent to the image as the comparison target angle histogram, and reads both from the angle histogram storage unit 310, and the matching unit 312. (S412).

マッチング部312は2つのヒストグラムの類似度判定を行う(S413)。この処理を図8を用いて説明する。一般に撮像部307でムービーが撮影された場合、フレーム間の時間的な隔たりは33ms〜66ms程度(30フレーム/秒から15フレーム/秒)であり、時間的に隣接した画像の構成要素には大きな変化はないため、それらの角度ヒストグラムにも必然的に大きな差は現れない。そのため、2つの画像の角度ヒストグラムはお互いの相対的な回転角度だけ平行移動したものとなる。マッチング部312では2つの角度ヒストグラム間の類似度と平行移動量を算出できればよいので、画像や信号波形の類似度を計測するために一般的に用いられている相互相関関数や、ヒストグラムの類似度を計測するためによく用いられるヒストグラムインタセクションなどによって計算する。相互相関関数はその最大値が類似度、最大値を与える変数が2つのヒストグラム間に存在する相対的な移動量となるが、ヒストグラムインタセクションではインタセクションを計算する変数をずらしながら行うことによって、最大のヒストグラムインタセクション値を類似度、それを与える変数のずれ量を移動量とする。相対的な移動量は基準ヒストグラム側を基準として扱うものとし、「基準角度ヒストグラムに対する比較対象角度ヒストグラムの移動量」とみなす。   The matching unit 312 determines the similarity between the two histograms (S413). This process will be described with reference to FIG. In general, when a movie is shot by the image pickup unit 307, the time interval between frames is about 33 ms to 66 ms (30 frames / second to 15 frames / second), which is a major component of temporally adjacent images. Since there is no change, there is inevitably a large difference in their angle histograms. Therefore, the angle histograms of the two images are translated by the relative rotation angle of each other. Since the matching unit 312 only needs to be able to calculate the similarity between two angle histograms and the amount of parallel movement, the cross-correlation function generally used to measure the similarity of images and signal waveforms, and the similarity of histograms Is calculated by a histogram intersection or the like that is often used to measure. The cross-correlation function has the maximum value as the similarity, and the variable that gives the maximum value is the relative movement amount existing between the two histograms. In the histogram intersection, by shifting the variable for calculating the intersection, The maximum histogram intersection value is the similarity, and the shift amount of the variable giving it is the movement amount. The relative movement amount is treated with the reference histogram side as a reference, and is regarded as “the movement amount of the comparison target angle histogram with respect to the reference angle histogram”.

演算可否判定部313は、マッチング部312が算出した類似度を所定の基準と比較し、2つの角度ヒストグラム間で演算を行ってよいかどうかを判断する(S414)。基準値の設定は、例えば相互相関関数を用いる場合、その最大値は基準角度ヒストグラムの自己相関関数の最大値を超えることはないので、自己相関関数のx%などとしてよい。あるいはヒストグラムインタセクションを使用する場合、基準角度ヒストグラム同士のインタセクションの最大値が100%と定義されるとき、そのy%などとしてよい。ここでは時間的に隣接した画像の角度ヒストグラムを比較することを前提としており、画像の構成に大きな変化がないことを想定しているため、x=80、y=75など比較的大きな値とするほうがよい。   The calculation availability determination unit 313 compares the similarity calculated by the matching unit 312 with a predetermined reference, and determines whether or not the calculation can be performed between the two angle histograms (S414). For example, when a cross-correlation function is used, the reference value may be set to x% of the auto-correlation function because the maximum value does not exceed the maximum value of the auto-correlation function of the reference angle histogram. Alternatively, when using a histogram intersection, if the maximum value of the intersection between the reference angle histograms is defined as 100%, it may be y% thereof. Here, it is assumed that the angle histograms of temporally adjacent images are compared, and it is assumed that there is no significant change in the configuration of the images, so a relatively large value such as x = 80, y = 75 is set. Better.

角度ヒストグラム演算部314では、演算可否判定部313での可否判定結果と、基準角度ヒストグラムに対する比較対象角度ヒストグラムの移動量と、2つの角度ヒストグラムを受け取り、可否判定結果にしたがって演算後角度ヒストグラムを生成する。可否判定結果が可である場合、演算後角度ヒストグラムは基準角度ヒストグラムと移動量だけ変数をずらした比較対象角度ヒストグラムとを変数ごとに演算(加算)する(S415)。可否判定結果が否である場合、演算を行わずに基準角度ヒストグラムを演算後角度ヒストグラムとする(S416)。   The angle histogram calculation unit 314 receives the determination result of the calculation determination unit 313, the amount of movement of the comparison angle histogram with respect to the reference angle histogram, and two angle histograms, and generates a calculated angle histogram according to the determination result. To do. If the determination result is acceptable, the calculated angle histogram is calculated (added) for each variable between the reference angle histogram and the comparison target angle histogram in which the variable is shifted by the movement amount (S415). When the determination result is negative, the reference angle histogram is set as the post-calculation angle histogram without performing the calculation (S416).

ここで傾き情報算出部302で算出される傾き角度情報は大きく2つに分類できる。ひとつは構造物から抽出される、強い方向性を持った傾き角度情報、もう一つは非構造物(自然物、人など)から抽出される傾き角度情報の分散値が大きい傾き角度情報である。非構造物からの傾き角度情報は構造物と比較してコントラストが低いため、その傾き角度情報が安定せず、したがってホワイトノイズ的な性質を持つ。例えば木の葉、木肌、芝生などは画像ごとにその傾き角度情報に揺らぎが生じる。対して構造物はコントラストが高いため、傾き角度情報は安定して所定の方向に出続ける。角度ヒストグラムにはこれら2つの成分が混在しているが、マッチング部312で算出した移動量を補正した上で累積加算を行うことで、非構造物からの傾き角度情報は平均化されていくのに対して、構造物からの傾き角度情報は強調されていくこととなる。   Here, the inclination angle information calculated by the inclination information calculation unit 302 can be roughly classified into two types. One is tilt angle information having a strong direction extracted from a structure, and the other is tilt angle information having a large variance value of tilt angle information extracted from a non-structure (natural object, person, etc.). Since the tilt angle information from the non-structure has a low contrast as compared with the structure, the tilt angle information is not stable and thus has white noise characteristics. For example, foliage, bark, lawn, etc. fluctuate in the tilt angle information for each image. On the other hand, since the structure has high contrast, the tilt angle information continues to be output in a predetermined direction stably. Although these two components are mixed in the angle histogram, the inclination angle information from the non-structure is averaged by performing the cumulative addition after correcting the movement amount calculated by the matching unit 312. On the other hand, the tilt angle information from the structure is emphasized.

したがってS401からS416までのステップを適切な時間幅を持つ画像間で実施することにより、演算後ヒストグラムにおける非構造物の影響は相対的に小さくなり、逆に構造物からの情報は先鋭化される。その結果、非構造物殻の傾き角度情報に埋もれていた構造物の傾き角度情報を、ピーク検出部304において検出可能とすることができる(S404)。傾き推定部305はピーク検出部304において検出した最頻値を与える角度を傾き推定角度と設定し、この情報を画像補正部306へ送る(S405)。画像補正部306では例えばアフィン変換などを行って、画像全体を回転させることよって画像間の回転移動量を補正することができる。ここで、傾き推定部305は、ピーク検出部304で検出された最頻値を与える角度が直前に傾き推定部305で推定された傾き角度と大きく異なっている場合、ピーク検出部304で得られた結果を無視し、直前に推定された角度を傾き角度としてもよい。あるいは、傾き推定部305が直前に推定した傾き角度に対して適当な誤差許容範囲(例えば±1゜など)を設定し、この範囲内でのヒストグラム最頻値をピーク検出部304から抽出して、これを推定角度としてもよい。いずれの場合も最終的に画像補正部306において画像全体を回転させることによって、目的の画像の補正が完了する(S406)。   Therefore, by performing the steps from S401 to S416 between images having appropriate time widths, the influence of non-structures in the post-computation histogram becomes relatively small, and conversely, information from the structures is sharpened. . As a result, the tilt angle information of the structure buried in the non-structure shell tilt angle information can be detected by the peak detection unit 304 (S404). The inclination estimation unit 305 sets the angle that gives the mode value detected by the peak detection unit 304 as the inclination estimation angle, and sends this information to the image correction unit 306 (S405). The image correction unit 306 can correct the amount of rotational movement between images by rotating the entire image by performing, for example, affine transformation. Here, the inclination estimation unit 305 obtains the peak detection unit 304 when the angle that gives the mode value detected by the peak detection unit 304 is significantly different from the inclination angle estimated by the inclination estimation unit 305 immediately before. The angle estimated just before may be used as the tilt angle. Alternatively, an appropriate error allowable range (for example, ± 1 °) is set for the inclination angle estimated immediately before by the inclination estimation unit 305, and the histogram mode value within this range is extracted from the peak detection unit 304. This may be the estimated angle. In either case, the image correction unit 306 finally rotates the entire image to complete the correction of the target image (S406).

補正後の画像は記憶部308に格納した後、図示しないモニタ装置に表示したり、図示しない外部記憶装置にファイルとして保存したり、してよい。また、ネットワークを介して送出してもよい。   The corrected image may be stored in the storage unit 308 and then displayed on a monitor device (not shown) or saved as a file in an external storage device (not shown). Moreover, you may send out via a network.

以上が本発明の一例である画像処理装置300の構成と動作である。   The above is the configuration and operation of the image processing apparatus 300 which is an example of the present invention.

なお、傾き角度を推定するために必要な情報を保有していない画像に対しては、何も処理を行わないようにしてもよい。たとえば、人物や自然物が画面いっぱいに映っている画像では、構造物情報が存在しないために傾き情報の算出が行えない。このような場合には視覚的にも画像の傾きについての感度が低くなる(傾いていても品質の低下を感じにくくなる)ため、人物や自然物から抽出した不安定かつ確度の低い傾き推定角度を用いて補正を行うよりも、補正自体をキャンセルしたほうがよい。   Note that no processing may be performed on an image that does not have information necessary to estimate the tilt angle. For example, in an image in which a person or a natural object is shown on the entire screen, the tilt information cannot be calculated because there is no structure information. In such a case, the sensitivity to the tilt of the image is low visually (it is difficult to perceive a decrease in quality even if it is tilted), so an unstable and low accuracy tilt estimation angle extracted from a person or a natural object is used. It is better to cancel the correction itself than to use it for correction.

なお、推定された傾き角度を保存するバッファを設けてもよい。このバッファには時系列で算出された推定傾き角度を保存しておき、ある一枚の画像の傾き角度の算出が不可であった場合に、その前後の傾き角度推定が成功した結果を用いた補間を行うことで推定を行ってもよい。ムービーなど連続した画像を取得する機器においては、画像の傾き角度は連続的に変化することが一般的であるためであり、この性質を用いることで、過去の傾き角度推定結果から外挿処理を用いて対象画像の傾き角度を推定することも可能である。   A buffer that stores the estimated tilt angle may be provided. This buffer stores the estimated tilt angle calculated in time series, and when the tilt angle of a single image cannot be calculated, the result of successful tilt angle estimation before and after that is used. The estimation may be performed by performing interpolation. This is because the inclination angle of an image generally changes continuously in a device that acquires continuous images such as a movie, and by using this property, extrapolation processing can be performed from past inclination angle estimation results. It is also possible to estimate the tilt angle of the target image.

(実施の形態2)
図9は、本発明の実施の形態2における画像処理装置の構成を示す図である。図9において、図3と同じ構成要素については同じ符号を用い、説明を省略する。
(Embodiment 2)
FIG. 9 is a diagram showing the configuration of the image processing apparatus according to Embodiment 2 of the present invention. 9, the same components as those in FIG. 3 are denoted by the same reference numerals, and description thereof is omitted.

センサ部901は撮像部307の内部あるいは外部に設置され、撮像部307の動きを所定の周期で計測、出力する。一般に撮像部307が画像をキャプチャするときに同期して、その動きを計測するのがよい。センサ部901は加速度センサ、ジャイロセンサ、方位センサなどで構成されており、理想的には撮像部307の動きすべてを計測できるよう、それぞれ3軸の計測軸を持つことが求められるが、必ずしもすべての軸を必要とはしない。画像データとセンサデータは画像処理装置300の内部では同期するように扱われる。センサ取得部902は取得したセンサデータを処理し、推定傾き角度を算出するための補助情報を算出する。   The sensor unit 901 is installed inside or outside the imaging unit 307, and measures and outputs the movement of the imaging unit 307 at a predetermined cycle. Generally, it is better to measure the movement in synchronization with the image capturing unit 307 capturing an image. The sensor unit 901 includes an acceleration sensor, a gyro sensor, an orientation sensor, and the like. Ideally, the sensor unit 901 is required to have three measurement axes in order to measure all the movements of the imaging unit 307. You don't need an axis. Image data and sensor data are handled so as to be synchronized inside the image processing apparatus 300. The sensor acquisition unit 902 processes the acquired sensor data and calculates auxiliary information for calculating the estimated tilt angle.

例えば、図10は加速度センサの3軸の出力値の一例を示したものである。本実施の形態においてはセンサの出力値そのものはさほど重要ではなく、それよりも波形の変化する周期やタイミングが重要となる。図10において、(a)、(b)、(c)のタイミングですべての軸で波形が変化しており、これによりある軸について何かの動きが生じた、ということよりもこのタイミングで撮像部307全体に衝撃が加えられた、ということがわかる。この衝撃が例えば歩行時の足の着地による衝撃である場合には(a)から(b)の期間、あるいは(b)から(c)の期間は比較的安定しており、画像の構図自体も時間的に前後の画像と比較して大きな変化はないものと予測することができる。したがってそれぞれの期間に撮影された画像から生成した角度ヒストグラムはその形状は似ているものとなるため、累積加算することが可能となる。一般的には歩行は2ヘルツ程度、走るときは〜5ヘルツであり、30fpsで撮影された動画の場合、6〜15枚程度の画像を累積加算することが可能となることを示している。このような情報を読み出し部311に入力して、角度ヒストグラム格納部310から当該の角度ヒストグラムを読み出してマッチング、演算可否判定、確保ヒストグラム演算(累積加算)を行うことで、より精度の高い推定傾き角度の算出が可能となる。   For example, FIG. 10 shows an example of triaxial output values of the acceleration sensor. In the present embodiment, the output value of the sensor itself is not so important, and the period and timing at which the waveform changes are more important than that. In FIG. 10, the waveforms change on all axes at the timings (a), (b), and (c), and imaging is performed at this timing rather than that some movement has occurred about a certain axis. It can be seen that an impact was applied to the entire portion 307. If this impact is caused by, for example, a foot landing during walking, the period from (a) to (b) or (b) to (c) is relatively stable, and the image composition itself is It can be predicted that there is no significant change in comparison with the previous and subsequent images. Therefore, the angle histograms generated from the images taken in the respective periods have similar shapes, and can be cumulatively added. In general, walking is about 2 Hz, running is ˜5 Hz, and in the case of a moving image shot at 30 fps, it is possible to cumulatively add about 6 to 15 images. By inputting such information to the reading unit 311, reading the angle histogram from the angle histogram storage unit 310, performing matching, calculation feasibility determination, and securing histogram calculation (cumulative addition), a more accurate estimated slope The angle can be calculated.

なお、ここでは加速度センサ3軸での例を用いたが、ジャイロセンサを用いてもよい。また、必ずしも3軸である必要はなく、それよりも多くても少なくてもよい。ただし、撮像部307自体の動きを検知したものであるのか、それとも歩行時の衝撃のような外乱的な要因によるものなのかを判定するためには、情報は冗長であるほうがよく、少なくとも2軸以上(異なるセンサでもよい)を備えることが望ましい。   Although an example with three axes of the acceleration sensor is used here, a gyro sensor may be used. Further, it is not always necessary to have three axes, and it may be more or less than that. However, in order to determine whether the movement of the imaging unit 307 itself is detected or due to a disturbance factor such as an impact during walking, the information should be redundant, and at least two axes It is desirable to provide the above (may be different sensors).

また、例えば加速度センサ、ジャイロセンサを用いて撮像部307の傾き角度をセンサによって大まかに推定し、傾き推定部305で推定傾き角度を算出する際の制約条件とすることもできる。図11はx方向、y方向の加速度の変化を示した一例である。図11の(a)、(b)、(c)のタイミングでそれぞれの方向の加速度を取得し、2次元平面にマッピングしてベクトル化したものを図12に示す。図12の(a)、(b)、(c)のベクトルはその方向が撮像部307の撮像時の鉛直方向に対する傾き角度を示しているため、これが鉛直方向を向くように画像を回転させることで傾きを除去できる。ところで、歩きながらの撮影ではセンサの値が慣性ノイズや他軸感度などで正確でなくなる場合がある。その場合には本発明で明らかにした方法での補正が必要となるが、センサによって計測された傾き方向を傾き推定部305に入力することにより、本発明の効果をさらに高めることができる。すなわち、センサによって示された方向が画像の真の鉛直方向である可能性が高いとし、センサの示す方向を中心として所定の範囲を設定し、ピーク検出部304においてはその設定された範囲内の最頻値を傾き角度とする。なお、範囲設定は固定値でも変動値でもよく、変動値の場合には動きの大きさ、すなわちセンサの振幅や安定度(所定時間範囲内の分散値などが利用できる)によって変化させてもよい。その場合は動きが小さいときはセンサの出力値の誤差は小さいと判断して範囲を狭く設定し、動きが大きいときは誤差が大きいと判断して範囲を広く設定する。その変化は連続的でもよいし、2段階以上の離散値であってもよい。あるいは、画像から推定角度を算出するための情報が得られない場合は、過去の推定結果、あるいは前後の推定結果と、センサ値とから推定角度を算出してもよい。その場合、時系列上で連続的に取得された画像であれば傾き角度も連続的に変化する、という仮定を適用し、すでに推定済みの角度に対して許容値を設定して、その範囲内にセンサ値が収まっていればその値を補正値とする、といった方式が考えられる。   Further, for example, the inclination angle of the imaging unit 307 can be roughly estimated by a sensor using an acceleration sensor or a gyro sensor, and a constraint condition can be set when the estimated inclination angle is calculated by the inclination estimation unit 305. FIG. 11 is an example showing changes in acceleration in the x and y directions. FIG. 12 shows an acceleration obtained in each direction at the timings (a), (b), and (c) in FIG. 11 and mapped to a two-dimensional plane and vectorized. The vectors of (a), (b), and (c) in FIG. 12 indicate the inclination angle with respect to the vertical direction when the image capturing unit 307 captures the image. Therefore, the image is rotated so that the vector is directed in the vertical direction. Can remove the tilt. By the way, in shooting while walking, the sensor value may not be accurate due to inertia noise, other axis sensitivity, or the like. In that case, correction by the method clarified in the present invention is required, but the effect of the present invention can be further enhanced by inputting the tilt direction measured by the sensor to the tilt estimation unit 305. That is, it is highly likely that the direction indicated by the sensor is the true vertical direction of the image, a predetermined range is set around the direction indicated by the sensor, and the peak detection unit 304 has a range within the set range. The mode value is defined as the tilt angle. The range setting may be a fixed value or a fluctuation value. In the case of a fluctuation value, it may be changed depending on the magnitude of movement, that is, the amplitude or stability of the sensor (a dispersion value within a predetermined time range can be used). . In this case, when the motion is small, it is determined that the error of the sensor output value is small and the range is set narrow. When the motion is large, the error is determined to be large and the range is set wide. The change may be continuous or a discrete value having two or more steps. Alternatively, when the information for calculating the estimated angle cannot be obtained from the image, the estimated angle may be calculated from the past estimation result, the previous and subsequent estimation results, and the sensor value. In that case, the assumption is made that the tilt angle also changes continuously if the images are acquired continuously in time series, and an allowable value is set for the angle that has already been estimated. If the sensor value falls within the range, a method may be considered in which the value is used as a correction value.

以上が本発明における実施の形態2における画像処理装置300の構成と動作である。   The above is the configuration and operation of the image processing apparatus 300 according to the second embodiment of the present invention.

(その他変形例)
なお、本発明を上記実施の形態に基づいて説明してきたが、本発明は、上記の実施の形態に限定されないのはもちろんである。以下のような場合も本発明に含まれる。
(Other variations)
Although the present invention has been described based on the above embodiment, it is needless to say that the present invention is not limited to the above embodiment. The following cases are also included in the present invention.

(1)上記の各装置は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコンピュータシステムである。前記RAMまたはハードディスクユニットには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムにしたがって動作することにより、各装置は、その機能を達成する。ここでコンピュータプログラムは、所定の機能を達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて構成されたものである。   (1) Each of the above devices is specifically a computer system including a microprocessor, a ROM, a RAM, a hard disk unit, a display unit, a keyboard, a mouse, and the like. A computer program is stored in the RAM or hard disk unit. Each device achieves its functions by the microprocessor operating according to the computer program. Here, the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.

(2)上記の各装置を構成する構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)から構成されているとしてもよい。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROM、RAMなどを含んで構成されるコンピュータシステムである。前記RAMには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムにしたがって動作することにより、システムLSIは、その機能を達成する。   (2) A part or all of the constituent elements constituting each of the above-described devices may be configured by one system LSI (Large Scale Integration). The system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of components on a single chip, and specifically, a computer system including a microprocessor, ROM, RAM, and the like. . A computer program is stored in the RAM. The system LSI achieves its functions by the microprocessor operating according to the computer program.

(3)上記の各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしてもよい。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAMなどから構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムにしたがって動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしてもよい。   (3) Part or all of the constituent elements constituting each of the above devices may be configured from an IC card that can be attached to and detached from each device or a single module. The IC card or the module is a computer system including a microprocessor, a ROM, a RAM, and the like. The IC card or the module may include the super multifunctional LSI described above. The IC card or the module achieves its function by the microprocessor operating according to the computer program. This IC card or this module may have tamper resistance.

(4)本発明は、上記に示す方法であるとしてもよい。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプログラムからなるデジタル信号であるとしてもよい。   (4) The present invention may be the method described above. Further, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.

また、本発明は、前記コンピュータプログラムまたは前記デジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD−ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu−ray Disc)、半導体メモリなどに記録したものとしてもよい。また、これらの記録媒体に記録されている前記デジタル信号であるとしてもよい。   The present invention also provides a computer-readable recording medium such as a flexible disk, hard disk, CD-ROM, MO, DVD, DVD-ROM, DVD-RAM, BD (Blu-ray Disc). ), Recorded in a semiconductor memory or the like. The digital signal may be recorded on these recording media.

また、本発明は、前記コンピュータプログラムまたは前記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしてもよい。   In the present invention, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, a data broadcast, or the like.

また、本発明は、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセッサは、前記コンピュータプログラムにしたがって動作するとしてもよい。   The present invention may be a computer system including a microprocessor and a memory, wherein the memory stores the computer program, and the microprocessor operates according to the computer program.

また、前記プログラムまたは前記デジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記デジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。   In addition, the program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like, and executed by another independent computer system. It is good.

(5)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。   (5) The above embodiment and the above modifications may be combined.

本発明にかかる画像処理装置は、撮影装置あるいは画像表示装置、映像表示装置へ組み込むことで、取得した画像の傾きを補正し、正しい向きの画像を生成することができる。従来の画像処理を用いた傾き補正装置では補正困難であった画像であっても、複数の画像情報を統合することで所望の画像の傾き情報を抽出することができる。また、本発明は撮影装置、表示装置のみではなく、映像を扱うプリンタやスキャナなどの電子媒体以外の傾き補正への応用も可能である。   The image processing apparatus according to the present invention can be incorporated into a photographing apparatus, an image display apparatus, or a video display apparatus, thereby correcting the inclination of the acquired image and generating an image with the correct orientation. Even for an image that has been difficult to be corrected by a conventional tilt correction apparatus using image processing, tilt information of a desired image can be extracted by integrating a plurality of pieces of image information. The present invention can be applied not only to a photographing apparatus and a display apparatus but also to tilt correction other than electronic media such as a printer or a scanner that handles video.

300 画像処理装置
301 画像取得部
302 傾き情報算出部
303 角度ヒストグラム生成部
304 ピーク検出部
305 傾き推定部
306 画像補正部
307 撮像部
308 記憶部
310 角度ヒストグラム格納部
311 読み出し部
312 マッチング部
313 演算可否判定部
314 角度ヒストグラム演算部
901 センサ部
902 センサ取得部
DESCRIPTION OF SYMBOLS 300 Image processing apparatus 301 Image acquisition part 302 Inclination information calculation part 303 Angle histogram generation part 304 Peak detection part 305 Inclination estimation part 306 Image correction part 307 Imaging part 308 Storage part 310 Angular histogram storage part 311 Reading part 312 Matching part 313 Computability Determination unit 314 Angle histogram calculation unit 901 sensor unit 902 sensor acquisition unit

Claims (17)

画像取得部と、
前記画像取得部で取得した画像の各画素に対して、画像の傾きを推定するための情報を抽出する傾き情報算出部と、
前記傾き情報算出部で算出した傾き情報を用いて、その傾き角度ごとの度数分布である角度ヒストグラムを生成する角度ヒストグラム生成部と、
前記角度ヒストグラム生成部で生成された前記角度ヒストグラムのうち、2個以上の前記角度ヒストグラムを格納する角度ヒストグラム格納部と、
前記角度ヒストグラム格納部に格納された2個以上の前記角度ヒストグラムのうち、基準角度ヒストグラム1個と、前記基準角度ヒストグラムとは異なる比較対象角度ヒストグラム1個を選択し、前記角度ヒストグラム格納部から読み出す読み出し部と、
前記基準角度ヒストグラムと前記比較対象角度ヒストグラムとの形状の類似度と移動量を調べるマッチング部と、
前記マッチング部の出力する前記類似度を用いて、前記基準角度ヒストグラムと前記比較対象角度ヒストグラム間で演算が可能かどうかを判定する演算可否判定部と、
前記演算可否判定部の判定結果が可であった場合に、前記基準角度ヒストグラムと前記比較対象角度ヒストグラム間で前記移動量を用いて演算を行って演算後角度ヒストグラムを生成し、前記判定結果が否であった場合には演算を行わずに前記基準角度ヒストグラムを前記演算後角度ヒストグラムとする、角度ヒストグラム演算部と、
前記演算後角度ヒストグラムの最大値あるいは極大値を検出するピーク検出部と、
前記ピーク検出部が検出した前記最大値あるいは前記極大値が示す傾き角度から画像の傾き角度を推定する傾き推定部と
を備える画像処理装置。
An image acquisition unit;
An inclination information calculation unit for extracting information for estimating the inclination of the image for each pixel of the image acquired by the image acquisition unit;
An angle histogram generation unit that generates an angle histogram that is a frequency distribution for each inclination angle using the inclination information calculated by the inclination information calculation unit;
An angle histogram storage unit that stores two or more of the angle histograms among the angle histograms generated by the angle histogram generation unit;
Among the two or more angle histograms stored in the angle histogram storage unit, one reference angle histogram and one comparison target angle histogram different from the reference angle histogram are selected and read out from the angle histogram storage unit. A reading unit;
A matching unit that examines the similarity and movement amount of the shape of the reference angle histogram and the comparison target angle histogram;
A calculation availability determination unit that determines whether calculation is possible between the reference angle histogram and the comparison target angle histogram using the similarity output from the matching unit;
When the determination result of the calculation possibility determination unit is acceptable, calculation is performed using the movement amount between the reference angle histogram and the comparison target angle histogram to generate a calculated angle histogram, and the determination result is If not, an angle histogram calculation unit that sets the reference angle histogram as the post-calculation angle histogram without performing calculation,
A peak detection unit for detecting the maximum value or the maximum value of the angle histogram after the calculation;
An image processing apparatus comprising: an inclination estimation unit that estimates an inclination angle of an image from an inclination angle indicated by the maximum value or the maximum value detected by the peak detection unit.
前記読み出し部は、前記演算後角度ヒストグラムを基準角度ヒストグラム、前記演算後角度ヒストグラム生成に用いられていない角度ヒストグラムを前記角度ヒストグラム格納部から1個選択して比較対象角度ヒストグラムとして前記角度ヒストグラム格納部から読み出す、
請求項1に記載の画像処理装置。
The readout unit selects the post-calculation angle histogram as a reference angle histogram, and selects one angle histogram that is not used for the post-computation angle histogram generation from the angle histogram storage unit as the comparison target angle histogram. Read from the
The image processing apparatus according to claim 1.
前記読み出し部は、前記角度ヒストグラム格納部に格納された前記角度ヒストグラムのうち、前記基準角度ヒストグラム1個と、前記基準角度ヒストグラム以外の角度ヒストグラムを2個以上選択して読み出し、
前記マッチング部は、前記2個以上の比較対象角度ヒストグラムと前記基準角度ヒストグラムとの形状の類似度や移動量をおのおのについて調べ、
前記演算可否判定部はおのおのの前記類似度を用いて演算可能かどうかを判定し、
前記角度ヒストグラム演算部は前記2つ以上の比較対象角度ヒストグラムのうち前記演算可否判定部の前記判定結果が可であった角度ヒストグラムのみを用いて前記規準角度ヒストグラムとの演算を行って前記演算後角度ヒストグラムを生成し、前記判定結果が全て否であった場合には演算を行わずに前記基準角度ヒストグラムを前記演算後角度ヒストグラムとする
請求項1に記載の画像処理装置。
The reading unit selects and reads one or more angle histograms other than the reference angle histogram and one reference angle histogram from the angle histograms stored in the angle histogram storage unit,
The matching unit examines the degree of similarity and the amount of movement between the two or more comparison target angle histograms and the reference angle histogram,
The calculation possibility determination unit determines whether calculation is possible using each of the similarities,
The angle histogram calculation unit performs the calculation with the reference angle histogram using only the angle histogram in which the determination result of the calculation availability determination unit is possible among the two or more comparison target angle histograms, and after the calculation The image processing apparatus according to claim 1, wherein an angle histogram is generated, and the reference angle histogram is used as the post-calculation angle histogram without performing a calculation when all the determination results are negative.
画像を撮影する撮像部と、
前記撮像部で撮影される画像以外の情報をセンシングするセンサ部と、
前記センサ部で取得した情報を取得するセンサ取得部
をさらに備え、前記センサ部で取得した情報から前記撮像部の動きの特徴を抽出して動きの種類が同じである時系列上の区間を設定し、その区間内に含まれるフレームから求められる前記角度ヒストグラムを選択して、累積加算を行う
請求項2または請求項3に記載の画像処理装置。
An imaging unit for taking an image;
A sensor unit for sensing information other than an image captured by the imaging unit;
It further includes a sensor acquisition unit that acquires information acquired by the sensor unit, and extracts a feature of the movement of the imaging unit from the information acquired by the sensor unit to set a time-series interval in which the type of movement is the same The image processing apparatus according to claim 2, wherein the angle histogram obtained from the frames included in the section is selected and cumulative addition is performed.
前記マッチング部は、前記基準角度ヒストグラムと前記比較対象角度ヒストグラムの相互相関関数を計算し、前記相互相関関数の最大値を前記類似度、その最大値を与える変数(傾き角度)を前記移動量とする
請求項1に記載の画像処理装置。
The matching unit calculates a cross-correlation function between the reference angle histogram and the comparison target angle histogram, the maximum value of the cross-correlation function is the similarity, and a variable (inclination angle) that gives the maximum value is the movement amount. The image processing apparatus according to claim 1.
前記マッチング部における類似度は、前記基準角度ヒストグラムと前記比較対象ヒストグラムのヒストグラムインタセクションであり、移動量は双方のヒストグラムの変数をずらしながら求めたヒストグラムインタセクションの値が最大値を与えるずれ量とする
請求項1に記載の画像処理装置。
The similarity in the matching unit is a histogram intersection of the reference angle histogram and the comparison target histogram, and the movement amount is a deviation amount that gives the maximum value of the histogram intersection value obtained by shifting both histogram variables. The image processing apparatus according to claim 1.
前記角度ヒストグラム演算部における演算は、前記移動量を補正し前記基準角度ヒストグラムと前記比較対象角度ヒストグラムとの形状の対応する部分とが一致するようにしたうえで行なう
請求項1に記載の画像処理装置。
The image processing according to claim 1, wherein the calculation in the angle histogram calculation unit is performed after correcting the movement amount so that corresponding portions of the shapes of the reference angle histogram and the comparison target angle histogram coincide with each other. apparatus.
前記角度ヒストグラム演算部における演算は、対応する変数(傾き角度)の持つ値同士の加算である
請求項6に記載の画像処理装置。
The image processing apparatus according to claim 6, wherein the calculation in the angle histogram calculation unit is addition of values of corresponding variables (inclination angles).
前記角度ヒストグラム演算部における演算は、対応する変数(傾き角度)の持つ値同士の積算である
請求項6に記載の画像処理装置。
The image processing apparatus according to claim 6, wherein the calculation in the angle histogram calculation unit is an integration of values of corresponding variables (tilt angles).
前記傾き情報算出部は、各画素の縦方向、横方向のエッジ強度を合成したベクトルを傾き情報とする
請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the inclination information calculation unit uses, as inclination information, a vector obtained by combining the vertical and horizontal edge strengths of each pixel.
前記傾き情報算出部は、Hough変換によって得られた線分の長さと方向である
請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the inclination information calculation unit is a length and direction of a line segment obtained by Hough transform.
前記傾き推定部は前記センサ取得部から画像以外の情報を取得し、これを用いて傾き角度とする角度範囲に制約を与えた上で傾き角度を推定する
請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the inclination estimation unit acquires information other than an image from the sensor acquisition unit, and estimates an inclination angle while constraining an angle range as an inclination angle using the information.
前記傾き推定部が出力する前記傾き情報にしたがって画像を補正する画像補正部
をさらに備える請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, further comprising an image correction unit that corrects an image according to the tilt information output by the tilt estimation unit.
画像取得ステップと、
前記画像取得ステップで取得した画像の各画素に対して、画像の傾きを推定するための情報を抽出する傾き情報算出ステップと、
前記傾き情報算出ステップで算出した傾き情報を用いて、その傾き角度ごとの度数分布である角度ヒストグラムを生成する角度ヒストグラム生成ステップと、
前記角度ヒストグラム生成ステップで生成された前記角度ヒストグラムのうち、2個以上の前記角度ヒストグラムを格納する角度ヒストグラム格納ステップと、
前記角度ヒストグラム格納ステップで格納された2個以上の前記角度ヒストグラムのうち、基準角度ヒストグラム1個と、前記基準角度ヒストグラムとは異なる比較対象角度ヒストグラム1個を選択して読み出す読み出しステップと、
前記基準角度ヒストグラムと前記比較対象角度ヒストグラムとの形状の類似度と移動量を調べるマッチングステップと、
前記マッチングステップで出力された前記類似度を用いて、前記基準角度ヒストグラムと前記比較対象角度ヒストグラム間で演算が可能かどうかを判定する演算可否判定ステップと、
前記演算可否判定ステップの判定結果が可であった場合に、前記基準角度ヒストグラムと前記比較対象角度ヒストグラム間で前記移動量を用いて演算を行って演算後角度ヒストグラムを生成し、前記判定結果が否であった場合には演算を行わずに前記基準角度ヒストグラムを前記演算後角度ヒストグラムとする、角度ヒストグラム演算ステップと、
前記演算後角度ヒストグラムの最大値あるいは極大値を検出するピーク検出ステップと、
前記ピーク検出ステップで検出された前記最大値あるいは前記極大値が示す傾き角度から画像の傾き角度を推定する傾き推定ステップと
を備える画像処理方法。
An image acquisition step;
An inclination information calculation step for extracting information for estimating the inclination of the image for each pixel of the image acquired in the image acquisition step;
Using the inclination information calculated in the inclination information calculation step, an angle histogram generation step for generating an angle histogram that is a frequency distribution for each inclination angle;
An angle histogram storage step of storing two or more of the angle histograms among the angle histograms generated in the angle histogram generation step;
A reading step of selecting and reading one reference angle histogram and one comparison target angle histogram different from the reference angle histogram among the two or more angle histograms stored in the angle histogram storage step;
A matching step for examining the similarity and movement amount of the shape of the reference angle histogram and the comparison target angle histogram;
A calculation possibility determination step for determining whether calculation is possible between the reference angle histogram and the comparison target angle histogram using the similarity output in the matching step;
When the determination result of the calculation possibility determination step is acceptable, calculation is performed using the movement amount between the reference angle histogram and the comparison target angle histogram to generate a calculated angle histogram, and the determination result is If not, an angle histogram calculation step in which the reference angle histogram is set as the post-calculation angle histogram without performing a calculation;
A peak detecting step for detecting a maximum value or a maximum value of the angle histogram after the calculation;
An image processing method comprising: an inclination estimation step for estimating an inclination angle of an image from an inclination angle indicated by the maximum value or the maximum value detected in the peak detection step.
請求項1に記載の画像処理装置を含む集積回路。 An integrated circuit including the image processing apparatus according to claim 1. 請求項14に記載の画像処理方法をコンピュータに実行させるためのプログラム。 A program for causing a computer to execute the image processing method according to claim 14. 請求項16に記載のプログラムを記憶した記憶媒体。 A storage medium storing the program according to claim 16.
JP2010133622A 2010-06-11 2010-06-11 Image processing apparatus and image processing method Pending JP2011259342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010133622A JP2011259342A (en) 2010-06-11 2010-06-11 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010133622A JP2011259342A (en) 2010-06-11 2010-06-11 Image processing apparatus and image processing method

Publications (1)

Publication Number Publication Date
JP2011259342A true JP2011259342A (en) 2011-12-22

Family

ID=45474993

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010133622A Pending JP2011259342A (en) 2010-06-11 2010-06-11 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP2011259342A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101561443B1 (en) * 2014-03-21 2015-10-19 주식회사 인프라웨어 Method of correcting document image using histogram and apparatus thereof
JP2016516365A (en) * 2013-03-15 2016-06-02 グーグル インコーポレイテッド Automatic adjustment of image direction
CN111259703A (en) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 Face inclination angle detection method and device
CN112212851A (en) * 2019-07-09 2021-01-12 深圳市优必选科技股份有限公司 Pose determination method and device, storage medium and mobile robot

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016516365A (en) * 2013-03-15 2016-06-02 グーグル インコーポレイテッド Automatic adjustment of image direction
US10469797B2 (en) 2013-03-15 2019-11-05 Google Llc Automatic adjustment of video orientation
US10887543B2 (en) 2013-03-15 2021-01-05 Google Llc Automatic adjustment of video orientation
KR101561443B1 (en) * 2014-03-21 2015-10-19 주식회사 인프라웨어 Method of correcting document image using histogram and apparatus thereof
CN111259703A (en) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 Face inclination angle detection method and device
CN112212851A (en) * 2019-07-09 2021-01-12 深圳市优必选科技股份有限公司 Pose determination method and device, storage medium and mobile robot

Similar Documents

Publication Publication Date Title
JP5756455B2 (en) Image processing apparatus and image processing method
CN105407271B (en) Image processing equipment and method, picture pick-up device and image forming apparatus
EP2640057B1 (en) Image processing device, image processing method and program
JP5694300B2 (en) Image processing apparatus, image processing method, and program
JP6395506B2 (en) Image processing apparatus and method, program, and imaging apparatus
EP2640058B1 (en) Image processing device, image processing method, program, and imaging device
JP5179398B2 (en) Image processing apparatus, image processing method, and image processing program
US9674441B2 (en) Image processing apparatus, image processing method, and storage medium
US9183633B2 (en) Image processing apparatus and image processing method
US8774550B2 (en) Picture processing device, picture processing method, integrated circuit, and program
JP2006245677A (en) Image processor, image processing method, and image processing program
JP2018207252A (en) Image processing system, control method for image processing system, and program
JP2017092756A (en) Image processing system, image processing method, image projecting system and program
JP2011259342A (en) Image processing apparatus and image processing method
JP5449980B2 (en) Motion compensation apparatus and method
JP5841345B2 (en) Image processing apparatus, image processing method, image processing program, and imaging apparatus
JP6178646B2 (en) Imaging apparatus and image shake correction processing method
JP6604783B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP6378496B2 (en) Image processing apparatus, control method, and recording medium
US9292907B2 (en) Image processing apparatus and image processing method
JP2019149717A (en) Image processing apparatus, image processing method, imaging apparatus, program, and storage medium
JP2011081613A (en) Image processing apparatus
JP2012070168A (en) Image processing device, image processing method, and image processing program
JP2007036741A (en) Method and apparatus for synthesizing multiple images
JP2008107290A (en) Distance image generator, distance image generation method, and program