JP2016031548A - Image processing apparatus, imaging device, program, and recording medium - Google Patents
Image processing apparatus, imaging device, program, and recording medium Download PDFInfo
- Publication number
- JP2016031548A JP2016031548A JP2014152100A JP2014152100A JP2016031548A JP 2016031548 A JP2016031548 A JP 2016031548A JP 2014152100 A JP2014152100 A JP 2014152100A JP 2014152100 A JP2014152100 A JP 2014152100A JP 2016031548 A JP2016031548 A JP 2016031548A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- unit
- image
- region
- edge
- 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.)
- Granted
Links
Images
Abstract
Description
本発明は、撮影によって生成される画像データを処理する画像処理装置に関する。 The present invention relates to an image processing apparatus that processes image data generated by photographing.
特許文献1には、机等の台座を背景とし、この台座に載置した用紙の紙面を撮影対象として撮影する場合において、撮影画像のうち、撮影対象領域(撮影対象を示す領域)を抽出(特定)する技術が開示されている。
In
特許文献1の技術では、撮影対象(用紙等)が無い状態の台座を予め撮影し、その後に台座に載置した撮影対象を撮影するようになっている。続いて、撮影対象が無い台座を撮影して得られた撮影画像と、台座に載置された撮影対象を撮影して得られた撮影画像との差分画像を求め、差分画像から輪郭情報(撮影対象領域の輪郭)を抽出するようになっている。
In the technique of
したがって、特許文献1の技術では、撮影対象を撮影する前に、撮影対象を載置する前の台座の撮影を行わなければならず、ユーザにとって二度手間が生じるという問題がある。また、撮影位置やレイアウトを変えて撮影対象を再撮影する場合、再び撮影対象を載置する前の台座の撮影を行わなければならず、手間である。
Therefore, the technique of
また、特許文献1の技術では、撮影対象が無い台座を示した撮影画像と、台座に載置された撮影対象を示した撮影画像との2つの画像を保持するための記憶容量が必要になるという問題も生じる。
Further, in the technique of
本発明は、記憶容量とユーザにかかる手間とを従来技術よりも抑制可能な画像処理装置を提供することを目的とする。 SUMMARY OF THE INVENTION An object of the present invention is to provide an image processing apparatus that can suppress the storage capacity and the user's effort compared to the prior art.
本発明の一態様の画像処理装置は、撮影画像から、撮影対象領域の頂点の候補である候補頂点を検出する検出部と、前記撮影画像のうち、複数の候補頂点をラインで結んで形成される領域以外の領域を背景領域とし、前記背景領域の代表色と同一または類似色の階調値の条件を設定する設定部と、前記撮影画像の画素毎に、前記条件を満たす背景色画素か否かを判定する第1判定部と、前記画素毎に、エッジを示すエッジ画素か否かを判定する第2判定部と、前記撮影画像のうち、前記背景色画素ではないと判定され前記エッジ画素と判定された画素を特定する特定部と、前記特定部に特定された画素を参照して、前記撮影画像から前記撮影対象領域を抽出する抽出部と、を備えたことを特徴とする。 An image processing apparatus according to an aspect of the present invention is formed by connecting, from a photographed image, a detection unit that detects candidate vertices that are candidates for vertices of a photographing target region, and connecting a plurality of candidate vertices of the photographed image with lines. A setting unit that sets a gradation value condition that is the same as or similar to the representative color of the background area, and a background color pixel that satisfies the condition for each pixel of the photographed image. A first determination unit configured to determine whether or not, a second determination unit configured to determine whether or not each pixel is an edge pixel indicating an edge, and the edge determined to be not the background color pixel in the captured image A specifying unit that specifies a pixel determined to be a pixel, and an extraction unit that extracts the shooting target region from the captured image with reference to the pixel specified by the specifying unit.
本発明の一態様によれば、特許文献1のように撮影対象が無い状態の背景(机等の台座)を予め撮影した画像を要することなく撮影対象部分を高精度に抽出できるため、撮影を2度行う必要がなく、記憶容量とユーザにかかる手間とを特許文献1よりも削減できるという効果を奏する。
According to one aspect of the present invention, since a portion to be photographed can be extracted with high accuracy without requiring an image in which a background (a pedestal such as a desk) without a subject to be photographed is used as in
〔実施形態1〕
(撮影装置の全体構成)
以下、本発明の一実施形態の撮影装置の構成を詳細に説明する。図1は、本実施形態に係る撮影装置の概略構成を示すブロック図である。
(Overall configuration of the imaging device)
Hereinafter, the configuration of an imaging apparatus according to an embodiment of the present invention will be described in detail. FIG. 1 is a block diagram illustrating a schematic configuration of a photographing apparatus according to the present embodiment.
本実施形態の撮影装置10は、画像を撮影するカメラ機能を備えた携帯型端末装置であり、例えばタブレットが挙げられる。図1に示すように、撮影装置10は、少なくとも、タッチパネル部100、撮影部200、情報処理部300、および記憶部400を備えている。
The
さらに、図示しないが、撮影装置10は、通信部、インターネット通信部、音声操作部、音声出力部、テレビ放送受像部、GPS(Global Positioning System)など、携帯型端末装置が標準的に備えている各種ハードウェアを備えている。
Furthermore, although not shown, the photographing
タッチパネル部100は、画像を表示する表示部と、ユーザのタッチ操作に応じた入力信号を生成する入力部とが一体化されている装置であり、周知のタッチパネルを用いることができる。つまり、表示部はLCD(Liquid Crystal Display)などで構成され、入力部は表示部と一体化された静電容量センサなどで構成される。なお、本実施形態の撮影装置10は、画像表示手段としてタッチパネル部100を備えているが、画像表示手段はタッチパネル部100に限られるものではない。つまり、撮影装置10において、表示部と入力部とが別々に構成されていてもよく、この場合、表示部はLCD等であり、入力部はキーボード等である。
The
撮影部200は、CCD(Charge Coupled Device)またはCMOS(Complementary Metal-Oxide Semiconductor)等のイメージセンサ(カメラ)である。撮影部200は、ユーザに入力された撮影指示信号に応じて、撮影処理を行い、撮影画像を示す撮影画像データを生成する。なお、撮影画像データは、画素毎に、R(赤)、G(緑)、B(青)の各チャンネルの階調値(8ビットの場合は0〜255)を示したカラー画像データである。
The photographing
情報処理部(画像処理装置)300は、撮影装置10の各ハードウェアの動作を制御するブロックであり、例えば、CPU(Central Processing Unit)を備えるマイクロコンピュータやマイクロプロセッサなどによって実現される。情報処理部300は、記憶部400に記憶されている各種情報および各種制御を実施するためのプログラムを取り出して情報処理を行い、情報処理の結果に基づいて撮影装置10の各ハードウェアに制御信号や情報を送って、撮影装置10の各ハードウェアの動作を制御する。
The information processing unit (image processing apparatus) 300 is a block that controls the operation of each hardware of the photographing
また、情報処理部300は、ユーザからの入力指示に応じて書面撮影モードに移行するように設計されている。書面撮影モードとは、撮影部200にて撮影されると、撮影によって得られた撮影画像データに対して書面用画像処理を施すモードである。書面用画像処理とは、机の上に載置されている書面(書籍や原稿等)が撮影対象であることを前提とした画像処理を指す。
Further, the
つまり、情報処理部300は、書面撮影モードに移行している場合において、撮影部200の撮影によって撮影画像データが生成されると、撮影画像データに書面用画像処理を施した上で撮影画像データを記憶部400に保存する。情報処理部300にて行われる書面用画像処理については後に詳述する。
That is, in the case where the
記憶部400は、情報処理部300が実行する各種アプリケーションプログラム、OSプログラム、制御プログラム、画像処理プログラム、これらプログラムを実行するときに読み出す各種データ(設定値、テーブル等)、前記の撮影画像データを記憶する記憶領域である。記憶部400としては、従来から公知の種々の記憶手段、例えば、リードオンリーメモリ(ROM)、ランダムアクセスメモリ(RAM)、フラッシュメモリ、EPROM(Erasable Programmable ROM)、EEPROM(登録商標)(Electrically EPROM)、ハードディスクドライブ(HDD)などを用いることができる。また、情報処理部300に取り扱われている各種データや処理中のデータは、記憶部400のワーキングメモリに一時的に記憶される。
The
(情報処理部300)
つぎに、情報処理部300に含まれる各ブロックを詳細に説明する。図1に示すように、情報処理部300は、四隅検出部301、平滑化処理部302、統計処理部303、条件設定部304(設定部)、背景色判定部305(第1判定部)、エッジ検出部306(第2判定部)、特定部307、抽出部308、歪み補正部309、フォーマット処理部310を備えている。これら各部は前記の書面用画像処理を行う処理部である。
(Information Processing Unit 300)
Next, each block included in the
つまり、書面撮影モードが設定されている場合、撮影部200にて撮影が行われると、この撮影によって得られた撮影画像データに対して、四隅検出部301、平滑化処理部302、統計処理部303、条件設定部304、背景色判定部305、エッジ検出部306、特定部307、抽出部308、歪み補正部309、フォーマット処理部310がこの順で画像処理を実行する。
That is, when the document shooting mode is set, when shooting is performed by the
なお、四隅検出部301〜抽出部308までの処理によって、撮影画像に含まれる撮影対象領域(撮影対象を示す領域)が抽出(特定)され、歪み補正部309の処理によって、当該撮影対象領域に対して歪み補正が実行され、フォーマット処理部310の処理によって、当該撮影対象領域を示した画像ファイルが形成される。以下、情報処理部300に含まれる各ブロックを順に説明する。
Note that a shooting target area (area indicating a shooting target) included in the shot image is extracted (specified) by the processes from the four
(四隅検出部301)
本実施形態の撮影画像は、机の上に載置された書籍の見開き2頁の書面を撮影対象とし、机が背景として含まれるように撮影して得られた画像である。つまり、図2に示すように、撮影画像500には、撮影対象を示す画像領域である撮影対象領域(書籍)510と、背景領域(机)550とが示されている。
(Four corner detector 301)
The photographed image according to the present embodiment is an image obtained by photographing a document on a two-page spread of a book placed on a desk as a subject of photographing and including the desk as a background. In other words, as shown in FIG. 2, the photographed image 500 shows a photographing target area (book) 510 and a background area (desk) 550 that are image areas indicating the photographing target.
四隅検出部301は、撮影画像500に含まれる撮影対象領域510が略矩形状の書面であるとみなして、撮影対象領域510の頂点の候補となる候補頂点を検出するブロックである。略矩形には、通常、頂点が4つあるため、検出される候補頂点も4つとなる。
The four-
略矩形状の撮影対象領域510の4つの候補頂点を検出する処理としては、様々な周知の手法があり、四隅検出部301は周知のいずれの手法を用いてもよいが、本実施形態では、特許文献2(特開2013−168119)の段落[0056]〜[0106]に示されている手法を用いる。以下では、この手法の処理内容の概要を説明する。
There are various known methods for detecting the four candidate vertices of the substantially rectangular imaging target area 510, and the four-
図3は、四隅検出部301の処理を示すフローチャートである。まず、四隅検出部301は、撮影画像500の中から、エッジを構成するエッジ画素の抽出を行い、エッジ画素を「1」として非エッジ画素を「0」とするエッジ画像(2値画像)を生成する(S1)。なお、エッジ画素の抽出には様々な周知の手法があり、四隅検出部301は、周知のいずれの手法を用いても構わない。但し、本実施形態では、撮影画像から輝度データに変換し、輝度データに対してキャニー法によるエッジ抽出を行う。
FIG. 3 is a flowchart showing processing of the four
なお、本実施形態では、エッジ検出部306でもキャニー法が用いられるようになっており、キャニー法を用いたエッジ抽出の内容についてはエッジ検出部306と共に後に詳述する。
In the present embodiment, the canny method is also used in the
なお、四隅検出部301は、キャニー法にて生成されたエッジ画像に対して膨張収縮などのモルフォロジー変換を行ってもよい。
Note that the four-
つぎに、四隅検出部301は、4方向または8方向に隣接(連結)しているエッジ画素同士のグループを連結エッジ領域とし、連結エッジ領域ごとに異なるラベルを付すラベリング処理を行う(S2)。
Next, the four
続いて、四隅検出部301は、ラベル付けがされた各連結エッジ領域から、撮影対象領域510と背景領域550との境界を含む連結エッジ領域を特徴領域として抽出する処理を行う(S3)。撮影対象は、その中心を撮影画像の中心付近とし、撮影画像の中の大部分を占めるようにして撮影されるのが通常である。そこで、四隅検出部301は、以下の条件Aを満たす連結エッジ領域を特徴領域として抽出する。
Subsequently, the four-
条件A:撮影画像において左上角部を原点とし、右方向(幅方向)をx軸、下方向(高さ方向)をy軸とし、撮影画像の右端のx座標をXmax、撮影画像の下端のy座標をYmaxとする。このとき、連結エッジ領域の幅方向の長さが撮影画像の幅(Xmax)の1/4以上、かつ、連結エッジ領域の高さ方向の長さが撮影画像の高さ(つまりYmax)の1/4以上であり、かつ、連結エッジ領域の中心点のx座標が、Xmax/4以上かつ3×Xmax/4以下で、当該中心点のy座標が、Ymax/4以上かつ3×Ymax/4以下である。 Condition A: In the captured image, the upper left corner is the origin, the right direction (width direction) is the x axis, the lower direction (height direction) is the y axis, the x coordinate of the right end of the captured image is Xmax, and the lower end of the captured image is The y coordinate is Ymax. At this time, the length in the width direction of the connected edge region is ¼ or more of the width (Xmax) of the captured image, and the length in the height direction of the connected edge region is 1 of the height of the captured image (that is, Ymax). / 4 or more, and the x coordinate of the center point of the connected edge region is Xmax / 4 or more and 3 × Xmax / 4 or less, and the y coordinate of the center point is Ymax / 4 or more and 3 × Ymax / 4. It is as follows.
なお、連結エッジ領域の中心点の座標の求め方の一例として、連結エッジ領域の全画素の座標値の平均を中心点の座標とする手法が挙げられる。 An example of a method for obtaining the coordinates of the center point of the connected edge region is a method in which the average of the coordinate values of all the pixels in the connected edge region is used as the coordinate of the center point.
続いて、四隅検出部301は、特徴領域の中から、四つの候補頂点から形成される略矩形領域の上辺、左辺、右辺、下辺をなす直線を特定する処理(直線抽出処理)を行う(S4)。
Subsequently, the four-
ここで、上辺は、撮影画像の中の上半分(つまり、y座標が0からYmax/2の範囲)に位置し、撮影画像の幅方向に平行である確率が高い。また、左辺は、撮影画像の左半分(つまり、x座標が0からXmax/2の範囲)に位置し、撮影画像の高さ方向に平行である確率が高い。右辺は、撮影画像の右半分(つまり、x座標がXmax/2からXmaxの範囲)に位置し、撮影画像の高さ方向に平行である確率が高い。下辺は、撮影画像の下半分(つまり、y座標がYmax/2からYmaxの範囲)に位置し、撮影画像の幅方向に平行である確率が高い。 Here, there is a high probability that the upper side is located in the upper half of the captured image (that is, the y coordinate is in the range of 0 to Ymax / 2) and is parallel to the width direction of the captured image. Further, the left side is located in the left half of the captured image (that is, the x coordinate is in the range of 0 to Xmax / 2) and has a high probability of being parallel to the height direction of the captured image. The right side is located in the right half of the captured image (that is, the x-coordinate is in the range of Xmax / 2 to Xmax) and has a high probability of being parallel to the height direction of the captured image. The lower side is located in the lower half of the captured image (that is, the y coordinate is in the range of Ymax / 2 to Ymax) and has a high probability of being parallel to the width direction of the captured image.
そこで、上辺、左辺、右辺、下辺の夫々について、存在確率の高い範囲において、特定の方向に連なるエッジ画素の数が最大であり、所定長さ以上の線分状のエッジ画素群を特徴領域の中から抽出する。抽出したエッジ画素群の近似直線の式を最小二乗法にて特定する。特定された近似直線が、上辺、左辺、右辺、下辺になる。 Therefore, for each of the upper side, the left side, the right side, and the lower side, the number of edge pixels connected in a specific direction is the maximum in the range where the existence probability is high, and a line-shaped edge pixel group having a predetermined length or more is selected as the feature region. Extract from inside. The expression of the approximate straight line of the extracted edge pixel group is specified by the method of least squares. The specified approximate straight line becomes the upper side, the left side, the right side, and the lower side.
S4による四辺の直線抽出処理が終了すると、四隅検出部301は、S4で求めた直線の式に基づいて交点座標を求める(S5)。すなわち、四隅検出部301は、左辺直線と上辺直線の交点座標を左上頂点座標、上辺直線と右辺直線の交点座標を右上頂点座標、右辺直線と下辺直線の交点座標を右下頂点座標、下辺直線と左辺直線の交点座標を左下頂点座標として求める。そして、四隅検出部301は、これら4つの頂点座標を候補頂点の座標とし、頂点座標を示した抽出結果情報を記憶部400に保存する。
When the four-side straight line extraction process in S4 is completed, the four-
なお、以上において、図3の各ステップの処理の概要を述べたが、図3の各ステップの処理の具体的内容については特許文献2に示されている通りである。また、四隅検出部301は、特許文献2に示されている手法以外の周知の手法を用いて、4つの候補頂点の座標を求めるようになっていてもよい。
In the above, the outline of the process of each step of FIG. 3 has been described. The specific contents of the process of each step of FIG. 3 are as shown in
(平滑化処理部302)
つぎに、平滑化処理部302について説明する。本実施形態では、後述する統計処理部303において、撮影画像500に含まれる背景領域550の階調値の統計量を求めるようになっている。この統計量は平均値ならびに標準偏差である。ここで、撮像素子の特性に依存したノイズが撮影画像データ(入力画像データ)に含まれてしまうと、ノイズが原因で標準偏差の値が大きく振れてしまうことがある。このノイズとしては、暗部ノイズ、熱電流あるいは撮像素子の出力バラつきによるノイズが挙げられる。このようなノイズの影響によって、背景領域のうちの互いに異なる複数の箇所で、本来はほぼ同じ階調値を示すはずなのに、大幅に異なる階調値を示すようになり、統計処理部303にて求められる統計値の誤差が大きくなる可能性がある。
(Smoothing processing unit 302)
Next, the smoothing
そこで、統計処理部303の前段に位置する平滑化処理部302が、上記のようなノイズの影響を軽減あるいは除去するために、R,G,Bのチャンネル毎に、平滑化処理を行うようになっている。
Therefore, the smoothing
平滑化処理を行うための手段として、移動平均フィルタや荷重平均フィルタなどの畳み込み演算を行う空間フィルタが一般的に知られている。移動平均フィルタの一例を図4に示す。同フィルタを適用することによって、撮影画像の注目画素と周辺画素との間で階調値(画素値)が平均化されることになるため、階調値の変動が緩やかになり、平滑化処理がなされることになる。 As means for performing a smoothing process, a spatial filter that performs a convolution operation such as a moving average filter or a weighted average filter is generally known. An example of the moving average filter is shown in FIG. By applying the same filter, the gradation value (pixel value) is averaged between the target pixel of the captured image and the surrounding pixels, so the fluctuation of the gradation value becomes gradual and smoothing processing is performed. Will be made.
なお、平滑化処理部302による平滑化処理の代わりに、メディアンフィルタを用いるようになっていてもよい。
Note that a median filter may be used instead of the smoothing processing by the smoothing
(統計処理部303)
統計処理部303は、撮影画像500に含まれる背景領域550について階調値の統計処理を行うブロックである。統計処理部303の処理内容を具体的に説明すると以下のとおりである。
(Statistical processing unit 303)
The
統計処理部303は、記憶部400に保存されている抽出結果情報(四隅検出部301の処理結果を示した情報)を参照して、平滑化処理部302にて平滑化処理された撮影画像のなかから背景領域550を特定する。さらに、統計処理部303は、背景領域550を複数のサブ領域に分割し、サブ領域毎に、各領域の中心画素を中心とした64×64画素の参照範囲を設定する。統計処理部303は、サブ領域毎に、参照範囲における各チャンネル(R,G,Bの各チャンネル)毎の階調値の統計値を求める。求められる統計値は、参照範囲の各画素の階調値の平均値(階調平均値)と、参照範囲の各画素の階調値の標準偏差とである。
The
より具体的に説明すると、統計処理部303は、四隅検出部301にて検出された四つの候補頂点を直線(ライン)で結んで形成される矩形領域(図5の破線)と撮影画像500の各辺との間の領域を背景領域550として扱う。さらに、統計処理部303は、背景領域550を、矩形領域の各辺(図5の破線)の各延長線によって区画される八つのサブ領域に分割し、サブ領域ごとに、前記参照範囲の統計値を求めるようになっている。
More specifically, the
つまり、図5に示すように、背景領域550はサブ領域A〜Hに分割される。そして、サブ領域ごとに、前記参照範囲について、R、G、Bのチャンネルごとの階調平均値(階調値の平均値)ならびに標準偏差を求める。図6は、図5のサブ領域A〜Hの各々について、Rチャンネルの階調平均値ならびに標準偏差を示したものである。なお、図示を省略しているが、Gチャンネル、Bチャンネルについても、図6と同様に、図5のサブ領域A〜Hの各々における階調平均値ならびに標準偏差が求められる。 That is, as shown in FIG. 5, the background area 550 is divided into sub-areas A to H. Then, for each sub-region, the gradation average value (average gradation value) and standard deviation for each of the R, G, and B channels are obtained for the reference range. FIG. 6 shows the grayscale average value and standard deviation of the R channel for each of the sub-regions A to H in FIG. Although not shown, for the G channel and the B channel, as in FIG. 6, the gradation average value and the standard deviation in each of the sub-regions A to H in FIG. 5 are obtained.
(条件設定部304)
条件設定部304は、統計処理部303の統計処理の結果に基づき、背景領域550の代表色と同一または類似色の階調値の数値範囲(条件)を設定するブロックである。この数値範囲は、RGBの各チャンネルにおいて、(階調平均値の平均値)±(n×標準偏差の平均値)の範囲とする(nは所定の係数)。
(Condition setting unit 304)
The
例えば、図6のRチャンネルの階調平均値を昇順に並び替えを行うと図7のようになり、階調平均値が最大値および最小値になる領域を除いた6つのサブ領域の階調平均値および標準偏差から、Rチャンネルの階調平均値の平均値(Rgra.avg.)、および、標準偏差の平均値(Rσavg.)を算出する。 For example, when the grayscale average values of the R channel in FIG. 6 are rearranged in ascending order, the result is as shown in FIG. 7, and the grayscales of the six sub-regions excluding the region where the grayscale average values are the maximum value and the minimum value are obtained. From the average value and the standard deviation, the average value of the R channel gradation average value (Rgra.avg.) And the average value of the standard deviation (Rσavg.) Are calculated.
すなわち、
Rgra.avg.=((56.15+57.71+59.14+61.27+68.53+76.34))/6=63.19
となる。
また、Rチャンネルの標準偏差の平均値Rσavg.は、
Rσavg.=((1.41+1.09+1.19+0.98+1.22+1.21))/6=1.18
となり、これらの値をベースに数値範囲を設定する。
That is,
Rgra.avg. = ((56.15 + 57.71 + 59.14 + 61.27 + 68.53 + 76.34)) / 6 = 63.19
It becomes.
The average value Rσavg. Of the R channel standard deviation is
Rσavg. = ((1.41 + 1.09 + 1.19 + 0.98 + 1.22 + 1.21)) / 6 = 1.18
The numerical range is set based on these values.
具体的には、Rチャンネルについて、代表色と同一または類似色の階調値の数値範囲Rcandは、
(Rgra.avg.−n×Rσ)≦Rcand≦(Rgra.avg.+n×Rσ)
となり、
所定の係数nを3に設定すると、
59.6≦Rcand≦66.7
となる。
Specifically, for the R channel, the numerical value range Rcand of gradation values of the same or similar color as the representative color is:
(Rgra.avg.−n × Rσ) ≦ Rcand ≦ (Rgra.avg. + N × Rσ)
And
If the predetermined coefficient n is set to 3,
59.6 ≦ Rcand ≦ 66.7
It becomes.
なお、数値範囲Rcandは、
(Rgra.avg.−n×Rσ)≦Rcand≦(Rgra.avg.+n×Rσ)ではなく、
勿論、(Rgra.avg.−n×Rσ)<Rcand<(Rgra.avg.+n×Rσ)であってもよい。
The numerical range Rcand is
(Rgra.avg.−n × Rσ) ≦ Rcand ≦ (Rgra.avg. + N × Rσ)
Of course, (Rgra.avg.−n × Rσ) <Rcand <(Rgra.avg. + N × Rσ) may be satisfied.
以上の処理をGおよびBのチャンネルについても同様に行い、Rcandのほか、GcandおよびBcandも求める。 The above processing is similarly performed for the G and B channels, and Gcand and Bcand are obtained in addition to Rcand.
なお、統計処理部303および条件設定部304において、平均値の求め方は、算術平均のみならず、加重平均や相加平均等でもよい。また、本実施形態では、係数nを3としているが、特に限定されるものではなく、整数だけでなく小数であってもかまわない。また、統計処理部303および条件設定部304において、平均値の代わりに中央値を用いてもよい。
Note that, in the
(背景色判定部305)
背景色判定部305は、R,G,Bのチャンネル毎に、撮影画像500の各画素について、条件設定部304にて設定された数値範囲を満たす背景色画素か否かの判定を行う。つまり、背景色判定部305は、Rチャンネルにおいて、階調値がRcandになっている画素を背景色画素と判定し、それ以外の画素を背景色画素ではないと判定する。背景色判定部305は、Gチャンネルにおいて、階調値がGcandになっている画素を背景色画素と判定し、それ以外の画素を背景色画素ではないと判定する。背景色判定部305は、Bチャンネルにおいて、階調値がBcandになっている画素を背景色画素と判定し、それ以外の画素を背景色画素ではないと判定する。
(Background color determination unit 305)
The background
さらに、背景色判定部305は、R,G,Bのチャンネル毎に、背景色画素か否かの判定結果を示す背景色画像を生成する。背景色画像は、背景色画素を「1」とし、背景色画素ではない画素を「0」とした2値画像である。図8は、R,G,Bのチャンネル毎に生成される背景色画像を示す。
Further, the background
なお、撮影画像500に含まれる背景領域550のなかにおいて、撮像素子の特性等によって生じたホワイトノイズなどが孤立点としてあらわれ、この孤立点が背景色画素として判定されないケースがある。 In the background region 550 included in the photographed image 500, white noise or the like generated due to the characteristics of the image sensor appears as an isolated point, and this isolated point may not be determined as a background color pixel.
そこで、背景色判定部305は、背景色画像に対して膨張収縮などのモルフォロジー変換を実施することにより、上記孤立点を背景色画素に変換するようになっていてもよい。これにより孤立点が除去された背景色画像を生成できる。
Therefore, the background
(エッジ検出部306)
エッジ検出部306は、R,G,Bのチャンネル毎に、撮影画像500からエッジ画素の検出処理(抽出処理)を行う。具体的には、R,G,Bのチャンネル毎に、撮影画像500を構成する各画素がエッジ画素(エッジを構成する画素)か否かの判定を行うことになる。
(Edge detection unit 306)
The
エッジ検出部306によるエッジ画素の検出処理としては、周知の様々なエッジ検出手法(エッジ抽出手法)を用いることができるが、本実施形態ではキャニー法(キャニーフィルタ)を用いる。キャニー法とは、ガウシアンフィルタ(図9)とソーベルフィルタ(図10)とを用いて細線化されたエッジを検出する手法を指す。以下では、エッジ検出部306による処理(キャニー法)を説明する。
As edge pixel detection processing by the
図11は、エッジ検出部306の処理内容を示したフローチャートである。エッジ検出部306は、R,G,Bのチャンネル毎に、図11の処理を実行するようになっている。
FIG. 11 is a flowchart showing the processing contents of the
まず、エッジ検出部306は、撮影画像に対してガウシアンフィルタを用いて平滑化を行う(S101)。これにより、撮影画像のノイズが抑制される。
First, the
つぎに、エッジ検出部306は、ソーベルフィルタを用いて画素毎にエッジ強度とエッジ方向とを求める(S201)。具体的には、エッジ検出部306は、注目画素(X,Y)のエッジ強度▽Lとエッジ方向θとを、下記の式(1)および式(2)によって求める。
▽L=√(Lx2+Ly2) 式(1)
θ=tan−1(Ly/Lx) 式(2)
Lxは、ソーベルフィルタの水平方向微分値であり、Lyは、ソーベルフィルタの垂直方向微分値である。
Next, the
▽ L = √ (Lx 2 + Ly 2 ) Formula (1)
θ = tan −1 (Ly / Lx) Equation (2)
Lx is a horizontal differential value of the Sobel filter, and Ly is a vertical differential value of the Sobel filter.
続いて、エッジ検出部306は、S201で求めたθ(エッジ方向)を量子化する(S301)。具体的には、0°,45°,90°,135°のいずれかの角度に量子化する。
Subsequently, the
つぎに、エッジ検出部306は、S201で求めたエッジ強度▽Lと、S301で量子化したθとを参照して、エッジを細くするための細線化処理(S401)を行う。細線化処理は以下に示すように実行される。
エッジ検出部306は、θ=0°の注目画素(X,Y)について、▽L(X,Y)>▽L(X−1,Y)且つ▽L(X,Y)>▽L(X+1,Y)の条件を満たす場合、▽L(X,Y)の値を維持し(変更しない)、この条件を満たさない場合、▽L(X,Y)の値を0に変更する。
エッジ検出部306は、θ=45°の注目画素(X,Y)について、▽L(X,Y)>▽L(X−1,Y+1)且つ▽L(X,Y)>▽L(X+1,Y−1)の条件を満たす場合、▽L(X,Y)の値を維持し(変更しない)、この条件を満たさない場合、▽L(X,Y)の値を0に変更する。
エッジ検出部306は、θ=90°の注目画素(X,Y)について、▽L(X,Y)>▽L(X,Y−1)且つ▽L(X,Y)>▽L(X,Y+1)の条件を満たす場合、▽L(X,Y)の値を維持し(変更しない)、この条件を満たさない場合、▽L(X,Y)の値を0に変更する。
エッジ検出部306は、θ=135°の注目画素(X,Y)について、▽L(X,Y)>▽L(X−1,Y−1)且つ▽L(X,Y)>▽L(X+1,Y+1)の条件を満たす場合、▽L(X,Y)の値を維持し(変更しない)、この条件を満たさない場合、▽L(X,Y)の値を0に変更する。
Next, the
The
The
The
The
以上のように▽Lおよびθを用いることでS3の細線化処理を実行できる。次に、エッジ検出部306は、画素毎に、エッジ強度に対してヒステリシス閾値処理を行うことにより、エッジか否かの判定を行う(S501)。
As described above, the thinning process of S3 can be executed by using ▽ L and θ. Next, the
具体的には、エッジ検出部306は、▽L(X,Y)>高レベル閾値であれば、注目画素(X,Y)をエッジ画素と判定し、▽L(X,Y)<低レベル閾値であれば、注目画素(X,Y)を非エッジ画素と判定する。なお、高レベル閾値>低レベル閾値であり、画像データが8ビットの場合、例えば高レベル閾値は144であり、低レベル閾値は64と設定される。但し、高レベル閾値>低レベル閾値さえ成立していれば、144や64という値に限定されないことはいうまでもない。
Specifically, the
また、エッジ検出部306は、低レベル閾値≦▽L(X,Y)≦高レベル閾値の場合、注目画素(X,Y)がエッジ画素に連結(隣接)していれば注目画素(X,Y)をエッジ画素と判定し、エッジ画素に連結していなければ注目画素(X,Y)を非エッジ画素と判定する。
Further, the
続いて、エッジ検出部306は、エッジ画素か否かの判定結果を示すエッジ画像を生成する(S601)。エッジ画像は、エッジ画素を「1」、非エッジ画素を「0」とした2値画像である。なお、エッジ検出部306は、当該エッジ画像に対して膨張収縮などのモルフォロジー変換を行ってもよい。
Subsequently, the
エッジ検出部306が、以上にて示した図11の処理を、R,G,Bのチャンネル毎に実行する。これにより、R,G,Bのチャンネル毎にエッジ画像が生成されることになる。図12は、R,G,Bのチャンネル毎に生成されるエッジ画像を示す。
The
なお、四隅検出部301によるエッジ抽出(図3のS1)についても、キャニー法が適用されるため、図11の処理と同じ処理が行われる。但し、エッジ検出部306においては、R,G,Bのチャンネル毎に図11に示すキャニー法が実行されるのに対し、四隅検出部301においては輝度データに対してキャニー法が実行される。
Note that since the Canny method is applied to edge extraction (S1 in FIG. 3) by the four
(特定部307)
特定部307は、背景色判定部305にて生成された背景色画像と、エッジ検出部306にて生成されたエッジ画像とを参照して、R,G,Bの全チャンネルにおいて背景色画素ではないと判定されエッジ画素と判定された画素を特定する処理を行う。
(Specific part 307)
The specifying
つまり、特定部307は、R,G,Bの全てのチャンネルにおいて、図8の背景色画像では背景色画素ではなく、図12のエッジ画像ではエッジ画素になっている画素を特定する処理を行う。なお、図8の背景色画像では、0のフラグ(黒を示すフラグ)が立っている画素が背景色画素ではない画素に相当し、図12のエッジ画像では、1のフラグ(白を示すフラグ)が立っている画素がエッジ画素に相当する。
That is, the specifying
続いて、特定部307は、R,G,Bの全チャンネルにおいて背景色画素ではないと判定されエッジ画素と判定された画素を特定する非背景色/エッジ画像を生成する。図13は、非背景色/エッジ画像900を示す。図13の非背景色/エッジ画像900は、R,G,Bの全チャンネルにおいて背景色画素ではないと判定されエッジ画素と判定された画素のフラグを1(白)として、それ以外の画素のフラグを0(黒)とした2値画像である。
Subsequently, the specifying
(抽出部308)
抽出部308は、撮影部200から入力された撮影画像500(図2)から、撮影対象領域510を抽出する処理を行う。以下、抽出部308の処理を説明する。
(Extractor 308)
The
本実施形態の撮影画像500(図2)は、机等を示す背景領域550と、書面等を示す撮影対象領域510とを含む。それゆえ、エッジ検出部306による処理では、撮影対象領域510の輪郭がエッジとして検出されるが、机の上に傷等が形成されている場合には背景領域550においても前記傷等がエッジとして検出されることもある。
The captured image 500 (FIG. 2) of the present embodiment includes a background area 550 indicating a desk or the like, and an imaging target area 510 indicating a document or the like. Therefore, in the processing by the
ところが、背景領域550のエッジ(机の上の傷等)は、上述したようにエッジとして検出されることがあるものの、背景色を示すことには変わらないため、背景色画素と判定される可能性が高い。したがって、図13の非背景色/エッジ画像にて特定されている特定画素(背景色画素ではないと判定されエッジ画素と判定された画素)から、背景領域550のエッジ(机等の傷)は外されることになる。 However, although the edge of the background area 550 (such as a scratch on the desk) may be detected as an edge as described above, it does not change to indicate the background color, so it can be determined as a background color pixel. High nature. Therefore, the edge (scratches on the desk, etc.) of the background region 550 is determined from the specific pixel (pixel determined not to be the background color pixel and determined to be the edge pixel) specified in the non-background color / edge image of FIG. Will be removed.
そして、以上の点からすれば、図13の非背景色/エッジ画像900において、上辺に直交する方向に向けて上辺から特定画素を探索した場合に上辺から最も近い位置にある特定画素と、下辺に直交する方向に向けて下辺から特定画素を探索した場合に下辺から最も近い位置にある特定画素と、左辺に直交する方向に向けて左辺から特定画素を探索した場合に左辺から最も近い位置にある特定画素と、右辺に直交する方向に向けて右辺から特定画素を探索した場合に右辺に最も近い位置にある特定画素とからなる画素群は、撮影画像500の撮影対象領域510の輪郭線に相当すると考えられる。
From the above points, in the non-background color /
そこで、抽出部308は、図13の非背景色/エッジ画像900を参照して、撮影対象領域510の輪郭線を成す輪郭画素を抽出する。具体的に、抽出部308は、(a)撮影画像500の上辺を構成する画素ごとに、当該画素から上辺と直交する方向に向けて並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第1探索処理と、(b)撮影画像500の下辺を構成する画素ごとに、当該画素から下辺と直交する方向に向けて並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第2探索処理と、(c)撮影画像500の左辺を構成する画素ごとに、当該画素から左辺と直交する方向に向けて並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第3探索処理と、(d)撮影画像500の右辺を構成する画素ごとに、当該画素から右辺に直交する方向に向けて並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第4探索処理とを実行する。なお、図14は、第1探索処理〜第4探索処理の各々について、探索される画素列のうちの一つを示した模式図である。第1探索処理〜第4探索処理にて抽出された画素を輪郭画素とする。
Therefore, the
さらに、抽出部308は、前記輪郭画素、および、前記輪郭画素に囲まれている画素のフラグを0(黒)とし、その他の画素のフラグを1(白)とした2値画像をマスク画像として生成する。図15は、抽出部308にて生成されるマスク画像700を示した図である。
Further, the
続いて、抽出部308は、生成したマスク画像700を用いて撮影画像500にマスキング処理を行うことにより、撮影画像500のなかから撮影対象領域510を抽出する。具体的には、抽出部308は、図15のマスク画像700にて前記輪郭画素および前記輪郭画素に囲まれている画素(0(黒)のフラグで示されている画素)については、撮影部200から入力した撮影画像500の階調値を与え、図15のマスク画像において前記輪郭画素よりも外側に位置する画素(1(白)のフラグで示されている画素)については、所定の階調値(例えば画像データが8ビットで表される場合は「0」)を与えた抽出済画像800を生成する。図16は、抽出済画像800を示す図である。図16の抽出済画像800は、図2の撮影画像500から抽出された撮影対象領域510が示され、撮影対象領域510の周囲は黒色が均一に塗り潰されたベタ画像領域となっている。つまり、図16の抽出済画像800は、図2の撮影画像500において撮影対象領域510以外の箇所が黒ベタ領域でマスキングされた画像に相当する。
Subsequently, the
(歪み補正部309)
歪み補正部309は、書面のような矩形状の撮影対象領域や、書籍の見開き頁などの若干湾曲した略矩形状の撮影対象領域に対し、撮影対象の正面の法線方向に対して傾いた方向から撮影対象を撮影することによる撮影対象物の歪みを補正するとともに、撮影対象領域の傾きを補正するブロックである。歪み補正部309の補正手法としては、周知の様々な手法を利用できるが、一例として特許文献3(特開2013−4088)に開示されている手法を挙げることができる。
(Distortion correction unit 309)
The
歪み補正部309は、抽出部308にて生成された抽出済画像800(図16)に示されている撮影対象領域に対して歪み補正を行う。
The
(フォーマット処理部310)
フォーマット処理部310は、歪み補正部309にて歪み補正された後の抽出済画像800を、所定フォーマットの画像ファイルに変換する。所定フォーマットとしては、JPEG若しくはTIFFが挙げられる。フォーマット処理部310は、生成した画像ファイルを記憶部400に保存する。
(Format processing unit 310)
The
本実施形態の情報処理部300においては、以上の通り、四隅検出部301〜抽出部308の処理によって、撮影画像500から抽出された撮影対象領域510を示した抽出済画像800が生成され、歪み補正部309によって、抽出済画像800に歪み補正が施され、歪み補正の施された抽出済画像800が所定フォーマットの画像ファイルに変換されて保存されることになる。
In the
そして、本実施形態では、エッジ検出部306のエッジ検出の結果と、背景色判定部305による背景色検出の結果とを併用して、撮影対象領域510を抽出している。これにより撮影対象領域510の抽出精度を相乗的に高めることができる。この点を以下具体的に説明する。
In the present embodiment, the imaging target region 510 is extracted using both the edge detection result of the
書籍等を撮影対象として撮影した場合、図2に示すように、撮影画像500においては、背景領域550に陰影領域520が示されることがある(同図では、背景領域550のうち、書籍の上辺付近に陰影領域520が形成されている)。陰影領域520は、照明光の影響による影、背景にて映りこまれたユーザの影(意図しない影)を示す領域である。 When a book or the like is photographed as a subject of photographing, as shown in FIG. 2, in the photographed image 500, a shadow region 520 may be shown in the background region 550 (in FIG. 2, the upper side of the book in the background region 550). A shadow area 520 is formed in the vicinity). The shadow area 520 is an area showing a shadow due to the influence of illumination light and a user's shadow (unintended shadow) reflected in the background.
陰影領域520は基本的にはグレイ色である。したがって、背景色判定部305が、図2に示す撮影画像500を対象として画素毎に背景色画素か否かの判定を行うと、背景領域550に位置する陰影領域520が背景色画素として判定されないというケースが生じる。
The shaded area 520 is basically a gray color. Therefore, when the background
ところが、本実施形態では、エッジ検出部306のエッジ検出の結果を併用しているため、陰影領域520が撮影対象領域510として抽出されることが抑制される。これは、陰影領域520はエッジとして検出されないし、背景色画素と判定された部分と陰影領域520との境界は、撮影対象領域510と陰影領域520との境界よりもエッジ強度が低いため、背景色画素と判定された部分と陰影領域520との境界がエッジとして判定されることは少ないからである。つまり、背景色画素か否かの判定結果を利用する手法の欠点を、エッジ検出結果を利用する手法によって補っていることになる。
However, in the present embodiment, since the result of edge detection by the
これに対し、前述したように、エッジ検出部306による処理では、撮影対象領域510の輪郭がエッジとして検出されるが、机の上に傷等が形成されている場合には背景領域550においても前記傷等がエッジとして検出されるケースもある。
On the other hand, as described above, in the processing by the
ところが、背景領域550の机の上の傷等は、上述したようにエッジとして検出されることがあるものの、背景色と類似する色を示すため、背景色画素と判定される可能性が高い。したがって、最終的には、抽出部308にて、背景領域550のエッジ(机の上の傷等)が撮影対象領域510の一部として抽出されることを抑制できる。すなわち、エッジ検出結果を利用する手法の欠点を、背景色画素か否かの判定結果を利用する手法によって補っているのである。
However, although a scratch on the desk in the background region 550 may be detected as an edge as described above, it shows a color similar to the background color, and thus is highly likely to be determined as a background color pixel. Therefore, finally, the
このように、本実施形態では、エッジ検出部306のエッジ検出の結果と、背景色判定部305による背景色検出の結果とを併用することにより、互いの欠点を補い合っているため、撮影対象領域510の抽出精度を相乗的に高めることができるのである。
As described above, in this embodiment, since the edge detection result of the
図16は、最終的に生成される抽出済画像800であるが、抽出済画像800において、図2の陰影領域520は、背景を成すベタ画像領域に塗り潰されており、撮影対象領域510と共に抽出されていないことがわかる。
FIG. 16 shows an extracted
また、以上の実施形態では、図5に示すように背景領域550を複数のサブ領域A〜Hに分割し、サブ領域の中心位置を含む所定サイズの参照領域をサブ領域ごとに設定し、サブ領域毎に参照領域の階調値の統計処理を行うようになっている。これにより、撮影対象(書籍等)の縁や影の影響の受けにくい領域を対象として前記統計処理を行うことができるため、背景色判定部305の判定精度を向上させることができ、これにより撮影対象領域510の抽出精度も向上させることができる。
In the above embodiment, as shown in FIG. 5, the background region 550 is divided into a plurality of sub-regions A to H, and a reference region having a predetermined size including the center position of the sub-region is set for each sub-region. Statistical processing of the gradation value of the reference area is performed for each area. As a result, the statistical processing can be performed on a region that is not easily affected by the edge or shadow of the subject to be photographed (such as a book), so that the judgment accuracy of the background
また、本実施形態では、図7に示すように、条件設定部304は、階調平均値が最大値および最小値になるサブ領域(A、E)を除いた上で、背景の代表色と同一または類似色の数値範囲を求めている。この理由は以下の通りである。背景領域550の一部において、偶然、光の反射(照明の映り込み等)によって他の領域に比べ極端に階調値が高くなったり、偶然、影(撮影者の影)が形成されることによって他の領域に比べ極端に階調値が低くなったり、標準偏差が大きくなるという特異な状況が生じることがある。そこで、階調平均値が最大値および最小値になる領域を除くことにより、背景領域550の代表色と同一または類似色の階調値の数値範囲の算出精度を向上させているのである。
In the present embodiment, as shown in FIG. 7, the
また、情報処理部300においては、撮影画像500から撮影対象領域510を抽出した抽出済画像800(図16)を生成できればよく、抽出済画像800の生成とは直接関係の無い歪み補正部309およびフォーマット処理部310は特に備えられていなくてもよい。また、平滑化処理部302も備えられていなくてもよい。
The
また、エッジ検出部306は、キャニー法によってエッジを検出しているが、キャニー法以外の手法を用いても構わない。例えば、注目画素について、水平方向あるいは垂直方向に隣接する画素との差分を求め、差分に対して閾値処理を行うことによってエッジ画素か否かを判定してもよい。閾値は、画像データが8ビットの場合、例えば48とする。
Further, although the
あるいは、図2に示すソーベルフィルタによってエッジ強度を求め、エッジ強度に対して閾値処理を行うことによってエッジ画素か否かを判定してもよい。閾値は、画像データが8ビットの場合、例えば96に設定する。 Alternatively, the edge strength may be obtained by a Sobel filter shown in FIG. 2 and a threshold process may be performed on the edge strength to determine whether or not the pixel is an edge pixel. The threshold is set to 96, for example, when the image data is 8 bits.
〔実施形態2〕
実施形態1では、図5に示すように背景領域550を八つのサブ領域A〜Hに分割し、サブ領域A〜Hについて統計処理を行っているが、八つのサブ領域A〜Hの全てについて統計処理を行う必要はない。例えば、統計処理部303は、図17に示すように、八つのサブ領域のうち、四つの候補頂点を直線で結んで形成される矩形領域の上下左右に隣接する四つのサブ領域イ〜二を検出し、サブ領域イ〜二の各々において、各領域の中心画素を中心とした64×64画素の参照範囲を設定するようになってもよい。そして、統計処理部303は、サブ領域イ〜二の各々において、参照範囲における各チャンネル(R,G,Bの各チャンネル)毎の階調値の統計値を求める。図17の例によれば、図5の例よりも計算量を減らせることができるというメリットを有し、図5の例によれば、図17の例よりもサンプル量が多いため高精度であるというメリットを有する。
[Embodiment 2]
In the first embodiment, as shown in FIG. 5, the background region 550 is divided into eight sub-regions A to H, and statistical processing is performed on the sub-regions A to H. There is no need to perform statistical processing. For example, as shown in FIG. 17, the
或いは、図18に示すように、四つの候補頂点を直線で結んで形成される矩形領域の上辺、下辺、左辺、右辺に隣接するブロックのうち、上辺に隣接するブロックを7つのサブ領域に等間隔で分割し(図18の「あ」〜「ま」)、サブ領域毎に、サブ領域の全画素の階調値の統計値を求めるようになっていてもよい。 Alternatively, as shown in FIG. 18, among the blocks adjacent to the upper, lower, left, and right sides of a rectangular area formed by connecting four candidate vertices with straight lines, the block adjacent to the upper side is divided into seven sub-areas, etc. It may be divided at intervals (“A” to “MA” in FIG. 18), and for each sub-region, the statistical values of the gradation values of all the pixels in the sub-region may be obtained.
〔実施形態3〕
実施形態1では撮影装置10の一例としてタブレットを挙げたが、撮影装置10は、撮影部200を有する各種携帯型端末(スマートフォン、タブレット、ノートパソコン、携帯電話等)であってもよい。また、撮影装置10は、デジタルスチルカメラ、汎用パソコン等であってもよい。
[Embodiment 3]
In the first embodiment, a tablet is used as an example of the
また、本実施形態の情報処理部300は、撮影部200を備えた撮影装置10に備えられている必要性はなく、撮影部200を備えない装置に設けられていても構わない。要は、カメラ付きの携帯端末から撮影画像を受信可能な装置(カメラ無しの汎用パソコンやサーバ装置)であれば情報処理部300を設けることが可能なのである。また、複合機、大型表示装置(インフォメーションディスプレイや電子黒板等)も撮影画像を受信可能であり、複合機、大型表示装置に情報処理部300を設けてもよい。なお、携帯端末と、パソコン、サーバ装置、複合機、大型表示装置等との間の撮影画像の通信手段としては、有線でも無線でもよい。また、インターネット等のネットワークを介した通信であってもよい。
In addition, the
また、携帯端末から、情報処理部300を備えた装置へ撮影画像を送信する際、携帯端末側において、撮影対象領域の抽出処理を実施して幾何学補正処理を行う第1モードと、撮影対象領域の抽出処理および幾何学補正処理を実施しない第2モードとをユーザに選択させるようになっていてもよい。いずれのモードが選択されたかを示すモード情報が撮影画像と共に携帯端末から情報処理部300を備えた装置へ送信され、情報処理部300は、モード情報が第1モードを示している場合は第1モードを実行し、モード情報が第2モードを示している場合は第2モードを実行するようになっている。
In addition, when transmitting a captured image from a mobile terminal to an apparatus including the
〔実施形態4〕
情報処理部300は、上述の通り、CPUを用いてソフトウェアにて実現してもよいし、集積回路等に形成された論理回路によって実現してもよい。なお、ソフトウェアによる場合、情報処理部300は、前記ソフトウェアであるプログラムがコンピュータ(またはCPU)で読み取り可能に記録されたROMまたは記憶装置等の記録媒体を備えている。上記記録媒体としては、例えば、カード、ディスク、半導体メモリ、プログラマブルな論理回路などの「一時的でない有形の媒体」であってもよい。また、上記プログラムは、任意の伝送媒体(通信ネットワークや放送波等)を介して上記コンピュータに伝送されてもよい。なお、本発明の一態様は、上記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。
[Embodiment 4]
As described above, the
〔まとめ〕
本発明の態様1の情報処理部300(画像処理装置)は、撮影画像500から、撮影対象領域510の頂点の候補である候補頂点を検出する四隅検出部301と、撮影画像500のうち、複数の候補頂点をラインで結んで形成される領域以外の領域を背景領域550とし、背景領域550の代表色と同一または類似色の階調値の数値範囲(条件)を設定する条件設定部304と、撮影画像500の画素毎に、前記数値範囲を満たす背景色画素か否かを判定する背景色判定部305(第1判定部)と、前記画素毎に、エッジを示すエッジ画素か否かを判定するエッジ検出部306(第2判定部)と、撮影画像500のうち、前記背景色画素ではないと判定され前記エッジ画素と判定された画素を特定する特定部307と、特定部307に特定された画素を参照して、撮影画像500から撮影対象領域510を抽出する抽出部308と、を備えたことを特徴とする。
[Summary]
The information processing unit 300 (image processing apparatus) according to the first aspect of the present invention includes a four-
本発明の態様1によれば、エッジ検出部306のエッジ検出結果と、背景色判定部305の判定結果とを併用して、撮影画像より撮影対象領域510を抽出しており、これにより撮影対象領域510の抽出精度を相乗的に高めることができるという効果を奏する。
According to the
つまり、(a)エッジ検出部306のエッジ検出結果を用いずに、背景色判定部305の判定結果を用いて撮影対象領域510を抽出する構成では、背景領域550に含まれる陰影領域520が撮影対象領域510として抽出されるという欠点があり、(b)、背景色判定部305の判定結果を用いずに、エッジ検出部306のエッジ検出結果を用いて撮影対象領域510を抽出する構成では、背景領域550に傷画像(例えば机の上の傷)がある場合に前記傷画像が撮影対象領域510として抽出されるという欠点がある。ところが、本願発明では、エッジ検出部306のエッジ検出結果を用いることにより、背景色判定部305の判定結果のみを用いる場合の欠点(陰影領域520が撮影対象領域510として抽出されてしまう)を抑制でき、背景色判定部305の判定結果を用いることによって、エッジ検出部306のエッジ検出結果のみを用いる場合の欠点(前記傷画像が撮影対象領域510として抽出されてしまう)を抑制できる。すなわち、本願発明では、エッジ検出と背景色判定とを併用することにより、互いの欠点を補い合うことができ、撮影対象の抽出精度を高めるという効果を相乗的に得ることができるのである。
That is, (a) in the configuration in which the imaging target region 510 is extracted using the determination result of the background
また、本発明の態様1の情報処理部300によれば、特許文献1のように撮影対象が無い状態の背景(机等の台座)を予め撮影した画像を要することなく撮影対象部分を高精度に抽出できるため、撮影を2度行う必要がなく、記憶容量とユーザにかかる手間とを特許文献1よりも削減できるという効果を奏する。
In addition, according to the
本発明の態様2の情報処理部300は、態様1の構成に加えて、背景領域550に含まれる範囲を統計対象として、統計対象の階調値の統計処理を行う統計処理部303を備え、条件設定部304は、前記統計処理の結果に基づいて前記数値範囲を設定することを特徴とする。
In addition to the configuration of the
これにより、撮影画像500のうち、背景領域550の代表色と同一または類似色を示す階調値の数値範囲を高精度に設定でき、背景色画素か否かの判定を精度よく行えることができるという効果を奏する。 Thereby, in the photographed image 500, a numerical value range of gradation values indicating the same or similar color as the representative color of the background region 550 can be set with high accuracy, and it can be accurately determined whether or not it is a background color pixel. There is an effect.
本発明の態様3の情報処理部300は、態様2の構成に加えて、前記統計対象の範囲を複数のサブ領域に分割し、サブ領域の中心位置を含む所定サイズの参照領域をサブ領域ごとに設定し、所定領域毎に参照領域の階調値の統計処理を行うことを特徴とする。
In addition to the configuration of
本発明の態様3によれば、撮影対象(書籍等)の縁や影の影響の受けにくい領域を対象として前記統計処理を行うことができるため、背景色判定部305の判定精度を向上させることができ、これにより撮影対象領域510の抽出精度も向上させることができる。
According to the third aspect of the present invention, the statistical processing can be performed on a region that is not easily affected by the edge or shadow of a shooting target (such as a book), and thus the determination accuracy of the background
本発明の態様4の情報処理部300は、態様3の構成に加えて、条件設定部304は、前記統計処理にて求められる統計量のうち平均値または中央値が最大となるサブ領域と前記平均値または中央値が最小となるサブ領域とを除いた各サブ領域の前記統計量を参照して、前記条件を設定することを特徴とする。
In addition to the configuration of aspect 3, the
本発明の態様4によれば、照明の映り込みや撮影者の影に起因して値のバラツキが大きくなる局所部分が背景領域550に含まれている場合であっても、この局所部分による影響を抑制できるという効果を奏する。 According to the aspect 4 of the present invention, even when the background region 550 includes a local portion in which the variation in the value increases due to the reflection of illumination or the shadow of the photographer, the influence of the local portion There is an effect that can be suppressed.
本発明の態様5の情報処理部300は、態様2〜態様4のいずれかに加え、撮影画像500に対して平滑化処理を行う平滑化処理部302を備え、統計処理部303は、前記平滑化処理の施された撮影画像500を用いて前記統計処理を行うことを特徴とする。
The
本発明の態様5によれば、撮影画像500中のノイズの影響が前記統計処理に及ぶことを抑制でき、前記統計処理の精度を向上させることができるという効果を奏する。 According to the aspect 5 of the present invention, it is possible to suppress the influence of noise in the captured image 500 from affecting the statistical processing, and it is possible to improve the accuracy of the statistical processing.
本発明の態様6の情報処理部300は、態様1〜態様5のいずれかに加え、特定部307にて特定された画素を特定画素とすると、抽出部308は、(a)撮影画像500の上辺を構成する画素ごとに、当該画素から上辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第1探索処理と、(b)撮影画像500の下辺を構成する画素ごとに、当該画素から下辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第2探索処理と、(c)撮影画像500の左辺を構成する画素ごとに、当該画素から左辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第3探索処理と、(d)撮影画像500の右辺を構成する画素ごとに、当該画素から右辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第4探索処理と、(e)前記第1〜第4探索処理にて抽出された特定画素を輪郭として、この輪郭および輪郭に囲まれている領域を、撮影対象領域510として抽出する抽出処理とを実行することを特徴とする。
The
本発明の態様6によれば、前記背景色画素ではないと判定され且つ前記エッジ画素と判定された画素である特定画素から、撮影対象領域510の輪郭を特定でき、この輪郭から、撮影対象領域510を特定できる。 According to the sixth aspect of the present invention, it is possible to specify the outline of the shooting target area 510 from the specific pixel that is determined not to be the background color pixel and to be the edge pixel, and from this outline, the shooting target area can be specified. 510 can be specified.
本発明の態様7の撮影装置10は、撮影部200と、態様1〜態様6のいずれかの情報処理部300とを備えたことを特徴とする。
The photographing
本発明の態様1〜6に係る情報処理部300は、コンピュータによって実現してもよく、この場合には、コンピュータを情報処理部300が備える各部として動作させることにより、情報処理部300をコンピュータにて実現させるプログラム、およびそれを記録したコンピュータ読み取り可能な記録媒体も、本発明の範疇に入る。
The
本発明の一態様は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の一態様の技術的範囲に含まれる。 One aspect of the present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims, and the technical means disclosed in different embodiments can be appropriately combined. Such embodiments are also included in the technical scope of one aspect of the present invention.
本発明は、撮影画像を処理する画像処理ソフトをインストール可能な装置、或いは、撮影画像を処理する画像処理回路を搭載可能な装置に適用される。このような装置として、例えば、汎用コンピュータ、サーバ装置、複合機、デジタルスチルカメラ、携帯端末(スマートフォン、タブレット、ノートパソコン、携帯電話)等が挙げられる。 The present invention is applied to a device capable of installing image processing software for processing a photographed image or a device capable of mounting an image processing circuit for processing a photographed image. Examples of such devices include general-purpose computers, server devices, multifunction devices, digital still cameras, and mobile terminals (smartphones, tablets, notebook computers, mobile phones) and the like.
10 撮影装置
200 撮影部
300 情報処理部(画像処理装置)
301 四隅検出部
302 平滑化処理部
303 統計処理部
304 条件設定部(設定部)
305 背景色判定部(第1判定部)
306 エッジ検出部(第2判定部)
307 特定部
308 抽出部
309 歪み補正部
310 フォーマット処理部
400 記憶部
500 撮影画像
510 撮影対象領域
520 陰影領域
550 背景領域
700 マスク画像
800 抽出済画像
DESCRIPTION OF
301 Four
305 Background color determination unit (first determination unit)
306 Edge detection unit (second determination unit)
307
Claims (9)
前記撮影画像のうち、複数の候補頂点をラインで結んで形成される領域以外の領域を背景領域とし、前記背景領域の代表色と同一または類似色の階調値の条件を設定する設定部と、
前記撮影画像の画素毎に、前記条件を満たす背景色画素か否かを判定する第1判定部と、
前記画素毎に、エッジを示すエッジ画素か否かを判定する第2判定部と、
前記撮影画像のうち、前記背景色画素ではないと判定され前記エッジ画素と判定された画素を特定する特定部と、
前記特定部に特定された画素を参照して、前記撮影画像から前記撮影対象領域を抽出する抽出部と、を備えた画像処理装置。 A detection unit that detects candidate vertices that are candidates for vertices in the shooting target region from the shot image;
A setting unit that sets a condition for a gradation value of the same or similar color as the representative color of the background area, with a background area other than an area formed by connecting a plurality of candidate vertices with lines in the captured image ,
A first determination unit that determines whether or not each pixel of the captured image is a background color pixel that satisfies the condition;
A second determination unit that determines whether or not each pixel is an edge pixel indicating an edge;
Among the captured images, a specifying unit that specifies a pixel that is determined not to be the background color pixel and determined to be the edge pixel;
An image processing apparatus comprising: an extraction unit that extracts the shooting target region from the captured image with reference to the pixel specified by the specifying unit.
前記設定部は、前記統計処理の結果に基づいて前記条件を設定する請求項1に記載の画像処理装置。 A statistical processing unit that performs statistical processing of gradation values using the range included in the background region as a statistical target;
The image processing apparatus according to claim 1, wherein the setting unit sets the condition based on a result of the statistical processing.
前記統計処理部は、前記平滑化処理の施された前記撮影画像を用いて前記統計処理を行う請求項2から4のいずれか1項に記載の画像処理装置。 A smoothing processing unit that performs a smoothing process on the captured image;
The image processing apparatus according to claim 2, wherein the statistical processing unit performs the statistical processing using the captured image that has been subjected to the smoothing processing.
前記抽出部は、(a)撮影画像の上辺を構成する画素ごとに、当該画素から上辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第1探索処理と、(b)撮影画像の下辺を構成する画素ごとに、当該画素から下辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第2探索処理と、(c)撮影画像の左辺を構成する画素ごとに、当該画素から左辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第3探索処理と、(d)撮影画像の右辺を構成する画素ごとに、当該画素から右辺と直交する方向に並んでいる画素列の中から当該画素に最も近い位置にある特定画素を探索する第4探索処理と、(e)前記第1〜第4探索処理にて抽出された特定画素を輪郭として、この輪郭および輪郭に囲まれている領域を、前記撮影対象領域として抽出する抽出処理とを実行することを特徴とする請求項1から5のいずれか1項に記載の画像処理装置。 When the pixel specified by the specifying unit is a specific pixel,
The extraction unit searches (a) for each pixel constituting the upper side of the captured image, a search for a specific pixel located closest to the pixel from a pixel row arranged in a direction orthogonal to the upper side from the pixel. 1 search process, and (b) for each pixel constituting the lower side of the photographed image, a search is made for a specific pixel located closest to the pixel from a pixel row arranged in a direction orthogonal to the lower side from the pixel. 2 search processing, and (c) for each pixel constituting the left side of the photographed image, a search is made for a specific pixel located closest to the pixel from a pixel row arranged in a direction orthogonal to the left side from the pixel. 3 search processing, and (d) for each pixel constituting the right side of the photographed image, a search is performed for a specific pixel at a position closest to the pixel from a pixel row arranged in a direction orthogonal to the right side from the pixel. 4 search processing; and (e) the first The extraction process of extracting the specific pixel extracted in the fourth search process as an outline and extracting the outline and the area surrounded by the outline as the imaging target area is performed. The image processing apparatus according to claim 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014152100A JP6326316B2 (en) | 2014-07-25 | 2014-07-25 | Image processing apparatus, photographing apparatus, program, recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014152100A JP6326316B2 (en) | 2014-07-25 | 2014-07-25 | Image processing apparatus, photographing apparatus, program, recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016031548A true JP2016031548A (en) | 2016-03-07 |
JP6326316B2 JP6326316B2 (en) | 2018-05-16 |
Family
ID=55441916
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014152100A Active JP6326316B2 (en) | 2014-07-25 | 2014-07-25 | Image processing apparatus, photographing apparatus, program, recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6326316B2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH113414A (en) * | 1996-06-07 | 1999-01-06 | Ultimatte Corp | Method for generating invisible window edge in image synthesization system |
JP2002094776A (en) * | 2000-09-19 | 2002-03-29 | Minolta Co Ltd | Image forming device |
JP2002208007A (en) * | 2000-12-18 | 2002-07-26 | Xerox Corp | Automatic detection of scanned document |
JP2002368982A (en) * | 2001-06-11 | 2002-12-20 | Ricoh Co Ltd | Picture processor, picture processing method and recording medium |
JP2009111472A (en) * | 2007-10-26 | 2009-05-21 | Murata Mach Ltd | Image processing apparatus and image reader |
JP2014123881A (en) * | 2012-12-21 | 2014-07-03 | Canon Inc | Information processing device, information processing method, and computer program |
-
2014
- 2014-07-25 JP JP2014152100A patent/JP6326316B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH113414A (en) * | 1996-06-07 | 1999-01-06 | Ultimatte Corp | Method for generating invisible window edge in image synthesization system |
JP2002094776A (en) * | 2000-09-19 | 2002-03-29 | Minolta Co Ltd | Image forming device |
JP2002208007A (en) * | 2000-12-18 | 2002-07-26 | Xerox Corp | Automatic detection of scanned document |
JP2002368982A (en) * | 2001-06-11 | 2002-12-20 | Ricoh Co Ltd | Picture processor, picture processing method and recording medium |
JP2009111472A (en) * | 2007-10-26 | 2009-05-21 | Murata Mach Ltd | Image processing apparatus and image reader |
JP2014123881A (en) * | 2012-12-21 | 2014-07-03 | Canon Inc | Information processing device, information processing method, and computer program |
Non-Patent Citations (1)
Title |
---|
脇 正宏、外3名: ""正倉院文書の並び替えのための断簡と台紙の領域分離方法"", 2013年度 画像電子学会第41回年次大会 予稿集, JPN6018010496, 22 June 2013 (2013-06-22), JP, pages 1 - 6, ISSN: 0003763822 * |
Also Published As
Publication number | Publication date |
---|---|
JP6326316B2 (en) | 2018-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
ES2868129T3 (en) | Image processing method and electronic device | |
US11113795B2 (en) | Image edge processing method, electronic device, and computer readable storage medium | |
US20200084401A1 (en) | Correcting pixel defects based on defect history in an image processing pipeline | |
JP6260620B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5826081B2 (en) | Image processing apparatus, character recognition method, and computer program | |
JP6099457B2 (en) | Image processing apparatus, area determination method, and computer program | |
JP2017520050A (en) | Local adaptive histogram flattening | |
US20150030247A1 (en) | System and method of correcting image artifacts | |
RU2631765C1 (en) | Method and system of correcting perspective distortions in images occupying double-page spread | |
US10354364B2 (en) | Automatic perspective control using vanishing points | |
JP2007129535A (en) | Image processor, image processing method, program thereof, and computer-readable recording medium recorded with same program | |
JP6172935B2 (en) | Image processing apparatus, image processing method, and image processing program | |
KR102009185B1 (en) | Method for removing color fringe | |
US20150332475A1 (en) | Detecting and compensating for motion between a flash and a no-flash image | |
US9117283B2 (en) | Image processing apparatus, image processing method, and computer-readable, non-transitory medium | |
CN107018407B (en) | Information processing device, evaluation chart, evaluation system, and performance evaluation method | |
JP6953178B2 (en) | Image processing device, image processing method, program | |
JP6564136B2 (en) | Image processing apparatus, image processing method, and program | |
US9361500B2 (en) | Image processing apparatus, image processing method, and recording medium | |
US10896344B2 (en) | Information processing apparatus, information processing method, and computer program | |
US10514591B2 (en) | Camera apparatus, image processing device, and image processing method | |
JP6326316B2 (en) | Image processing apparatus, photographing apparatus, program, recording medium | |
JP2012108720A (en) | Information processing apparatus, method, and program | |
JP6777507B2 (en) | Image processing device and image processing method | |
JP6600090B2 (en) | Image processing apparatus, image processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20170323 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180315 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20180327 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180416 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6326316 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |