JP2016024694A - Image processing apparatus, image processing method, and program - Google Patents
Image processing apparatus, image processing method, and program Download PDFInfo
- Publication number
- JP2016024694A JP2016024694A JP2014149350A JP2014149350A JP2016024694A JP 2016024694 A JP2016024694 A JP 2016024694A JP 2014149350 A JP2014149350 A JP 2014149350A JP 2014149350 A JP2014149350 A JP 2014149350A JP 2016024694 A JP2016024694 A JP 2016024694A
- Authority
- JP
- Japan
- Prior art keywords
- shadow
- pixel
- luminance
- background
- flag
- 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
Landscapes
- Character Input (AREA)
- Traffic Control Systems (AREA)
Abstract
Description
本発明は、画像処理装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program.
近年、様々な場面で入力画像から文字を自動認識する文字認識技術が利用されている。例えば、車両のナンバープレートから車番を読み取る車番認識システムや、カメラで撮像したランドマークの画像から文字を認識し、認識した文字に応じて情報を提供する情報提供システムなどに文字認識技術が利用されている。文字認識の方法としては、例えば、認識対象として設定した文字を表す辞書画像と入力画像とを画素単位で比較して類似度を計算し、最も類似度が高い辞書画像を認識結果とする方法がある。 In recent years, character recognition technology that automatically recognizes characters from input images in various scenes has been used. For example, character recognition technology is used in a vehicle number recognition system that reads a vehicle number from a license plate of a vehicle, an information provision system that recognizes characters from landmark images captured by a camera, and provides information according to the recognized characters. It's being used. As a method of character recognition, for example, there is a method in which a dictionary image representing a character set as a recognition target and an input image are compared in pixel units to calculate a similarity, and a dictionary image with the highest similarity is used as a recognition result. is there.
辞書画像と入力画像とを比較する際、入力画像から文字を含む領域が切り出され、切り出された領域を二値化した二値化画像が辞書画像との比較に利用される。二値化画像の生成には、輝度の高い背景部と輝度の低い文字部とを判定する閾値が用いられる。つまり、閾値より輝度の高い画素を白に変換し、閾値より輝度の低い画素を黒に変換することで二値化画像が生成される。なお、背景部の輝度が文字部の輝度よりも低い場合には白と黒とを反転した二値化画像が生成される。 When comparing the dictionary image and the input image, a region including characters is cut out from the input image, and a binarized image obtained by binarizing the cut-out region is used for comparison with the dictionary image. For the generation of the binarized image, a threshold value for determining a background portion with high luminance and a character portion with low luminance is used. That is, a binarized image is generated by converting a pixel having a luminance higher than the threshold to white and converting a pixel having a luminance lower than the threshold to black. Note that when the luminance of the background portion is lower than the luminance of the character portion, a binary image in which white and black are reversed is generated.
背景部と文字部との明暗差が画像内で一定の場合、二値化に用いる閾値を最大輝度と最小輝度との中間に設定すれば、上記の方法により背景部と文字部とを正しく分離した二値化画像が得られる。しかし、実際には、入力画像に影が映り込むことがあり、上記の方法を適用しても文字部と背景部とを正しく分離できないことがある。こうした事情に鑑み、入力画像全体に大局的な1つの閾値を設定するのではなく、画素ブロック毎に局所的な閾値を設定して二値化を行う手法が提案されている。 If the contrast between the background and text is constant in the image, the background and text can be separated correctly by the above method if the threshold used for binarization is set between the maximum and minimum brightness. A binarized image is obtained. However, in practice, a shadow may appear in the input image, and even if the above method is applied, the character portion and the background portion may not be correctly separated. In view of such circumstances, a method has been proposed in which binarization is performed by setting a local threshold value for each pixel block instead of setting a global threshold value for the entire input image.
しかしながら、細い物体による影などが文字部にかかり、線状の暗部が文字部に重なるような場合、上記提案に係る手法を適用すると、文字部と暗部とが結合して文字の形状が乱れるリスクや、重なり部分が除去されて文字部が分断されるリスクが生じる。例えば、画素ブロックのサイズを調整しても、いずれかのリスクが生じる可能性がある。そのため、線状の暗部が生じるような状況では、上記提案に係る手法を適用しても、文字認識に適した二値化画像が得られない可能性がある。 However, when a shadow or the like by a thin object is applied to the character part and a linear dark part overlaps the character part, applying the method according to the above proposal may result in a combination of the character part and the dark part, resulting in a disordered character shape. In addition, there is a risk that the overlapping part is removed and the character part is divided. For example, even if the pixel block size is adjusted, any risk may occur. Therefore, in a situation where a linear dark part occurs, there is a possibility that a binarized image suitable for character recognition cannot be obtained even if the method according to the above proposal is applied.
そこで、1つの側面によれば、本発明の目的は、文字部分を残して線状の暗部を除去することが可能な画像処理装置、画像処理方法、及びプログラムを提供することにある。 Therefore, according to one aspect, an object of the present invention is to provide an image processing apparatus, an image processing method, and a program capable of removing a linear dark portion while leaving a character portion.
本開示の1つの側面によれば、背景色を有する背景の上に背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、背景から背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、背景に影が重なる領域から文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を記憶する記憶部と、入力画像内で被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が第2の閾値より大きい画素を特定して第2のフラグを設定し、第1のフラグを設定した画素の輝度を背景の輝度に設定する演算部と、を有する、画像処理装置が提供される。 According to one aspect of the present disclosure, an input image obtained by imaging a subject having a character described in a color different from the background color on a background having a background color, and luminance from the background to a region where a shadow is superimposed on the background A storage unit that stores a first threshold value used for determination of change and a second threshold value used for determination of luminance change from a region where a shadow is superimposed on a background to a region where a shadow is superimposed on a character; and a subject in the input image Detecting a decrease in luminance for pixels located at the edge of the pixel, specifying a pixel for which the decrease in luminance is greater than the first threshold, and increasing and decreasing the luminance while sequentially tracking adjacent pixels starting from the identified pixel Is detected, a pixel whose increase in luminance is smaller than the first threshold is set and the first flag is set, and a pixel whose decrease in luminance is larger than the second threshold is specified and the second flag is set And the brightness of the pixel with the first flag set The having an arithmetic unit for setting the brightness of the background, the image processing apparatus is provided.
また、本開示の他の1つの側面によれば、コンピュータが、背景色を有する背景の上に背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、背景から背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、背景に影が重なる領域から文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、入力画像内で被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が第2の閾値より大きい画素を特定して第2のフラグを設定し、第1のフラグを設定した画素の輝度を背景の輝度に設定する画像処理方法が提供される。 Further, according to another aspect of the present disclosure, the computer captures an input image obtained by imaging a subject having characters described in a color different from the background color on the background having the background color, and from the background to the background. A first threshold value used for determining a luminance change to an area where a shadow overlaps and a second threshold value used to determine a luminance change from an area where a shadow overlaps a background to an area where a shadow overlaps a character are acquired and input Detects a decrease in luminance for a pixel located at the edge of the subject in the image, identifies a pixel for which the decrease in luminance is greater than the first threshold, and sequentially tracks adjacent pixels starting from the identified pixel Increase and decrease are detected, a pixel whose luminance increase is smaller than the first threshold is specified and a first flag is set, and a pixel whose luminance decrease is larger than the second threshold is specified and second Set the first flag and set the first flag An image processing method for setting the brightness of the boss was pixels to the luminance of the background is provided.
また、本開示の他の1つの側面によれば、コンピュータに、背景色を有する背景の上に背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、背景から背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、背景に影が重なる領域から文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、入力画像内で被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が第2の閾値より大きい画素を特定して第2のフラグを設定し、第1のフラグを設定した画素の輝度を背景の輝度に設定する処理を実行させる、プログラムが提供される。 According to another aspect of the present disclosure, an input image obtained by capturing an object having characters written in a color different from a background color on a background having a background color and a background to background A first threshold value used for determining a luminance change to an area where a shadow overlaps and a second threshold value used to determine a luminance change from an area where a shadow overlaps a background to an area where a shadow overlaps a character are acquired and input Detects a decrease in luminance for a pixel located at the edge of the subject in the image, identifies a pixel for which the decrease in luminance is greater than the first threshold, and sequentially tracks adjacent pixels starting from the identified pixel Increase and decrease are detected, a pixel whose luminance increase is smaller than the first threshold is specified and a first flag is set, and a pixel whose luminance decrease is larger than the second threshold is specified and second Set the first flag and set the first flag The brightness of the boss was pixels to execute a process of setting the brightness of the background, the program is provided.
本発明によれば、文字部分を残して線状の暗部を除去することが可能になる。 According to the present invention, it is possible to remove a linear dark part while leaving a character part.
以下に添付図面を参照しながら、本発明の実施形態について説明する。なお、本明細書及び図面において実質的に同一の機能を有する要素については、同一の符号を付することにより重複説明を省略する場合がある。 Embodiments of the present invention will be described below with reference to the accompanying drawings. In addition, about the element which has the substantially same function in this specification and drawing, duplication description may be abbreviate | omitted by attaching | subjecting the same code | symbol.
<1.第1実施形態>
図1を参照しながら、第1実施形態について説明する。図1は、第1実施形態に係る画像処理装置の一例を示した図である。
<1. First Embodiment>
The first embodiment will be described with reference to FIG. FIG. 1 is a diagram illustrating an example of an image processing apparatus according to the first embodiment.
図1に示すように、画像処理装置10は、記憶部11及び演算部12を有する。
なお、記憶部11は、RAM(Random Access Memory)などの揮発性記憶装置、或いは、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性記憶装置である。演算部12は、CPU(Central Processing Unit)やDSP(Digital Signal Processor)などのプロセッサである。但し、演算部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの電子回路であってもよい。演算部12は、例えば、記憶部11又は他のメモリに記憶されたプログラムを実行する。
As illustrated in FIG. 1, the
The
記憶部11は、入力画像Pin、第1の閾値Th1、及び第2の閾値Th2を記憶する。入力画像Pinは、背景色を有する背景の上に背景色とは異なる色で記載された文字を有する被写体を撮像した画像である。なお、ここでは一例として背景色が文字の色よりも明るい色であると仮定している。例えば、背景色は白、黄色、ピンクなどであり、文字の色は黒などである。なお、背景色と文字色とを反転した場合は、背景色の輝度と文字色の輝度との関係を反転させれば、同様に第1実施形態に係る技術を適用可能である。
The
第1の閾値Th1は、背景から、背景に影が重なる領域への輝度変化の判定に用いる閾値である。第2の閾値Th2は、背景に影が重なる領域から文字に影が重なる領域への輝度変化の判定に用いる閾値である。背景から、背景に影が重なる領域への輝度変化は、背景に影が重なる領域から文字に影が重なる領域への輝度変化よりも大きい。そのため、第1の閾値Th1は、例えば、第2の閾値Th2よりも大きく設定される。 The first threshold value Th1 is a threshold value used for determining the luminance change from the background to the region where the shadow overlaps the background. The second threshold value Th2 is a threshold value used for determining the luminance change from the region where the shadow is superimposed on the background to the region where the shadow is superimposed on the character. The luminance change from the background to the area where the shadow overlaps the background is larger than the luminance change from the area where the shadow overlaps the background to the area where the shadow overlaps the character. Therefore, the first threshold value Th1 is set to be larger than the second threshold value Th2, for example.
演算部12は、入力画像Pin内で被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が第1の閾値Th1より大きい画素を特定する。また、演算部12は、端部で特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出する。追跡の過程で、演算部12は、輝度の増加が第1の閾値Th1より小さい画素を特定して第1のフラグを設定する。さらに、演算部12は、追跡の過程で、輝度の減少が第2の閾値Th2より大きい画素を特定して第2のフラグを設定する。そして、演算部12は、第1のフラグだけを設定した画素の輝度を背景の輝度に設定する。
The
図1の例では、入力画像Pin内の被写体の枠に接する部分が端部となる。以下、枠に接する画素列から順に1段目、2段目、…と表記する場合がある。
例えば、入力画像Pinの上辺端部に位置する(A)の領域に注目すると、入力画像Pinの上辺に接する画素列は1段目、上辺から下辺方向に向けて1段目に隣接する画素列が2段目となる。図1の例では、(A)の領域に位置する1段目の画素列の一部に影がかかっているため、影がかかっている部分の輝度が背景色の輝度に比べて低下している。そのため、影がかかっている部分で輝度の減少が第1の閾値Th1より大きくなる。演算部12は、画素PxSとして、この部分の画素を特定する。
In the example of FIG. 1, a portion in contact with the frame of the subject in the input image Pin is an end portion. Hereinafter, the first row, the second row,... May be written in order from the pixel column in contact with the frame.
For example, when attention is paid to the area (A) located at the upper edge of the input image Pin, the pixel row in contact with the upper side of the input image Pin is the first row, and the pixel row adjacent to the first row from the upper side toward the lower side. Becomes the second stage. In the example of FIG. 1, since a part of the first pixel row located in the area (A) is shaded, the brightness of the shaded part is lower than the brightness of the background color. Yes. Therefore, the decrease in luminance is greater than the first threshold Th1 in the shadowed portion. The
また、演算部12は、画素PxSを始点として連続する画素を追跡しながら輝度変化を順次検出する。図1の例では、2段目の画素列のうち、連続する画素として画素PxSに対して縦方向及び斜め方向に隣接する画素が特定され、追跡範囲として設定されている。演算部12は、追跡範囲の画素と画素PxSとの輝度変化に基づいて第1のフラグ及び第2のフラグの設定対象となる画素を特定する。図1の例では、画素PxSの下方に位置する画素(色付きの画素)に第1のフラグが設定されている。
In addition, the
第2段目の画素列について画素を特定した演算部12は、3段目の画素列について第1のフラグ及び第2のフラグの設定対象となる画素を特定する。このとき、演算部12は、1段目で特定した画素PxSと2段目で第1のフラグを設定した画素との位置関係から、追跡方向を計算し、3段目の追跡範囲を設定する。そして、演算部12は、設定した追跡範囲の中で、第1のフラグ及び第2のフラグの設定対象となる画素を特定する。なお、連続する方向を考慮せず、予め設定した方向を基準に追跡範囲を設定してもよい。
The
3段目で画素を特定した方法と同様に、演算部12は、4段目以降について第1のフラグ及び第2のフラグの設定対象となる画素を特定する。追跡範囲内で画素を特定できなかった場合、演算部12は、始点とした画素PxSとは異なる画素PxSが1段目にないか探索し、他の画素PxSがある場合には当該他の画素PxSについて第1のフラグ及び第2のフラグの設定対象となる画素を特定する。第2のフラグが設定された画素を残し、第1のフラグが設定された画素の輝度を背景の輝度に設定すると、図1に示すように、文字の形状を乱さずに影が除去される。
Similar to the method of specifying the pixels in the third stage, the
上記のように、演算部12は、被写体の端部から影の部分を探索し、影の部分に位置する画素を特定すると共に、文字と重なる影の部分を特定し、文字と重なる部分を残しつつ影の部分を除去する(影の部分に位置する画素の輝度を背景と同じにする)。この処理により、文字を残して影が消去されるため、文字と背景とを適切に分離する二値化用の閾値を決めることが可能になる。その結果、文字がくっきりと浮き立った鮮明な二値化画像が得られ、文字認識の精度が向上する。
As described above, the
以上、第1実施形態について説明した。
<2.第2実施形態>
次に、第2実施形態について説明する。
The first embodiment has been described above.
<2. Second Embodiment>
Next, a second embodiment will be described.
[2−1.システム]
まず、第2実施形態に係る技術を適用可能なシステムの例について説明する。
(車番認識システム5について)
図2を参照しながら、第2実施形態に係る技術を適用可能なシステムの一例として、車番認識システム5について説明する。図2は、第2実施形態に係る車番認識システムの一例を示した図である。
[2-1. system]
First, an example of a system to which the technology according to the second embodiment can be applied will be described.
(About car number recognition system 5)
A vehicle
図2に示すように、車番認識システム5は、被写体51を撮影する撮像装置52、及び撮像装置52が撮影した画像の処理を実行する画像処理装置100を含む。撮像装置52は、例えば、自動車やバイクなどの被写体51に設置されたナンバープレートを含む領域NRを撮影する。領域NRの画像(以下、入力画像)は、画像処理装置100に入力される。画像処理装置100は、入力画像からナンバープレートに含まれる文字、数字、記号など(以下、単に文字と称する。)を認識する。
As illustrated in FIG. 2, the vehicle
文字認識の精度は、画像に含まれる文字の鮮明度に依存する。例えば、図2に示すように、被写体51の一部RC(例えば、バイクの荷台など)の影が領域NRにかかる場合、入力画像に含まれる文字が影の影響で不鮮明になる。影の形状は、光源Lと領域NRとの位置関係や影を作る部材の形状などに依存する。例えば、バイクの荷台は、領域NRに線状の影をつくることがある。線状の影が文字にかかると、二値化した際に文字と影とが結合して文字の形が乱れ、文字認識に失敗することがある。 The accuracy of character recognition depends on the sharpness of characters included in the image. For example, as shown in FIG. 2, when a shadow of a part RC (for example, a motorcycle bed) of the subject 51 is applied to the region NR, characters included in the input image are blurred due to the shadow. The shape of the shadow depends on the positional relationship between the light source L and the region NR, the shape of the member that creates the shadow, and the like. For example, a motorcycle bed may create a linear shadow in the region NR. When a linear shadow is applied to a character, when binarized, the character and the shadow are combined to disturb the shape of the character, and character recognition may fail.
画像処理装置100は、文字の形状を正しく残しつつ線状の影を入力画像から除去する。例えば、画像処理装置100は、入力画像中の文字を含まない背景領域から一定幅の影を検出する。そして、画像処理装置100は、影の部分に隣接する画素の輝度値を抽出し、影の部分として、輝度値が急激に変化しない画素を追跡する。また、画像処理装置100は、同一方向に続く画素の集合について、輝度勾配の下降方向から上昇方向への変化の有無を記憶し、追跡した影の部分で当該変化がない画素の集合を背景領域に相当する輝度値に補正する。この補正により影が除去される。
The
上記補正後の輝度分布に基づいて二値化用の閾値を決定することで、影の影響を受けない二値化用の閾値が得られる。なお、画像処理装置100は、背景領域から一定幅の影を検出する処理において、影の部分が延伸する方向を算出し、影の部分を追跡する範囲に限定を加えてもよい。また、バイクの荷台など、影を生じさせる部材の形状が既知の場合、影の出現するパターンの情報を予め用意しておき、画像処理装置100が利用できるようにしてもよい。この場合、画像処理装置100は、追跡範囲をパターンに基づいて絞り込むことができる。
By determining the binarization threshold based on the corrected luminance distribution, the binarization threshold that is not affected by the shadow is obtained. Note that the
上記のような画像処理により線状の影が除かれ、文字の鮮明度が上がる。その結果、文字認識の精度が向上する。
(その他のシステムについて)
ところで、第2実施形態に係る技術は、上記の車番認識システム5の他、例えば、ランドマーク認識システムやOCR(Optical Character Recognition)システムなど、画像から文字を認識する様々なシステムに適用することができる。
The image processing as described above removes linear shadows and increases the sharpness of characters. As a result, the accuracy of character recognition is improved.
(About other systems)
By the way, the technology according to the second embodiment is applied to various systems for recognizing characters from an image, such as a landmark recognition system and an OCR (Optical Character Recognition) system, in addition to the vehicle
ランドマーク認識システムは、街中や観光地にある看板などをスマートフォンのカメラ機能などで撮像し、撮像画像から認識した文字列に基づいて地域や施設などのランドマークに関する情報を提供するシステムである。第2実施形態に係る技術をランドマーク認識システムに適用すると、看板などの文字が影にかかっているような状況においても文字認識がより精度良く行われるため、正しい情報を提供できる可能性が高まる。 The landmark recognition system is a system that captures a signboard or the like in a town or a sightseeing spot with a camera function of a smartphone and provides information related to landmarks such as areas and facilities based on a character string recognized from the captured image. When the technology according to the second embodiment is applied to the landmark recognition system, character recognition is performed with higher accuracy even in a situation where a character such as a sign is in a shadow, so that the possibility of providing correct information is increased. .
OCRシステムは、スキャナなどの光学機器で読み取った文字列の画像から個々の文字を認識してテキストデータに変換するシステムである。第2実施形態に係る技術をOCRシステムに適用すると、本などの原稿を読み取る際にスキャナのガラス面と紙面との間に異物が挟まった場合や、ガラス面のキズなどが線状の影となって生じた場合などにおいて文字認識の精度向上が期待できる。 The OCR system is a system that recognizes individual characters from an image of a character string read by an optical device such as a scanner and converts the characters into text data. When the technology according to the second embodiment is applied to an OCR system, when a document such as a book is read, a foreign object is caught between the glass surface of the scanner and the paper surface, or a scratch on the glass surface is a linear shadow. In such a case, the accuracy of character recognition can be expected to improve.
以上、第2実施形態に係る技術を適用可能なシステムの例について説明した。以下では、上記の車番認識システム5を例に説明を進めるが、第2実施形態に係る技術の適用範囲はこれに限定されない。画像から文字認識を行う任意のシステムに対して第2実施形態に係る技術を適用することが可能である。
Heretofore, an example of a system to which the technology according to the second embodiment can be applied has been described. Hereinafter, the description will be given by taking the above-described vehicle
[2−2.ハードウェア]
ここで、図3を参照しながら、画像処理装置100の機能を実現可能なハードウェアについて説明する。図3は、第2実施形態に係る画像処理装置の機能を実現可能なハードウェアの一例を示した図である。
[2-2. hardware]
Here, hardware capable of realizing the functions of the
画像処理装置100が有する機能は、例えば、図3に示す情報処理装置のハードウェア資源を用いて実現することが可能である。つまり、画像処理装置100が有する機能は、コンピュータプログラムを用いて図3に示すハードウェアを制御することにより実現される。
The functions of the
図3に示すように、このハードウェアは、主に、CPU902と、ROM(Read Only Memory)904と、RAM906と、ホストバス908と、ブリッジ910とを有する。さらに、このハードウェアは、外部バス912と、インターフェース914と、入力部916と、出力部918と、記憶部920と、ドライブ922と、接続ポート924と、通信部926とを有する。
As shown in FIG. 3, this hardware mainly includes a
CPU902は、例えば、演算処理装置又は制御装置として機能し、ROM904、RAM906、記憶部920、又はリムーバブル記録媒体928に記録された各種プログラムに基づいて各構成要素の動作全般又はその一部を制御する。ROM904は、CPU902に読み込まれるプログラムや演算に用いるデータなどを格納する記憶装置の一例である。RAM906には、例えば、CPU902に読み込まれるプログラムや、そのプログラムを実行する際に変化する各種パラメータなどが一時的又は永続的に格納される。
The
これらの要素は、例えば、高速なデータ伝送が可能なホストバス908を介して相互に接続される。一方、ホストバス908は、例えば、ブリッジ910を介して比較的データ伝送速度が低速な外部バス912に接続される。また、入力部916としては、例えば、マウス、キーボード、タッチパネル、タッチパッド、ボタン、スイッチ、及びレバーなどが用いられる。さらに、入力部916としては、赤外線やその他の電波を利用して制御信号を送信することが可能なリモートコントローラが用いられることもある。
These elements are connected to each other via, for example, a
出力部918としては、例えば、CRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)、PDP(Plasma Display Panel)、又はELD(Electro-Luminescence Display)などのディスプレイ装置が用いられる。また、出力部918として、スピーカやヘッドホンなどのオーディオ出力装置、又はプリンタなどが用いられることもある。つまり、出力部918は、情報を視覚的又は聴覚的に出力することが可能な装置である。
As the
記憶部920は、各種のデータを格納するための装置である。記憶部920としては、例えば、HDDなどの磁気記憶デバイスが用いられる。また、記憶部920として、SSD(Solid State Drive)やRAMディスクなどの半導体記憶デバイス、光記憶デバイス、又は光磁気記憶デバイスなどが用いられてもよい。
The
ドライブ922は、着脱可能な記録媒体であるリムーバブル記録媒体928に記録された情報を読み出し、又はリムーバブル記録媒体928に情報を書き込む装置である。リムーバブル記録媒体928としては、例えば、磁気ディスク、光ディスク、光磁気ディスク、又は半導体メモリなどが用いられる。
The
接続ポート924は、例えば、USB(Universal Serial Bus)ポート、IEEE1394ポート、SCSI(Small Computer System Interface)、RS−232Cポート、又は光オーディオ端子など、外部接続機器930を接続するためのポートである。外部接続機器930としては、例えば、プリンタなどが用いられる。
The
通信部926は、ネットワーク932に接続するための通信デバイスである。通信部926としては、例えば、有線又は無線LAN(Local Area Network)用の通信回路、WUSB(Wireless USB)用の通信回路、光通信用の通信回路やルータ、ADSL(Asymmetric Digital Subscriber Line)用の通信回路やルータ、携帯電話ネットワーク用の通信回路などが用いられる。通信部926に接続されるネットワーク932は、有線又は無線により接続されたネットワークであり、例えば、インターネット、LAN、放送網、衛星通信回線などを含む。
The
以上、ハードウェアについて説明した。
[2−3.画像処理装置の機能]
次に、図4を参照しながら、画像処理装置100の機能について説明する。図4は、第2実施形態に係る画像処理装置が有する機能の一例を示したブロック図である。
The hardware has been described above.
[2-3. Function of image processing apparatus]
Next, functions of the
図4に示すように、画像処理装置100は、記憶部101、画像取得部102、領域特定部103、影処理部104、二値化部105、及び文字認識部106を有する。
なお、記憶部101の機能は、上述したRAM906や記憶部920などを用いて実現できる。また、画像取得部102、領域特定部103、影処理部104、二値化部105、及び文字認識部106の機能は、上述したCPU902などを用いて実現できる。
As illustrated in FIG. 4, the
Note that the function of the
(記憶部101)
記憶部101について説明する。
記憶部101は、領域情報111、閾値情報112、形状情報113、及び辞書情報114を有する。
(Storage unit 101)
The
The
(領域情報111)
まず、図5及び図6を参照しながら、領域情報111について説明する。
なお、図5は、第2実施形態に係る領域情報の一例を示した図である。図6は、第2実施形態に係る領域の一例を示した図である。
(Region information 111)
First, the
FIG. 5 is a diagram illustrating an example of area information according to the second embodiment. FIG. 6 is a diagram illustrating an example of a region according to the second embodiment.
領域情報111は、ナンバープレートのフォーマットに関する情報である。領域情報111は、図5に示すように、ナンバープレートに設定された各領域の種類と、各領域が位置する座標とを含む。
The
図5の例では、領域の種類として、領域A、B、Cが設定されている。領域Aは、ナンバープレートの全体(プレート全体)に設定されている。領域Bは、画像から特定可能な要素を含む領域である。また、領域Bは、文字を要素として含む文字領域と、文字以外を要素として含む文字領域以外とに分類されている。領域Cは、領域Aから領域Bを差し引いた残りの領域である。以下、領域Cを背景領域と呼ぶことがある。 In the example of FIG. 5, areas A, B, and C are set as the types of areas. Area A is set for the entire license plate (the entire plate). Region B is a region including elements that can be identified from the image. The area B is classified into a character area that includes characters as elements and a non-character area that includes elements other than characters. Area C is the remaining area obtained by subtracting area B from area A. Hereinafter, the region C may be referred to as a background region.
文字の要素としては、例えば、市区町村コード、一連番号、用途コードなどがある。なお、市区町村コードは複数存在する場合があるため、図5の例では、市区町村コード#1、市区町村コード#2と分けて記載されている。また、一連番号も桁毎に番号が認識されるため、図5の例では、4桁の一連番号の場合、一連番号1桁目、2桁目、3桁目、4桁目と分けて記載されている。一方、文字以外の要素としては、例えば、ナンバープレートを固定するネジ部や、自賠責ステッカーなどがある。
Examples of character elements include city codes, serial numbers, and usage codes. Since there may be a plurality of municipal codes, the
各領域は、例えば、各領域を矩形で規定し、左上に位置する座標及び右下に位置する座標を用いて表現できる。図5の例では、プレート全体を規定する矩形の左上が原点(0,0)に設定され、右下が(344,200)に設定されている。また、市区町村コード#1の領域は、左上が(73,19)に設定され、右下が(271,57)に設定されている。他の領域についても同様である。なお、図5に示したフォーマットは一例であり、車両の種類などに応じて異なるものが用いられる。
Each area can be expressed by, for example, defining each area with a rectangle and using coordinates located at the upper left and coordinates located at the lower right. In the example of FIG. 5, the upper left corner of the rectangle defining the entire plate is set to the origin (0, 0), and the lower right corner is set to (344, 200). In the area of
図5に例示した領域情報111を利用すると、図6に示すように、入力画像から切り出したナンバープレートの画像から領域R1、R2、…、R7などを特定することができる。領域R1、R7は、市区町村コードを含む領域である。領域R2は、用途コードを含む領域である。R3、…、R6は、一連番号を含む領域である。つまり、領域情報111を利用すれば、ナンバープレートの地色(以下、背景色)だけを含む背景領域(上記の領域C)を特定することができる。
If the
(閾値情報112)
次に、図7を参照しながら、閾値情報112について説明する。図7は、第2実施形態に係る閾値情報の一例を示した図である。
(Threshold information 112)
Next, the
図7に示すように、閾値情報112は、3種類の閾値を含む。その1つは、影の判定に用いる影判定用の閾値ThSである。入力画像の背景に影がかかると、背景に位置する画素の輝度に比べ、影の部分に位置する画素の輝度は小さくなる。そのため、文字が存在しない部分で隣接する画素間の輝度が減少した場合、低い輝度の画素は、影の部分に位置する画素であると判定できる。一方、低い輝度の画素を基準に隣接する画素間で輝度が増加した場合、高い輝度を有する画素は、背景の部分に位置する画素であると判定できる。このような判定に上記の閾値ThSが利用される。
As shown in FIG. 7, the
また、閾値情報112には、影と文字とが重なる領域の判定に用いる重なり判定用の閾値ThBが含まれる。文字と影とが重なる部分に位置する画素の輝度は、文字だけの部分に位置する画素の輝度に比べて小さくなる。そのため、影の部分に位置する画素と隣接する画素との間で輝度が減少した場合、低い輝度の画素は、文字に影が重なった部分に位置する画素であると判定できる。一方、低い輝度の画素を基準に隣接する画素間で輝度が増加した場合、高い輝度を有する画素は、影の部分に位置する画素であると判定できる。このような判定に上記の閾値ThBが利用される。
The
但し、文字の部分に位置する画素の輝度と、文字に影が重なった部分に位置する画素の輝度との差は、背景の部分に位置する画素の輝度と、背景に影が重なった部分に位置する画素の輝度との差よりも小さいことが多い。そのため、閾値ThBは、例えば、閾値ThSよりも小さな値に設定される。なお、閾値ThCは、画像の二値化に用いる閾値であり、影を除去した入力画像における輝度分布から画像処理装置100により決定されてもよいし、予め設定されて記憶部101に格納されていてもよい。
However, the difference between the luminance of the pixel located in the character portion and the luminance of the pixel located in the portion where the shadow is superimposed on the character is the difference between the luminance of the pixel located in the background portion and the portion where the shadow is superimposed on the background. It is often smaller than the difference from the brightness of the pixel located. Therefore, the threshold value ThB is set to a value smaller than the threshold value ThS, for example. The threshold value ThC is a threshold value used for binarization of the image, and may be determined by the
(形状情報113)
次に、図8を参照しながら、形状情報113について説明する。図8は、第2実施形態に係る形状情報の一例を示した図である。
(Shape information 113)
Next, the
ナンバープレートのように、影として映り込む物体が予め想定できる場合、影の形状を示したパターンを形状情報113として予め用意しておくことができる。図8の例では、バイクの荷台が影として映り込む場合を例に8つのパターンを示している。パターンP2Aは、ナンバープレートの上辺から伸びる2本の線状のパターンを表している。また、パターンP3Aは、上辺から伸びるU字カーブのような形状の影と1本の線状の影とを含むパターンを表している。
When an object that appears as a shadow can be assumed in advance, such as a license plate, a pattern indicating the shape of the shadow can be prepared in advance as the
これらのパターンは、例えば、ナンバープレートの上辺に位置する影の端点数で分類することができる。図8の例では、上辺の端点数が2つのパターンとして、3つのパターンP2A、P2B、P2Cが分類されている。また、上辺の端点数が3つのパターンとして、3つのパターンP3A、P3B、P3Cが分類されている。また、上辺の端点数が4つのパターンとして、2つのパターンP4A、P4Bが分類されている。このような分類を示す情報を形状情報113に含めることでパターンを効率的に検索できるようになる。
These patterns can be classified by, for example, the number of shadow end points located on the upper side of the license plate. In the example of FIG. 8, three patterns P2A, P2B, and P2C are classified as patterns having two endpoints on the upper side. Also, three patterns P3A, P3B, and P3C are classified as patterns having three endpoints on the upper side. Further, two patterns P4A and P4B are classified as patterns having four end points on the upper side. By including information indicating such classification in the
なお、図8に例示したパターンの他にも、被写体の種類や映り込む物体の形状などに応じて任意のパターンを用意することができる。また、分類方法も上辺の端点数だけでなく、下辺の端点数や、左辺又は右辺の端点数などを組み合わせて分類する方法なども適用可能である。こうした変形例についても第2実施形態の技術的範囲に含まれる。 In addition to the patterns illustrated in FIG. 8, an arbitrary pattern can be prepared according to the type of subject, the shape of the object to be reflected, and the like. As the classification method, not only the number of endpoints on the upper side but also a method of classifying by combining the number of endpoints on the lower side, the number of endpoints on the left side or the right side, and the like can be applied. Such modifications are also included in the technical scope of the second embodiment.
(辞書情報114)
次に、図9を参照しながら、辞書情報114について説明する。図9は、第2実施形態に係る辞書情報の一例を示した図である。
(Dictionary information 114)
Next, the
辞書情報114は、文字の認識処理に利用する辞書画像を管理するデータベースである。例えば、図9に示すように、辞書情報114には、文字毎に、文字コードと、文字の形状を表す画像(辞書画像)とを対応付けるレコードが含まれる。なお、図9の例では、文字コードを辞書画像に対応付けているが、各文字を特定可能な情報であれば文字コード以外の情報を辞書画像に対応付けてもよい。また、辞書画像のデータフォーマットは任意であり、圧縮形式のデータフォーマットでもよいし、非圧縮形式のデータフォーマットでもよい。また、辞書情報114により管理される文字の種類は任意である。
The
(画像取得部102)
次に、画像取得部102について説明する。
画像取得部102は、撮像装置52が撮像した画像を取得する。例えば、画像処理装置100と撮像装置52とがネットワークを介して接続されている場合、画像取得部102は、撮像装置52と通信して画像を取得する。また、画像処理装置100が撮像装置52のメモリ(非図示)にアクセスできる場合、画像取得部102は、撮像装置52のメモリから画像を読み出す。また、撮像装置52により撮像された画像が、外部の記憶装置(非図示)に格納されている場合、画像取得部102は、外部の記憶装置から画像を取得してもよい。
(Image acquisition unit 102)
Next, the
The
例えば、屋外で撮影された通過車両のナンバープレートのように、照明環境や撮影対象を自由に設定することが難しい状況で、バイクの荷台などのように線状の物体による影が文字部にかかった画像などが画像取得部102により取得される。画像取得部102により取得された画像は、領域特定部103に入力される。
For example, in a situation where it is difficult to freely set the lighting environment and the subject to be photographed, such as a license plate of a passing vehicle taken outdoors, the shadow of a linear object such as a motorcycle bed rests on the character part. An image or the like is acquired by the
(領域特定部103)
次に、領域特定部103について説明する。
領域特定部103は、画像取得部102から入力された画像についてエッジ検出を行い、その画像からナンバープレートの輪郭に沿って画像(入力画像)を切り出す。また、領域特定部103は、入力画像に含まれるエッジの位置から文字を囲む矩形領域の輪郭を特定し、特定した矩形領域の位置に基づいてフォーマットを特定する。例えば、領域特定部103は、領域情報111を参照し、特定した矩形領域間の位置関係と、フォーマットを規定する領域間の位置関係とが最も類似するフォーマットを特定する。
(Area specifying unit 103)
Next, the
The
なお、以下の説明において、ナンバープレートの輪郭周辺に文字は存在せず、無地の背景だけが存在するものとする。また、背景の輝度は、背景に影がかかった部分の輝度より大きいものとする。また、背景に影がかかった部分の輝度は、文字に影がかかった部分の輝度より大きいものとする。例えば、原動機付き自転車のナンバープレートを例に挙げると、多くの場合、背景色が白、黄色、ピンクのいずれかであり、文字色が黒である。つまり、上述した輝度の関係が成り立つ。以下、この例に沿って説明を進める。 In the following description, it is assumed that there are no characters around the outline of the license plate and only a plain background exists. In addition, the luminance of the background is greater than the luminance of the shadowed portion of the background. In addition, the luminance of a portion where the background is shaded is greater than the luminance of the portion where the character is shaded. For example, taking a license plate of a motorbike as an example, in many cases, the background color is white, yellow, or pink, and the character color is black. That is, the above-described luminance relationship is established. Hereinafter, the description will proceed along this example.
領域特定部103により特定されたフォーマットの情報は、影処理部104、二値化部105、及び文字認識部106に入力される。
(影処理部104)
次に、影処理部104について説明する。
Information on the format specified by the
(Shadow processing unit 104)
Next, the
影処理部104は、入力画像の輪郭上にある画素について影の端点を探索する。例えば、影処理部104は、文字の存在しない背景領域の輝度値を基に二値化し、影の端点として、黒画素の幅が予め設定した値以下である画素の集合を検出する。端点を検出した場合、影処理部104は、端点を始点として連続する画素について、隣接する画素間の輝度差に基づく判定処理により影の部分を追跡する。
The
例えば、影処理部104は、端点の画素と隣接画素との輝度差を計算する。端点の画素に比べて隣接画素の輝度が減少している場合、影処理部104は、輝度差(絶対値)が閾値ThS以下であるか否かを判定する。輝度差が閾値ThS以下である場合、影処理部104は、隣接画素が影の部分の画素であると判定し、影が続いていると認識する。そして、影処理部104は、影の部分であると判定した画素に影フラグを設定する。一方、輝度差が閾値ThS超過である場合、影処理部104は、隣接画素が背景の部分の画素であると判定し、影が続いていないと認識する。
For example, the
また、端点の画素に比べて隣接画素の輝度が増加している場合、影処理部104は、輝度差(絶対値)が閾値ThB以上であるか否かを判定する。輝度差が閾値ThB以上である場合、影処理部104は、隣接画像が、文字に影が重なった部分の画素であると判定する。そして、影処理部104は、文字に影が重なった部分であると判定した画素に文字フラグを設定する。一方、輝度差が閾値ThB未満である場合、隣接画素には文字フラグが設定されず、影フラグが設定される。
When the brightness of the adjacent pixel is increased as compared with the pixel at the end point, the
上記と同様に、影処理部104は、端点を始点として影が連続する画素を順次追跡し、輝度差に基づいて影フラグ又は文字フラグを設定する。
なお、文字フラグが設定された画素と、隣接画素との輝度差が減少している場合、影処理部104は、輝度差(絶対値)が閾値ThB以上であるか否かを判定する。輝度差が閾値ThB以上である場合、影処理部104は、隣接画素が、背景に影が重なった部分の画素であると判定し、当該隣接画素に影フラグを設定する。一方、輝度差が閾値ThB未満である場合、影処理部104は、隣接画素が、文字に影が重なった部分の画素であると判定し、当該隣接画素に文字フラグを設定する。
In the same manner as described above, the
When the luminance difference between the pixel for which the character flag is set and the adjacent pixel is decreased, the
影処理部104は、検出した端点の全てについて影の部分を追跡する上記の処理を実行し、輝度差に基づく影フラグ又は文字フラグを設定する。そして、影処理部104は、影フラグを設定した画素の輝度を背景の輝度に設定する。このとき、文字フラグが設定された画素の輝度は維持される。つまり、影処理部104は、文字と重なる部分を残しつつ影の部分を除去する。このようにして影処理部104により影の部分が除去された入力画像は、二値化部105に入力される。
The
(二値化部105、文字認識部106)
次に、二値化部105、及び文字認識部106について説明する。
二値化部105には、影の部分が除去された入力画像を二値化して二値化画像を生成する。例えば、二値化部105は、入力画像に含まれる画素の輝度分布(ヒストグラム)を求め、輝度の高い領域にできた分布の山と、輝度の低い領域にできた分布の山とを分離する輝度の値(例えば、2つのピークの中間に位置する輝度)を閾値ThCに設定する。そして、二値化部105は、入力画像に含まれる各画素の輝度と閾値ThCとを比較し、輝度が閾値ThC以上の画素を白画素、輝度が閾値ThC未満の画素を黒画素に設定する。
(
Next, the
The
二値化部105により二値化された入力画像(以下、二値化画像)は、文字認識部106に入力される。文字認識部106は、領域情報111を参照し、二値化画像に含まれる文字の領域を特定する。また、文字認識部106は、辞書情報114を参照し、特定した領域の画像と各辞書画像とを比較し、最も類似する辞書画像を特定する。そして、文字認識部106は、特定した辞書画像に対応する文字を認識結果として出力する。
An input image binarized by the binarization unit 105 (hereinafter referred to as binarized image) is input to the
以上、画像処理装置100の機能について説明した。
[2−4.処理の流れ]
次に、画像処理装置100が実行する文字認識処理の流れについて説明する。
The function of the
[2-4. Process flow]
Next, a flow of character recognition processing executed by the
(全体的な流れ)
図10及び図11を参照しながら、文字認識処理の全体的な流れについて説明する。
なお、図10は、第2実施形態に係る画像処理装置が実行する文字認識処理の流れを示したフロー図である。図11は、第2実施形態に係る端部、影、文字、重なりの一例を示した図である。
(Overall flow)
The overall flow of character recognition processing will be described with reference to FIGS.
FIG. 10 is a flowchart showing the flow of character recognition processing executed by the image processing apparatus according to the second embodiment. FIG. 11 is a diagram illustrating an example of an end portion, a shadow, a character, and an overlap according to the second embodiment.
(S101)画像取得部102は、撮像装置52が撮像した画像を取得する。
例えば、屋外で撮影された通過車両のナンバープレートのように、照明環境や撮影対象を自由に設定することが難しい状況で、バイクの荷台などのように線状の物体による影が文字部にかかった画像などが画像取得部102により取得される。画像取得部102により取得された画像は、領域特定部103に入力される。
(S101) The
For example, in a situation where it is difficult to freely set the lighting environment and the subject to be photographed, such as a license plate of a passing vehicle taken outdoors, the shadow of a linear object such as a motorcycle bed rests on the character part. An image or the like is acquired by the
(S102)領域特定部103は、ナンバープレート及び各領域を特定する。
例えば、領域特定部103は、画像取得部102から入力された画像についてエッジ検出を行い、その画像からナンバープレートの輪郭に沿って画像(入力画像)を切り出す。また、領域特定部103は、入力画像に含まれるエッジの位置から文字を囲む矩形領域の輪郭を特定し、特定した矩形領域の位置に基づいてフォーマットを特定する。例えば、領域情報111は、領域情報111を参照し、特定した矩形領域間の位置関係と、フォーマットを規定する領域間の位置関係とが最も類似するフォーマットを特定する。
(S102) The
For example, the
ここでは、ナンバープレートの輪郭周辺に文字は存在せず、無地の背景だけが存在するものとする。また、背景の輝度は、背景に影がかかった部分の輝度より大きいものとする。また、背景に影がかかった部分の輝度は、文字に影がかかった部分の輝度より大きいものとする。例えば、原動機付き自転車のナンバープレートを例に挙げると、多くの場合、背景色が白、黄色、ピンクのいずれかであり、文字色が黒である。つまり、上述した輝度の関係が成り立つ。以下、この例に沿って説明を進める。 Here, it is assumed that there are no characters around the outline of the license plate, only a plain background. In addition, the luminance of the background is greater than the luminance of the shadowed portion of the background. In addition, the luminance of a portion where the background is shaded is greater than the luminance of the portion where the character is shaded. For example, taking a license plate of a motorbike as an example, in many cases, the background color is white, yellow, or pink, and the character color is black. That is, the above-described luminance relationship is established. Hereinafter, the description will proceed along this example.
(S103)影処理部104は、影領域の特定及び輝度の補正を実行する。
S103において、影処理部104は、入力画像の輪郭上にある画素について影の端点を探索する。入力画像の輪郭上にある画素とは、図11に示すように、ナンバープレートの上辺、下辺、右辺、左辺の各端部に位置する画素である。例えば、影処理部104は、文字の存在しない背景領域の輝度値を基に二値化し、影の端点として、黒画素の幅が予め設定した値以下である画素の集合を検出する。
(S103) The
In step S <b> 103, the
端点を検出した場合、影処理部104は、端点を始点として連続する画素について、隣接する画素間の輝度差に基づく判定処理により影の部分を追跡する。そして、影処理部104は、背景に影が重なった部分の画素に影フラグを設定し、文字に影が重なった部分の画素に文字フラグを設定する。図11の例では、「重なり」と表記した黒色の部分にある画素に文字フラグが設定される。また、影処理部104は、影フラグを設定した画素の輝度を背景の輝度に設定する補正処理を実行する。
When the end point is detected, the
(S104)二値化部105は、S103で補正処理が施された入力画像から、二値化用の閾値ThCを計算する。例えば、二値化部105は、入力画像に含まれる画素の輝度分布(ヒストグラム)を求め、輝度の高い領域にできた分布の山と、輝度の低い領域にできた分布の山とを分離する輝度の値(例えば、2つのピークの中間に位置する輝度)を閾値ThCに設定する。そして、二値化部105は、入力画像に含まれる各画素の輝度と閾値ThCとを比較し、輝度が閾値ThC以上の画素を白画素、輝度が閾値ThC未満の画素を黒画素に設定する。
(S104) The
(S105、S106)文字認識部106は、領域情報111を参照し、二値化画像に含まれる文字の領域を特定する。また、文字認識部106は、辞書情報114を参照し、特定した領域の画像と各辞書画像とを比較し、最も類似する辞書画像を特定する。また、文字認識部106は、特定した辞書画像に対応する文字を認識結果として出力する。S106の処理が完了すると、図10に示した一連の処理は終了する。
(S105, S106) The
(影領域の特定及び輝度の補正)
ここで、図12及び図13を参照しながら、S103の処理について、さらに説明する。S103の処理は、主に影処理部104により実行される。
(Shadow area identification and brightness correction)
Here, the process of S103 will be further described with reference to FIGS. The process of S103 is mainly executed by the
なお、図12は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち影領域の特定及び輝度の補正に係る処理の流れを示した第1のフロー図である。図13は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち影領域の特定及び輝度の補正に係る処理の流れを示した第2のフロー図である。 FIG. 12 is a first flowchart showing a flow of processing related to shadow area specification and luminance correction in the character recognition processing executed by the image processing apparatus according to the second embodiment. FIG. 13 is a second flowchart showing a flow of processing relating to shadow region specification and luminance correction in the character recognition processing executed by the image processing apparatus according to the second embodiment.
(S111)影処理部104は、入力画像の端部に端点探索の開始位置を設定する。例えば、影処理部104は、入力画像の左上に位置する画素を端点探索の開始位置に設定する。なお、最初に端点探索を実行する端部の開始位置は任意に設定してよい。
(S111) The
(S112)影処理部104は、S111で設定した端点探索の開始位置から、入力画像の輪郭に沿って影の端点を探索する。例えば、影処理部104は、文字の存在しない背景領域の輝度値を基に二値化し、影の端点として、黒画素の幅(つまり、端点の幅)が予め設定した値以下である画素の集合(連続する1以上の画素)を検出する。なお、黒画素の幅が予め設定した値を超過する場合、影処理部104は、線状の影ではないと判断し、端点から除外する。また、端点探索の方向は予め設定されているものとする。
(S112) The
(S113)影処理部104は、S112で影の端点が検出されたか否かを判定する。影の端点が検出された場合、処理はS114へと進む。一方、影の端点が検出されなかった場合、図12に示した一連の処理は終了する。
(S113) The
(S114)影処理部104は、S112で検出した影の端点を始点として連続する影の部分を追跡し、影の部分に位置する画素に影フラグ又は文字フラグを設定する。この処理により、背景に影が重なる部分の画素には影フラグが設定され、文字に影が重なる部分の画素に文字フラグが設定される。なお、S114の処理については後で詳述する。
(S114) The
(S115)影処理部104は、端点探索の開始位置を未探索の隣接画素に設定する。例えば、影処理部104は、S112で検出した影の端点に隣接する未探索の画素を端点探索の開始位置に設定する。なお、未探索の隣接画素がない場合、影処理部104は、例えば、端点探索の開始位置を設定せず、処理をS116へと進める。
(S115) The
(S116)影処理部104は、入力画像の輪郭上にある全ての画素を探索し終えたか否かを判定する。輪郭上の画素を探索し終えた場合、処理はS117へと進む。一方、輪郭上の画素を探索し終えていない場合、処理はS112へと進む。
(S116) The
(S117)影処理部104は、形状情報113を参照し、影フラグが設定された画素及び文字フラグが設定された画素の集合がつくる形状に類似する影のパターンを抽出する。そして、影処理部104は、抽出した影のパターンに基づいて影フラグ又は文字フラグを設定する画素を追加探索する。なお、S117の処理については後で詳述する。
(S117) The
(S118)影処理部104は、影フラグを設定した画素の輝度値を背景画素の輝度値に設定する。このとき、影処理部104は、文字フラグを設定した画素の輝度値をそのまま維持する。S118の処理により文字と重なる部分を残したまま、線状の影を除去することができる。S118の処理が完了すると、図12に示した一連の処理は終了する。
(S118) The
(フラグの設定)
ここで、図13を参照しながら、S114の処理について、さらに説明する。
(S121)影処理部104は、影の端点を現在画素に設定する。現在画素は、影フラグ又は文字フラグを設定する画素を探索して影の部分を追跡する際の基準となる。
(Set flag)
Here, the process of S114 will be further described with reference to FIG.
(S121) The
(S122)影処理部104は、現在画素を基準に、隣接画素を追跡対象に設定する。
例えば、図14に示すように、入力画像の上辺を1段目としてY方向に2段目、3段目、…と追跡を進める場合、影処理部104は、現在画素が位置する段の次の段に位置する画素列のうち、現在画素を基準に縦方向に隣接する画素を追跡対象に設定する。なお、X方向に追跡を進める場合、影処理部104は、現在画素を基準に横方向に隣接する画素を追跡対象に設定する。なお、図14は、第2実施形態に係る追跡対象の一例を示した図である。
(S122) The
For example, as shown in FIG. 14, when tracking the upper side of the input image as the first step and the second step, the third step,... In the Y direction, the
(S123)影処理部104は、S122で追跡対象に設定した隣接画素と現在画素との輝度差を計算する。
(S124)影処理部104は、S123で計算した輝度差に基づき、現在画素から隣接画素への輝度の増加が閾値ThS以下であるか否かを判定する。輝度の増加が閾値ThS以下である場合、処理はS125へと進む。一方、輝度の増加が閾値ThS以下でない場合、処理はS128へと進む。なお、輝度が減少している場合は、輝度の増加が閾値ThS以下であると判定され、処理はS125へと進む。
(S123) The
(S124) Based on the luminance difference calculated in S123, the
(S125)影処理部104は、S123で計算した輝度差に基づき、現在画素から隣接画素への輝度の減少が閾値ThB以上であるか否かを判定する。輝度の減少が閾値ThB以上である場合、処理はS126へと進む。一方、輝度の減少が閾値ThB以上でない場合、処理はS127へと進む。なお、輝度が増加している場合は、輝度の減少が閾値ThB以上でないと判定され、処理はS127へと進む。
(S125) The
(S126)影処理部104は、隣接画素に文字フラグを設定する。S126の処理が完了すると、処理はS128へと進む。
(S127)影処理部104は、隣接画素に影フラグを設定する。S127の処理が完了すると、処理はS128へと進む。
(S126) The
(S127) The
(S128)影処理部104は、追跡対象の画素を探索し終えたか否かを判定する。追跡対象の画素を探索し終えている場合、処理はS129へと進む。一方、追跡対象の画素を探索し終えていない場合、処理はS123へと進む。
(S128) The
(S129)影処理部104は、現ターンでフラグを設定したかを判定する。現ターンは、現在設定されている現在画素について実行したS122以降の処理である。現在画素を基準とする隣接画素に影フラグも文字フラグも設定されていない場合、現在画素から先は影の部分が続いていないと判断される。従って、現ターンで各隣接画素にいずれのフラグも設定されていない場合、図13に示した一連の処理は終了する。一方、現ターンで少なくとも1つの隣接画素に影フラグ又は文字フラグが設定された場合、処理はS130へと進む。
(S129) The
(S130)影処理部104は、影フラグ又は文字フラグが設定された1以上の隣接画素を現在画素に設定し、現在画素の設定を更新する。S130の処理が完了すると、処理はS122へと進む。
(S130) The
(追跡対象の設定)
ここで、図15を参照しながら、S122の処理について、さらに説明する。図15は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追跡対象の設定に係る処理の流れを示したフロー図である。
(Tracking target setting)
Here, the process of S122 will be further described with reference to FIG. FIG. 15 is a flowchart showing a flow of processing related to setting of a tracking target among character recognition processing executed by the image processing apparatus according to the second embodiment.
(S131)影処理部104は、複数段を探索したか否かを判定する。例えば、図14に示すように、影の端点を始点としてY方向に2段目、3段目、…と影の部分を追跡する場合、影処理部104は、2段以上にわたって影を追跡済みか否かを判定する。複数段を追跡している場合、処理はS132へと進む。一方、複数段を追跡していない場合(影の端点が現在画素の場合)、処理はS134へと進む。
(S131) The
(S132)影処理部104は、影の端点と、影フラグ又は文字フラグを設定した画素との位置関係から影の延伸方向を計算する。例えば、図14の例(図中の矢印を参照)では、Y方向に3画素、X方向に2画素移動する方向に影が延伸しており、影の延伸方向として傾き2/3が得られる。
(S132) The
(S133)影処理部104は、S132で計算した影の延伸方向に沿って追跡対象を設定する。例えば、影処理部104は、図14に示すように、影の延伸方向に沿って現在画素(この例ではXが7〜9、Yが4の範囲にある画素)に隣接する範囲(この例ではXが7〜10、Yが5の範囲)を追跡対象に設定する。このように、追跡対象の画素を制限することで、輝度差の計算処理、及び、影フラグ又は文字フラグの設定に関する判定処理にかかる負荷が低減される。S133の処理が完了すると、図15に示した一連の処理は終了する。
(S133) The
(S134)影処理部104は、現在画素の周囲に追跡対象を設定する。例えば、影処理部104は、現在画素を基準に縦方向、横方向、斜め方向に隣接する画素を追跡対象に設定する。この場合、S133の処理とは異なり影の延伸方向は考慮されない。S134の処理が完了すると、図15に示した一連の処理は終了する。
(S134) The
(追加探索)
ここで、図16及び図17を参照しながら、S117の処理について、さらに説明する。
(Additional search)
Here, the processing of S117 will be further described with reference to FIGS.
なお、図16は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の流れを示したフロー図である。図17は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の一例を示した図である。 FIG. 16 is a flowchart showing a flow of processing related to additional search among character recognition processing executed by the image processing apparatus according to the second embodiment. FIG. 17 is a diagram illustrating an example of a process related to an additional search among the character recognition processes executed by the image processing apparatus according to the second embodiment.
(S141)影処理部104は、上辺の端点数をカウントする。
(S142)影処理部104は、S141でカウントした端点数に応じたパターンから、影の形状と類似するパターンを特定する。
(S141) The
(S142) The
例えば、影処理部104は、S111〜S116の処理を実行し、図17のT11、T12に示すように影の延伸方向に沿って影の部分を追跡する。図17の例では、T13に示すように、上辺から延伸する4本の直線的な影の部分が特定されている。この場合、上辺に位置する端点数は4である。ここで、影処理部104は、形状情報113を参照し、端点数が4のパターンP4A、P4Bを抽出する。さらに、影処理部104は、T13の(A)及び(B)の部分が下辺の端部まで延伸していないことを形状の特徴として認識し、この形状の特徴に適合するパターンP4Bを特定する。
For example, the
(S143)影処理部104は、S142でパターンを特定できたか否かを判定する。パターンを特定できた場合、処理はS144へと進む。一方、パターンを特定できなかった場合、図16に示した一連の処理は終了する。
(S143) The
(S144)影処理部104は、S142で特定したパターンに基づいて影の延伸方向を設定し、追跡及びフラグの設定を実行する。図17の例では、パターンP4Bが特定されており、パターンP4Bに基づいてT14の(A)及び(B)の部分を架橋するように影の部分を追跡する。追跡方法及びフラグの設定方法は、上述したS114と同じである。図17の例では、(A)の部分と(B)の部分とを架橋する画素に対して影フラグ又は文字フラグが設定されている。S144の処理が完了すると、図16に示した一連の処理は終了する。
(S144) The
以上、文字認識処理の流れについて説明した。
(追加探索の変形例)
ここで、図18及び図19を参照しながら、上述したS117の処理に係る変形例について説明する。
The flow of character recognition processing has been described above.
(Modification of additional search)
Here, with reference to FIG. 18 and FIG. 19, a modified example related to the above-described processing of S117 will be described.
なお、図18は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の流れの一変形例を示したフロー図である。図19は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の一変形例を示した図である。 FIG. 18 is a flowchart showing a modification of the process related to the additional search among the character recognition processes executed by the image processing apparatus according to the second embodiment. FIG. 19 is a diagram illustrating a modification of the process related to the additional search among the character recognition processes executed by the image processing apparatus according to the second embodiment.
(S151、S152)影処理部104は、上辺の端点数をカウントする。また、影処理部104は、下辺の端点数をカウントする。
(S153)影処理部104は、上辺の端点数と下辺の端点数とが同じか否かを判定する。上辺の端点数と下辺の端点数とが同じである場合、処理はS154へと進む。一方、上辺の端点数と下辺の端点数とが同じでない場合、処理はS155へと進む。
(S151, S152) The
(S153) The
(S154)影処理部104は、形状情報113を参照し、S151でカウントした端点数に対応し、且つ上辺の端点と下辺の端点とを各々直線で結ぶパターンを抽出する。例えば、図19に示すように、上辺に4つの端点が検出され、下辺に4つの端点が検出された場合、上辺の端点数が4のパターンのうちパターンP4Aが抽出される。なお、結ぶ端点の組み合わせ方法としては、例えば、左から何番目であるかを認識し、同じ順番の端点を抽出して結ぶ方法を適用できる。S154の処理が完了すると、処理はS157へと進む。
(S154) The
(S155)影処理部104は、S151でカウントした端点数に応じたパターンから、影の形状と類似するパターンを特定する。
例えば、影処理部104は、S111〜S116の処理を実行し、図17のT11、T12に示すように影の延伸方向に沿って影の部分を追跡する。図17の例では、T13に示すように、上辺から延伸する4本の直線的な影の部分が特定されている。この場合、上辺に位置する端点数は4である。ここで、影処理部104は、形状情報113を参照し、端点数が4のパターンP4A、P4Bを抽出する。さらに、影処理部104は、T13の(A)及び(B)の部分が下辺の端部まで延伸していないことを形状の特徴として認識し、この形状の特徴に適合するパターンP4Bを特定する。S155の処理が完了すると、処理はS156へと進む。
(S155) The
For example, the
(S156)影処理部104は、S155でパターンを特定できたか否かを判定する。パターンを特定できた場合、処理はS157へと進む。一方、パターンを特定できなかった場合、図18に示した一連の処理は終了する。
(S156) The
(S157)影処理部104は、S154で抽出又はS155で特定したパターンに基づいて影の延伸方向を設定し、追跡及びフラグの設定を実行する。追跡方法及びフラグの設定方法は、上述したS114と同じである。S157の処理が完了すると、図18に示した一連の処理は終了する。
(S157) The
更なる変形例として、例えば、S153で上辺の端点数と下辺の端点数とが同じであると判定された場合、パターンを特定せず、上辺の端点と下辺の端点とを結ぶ直線の傾きを計算し、その傾きに沿って追跡範囲を設定する方法も適用可能である。この方法によれば、追跡範囲を限定することで追跡及びフラグの設定に係る処理の負荷を低減できる。 As a further modification, for example, when it is determined in S153 that the number of end points on the upper side is the same as the number of end points on the lower side, the pattern is not specified, and the slope of the straight line connecting the end points on the upper side and the lower side is determined. A method of calculating and setting a tracking range along the inclination is also applicable. According to this method, it is possible to reduce the processing load related to tracking and flag setting by limiting the tracking range.
(追跡対象の設定の変形例)
ここで、図20を参照しながら、上述したS122の処理に係る変形例について説明する。なお、図20は、第2実施形態に係る画像処理装置が実行する文字認識処理のうち追跡対象の設定に係る処理の一変形例を示した図である。
(Modification of tracking target setting)
Here, with reference to FIG. 20, a modified example related to the processing of S122 described above will be described. FIG. 20 is a diagram illustrating a modified example of processing related to setting of a tracking target among character recognition processing executed by the image processing apparatus according to the second embodiment.
(S161)影処理部104は、複数段を探索したか否かを判定する。例えば、図14に示すように、影の端点を始点としてY方向に2段目、3段目、…と影の部分を追跡する場合、影処理部104は、2段以上にわたって影を追跡済みか否かを判定する。複数段を追跡している場合、処理はS162へと進む。一方、複数段を追跡していない場合(影の端点が現在画素の場合)、処理はS165へと進む。
(S161) The
(S162)影処理部104は、影の端点と、影フラグ又は文字フラグを設定した画素との位置関係から影の延伸方向を計算する。例えば、図14の例(図中の矢印を参照)では、Y方向に3画素、X方向に2画素移動する方向に影が延伸しており、影の延伸方向として傾き2/3が得られる。
(S162) The
(S163)影処理部104は、端点の幅を計算する。なお、端点の幅は、端点探索の実行時に予め計算して保持しておいてもよい。
(S164)影処理部104は、S162で計算した影の延伸方向に沿って、S163で計算した端点の幅に予め設定したマージン(例えば、5%など)を加えた幅を有する線状の領域を追跡対象に設定する。このように、追跡対象の画素を制限することで、輝度差の計算処理、及び、影フラグ又は文字フラグの設定に関する判定処理にかかる負荷が低減される。S164の処理が完了すると、図20に示した一連の処理は終了する。
(S163) The
(S164) The
(S165)影処理部104は、現在画素の周囲に追跡対象を設定する。例えば、影処理部104は、現在画素を基準に縦方向、横方向、斜め方向に隣接する画素を追跡対象に設定する。この場合、S164の処理とは異なり影の延伸方向は考慮されない。S165の処理が完了すると、図20に示した一連の処理は終了する。
(S165) The
以上、文字認識処理の流れに係る変形例について説明した。
[2−5.その他]
これまで、矩形のナンバープレートを例に入力画像の上下を横断する影について、影の部分を追跡し、文字と影とが重なる部分を残して影を消去する方法について説明してきた。しかし、第2実施形態に係る技術の適用範囲はこれに限定されない。例えば、入力画像の左右を横断する影についても同様の技術的思想に基づいて適切に影を消去することができる。また、背景の輝度が文字の輝度より小さい場合にも第2実施形態に係る技術を応用することができる。例えば、背景が黒などの暗色で、文字が白又は黄色などの明色である場合が考えられる。この場合、背景に影が重なった部分の輝度が最も小さく、次に背景だけの部分の輝度が小さく、次に影が文字に重なった部分の輝度が小さく、文字だけの部分の輝度が最も大きくなることを考慮して閾値を設定すれば、既に説明した第2実施形態と同様の技術的思想に基づいて影を消去することができる。
In the above, the modification concerning the flow of a character recognition process was demonstrated.
[2-5. Others]
Up to now, a method has been described in which a shadow portion of an input image is traced by using a rectangular license plate as an example, the shadow portion is tracked, and the shadow is erased while leaving a portion where the character and the shadow overlap. However, the application range of the technology according to the second embodiment is not limited to this. For example, a shadow that crosses the left and right of the input image can be appropriately erased based on the same technical idea. The technique according to the second embodiment can also be applied when the luminance of the background is smaller than the luminance of characters. For example, the background may be a dark color such as black and the character may be a light color such as white or yellow. In this case, the brightness of the part where the shadow is superimposed on the background is the lowest, the brightness of the part where only the background is next, the brightness of the part where the shadow is superimposed next to the letter is low, and the brightness of the part where only the character is high If the threshold value is set in consideration of this, the shadow can be erased based on the same technical idea as that of the second embodiment already described.
以上、第2実施形態について説明した。
<3.付記>
以上説明した実施形態に関し、さらに以下の付記を開示する。
The second embodiment has been described above.
<3. Addendum>
The following additional notes are disclosed with respect to the embodiment described above.
(付記1) 背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を記憶する記憶部と、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する演算部と、
を有する、画像処理装置。
(Supplementary Note 1) Determination of luminance change from an input image obtained by imaging a subject having characters described in a color different from the background color on a background having a background color to an area where a shadow overlaps the background A storage unit that stores a first threshold value used for the determination, and a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character;
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold Specifying a second flag, and setting a luminance of a pixel for which only the first flag is set as the luminance of the background;
An image processing apparatus.
(付記2) 前記演算部は、前記特定した画素を始点として隣接する画素を順次追跡する際、追跡方向を維持するように追跡範囲を制限する
付記1に記載の画像処理装置。
(Supplementary note 2) The image processing device according to
(付記3) 前記記憶部は、前記影の形状を示すパターン情報をさらに記憶し、
前記演算部は、前記第1のフラグ及び前記第2のフラグを設定した画素の集合が有する形状に基づき、前記パターン情報の中から類似する前記影の形状を特定し、特定した形状に沿った方向に追跡範囲を拡張して前記画素を特定する処理を継続する
付記1又は2に記載の画像処理装置。
(Additional remark 3) The said memory | storage part further memorize | stores the pattern information which shows the shape of the said shadow,
The arithmetic unit identifies a similar shadow shape from the pattern information based on a shape of a set of pixels in which the first flag and the second flag are set, and follows the identified shape. The image processing apparatus according to
(付記4) 前記演算部は、前記被写体の端部に位置する画素のうち前記第1のフラグが設定された連続する画素の集合の数をカウントし、前記被写体の対向する二辺の一方についてカウントした前記集合の数と、他方についてカウントした前記集合の数とが同じ場合、前記一方の辺に位置する前記画素の集合と、前記他方の辺に位置する前記画素の集合とを結ぶ直線上に追跡範囲を制限して前記画素を特定する処理を実行する
付記3に記載の画像処理装置。
(Additional remark 4) The said calculating part counts the number of the sets of the continuous pixels to which the said 1st flag was set among the pixels located in the edge part of the said object, About one of the two sides which the said object opposes On the straight line connecting the set of pixels located on the one side and the set of pixels located on the other side, when the counted number of sets and the number of sets counted on the other side are the same The image processing apparatus according to
(付記5) コンピュータが、
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する
画像処理方法。
(Appendix 5) The computer
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold An image processing method in which the second flag is specified and the luminance of the pixel for which only the first flag is set is set as the luminance of the background.
(付記6) コンピュータに、
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する
処理を実行させる、プログラム。
(Appendix 6)
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold Specifying a second flag, setting a second flag, and setting the luminance of a pixel for which only the first flag has been set to the luminance of the background.
(付記7) 前記コンピュータが、前記特定した画素を始点として隣接する画素を順次追跡する際、追跡方向を維持するように追跡範囲を制限する
付記5に記載の画像処理方法。
(Supplementary note 7) The image processing method according to
(付記8) 前記コンピュータが、前記影の形状を示すパターン情報を取得し、前記第1のフラグ及び前記第2のフラグを設定した画素の集合が有する形状に基づき、前記パターン情報の中から類似する前記影の形状を特定し、特定した形状に沿った方向に追跡範囲を拡張して前記画素を特定する処理を継続する
付記5又は7に記載の画像処理方法。
(Additional remark 8) The said computer acquires the pattern information which shows the shape of the said shadow, and it is similar from the said pattern information based on the shape which the group of the pixels which set the said 1st flag and the said 2nd flag has The image processing method according to
(付記9) 前記コンピュータが、前記被写体の端部に位置する画素のうち前記第1のフラグが設定された連続する画素の集合の数をカウントし、前記被写体の対向する二辺の一方についてカウントした前記集合の数と、他方についてカウントした前記集合の数とが同じ場合、前記一方の辺に位置する前記画素の集合と、前記他方の辺に位置する前記画素の集合とを結ぶ直線上に追跡範囲を制限して前記画素を特定する処理を実行する
付記8に記載の画像処理方法。
(Additional remark 9) The said computer counts the number of the sets of the continuous pixels to which the said 1st flag was set among the pixels located in the edge part of the said object, and it counts about one of the two opposing sides of the said object. When the number of the sets and the number of the sets counted for the other are the same, on a straight line connecting the set of pixels located on the one side and the set of pixels located on the other side The image processing method according to
(付記10) 背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を記憶する記憶部と、
前記入力画像内で前記被写体の端部に位置する画素について輝度の増加を検出し、当該輝度の増加が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の減少が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の増加が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する演算部と、
を有する、画像処理装置。
(Supplementary Note 10) Determination of luminance change from an input image obtained by imaging a subject having a character described in a color different from the background color on a background having a background color to an area where a shadow overlaps the background A storage unit that stores a first threshold value used for the determination, and a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character;
In the input image, an increase in luminance is detected for a pixel located at an end of the subject, a pixel in which the increase in luminance is greater than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance decrease is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance increase is larger than the second threshold Specifying a second flag, and setting a luminance of a pixel for which only the first flag is set as the luminance of the background;
An image processing apparatus.
(付記11) コンピュータが、
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の増加を検出し、当該輝度の増加が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の減少が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の増加が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する
画像処理方法。
(Appendix 11) The computer
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, an increase in luminance is detected for a pixel located at an end of the subject, a pixel in which the increase in luminance is greater than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance decrease is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance increase is larger than the second threshold An image processing method in which the second flag is specified and the luminance of the pixel for which only the first flag is set is set as the luminance of the background.
(付記12) コンピュータに、
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の増加を検出し、当該輝度の増加が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の減少が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の増加が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグだけを設定した画素の輝度を前記背景の輝度に設定する
処理を実行させる、プログラム。
(Supplementary note 12)
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, an increase in luminance is detected for a pixel located at an end of the subject, a pixel in which the increase in luminance is greater than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance decrease is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance increase is larger than the second threshold Specifying a second flag, setting a second flag, and setting the luminance of a pixel for which only the first flag has been set to the luminance of the background.
(付記13) 付記6又は12に記載のプログラムが格納された、コンピュータにより読取り可能な記録媒体。
(Supplementary Note 13) A computer-readable recording medium storing the program according to
10 画像処理装置
11 記憶部
12 演算部
Th1 第1の閾値
Th2 第2の閾値
Pin 入力画像
PxS 画素
DESCRIPTION OF
Claims (6)
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグを設定した画素の輝度を前記背景の輝度に設定する演算部と、
を有する、画像処理装置。 An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold Specifying a second flag, and setting the luminance of the pixel for which the first flag is set as the luminance of the background;
An image processing apparatus.
請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the calculation unit limits a tracking range so as to maintain a tracking direction when sequentially tracking adjacent pixels starting from the identified pixel.
前記演算部は、前記第1のフラグ及び前記第2のフラグを設定した画素の集合が有する形状に基づき、前記パターン情報の中から類似する前記影の形状を特定し、特定した形状に沿った方向に追跡範囲を拡張して前記画素を特定する処理を継続する
請求項1又は2に記載の画像処理装置。 The storage unit further stores pattern information indicating the shape of the shadow,
The arithmetic unit identifies a similar shadow shape from the pattern information based on a shape of a set of pixels in which the first flag and the second flag are set, and follows the identified shape. The image processing apparatus according to claim 1, wherein the process of extending the tracking range in the direction and specifying the pixel is continued.
請求項3に記載の画像処理装置。 The calculation unit counts the number of sets of consecutive pixels in which the first flag is set among the pixels located at the end of the subject, and counts one of the two opposite sides of the subject. And the number of the sets counted for the other are the tracking range on a straight line connecting the set of pixels located on the one side and the set of pixels located on the other side. The image processing apparatus according to claim 3, wherein a process of limiting and specifying the pixel is executed.
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグを設定した画素の輝度を前記背景の輝度に設定する
画像処理方法。 Computer
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold An image processing method in which the second flag is set by specifying the brightness and the luminance of the pixel for which the first flag is set is set as the luminance of the background.
背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を取得し、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第1の閾値より大きい画素を特定し、特定した画素を始点として隣接する画素を順次追跡しながら輝度の増加及び減少を検出し、当該輝度の増加が前記第1の閾値より小さい画素を特定して第1のフラグを設定し、当該輝度の減少が前記第2の閾値より大きい画素を特定して第2のフラグを設定し、前記第1のフラグを設定した画素の輝度を前記背景の輝度に設定する
処理を実行させる、プログラム。 On the computer,
An input image obtained by imaging a subject having a character written in a color different from the background color on a background having a background color, and a first used for determining a luminance change from the background to a region where a shadow overlaps the background And a second threshold value used for determining a luminance change from a region where a shadow is superimposed on the background to a region where a shadow is superimposed on the character,
In the input image, a decrease in luminance is detected for a pixel located at an end of the subject, a pixel whose luminance decrease is larger than the first threshold is specified, and adjacent pixels are sequentially set starting from the specified pixel. Pixels whose luminance increase and decrease are detected while tracking, a pixel whose luminance increase is smaller than the first threshold are specified and a first flag is set, and pixels whose luminance decrease is larger than the second threshold Specifying a second flag, setting a second flag, and setting the luminance of the pixel for which the first flag has been set to the luminance of the background.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014149350A JP6331819B2 (en) | 2014-07-23 | 2014-07-23 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014149350A JP6331819B2 (en) | 2014-07-23 | 2014-07-23 | Image processing apparatus, image processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016024694A true JP2016024694A (en) | 2016-02-08 |
JP6331819B2 JP6331819B2 (en) | 2018-05-30 |
Family
ID=55271382
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014149350A Active JP6331819B2 (en) | 2014-07-23 | 2014-07-23 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6331819B2 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0365770A (en) * | 1989-08-03 | 1991-03-20 | Nippon Telegr & Teleph Corp <Ntt> | Picture processor |
JPH0863549A (en) * | 1994-08-22 | 1996-03-08 | Omron Corp | Vehicle number recognition device, binarization device and picture processor |
JP2007156741A (en) * | 2005-12-02 | 2007-06-21 | Koito Ind Ltd | Character extraction method, character extraction device, and program |
JP2010073051A (en) * | 2008-09-19 | 2010-04-02 | Toshiba Corp | Method and device for recognizing license plate |
JP2012155586A (en) * | 2011-01-27 | 2012-08-16 | Mitsubishi Heavy Ind Ltd | Image binarization method and image binarization device |
-
2014
- 2014-07-23 JP JP2014149350A patent/JP6331819B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0365770A (en) * | 1989-08-03 | 1991-03-20 | Nippon Telegr & Teleph Corp <Ntt> | Picture processor |
JPH0863549A (en) * | 1994-08-22 | 1996-03-08 | Omron Corp | Vehicle number recognition device, binarization device and picture processor |
JP2007156741A (en) * | 2005-12-02 | 2007-06-21 | Koito Ind Ltd | Character extraction method, character extraction device, and program |
JP2010073051A (en) * | 2008-09-19 | 2010-04-02 | Toshiba Corp | Method and device for recognizing license plate |
JP2012155586A (en) * | 2011-01-27 | 2012-08-16 | Mitsubishi Heavy Ind Ltd | Image binarization method and image binarization device |
Also Published As
Publication number | Publication date |
---|---|
JP6331819B2 (en) | 2018-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5775225B2 (en) | Text detection using multi-layer connected components with histograms | |
JP6395759B2 (en) | Lane detection | |
WO2019169532A1 (en) | License plate recognition method and cloud system | |
TWI541763B (en) | Method, electronic device and medium for adjusting depth values | |
US20150055857A1 (en) | Text detection in natural images | |
KR101279712B1 (en) | Apparatus and method for providing real-time lane detection, recording medium thereof | |
JP4904330B2 (en) | Method and apparatus for extracting text from an image | |
Tabassum et al. | Text detection using MSER and stroke width transform | |
KR101610525B1 (en) | Apparatus for extracting a pupil considering illumination and method thereof | |
JP2015064752A (en) | Vehicle monitoring device and vehicle monitoring method | |
JP2009276910A (en) | Image processor, method and program | |
JP6311354B2 (en) | Information processing apparatus, binarization threshold value determination method, and program | |
JP6772059B2 (en) | Electronic control devices, electronic control systems and electronic control methods | |
JP6331819B2 (en) | Image processing apparatus, image processing method, and program | |
KR101845280B1 (en) | System and method for recognizing vehicle number by removing shadow signals | |
JP6354186B2 (en) | Information processing apparatus, blur condition calculation method, and program | |
CN109388134B (en) | Method and apparatus for identifying vehicle navigation path boundaries | |
KR101329492B1 (en) | Apparatus and method for controlling camera for locating scene text to proper position and size | |
JP2009015515A (en) | Number plate extraction system, number plate extraction device, number plate extraction method, and program | |
CN113743413B (en) | Visual SLAM method and system combining image semantic information | |
Liu | Digits Recognition on Medical Device | |
JP2005251132A (en) | Shadow detector, shadow detection method, shadow detection program, image processor using shadow detector, image processing method using shadow detection method and image processing program using shadow detection program | |
US10304195B2 (en) | Information processing apparatus, computer-readable storage medium, and information processing method for judging a recognition target area | |
Nor et al. | A new visual signature for content-based indexing of low resolution documents | |
JP6166686B2 (en) | Component detection apparatus, method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20170406 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180302 |
|
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: 20180403 |
|
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: 6331819 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |