JP2016024694A - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

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
Application number
JP2014149350A
Other languages
Japanese (ja)
Other versions
JP6331819B2 (en
Inventor
亜希子 楠本
Akiko Kusumoto
亜希子 楠本
悠介 野中
Yusuke Nonaka
悠介 野中
馬場 孝之
Takayuki Baba
孝之 馬場
上原 祐介
Yusuke Uehara
祐介 上原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2014149350A priority Critical patent/JP6331819B2/en
Publication of JP2016024694A publication Critical patent/JP2016024694A/en
Application granted granted Critical
Publication of JP6331819B2 publication Critical patent/JP6331819B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Character Input (AREA)
  • Traffic Control Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To remove a linear dark section, while keeping a character section.SOLUTION: An image processing apparatus 10 operates as follows: storing an input image Pin obtained by capturing a subject with a character described on a background having a background color with a color different from the background color, a first threshold Th1 to be used for determining luminance change from the background to an area with shadow overlapping the background, and a second threshold Th2 to be used for determining luminance change from the area with shadow overlapping the background to an area with shadow overlapping the character; detecting decease of luminance of a pixel located at an end of the subject in the input image Pin; specifying a pixel with luminance decrease larger than the first threshold Th1; detecting increase and decrease of luminance, while sequentially tracking adjacent pixels starting from the specified pixel; specifying a pixel with luminance increase less than the first threshold Th1 to set a first flag; specifying a pixel with luminance decrease larger than the second threshold Th2 to set a second flag; and setting a luminance of the pixel with the first flag set thereto, as a luminance of the background.SELECTED DRAWING: Figure 1

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.

Oivind Due Trier, and Anil K. Jain, "Goal-Directed Evaluation of Binarization Methods," IEEE Transactions On Pattern Analysis And Machine Intelligence, vol.17, no.12, pp.1194-1200, Dec. 1995.Oivind Due Trier, and Anil K. Jain, "Goal-Directed Evaluation of Binarization Methods," IEEE Transactions On Pattern Analysis And Machine Intelligence, vol.17, no.12, pp.1194-1200, Dec. 1995.

しかしながら、細い物体による影などが文字部にかかり、線状の暗部が文字部に重なるような場合、上記提案に係る手法を適用すると、文字部と暗部とが結合して文字の形状が乱れるリスクや、重なり部分が除去されて文字部が分断されるリスクが生じる。例えば、画素ブロックのサイズを調整しても、いずれかのリスクが生じる可能性がある。そのため、線状の暗部が生じるような状況では、上記提案に係る手法を適用しても、文字認識に適した二値化画像が得られない可能性がある。   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.

第1実施形態に係る画像処理装置の一例を示した図である。1 is a diagram illustrating an example of an image processing apparatus according to a first embodiment. 第2実施形態に係る車番認識システムの一例を示した図である。It is the figure which showed an example of the vehicle number recognition system which concerns on 2nd Embodiment. 第2実施形態に係る画像処理装置の機能を実現可能なハードウェアの一例を示した図である。It is the figure which showed an example of the hardware which can implement | achieve the function of the image processing apparatus which concerns on 2nd Embodiment. 第2実施形態に係る画像処理装置が有する機能の一例を示したブロック図である。It is the block diagram which showed an example of the function which the image processing apparatus which concerns on 2nd Embodiment has. 第2実施形態に係る領域情報の一例を示した図である。It is the figure which showed an example of the area | region information which concerns on 2nd Embodiment. 第2実施形態に係る領域の一例を示した図である。It is the figure which showed an example of the area | region which concerns on 2nd Embodiment. 第2実施形態に係る閾値情報の一例を示した図である。It is a figure showing an example of threshold information concerning a 2nd embodiment. 第2実施形態に係る形状情報の一例を示した図である。It is the figure which showed an example of the shape information which concerns on 2nd Embodiment. 第2実施形態に係る辞書情報の一例を示した図である。It is the figure which showed an example of the dictionary information which concerns on 2nd Embodiment. 第2実施形態に係る画像処理装置が実行する文字認識処理の流れを示したフロー図である。It is the flowchart which showed the flow of the character recognition process which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る端部、影、文字、重なりの一例を示した図である。It is the figure which showed an example of the edge part which concerns on 2nd Embodiment, a shadow, a character, and overlap. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち影領域の特定及び輝度の補正に係る処理の流れを示した第1のフロー図である。It is the 1st flowchart which showed the flow of the process which concerns on shadow area specification and brightness correction among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち影領域の特定及び輝度の補正に係る処理の流れを示した第2のフロー図である。It is the 2nd flowchart which showed the flow of the process which concerns on shadow area specification and brightness correction among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る追跡対象の一例を示した図である。It is the figure which showed an example of the tracking object which concerns on 2nd Embodiment. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追跡対象の設定に係る処理の流れを示したフロー図である。It is the flowchart which showed the flow of the process which concerns on the setting of a tracking object among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の流れを示したフロー図である。It is the flowchart which showed the flow of the process which concerns on an additional search among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の一例を示した図である。It is the figure which showed an example of the process which concerns on an additional search among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の流れの一変形例を示したフロー図である。It is the flowchart which showed the modification of the flow of the process which concerns on an additional search among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追加探索に係る処理の一変形例を示した図である。It is the figure which showed the modification of the process which concerns on an additional search among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs. 第2実施形態に係る画像処理装置が実行する文字認識処理のうち追跡対象の設定に係る処理の一変形例を示した図である。It is the figure which showed the modification of the process which concerns on the setting of a tracking target among the character recognition processes which the image processing apparatus which concerns on 2nd Embodiment performs.

以下に添付図面を参照しながら、本発明の実施形態について説明する。なお、本明細書及び図面において実質的に同一の機能を有する要素については、同一の符号を付することにより重複説明を省略する場合がある。   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 image processing apparatus 10 includes a storage unit 11 and a calculation unit 12.
The storage unit 11 is a volatile storage device such as a RAM (Random Access Memory) or a non-volatile storage device such as an HDD (Hard Disk Drive) or a flash memory. The arithmetic unit 12 is a processor such as a CPU (Central Processing Unit) or a DSP (Digital Signal Processor). However, the arithmetic unit 12 may be an electronic circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). For example, the calculation unit 12 executes a program stored in the storage unit 11 or another memory.

記憶部11は、入力画像Pin、第1の閾値Th1、及び第2の閾値Th2を記憶する。入力画像Pinは、背景色を有する背景の上に背景色とは異なる色で記載された文字を有する被写体を撮像した画像である。なお、ここでは一例として背景色が文字の色よりも明るい色であると仮定している。例えば、背景色は白、黄色、ピンクなどであり、文字の色は黒などである。なお、背景色と文字色とを反転した場合は、背景色の輝度と文字色の輝度との関係を反転させれば、同様に第1実施形態に係る技術を適用可能である。   The storage unit 11 stores the input image Pin, the first threshold value Th1, and the second threshold value Th2. The input image Pin is an image obtained by capturing an object having characters written in a color different from the background color on the background having the background color. Here, as an example, it is assumed that the background color is lighter than the character color. For example, the background color is white, yellow, pink or the like, and the character color is black or the like. When the background color and the character color are reversed, the technique according to the first embodiment can be similarly applied if the relationship between the luminance of the background color and the luminance of the character color is reversed.

第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 calculation unit 12 detects a decrease in luminance for the pixel located at the end of the subject in the input image Pin, and identifies a pixel for which the decrease in luminance is greater than the first threshold Th1. In addition, the calculation unit 12 detects an increase and a decrease in luminance while sequentially tracking adjacent pixels starting from the pixel specified at the end. In the tracking process, the calculation unit 12 sets a first flag by specifying a pixel whose luminance increase is smaller than the first threshold Th1. Further, in the tracking process, the calculation unit 12 identifies a pixel whose luminance decrease is greater than the second threshold Th2, and sets the second flag. Then, the calculation unit 12 sets the luminance of the pixel for which only the first flag is set as the luminance of the background.

図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 calculation unit 12 specifies the pixel of this portion as the pixel PxS.

また、演算部12は、画素PxSを始点として連続する画素を追跡しながら輝度変化を順次検出する。図1の例では、2段目の画素列のうち、連続する画素として画素PxSに対して縦方向及び斜め方向に隣接する画素が特定され、追跡範囲として設定されている。演算部12は、追跡範囲の画素と画素PxSとの輝度変化に基づいて第1のフラグ及び第2のフラグの設定対象となる画素を特定する。図1の例では、画素PxSの下方に位置する画素(色付きの画素)に第1のフラグが設定されている。   In addition, the calculation unit 12 sequentially detects luminance changes while tracking successive pixels starting from the pixel PxS. In the example of FIG. 1, pixels adjacent to the pixel PxS in the vertical direction and the diagonal direction are specified as continuous pixels in the second pixel row, and are set as a tracking range. The computing unit 12 identifies the pixel that is the setting target of the first flag and the second flag based on the luminance change between the pixel in the tracking range and the pixel PxS. In the example of FIG. 1, a first flag is set for a pixel (colored pixel) located below the pixel PxS.

第2段目の画素列について画素を特定した演算部12は、3段目の画素列について第1のフラグ及び第2のフラグの設定対象となる画素を特定する。このとき、演算部12は、1段目で特定した画素PxSと2段目で第1のフラグを設定した画素との位置関係から、追跡方向を計算し、3段目の追跡範囲を設定する。そして、演算部12は、設定した追跡範囲の中で、第1のフラグ及び第2のフラグの設定対象となる画素を特定する。なお、連続する方向を考慮せず、予め設定した方向を基準に追跡範囲を設定してもよい。   The computing unit 12 that has identified the pixel for the second pixel row identifies the pixel for which the first flag and the second flag are to be set for the third pixel row. At this time, the calculation unit 12 calculates the tracking direction from the positional relationship between the pixel PxS specified in the first stage and the pixel in which the first flag is set in the second stage, and sets the tracking range in the third stage. . And the calculating part 12 specifies the pixel used as the setting object of a 1st flag and a 2nd flag in the set tracking range. Note that the tracking range may be set based on a preset direction without considering the continuous direction.

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 calculation unit 12 specifies the pixels for which the first flag and the second flag are set for the fourth and subsequent stages. When a pixel cannot be specified within the tracking range, the calculation unit 12 searches for a pixel PxS that is different from the pixel PxS as the starting point in the first stage, and if there is another pixel PxS, the other pixel The pixel for which the first flag and the second flag are set for PxS is specified. If the pixel set with the second flag is left and the luminance of the pixel set with the first flag is set to the background luminance, the shadow is removed without disturbing the character shape as shown in FIG. .

上記のように、演算部12は、被写体の端部から影の部分を探索し、影の部分に位置する画素を特定すると共に、文字と重なる影の部分を特定し、文字と重なる部分を残しつつ影の部分を除去する(影の部分に位置する画素の輝度を背景と同じにする)。この処理により、文字を残して影が消去されるため、文字と背景とを適切に分離する二値化用の閾値を決めることが可能になる。その結果、文字がくっきりと浮き立った鮮明な二値化画像が得られ、文字認識の精度が向上する。   As described above, the calculation unit 12 searches for the shadow portion from the edge of the subject, specifies the pixel located in the shadow portion, specifies the shadow portion that overlaps the character, and leaves the portion overlapping the character. While removing the shadow portion (the luminance of the pixel located in the shadow portion is the same as the background). By this process, since the shadow is erased while leaving the character, it is possible to determine a binarization threshold value for appropriately separating the character and the background. As a result, a clear binarized image with clear characters is obtained, and the accuracy of character recognition is improved.

以上、第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 number recognition system 5 will be described as an example of a system to which the technology according to the second embodiment can be applied with reference to FIG. FIG. 2 is a diagram illustrating an example of a vehicle number recognition system according to the second embodiment.

図2に示すように、車番認識システム5は、被写体51を撮影する撮像装置52、及び撮像装置52が撮影した画像の処理を実行する画像処理装置100を含む。撮像装置52は、例えば、自動車やバイクなどの被写体51に設置されたナンバープレートを含む領域NRを撮影する。領域NRの画像(以下、入力画像)は、画像処理装置100に入力される。画像処理装置100は、入力画像からナンバープレートに含まれる文字、数字、記号など(以下、単に文字と称する。)を認識する。   As illustrated in FIG. 2, the vehicle number recognition system 5 includes an imaging device 52 that captures a subject 51 and an image processing device 100 that performs processing of an image captured by the imaging device 52. The imaging device 52 photographs a region NR including a license plate installed on a subject 51 such as an automobile or a motorcycle. An image in the area NR (hereinafter referred to as an input image) is input to the image processing apparatus 100. The image processing apparatus 100 recognizes characters, numbers, symbols, and the like (hereinafter simply referred to as characters) included in the license plate from the input image.

文字認識の精度は、画像に含まれる文字の鮮明度に依存する。例えば、図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 image processing apparatus 100 removes the linear shadow from the input image while leaving the character shape correctly. For example, the image processing apparatus 100 detects a shadow having a certain width from a background area that does not include characters in the input image. Then, the image processing apparatus 100 extracts the luminance value of the pixel adjacent to the shadow portion, and tracks the pixel whose luminance value does not change rapidly as the shadow portion. Further, the image processing apparatus 100 stores the presence / absence of a change in the luminance gradient from the descending direction to the ascending direction for a set of pixels that continue in the same direction, and sets the set of pixels that do not change in the tracked shadow portion as the background region Is corrected to a luminance value corresponding to. This correction removes the shadow.

上記補正後の輝度分布に基づいて二値化用の閾値を決定することで、影の影響を受けない二値化用の閾値が得られる。なお、画像処理装置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 image processing apparatus 100 may calculate a direction in which the shadow portion extends in the process of detecting a shadow having a certain width from the background region, and may limit the range in which the shadow portion is tracked. In addition, when the shape of a member that causes a shadow, such as a motorcycle bed, is known, information on a pattern in which a shadow appears may be prepared in advance so that the image processing apparatus 100 can use it. In this case, the image processing apparatus 100 can narrow down the tracking range based on the pattern.

上記のような画像処理により線状の影が除かれ、文字の鮮明度が上がる。その結果、文字認識の精度が向上する。
(その他のシステムについて)
ところで、第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 number recognition system 5 described above. Can do.

ランドマーク認識システムは、街中や観光地にある看板などをスマートフォンのカメラ機能などで撮像し、撮像画像から認識した文字列に基づいて地域や施設などのランドマークに関する情報を提供するシステムである。第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 number recognition system 5 as an example, but the scope of application of the technology according to the second embodiment is not limited to this. The technique according to the second embodiment can be applied to any system that performs character recognition from an image.

[2−2.ハードウェア]
ここで、図3を参照しながら、画像処理装置100の機能を実現可能なハードウェアについて説明する。図3は、第2実施形態に係る画像処理装置の機能を実現可能なハードウェアの一例を示した図である。
[2-2. hardware]
Here, hardware capable of realizing the functions of the image processing apparatus 100 will be described with reference to FIG. FIG. 3 is a diagram illustrating an example of hardware capable of realizing the functions of the image processing apparatus according to the second embodiment.

画像処理装置100が有する機能は、例えば、図3に示す情報処理装置のハードウェア資源を用いて実現することが可能である。つまり、画像処理装置100が有する機能は、コンピュータプログラムを用いて図3に示すハードウェアを制御することにより実現される。   The functions of the image processing apparatus 100 can be realized using, for example, hardware resources of the information processing apparatus illustrated in FIG. That is, the functions of the image processing apparatus 100 are realized by controlling the hardware shown in FIG. 3 using a computer program.

図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 CPU 902, a ROM (Read Only Memory) 904, a RAM 906, a host bus 908, and a bridge 910. Further, this hardware includes an external bus 912, an interface 914, an input unit 916, an output unit 918, a storage unit 920, a drive 922, a connection port 924, and a communication unit 926.

CPU902は、例えば、演算処理装置又は制御装置として機能し、ROM904、RAM906、記憶部920、又はリムーバブル記録媒体928に記録された各種プログラムに基づいて各構成要素の動作全般又はその一部を制御する。ROM904は、CPU902に読み込まれるプログラムや演算に用いるデータなどを格納する記憶装置の一例である。RAM906には、例えば、CPU902に読み込まれるプログラムや、そのプログラムを実行する際に変化する各種パラメータなどが一時的又は永続的に格納される。   The CPU 902 functions as, for example, an arithmetic processing unit or a control unit, and controls the overall operation of each component or a part thereof based on various programs recorded in the ROM 904, the RAM 906, the storage unit 920, or the removable recording medium 928. . The ROM 904 is an example of a storage device that stores a program read by the CPU 902, data used for calculation, and the like. The RAM 906 temporarily or permanently stores, for example, a program read by the CPU 902 and various parameters that change when the program is executed.

これらの要素は、例えば、高速なデータ伝送が可能なホストバス908を介して相互に接続される。一方、ホストバス908は、例えば、ブリッジ910を介して比較的データ伝送速度が低速な外部バス912に接続される。また、入力部916としては、例えば、マウス、キーボード、タッチパネル、タッチパッド、ボタン、スイッチ、及びレバーなどが用いられる。さらに、入力部916としては、赤外線やその他の電波を利用して制御信号を送信することが可能なリモートコントローラが用いられることもある。   These elements are connected to each other via, for example, a host bus 908 capable of high-speed data transmission. On the other hand, the host bus 908 is connected to an external bus 912 having a relatively low data transmission speed via a bridge 910, for example. As the input unit 916, for example, a mouse, a keyboard, a touch panel, a touch pad, a button, a switch, a lever, or the like is used. Furthermore, as the input unit 916, a remote controller capable of transmitting a control signal using infrared rays or other radio waves may be used.

出力部918としては、例えば、CRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)、PDP(Plasma Display Panel)、又はELD(Electro-Luminescence Display)などのディスプレイ装置が用いられる。また、出力部918として、スピーカやヘッドホンなどのオーディオ出力装置、又はプリンタなどが用いられることもある。つまり、出力部918は、情報を視覚的又は聴覚的に出力することが可能な装置である。   As the output unit 918, for example, a display device such as a CRT (Cathode Ray Tube), an LCD (Liquid Crystal Display), a PDP (Plasma Display Panel), or an ELD (Electro-Luminescence Display) is used. As the output unit 918, an audio output device such as a speaker or headphones, or a printer may be used. In other words, the output unit 918 is a device that can output information visually or audibly.

記憶部920は、各種のデータを格納するための装置である。記憶部920としては、例えば、HDDなどの磁気記憶デバイスが用いられる。また、記憶部920として、SSD(Solid State Drive)やRAMディスクなどの半導体記憶デバイス、光記憶デバイス、又は光磁気記憶デバイスなどが用いられてもよい。   The storage unit 920 is a device for storing various data. As the storage unit 920, for example, a magnetic storage device such as an HDD is used. Further, as the storage unit 920, a semiconductor storage device such as an SSD (Solid State Drive) or a RAM disk, an optical storage device, a magneto-optical storage device, or the like may be used.

ドライブ922は、着脱可能な記録媒体であるリムーバブル記録媒体928に記録された情報を読み出し、又はリムーバブル記録媒体928に情報を書き込む装置である。リムーバブル記録媒体928としては、例えば、磁気ディスク、光ディスク、光磁気ディスク、又は半導体メモリなどが用いられる。   The drive 922 is a device that reads information recorded on a removable recording medium 928 that is a removable recording medium or writes information on the removable recording medium 928. As the removable recording medium 928, for example, a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory is used.

接続ポート924は、例えば、USB(Universal Serial Bus)ポート、IEEE1394ポート、SCSI(Small Computer System Interface)、RS−232Cポート、又は光オーディオ端子など、外部接続機器930を接続するためのポートである。外部接続機器930としては、例えば、プリンタなどが用いられる。   The connection port 924 is a port for connecting an external connection device 930 such as a USB (Universal Serial Bus) port, an IEEE 1394 port, a SCSI (Small Computer System Interface), an RS-232C port, or an optical audio terminal. For example, a printer or the like is used as the external connection device 930.

通信部926は、ネットワーク932に接続するための通信デバイスである。通信部926としては、例えば、有線又は無線LAN(Local Area Network)用の通信回路、WUSB(Wireless USB)用の通信回路、光通信用の通信回路やルータ、ADSL(Asymmetric Digital Subscriber Line)用の通信回路やルータ、携帯電話ネットワーク用の通信回路などが用いられる。通信部926に接続されるネットワーク932は、有線又は無線により接続されたネットワークであり、例えば、インターネット、LAN、放送網、衛星通信回線などを含む。   The communication unit 926 is a communication device for connecting to the network 932. As the communication unit 926, for example, a communication circuit for wired or wireless LAN (Local Area Network), a communication circuit for WUSB (Wireless USB), a communication circuit or router for optical communication, an ADSL (Asymmetric Digital Subscriber Line) Communication circuits, routers, communication circuits for mobile phone networks, and the like are used. A network 932 connected to the communication unit 926 is a wired or wireless network, and includes, for example, the Internet, a LAN, a broadcast network, a satellite communication line, and the like.

以上、ハードウェアについて説明した。
[2−3.画像処理装置の機能]
次に、図4を参照しながら、画像処理装置100の機能について説明する。図4は、第2実施形態に係る画像処理装置が有する機能の一例を示したブロック図である。
The hardware has been described above.
[2-3. Function of image processing apparatus]
Next, functions of the image processing apparatus 100 will be described with reference to FIG. FIG. 4 is a block diagram illustrating an example of functions that the image processing apparatus according to the second embodiment has.

図4に示すように、画像処理装置100は、記憶部101、画像取得部102、領域特定部103、影処理部104、二値化部105、及び文字認識部106を有する。
なお、記憶部101の機能は、上述したRAM906や記憶部920などを用いて実現できる。また、画像取得部102、領域特定部103、影処理部104、二値化部105、及び文字認識部106の機能は、上述したCPU902などを用いて実現できる。
As illustrated in FIG. 4, the image processing apparatus 100 includes a storage unit 101, an image acquisition unit 102, an area specifying unit 103, a shadow processing unit 104, a binarization unit 105, and a character recognition unit 106.
Note that the function of the storage unit 101 can be realized by using the above-described RAM 906, the storage unit 920, or the like. Further, the functions of the image acquisition unit 102, the region specifying unit 103, the shadow processing unit 104, the binarization unit 105, and the character recognition unit 106 can be realized using the above-described CPU 902 or the like.

(記憶部101)
記憶部101について説明する。
記憶部101は、領域情報111、閾値情報112、形状情報113、及び辞書情報114を有する。
(Storage unit 101)
The storage unit 101 will be described.
The storage unit 101 includes region information 111, threshold information 112, shape information 113, and dictionary information 114.

(領域情報111)
まず、図5及び図6を参照しながら、領域情報111について説明する。
なお、図5は、第2実施形態に係る領域情報の一例を示した図である。図6は、第2実施形態に係る領域の一例を示した図である。
(Region information 111)
First, the region information 111 will be described with reference to FIGS.
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 area information 111 is information related to the license plate format. As shown in FIG. 5, the area information 111 includes the type of each area set in the license plate and the coordinates where each area is located.

図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 municipal code # 1 and the municipal code # 2 are described separately in the example of FIG. In addition, since the serial number is recognized for each digit, in the example of FIG. 5, in the case of a 4-digit serial number, the serial number is described separately from the first digit, the second digit, the third digit, and the fourth digit. Has been. On the other hand, as elements other than characters, there are, for example, a screw portion for fixing a license plate, a self-responsibility sticker, and the like.

各領域は、例えば、各領域を矩形で規定し、左上に位置する座標及び右下に位置する座標を用いて表現できる。図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 municipal code # 1, the upper left is set to (73, 19) and the lower right is set to (271, 57). The same applies to other areas. The format shown in FIG. 5 is an example, and different formats are used depending on the type of vehicle.

図5に例示した領域情報111を利用すると、図6に示すように、入力画像から切り出したナンバープレートの画像から領域R1、R2、…、R7などを特定することができる。領域R1、R7は、市区町村コードを含む領域である。領域R2は、用途コードを含む領域である。R3、…、R6は、一連番号を含む領域である。つまり、領域情報111を利用すれば、ナンバープレートの地色(以下、背景色)だけを含む背景領域(上記の領域C)を特定することができる。   If the area information 111 illustrated in FIG. 5 is used, areas R1, R2,..., R7, etc. can be specified from the license plate image cut out from the input image, as shown in FIG. Regions R1 and R7 are regions including city codes. The region R2 is a region including a usage code. R3,..., R6 are regions including serial numbers. That is, if the area information 111 is used, a background area (the above-mentioned area C) including only the ground color (hereinafter referred to as background color) of the license plate can be specified.

(閾値情報112)
次に、図7を参照しながら、閾値情報112について説明する。図7は、第2実施形態に係る閾値情報の一例を示した図である。
(Threshold information 112)
Next, the threshold information 112 will be described with reference to FIG. FIG. 7 is a diagram illustrating an example of threshold information according to the second embodiment.

図7に示すように、閾値情報112は、3種類の閾値を含む。その1つは、影の判定に用いる影判定用の閾値ThSである。入力画像の背景に影がかかると、背景に位置する画素の輝度に比べ、影の部分に位置する画素の輝度は小さくなる。そのため、文字が存在しない部分で隣接する画素間の輝度が減少した場合、低い輝度の画素は、影の部分に位置する画素であると判定できる。一方、低い輝度の画素を基準に隣接する画素間で輝度が増加した場合、高い輝度を有する画素は、背景の部分に位置する画素であると判定できる。このような判定に上記の閾値ThSが利用される。   As shown in FIG. 7, the threshold information 112 includes three types of thresholds. One of them is a threshold value ThS for shadow determination used for shadow determination. When a shadow is applied to the background of the input image, the brightness of the pixel located in the shadow portion is lower than the brightness of the pixel located in the background. Therefore, when the luminance between adjacent pixels decreases in a portion where no character exists, it can be determined that the low luminance pixel is a pixel located in the shadow portion. On the other hand, when the luminance increases between adjacent pixels based on the low luminance pixel, it can be determined that the pixel having the high luminance is a pixel located in the background portion. The threshold value ThS is used for such determination.

また、閾値情報112には、影と文字とが重なる領域の判定に用いる重なり判定用の閾値ThBが含まれる。文字と影とが重なる部分に位置する画素の輝度は、文字だけの部分に位置する画素の輝度に比べて小さくなる。そのため、影の部分に位置する画素と隣接する画素との間で輝度が減少した場合、低い輝度の画素は、文字に影が重なった部分に位置する画素であると判定できる。一方、低い輝度の画素を基準に隣接する画素間で輝度が増加した場合、高い輝度を有する画素は、影の部分に位置する画素であると判定できる。このような判定に上記の閾値ThBが利用される。   The threshold information 112 includes an overlap determination threshold ThB used for determining an area where a shadow and a character overlap. The luminance of the pixel located in the portion where the character and the shadow overlap is smaller than the luminance of the pixel located in the portion containing only the character. Therefore, when the luminance decreases between the pixel located in the shadow portion and the adjacent pixel, it can be determined that the low-luminance pixel is a pixel located in the portion where the shadow is superimposed on the character. On the other hand, when the luminance increases between adjacent pixels based on the low luminance pixel, it can be determined that the pixel having the high luminance is a pixel located in the shadow portion. The threshold value ThB is used for such determination.

但し、文字の部分に位置する画素の輝度と、文字に影が重なった部分に位置する画素の輝度との差は、背景の部分に位置する画素の輝度と、背景に影が重なった部分に位置する画素の輝度との差よりも小さいことが多い。そのため、閾値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 image processing apparatus 100 from the luminance distribution in the input image from which the shadow is removed, or is preset and stored in the storage unit 101. May be.

(形状情報113)
次に、図8を参照しながら、形状情報113について説明する。図8は、第2実施形態に係る形状情報の一例を示した図である。
(Shape information 113)
Next, the shape information 113 will be described with reference to FIG. FIG. 8 is a diagram illustrating an example of shape information according to the second embodiment.

ナンバープレートのように、影として映り込む物体が予め想定できる場合、影の形状を示したパターンを形状情報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 shape information 113. In the example of FIG. 8, eight patterns are shown by way of example in which a motorcycle bed is reflected as a shadow. The pattern P2A represents two linear patterns extending from the upper side of the license plate. The pattern P3A represents a pattern including a shadow having a U-shaped curve extending from the upper side and one linear shadow.

これらのパターンは、例えば、ナンバープレートの上辺に位置する影の端点数で分類することができる。図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 shape information 113, a pattern can be efficiently searched.

なお、図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 dictionary information 114 will be described with reference to FIG. FIG. 9 is a diagram showing an example of dictionary information according to the second embodiment.

辞書情報114は、文字の認識処理に利用する辞書画像を管理するデータベースである。例えば、図9に示すように、辞書情報114には、文字毎に、文字コードと、文字の形状を表す画像(辞書画像)とを対応付けるレコードが含まれる。なお、図9の例では、文字コードを辞書画像に対応付けているが、各文字を特定可能な情報であれば文字コード以外の情報を辞書画像に対応付けてもよい。また、辞書画像のデータフォーマットは任意であり、圧縮形式のデータフォーマットでもよいし、非圧縮形式のデータフォーマットでもよい。また、辞書情報114により管理される文字の種類は任意である。   The dictionary information 114 is a database that manages dictionary images used for character recognition processing. For example, as shown in FIG. 9, the dictionary information 114 includes a record for associating a character code with an image representing a character shape (dictionary image) for each character. In the example of FIG. 9, the character code is associated with the dictionary image. However, information other than the character code may be associated with the dictionary image as long as the information can identify each character. The data format of the dictionary image is arbitrary, and may be a compressed data format or an uncompressed data format. The type of characters managed by the dictionary information 114 is arbitrary.

(画像取得部102)
次に、画像取得部102について説明する。
画像取得部102は、撮像装置52が撮像した画像を取得する。例えば、画像処理装置100と撮像装置52とがネットワークを介して接続されている場合、画像取得部102は、撮像装置52と通信して画像を取得する。また、画像処理装置100が撮像装置52のメモリ(非図示)にアクセスできる場合、画像取得部102は、撮像装置52のメモリから画像を読み出す。また、撮像装置52により撮像された画像が、外部の記憶装置(非図示)に格納されている場合、画像取得部102は、外部の記憶装置から画像を取得してもよい。
(Image acquisition unit 102)
Next, the image acquisition unit 102 will be described.
The image acquisition unit 102 acquires an image captured by the imaging device 52. For example, when the image processing apparatus 100 and the imaging apparatus 52 are connected via a network, the image acquisition unit 102 communicates with the imaging apparatus 52 and acquires an image. When the image processing apparatus 100 can access a memory (not shown) of the imaging device 52, the image acquisition unit 102 reads an image from the memory of the imaging device 52. Further, when the image captured by the imaging device 52 is stored in an external storage device (not shown), the image acquisition unit 102 may acquire the image from the external storage device.

例えば、屋外で撮影された通過車両のナンバープレートのように、照明環境や撮影対象を自由に設定することが難しい状況で、バイクの荷台などのように線状の物体による影が文字部にかかった画像などが画像取得部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 image acquisition unit 102. The image acquired by the image acquisition unit 102 is input to the area specifying unit 103.

(領域特定部103)
次に、領域特定部103について説明する。
領域特定部103は、画像取得部102から入力された画像についてエッジ検出を行い、その画像からナンバープレートの輪郭に沿って画像(入力画像)を切り出す。また、領域特定部103は、入力画像に含まれるエッジの位置から文字を囲む矩形領域の輪郭を特定し、特定した矩形領域の位置に基づいてフォーマットを特定する。例えば、領域特定部103は、領域情報111を参照し、特定した矩形領域間の位置関係と、フォーマットを規定する領域間の位置関係とが最も類似するフォーマットを特定する。
(Area specifying unit 103)
Next, the area specifying unit 103 will be described.
The area specifying unit 103 performs edge detection on the image input from the image acquisition unit 102, and cuts out an image (input image) from the image along the contour of the license plate. Further, the area specifying unit 103 specifies the outline of a rectangular area surrounding the character from the position of the edge included in the input image, and specifies the format based on the position of the specified rectangular area. For example, the region specifying unit 103 refers to the region information 111 and specifies a format in which the positional relationship between the specified rectangular regions and the positional relationship between the regions defining the format are most similar.

なお、以下の説明において、ナンバープレートの輪郭周辺に文字は存在せず、無地の背景だけが存在するものとする。また、背景の輝度は、背景に影がかかった部分の輝度より大きいものとする。また、背景に影がかかった部分の輝度は、文字に影がかかった部分の輝度より大きいものとする。例えば、原動機付き自転車のナンバープレートを例に挙げると、多くの場合、背景色が白、黄色、ピンクのいずれかであり、文字色が黒である。つまり、上述した輝度の関係が成り立つ。以下、この例に沿って説明を進める。   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 area specifying unit 103 is input to the shadow processing unit 104, binarization unit 105, and character recognition unit 106.
(Shadow processing unit 104)
Next, the shadow processing unit 104 will be described.

影処理部104は、入力画像の輪郭上にある画素について影の端点を探索する。例えば、影処理部104は、文字の存在しない背景領域の輝度値を基に二値化し、影の端点として、黒画素の幅が予め設定した値以下である画素の集合を検出する。端点を検出した場合、影処理部104は、端点を始点として連続する画素について、隣接する画素間の輝度差に基づく判定処理により影の部分を追跡する。   The shadow processing unit 104 searches for a shadow end point for a pixel on the contour of the input image. For example, the shadow processing unit 104 binarizes based on the luminance value of the background area where no character exists, and detects a set of pixels whose black pixel width is equal to or smaller than a preset value as shadow end points. When the end point is detected, the shadow processing unit 104 tracks a shadow portion by a determination process based on a luminance difference between adjacent pixels with respect to a continuous pixel starting from the end point.

例えば、影処理部104は、端点の画素と隣接画素との輝度差を計算する。端点の画素に比べて隣接画素の輝度が減少している場合、影処理部104は、輝度差(絶対値)が閾値ThS以下であるか否かを判定する。輝度差が閾値ThS以下である場合、影処理部104は、隣接画素が影の部分の画素であると判定し、影が続いていると認識する。そして、影処理部104は、影の部分であると判定した画素に影フラグを設定する。一方、輝度差が閾値ThS超過である場合、影処理部104は、隣接画素が背景の部分の画素であると判定し、影が続いていないと認識する。   For example, the shadow processing unit 104 calculates the luminance difference between the end point pixel and the adjacent pixel. When the luminance of the adjacent pixel is reduced compared to the pixel at the end point, the shadow processing unit 104 determines whether or not the luminance difference (absolute value) is equal to or less than the threshold ThS. When the luminance difference is equal to or smaller than the threshold ThS, the shadow processing unit 104 determines that the adjacent pixel is a shadow portion pixel and recognizes that the shadow continues. Then, the shadow processing unit 104 sets a shadow flag for the pixel determined to be a shadow portion. On the other hand, when the luminance difference exceeds the threshold ThS, the shadow processing unit 104 determines that the adjacent pixel is a background pixel, and recognizes that the shadow does not continue.

また、端点の画素に比べて隣接画素の輝度が増加している場合、影処理部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 shadow processing unit 104 determines whether or not the brightness difference (absolute value) is equal to or greater than the threshold ThB. When the luminance difference is equal to or greater than the threshold ThB, the shadow processing unit 104 determines that the adjacent image is a pixel in a portion where a shadow is superimposed on a character. Then, the shadow processing unit 104 sets a character flag for a pixel determined to be a portion where a shadow is superimposed on the character. On the other hand, when the luminance difference is less than the threshold ThB, the character flag is not set for the adjacent pixels, and the shadow flag is set.

上記と同様に、影処理部104は、端点を始点として影が連続する画素を順次追跡し、輝度差に基づいて影フラグ又は文字フラグを設定する。
なお、文字フラグが設定された画素と、隣接画素との輝度差が減少している場合、影処理部104は、輝度差(絶対値)が閾値ThB以上であるか否かを判定する。輝度差が閾値ThB以上である場合、影処理部104は、隣接画素が、背景に影が重なった部分の画素であると判定し、当該隣接画素に影フラグを設定する。一方、輝度差が閾値ThB未満である場合、影処理部104は、隣接画素が、文字に影が重なった部分の画素であると判定し、当該隣接画素に文字フラグを設定する。
In the same manner as described above, the shadow processing unit 104 sequentially tracks pixels in which a shadow is continuous starting from an end point, and sets a shadow flag or a character flag based on a luminance difference.
When the luminance difference between the pixel for which the character flag is set and the adjacent pixel is decreased, the shadow processing unit 104 determines whether or not the luminance difference (absolute value) is equal to or greater than the threshold ThB. When the luminance difference is equal to or greater than the threshold ThB, the shadow processing unit 104 determines that the adjacent pixel is a pixel of a portion where the shadow is superimposed on the background, and sets a shadow flag for the adjacent pixel. On the other hand, when the luminance difference is less than the threshold value ThB, the shadow processing unit 104 determines that the adjacent pixel is a pixel of a portion where a shadow is superimposed on the character, and sets a character flag for the adjacent pixel.

影処理部104は、検出した端点の全てについて影の部分を追跡する上記の処理を実行し、輝度差に基づく影フラグ又は文字フラグを設定する。そして、影処理部104は、影フラグを設定した画素の輝度を背景の輝度に設定する。このとき、文字フラグが設定された画素の輝度は維持される。つまり、影処理部104は、文字と重なる部分を残しつつ影の部分を除去する。このようにして影処理部104により影の部分が除去された入力画像は、二値化部105に入力される。   The shadow processing unit 104 executes the above-described process of tracking the shadow portion for all the detected end points, and sets a shadow flag or a character flag based on the luminance difference. Then, the shadow processing unit 104 sets the luminance of the pixel for which the shadow flag is set to the luminance of the background. At this time, the luminance of the pixel for which the character flag is set is maintained. That is, the shadow processing unit 104 removes the shadow part while leaving the part overlapping the character. The input image from which the shadow portion is removed by the shadow processing unit 104 in this way is input to the binarization unit 105.

(二値化部105、文字認識部106)
次に、二値化部105、及び文字認識部106について説明する。
二値化部105には、影の部分が除去された入力画像を二値化して二値化画像を生成する。例えば、二値化部105は、入力画像に含まれる画素の輝度分布(ヒストグラム)を求め、輝度の高い領域にできた分布の山と、輝度の低い領域にできた分布の山とを分離する輝度の値(例えば、2つのピークの中間に位置する輝度)を閾値ThCに設定する。そして、二値化部105は、入力画像に含まれる各画素の輝度と閾値ThCとを比較し、輝度が閾値ThC以上の画素を白画素、輝度が閾値ThC未満の画素を黒画素に設定する。
(Binarization unit 105, character recognition unit 106)
Next, the binarization unit 105 and the character recognition unit 106 will be described.
The binarization unit 105 binarizes the input image from which the shadow portion is removed to generate a binarized image. For example, the binarization unit 105 obtains a luminance distribution (histogram) of pixels included in the input image, and separates a distribution peak formed in a high luminance region from a distribution mountain formed in a low luminance region. A luminance value (for example, a luminance located between two peaks) is set as the threshold ThC. Then, the binarization unit 105 compares the luminance of each pixel included in the input image with a threshold ThC, and sets a pixel whose luminance is equal to or higher than the threshold ThC as a white pixel and a pixel whose luminance is lower than the threshold ThC as a black pixel. .

二値化部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 character recognition unit 106. The character recognizing unit 106 refers to the region information 111 and specifies a character region included in the binarized image. In addition, the character recognition unit 106 refers to the dictionary information 114, compares the specified region image with each dictionary image, and specifies the most similar dictionary image. Then, the character recognition unit 106 outputs a character corresponding to the specified dictionary image as a recognition result.

以上、画像処理装置100の機能について説明した。
[2−4.処理の流れ]
次に、画像処理装置100が実行する文字認識処理の流れについて説明する。
The function of the image processing apparatus 100 has been described above.
[2-4. Process flow]
Next, a flow of character recognition processing executed by the image processing apparatus 100 will be described.

(全体的な流れ)
図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 image acquisition unit 102 acquires an image captured by the imaging device 52.
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 image acquisition unit 102. The image acquired by the image acquisition unit 102 is input to the area specifying unit 103.

(S102)領域特定部103は、ナンバープレート及び各領域を特定する。
例えば、領域特定部103は、画像取得部102から入力された画像についてエッジ検出を行い、その画像からナンバープレートの輪郭に沿って画像(入力画像)を切り出す。また、領域特定部103は、入力画像に含まれるエッジの位置から文字を囲む矩形領域の輪郭を特定し、特定した矩形領域の位置に基づいてフォーマットを特定する。例えば、領域情報111は、領域情報111を参照し、特定した矩形領域間の位置関係と、フォーマットを規定する領域間の位置関係とが最も類似するフォーマットを特定する。
(S102) The area specifying unit 103 specifies the license plate and each area.
For example, the area specifying unit 103 performs edge detection on the image input from the image acquisition unit 102 and cuts out an image (input image) from the image along the outline of the license plate. Further, the area specifying unit 103 specifies the outline of a rectangular area surrounding the character from the position of the edge included in the input image, and specifies the format based on the position of the specified rectangular area. For example, the area information 111 refers to the area information 111 and specifies a format in which the positional relationship between the specified rectangular areas and the positional relationship between the areas defining the format are most similar.

ここでは、ナンバープレートの輪郭周辺に文字は存在せず、無地の背景だけが存在するものとする。また、背景の輝度は、背景に影がかかった部分の輝度より大きいものとする。また、背景に影がかかった部分の輝度は、文字に影がかかった部分の輝度より大きいものとする。例えば、原動機付き自転車のナンバープレートを例に挙げると、多くの場合、背景色が白、黄色、ピンクのいずれかであり、文字色が黒である。つまり、上述した輝度の関係が成り立つ。以下、この例に沿って説明を進める。   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 shadow processing unit 104 executes shadow area specification and luminance correction.
In step S <b> 103, the shadow processing unit 104 searches for a shadow end point for a pixel on the contour of the input image. As shown in FIG. 11, the pixels on the contour of the input image are pixels located at each end of the upper side, the lower side, the right side, and the left side of the license plate. For example, the shadow processing unit 104 binarizes based on the luminance value of the background area where no character exists, and detects a set of pixels whose black pixel width is equal to or smaller than a preset value as shadow end points.

端点を検出した場合、影処理部104は、端点を始点として連続する画素について、隣接する画素間の輝度差に基づく判定処理により影の部分を追跡する。そして、影処理部104は、背景に影が重なった部分の画素に影フラグを設定し、文字に影が重なった部分の画素に文字フラグを設定する。図11の例では、「重なり」と表記した黒色の部分にある画素に文字フラグが設定される。また、影処理部104は、影フラグを設定した画素の輝度を背景の輝度に設定する補正処理を実行する。   When the end point is detected, the shadow processing unit 104 tracks a shadow portion by a determination process based on a luminance difference between adjacent pixels with respect to a continuous pixel starting from the end point. Then, the shadow processing unit 104 sets a shadow flag for the pixel where the shadow is superimposed on the background, and sets a character flag for the pixel where the shadow is superimposed on the character. In the example of FIG. 11, a character flag is set for a pixel in a black portion denoted as “overlap”. In addition, the shadow processing unit 104 executes correction processing for setting the luminance of the pixel for which the shadow flag is set to the luminance of the background.

(S104)二値化部105は、S103で補正処理が施された入力画像から、二値化用の閾値ThCを計算する。例えば、二値化部105は、入力画像に含まれる画素の輝度分布(ヒストグラム)を求め、輝度の高い領域にできた分布の山と、輝度の低い領域にできた分布の山とを分離する輝度の値(例えば、2つのピークの中間に位置する輝度)を閾値ThCに設定する。そして、二値化部105は、入力画像に含まれる各画素の輝度と閾値ThCとを比較し、輝度が閾値ThC以上の画素を白画素、輝度が閾値ThC未満の画素を黒画素に設定する。   (S104) The binarization unit 105 calculates a threshold value ThC for binarization from the input image subjected to the correction process in S103. For example, the binarization unit 105 obtains a luminance distribution (histogram) of pixels included in the input image, and separates a distribution peak formed in a high luminance region from a distribution mountain formed in a low luminance region. A luminance value (for example, a luminance located between two peaks) is set as the threshold ThC. Then, the binarization unit 105 compares the luminance of each pixel included in the input image with a threshold ThC, and sets a pixel whose luminance is equal to or higher than the threshold ThC as a white pixel and a pixel whose luminance is lower than the threshold ThC as a black pixel. .

(S105、S106)文字認識部106は、領域情報111を参照し、二値化画像に含まれる文字の領域を特定する。また、文字認識部106は、辞書情報114を参照し、特定した領域の画像と各辞書画像とを比較し、最も類似する辞書画像を特定する。また、文字認識部106は、特定した辞書画像に対応する文字を認識結果として出力する。S106の処理が完了すると、図10に示した一連の処理は終了する。   (S105, S106) The character recognizing unit 106 refers to the region information 111, and specifies a character region included in the binarized image. In addition, the character recognition unit 106 refers to the dictionary information 114, compares the specified region image with each dictionary image, and specifies the most similar dictionary image. In addition, the character recognition unit 106 outputs a character corresponding to the specified dictionary image as a recognition result. When the process of S106 is completed, the series of processes illustrated in FIG.

(影領域の特定及び輝度の補正)
ここで、図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 shadow processing unit 104.

なお、図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 shadow processing unit 104 sets an end point search start position at the end of the input image. For example, the shadow processing unit 104 sets the pixel located at the upper left of the input image as the start position of the end point search. Note that the start position of the end where the end point search is first performed may be arbitrarily set.

(S112)影処理部104は、S111で設定した端点探索の開始位置から、入力画像の輪郭に沿って影の端点を探索する。例えば、影処理部104は、文字の存在しない背景領域の輝度値を基に二値化し、影の端点として、黒画素の幅(つまり、端点の幅)が予め設定した値以下である画素の集合(連続する1以上の画素)を検出する。なお、黒画素の幅が予め設定した値を超過する場合、影処理部104は、線状の影ではないと判断し、端点から除外する。また、端点探索の方向は予め設定されているものとする。   (S112) The shadow processing unit 104 searches for the end point of the shadow along the contour of the input image from the end point search start position set in S111. For example, the shadow processing unit 104 binarizes on the basis of the luminance value of the background area where no character exists, and the width of the black pixel (that is, the width of the end point) is equal to or less than a preset value as a shadow end point. A set (one or more consecutive pixels) is detected. If the width of the black pixel exceeds a preset value, the shadow processing unit 104 determines that it is not a linear shadow and excludes it from the end point. Further, it is assumed that the direction of the end point search is set in advance.

(S113)影処理部104は、S112で影の端点が検出されたか否かを判定する。影の端点が検出された場合、処理はS114へと進む。一方、影の端点が検出されなかった場合、図12に示した一連の処理は終了する。   (S113) The shadow processing unit 104 determines whether an end point of the shadow is detected in S112. When the shadow end point is detected, the process proceeds to S114. On the other hand, when the end point of the shadow is not detected, the series of processes shown in FIG. 12 ends.

(S114)影処理部104は、S112で検出した影の端点を始点として連続する影の部分を追跡し、影の部分に位置する画素に影フラグ又は文字フラグを設定する。この処理により、背景に影が重なる部分の画素には影フラグが設定され、文字に影が重なる部分の画素に文字フラグが設定される。なお、S114の処理については後で詳述する。   (S114) The shadow processing unit 104 tracks a continuous shadow portion starting from the end point of the shadow detected in S112, and sets a shadow flag or a character flag for a pixel located in the shadow portion. With this process, a shadow flag is set for the pixel where the shadow overlaps the background, and a character flag is set for the pixel where the shadow overlaps the character. The process of S114 will be described in detail later.

(S115)影処理部104は、端点探索の開始位置を未探索の隣接画素に設定する。例えば、影処理部104は、S112で検出した影の端点に隣接する未探索の画素を端点探索の開始位置に設定する。なお、未探索の隣接画素がない場合、影処理部104は、例えば、端点探索の開始位置を設定せず、処理をS116へと進める。   (S115) The shadow processing unit 104 sets the end point search start position to an unsearched adjacent pixel. For example, the shadow processing unit 104 sets an unsearched pixel adjacent to the shadow end point detected in S112 as the end point search start position. If there is no unsearched adjacent pixel, for example, the shadow processing unit 104 does not set the start position of the end point search, and advances the process to S116.

(S116)影処理部104は、入力画像の輪郭上にある全ての画素を探索し終えたか否かを判定する。輪郭上の画素を探索し終えた場合、処理はS117へと進む。一方、輪郭上の画素を探索し終えていない場合、処理はS112へと進む。   (S116) The shadow processing unit 104 determines whether or not all pixels on the contour of the input image have been searched. When the search for pixels on the contour has been completed, the process proceeds to S117. On the other hand, if the search for pixels on the contour has not been completed, the process proceeds to S112.

(S117)影処理部104は、形状情報113を参照し、影フラグが設定された画素及び文字フラグが設定された画素の集合がつくる形状に類似する影のパターンを抽出する。そして、影処理部104は、抽出した影のパターンに基づいて影フラグ又は文字フラグを設定する画素を追加探索する。なお、S117の処理については後で詳述する。   (S117) The shadow processing unit 104 refers to the shape information 113, and extracts a shadow pattern similar to the shape created by the set of pixels set with the shadow flag and pixels set with the character flag. Then, the shadow processing unit 104 additionally searches for a pixel for setting a shadow flag or a character flag based on the extracted shadow pattern. The process of S117 will be described in detail later.

(S118)影処理部104は、影フラグを設定した画素の輝度値を背景画素の輝度値に設定する。このとき、影処理部104は、文字フラグを設定した画素の輝度値をそのまま維持する。S118の処理により文字と重なる部分を残したまま、線状の影を除去することができる。S118の処理が完了すると、図12に示した一連の処理は終了する。   (S118) The shadow processing unit 104 sets the luminance value of the pixel for which the shadow flag is set as the luminance value of the background pixel. At this time, the shadow processing unit 104 maintains the luminance value of the pixel for which the character flag is set as it is. The linear shadow can be removed while leaving the portion overlapping the character by the process of S118. When the process of S118 is completed, the series of processes shown in FIG.

(フラグの設定)
ここで、図13を参照しながら、S114の処理について、さらに説明する。
(S121)影処理部104は、影の端点を現在画素に設定する。現在画素は、影フラグ又は文字フラグを設定する画素を探索して影の部分を追跡する際の基準となる。
(Set flag)
Here, the process of S114 will be further described with reference to FIG.
(S121) The shadow processing unit 104 sets the end point of the shadow as the current pixel. The current pixel serves as a reference when searching for a pixel for which a shadow flag or a character flag is set and tracking a shadow portion.

(S122)影処理部104は、現在画素を基準に、隣接画素を追跡対象に設定する。
例えば、図14に示すように、入力画像の上辺を1段目としてY方向に2段目、3段目、…と追跡を進める場合、影処理部104は、現在画素が位置する段の次の段に位置する画素列のうち、現在画素を基準に縦方向に隣接する画素を追跡対象に設定する。なお、X方向に追跡を進める場合、影処理部104は、現在画素を基準に横方向に隣接する画素を追跡対象に設定する。なお、図14は、第2実施形態に係る追跡対象の一例を示した図である。
(S122) The shadow processing unit 104 sets adjacent pixels as tracking targets based on the current pixel.
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 shadow processing unit 104 follows the step where the current pixel is located. Among the pixel columns located in the stage, pixels adjacent in the vertical direction with respect to the current pixel are set as tracking targets. When tracking is performed in the X direction, the shadow processing unit 104 sets a pixel adjacent in the horizontal direction as a tracking target based on the current pixel. FIG. 14 is a diagram illustrating an example of a tracking target according to the second embodiment.

(S123)影処理部104は、S122で追跡対象に設定した隣接画素と現在画素との輝度差を計算する。
(S124)影処理部104は、S123で計算した輝度差に基づき、現在画素から隣接画素への輝度の増加が閾値ThS以下であるか否かを判定する。輝度の増加が閾値ThS以下である場合、処理はS125へと進む。一方、輝度の増加が閾値ThS以下でない場合、処理はS128へと進む。なお、輝度が減少している場合は、輝度の増加が閾値ThS以下であると判定され、処理はS125へと進む。
(S123) The shadow processing unit 104 calculates the luminance difference between the adjacent pixel set as the tracking target in S122 and the current pixel.
(S124) Based on the luminance difference calculated in S123, the shadow processing unit 104 determines whether or not the increase in luminance from the current pixel to the adjacent pixel is equal to or less than the threshold ThS. If the increase in luminance is less than or equal to the threshold ThS, the process proceeds to S125. On the other hand, if the increase in luminance is not less than or equal to the threshold ThS, the process proceeds to S128. If the luminance is decreasing, it is determined that the increase in luminance is equal to or less than the threshold value ThS, and the process proceeds to S125.

(S125)影処理部104は、S123で計算した輝度差に基づき、現在画素から隣接画素への輝度の減少が閾値ThB以上であるか否かを判定する。輝度の減少が閾値ThB以上である場合、処理はS126へと進む。一方、輝度の減少が閾値ThB以上でない場合、処理はS127へと進む。なお、輝度が増加している場合は、輝度の減少が閾値ThB以上でないと判定され、処理はS127へと進む。   (S125) The shadow processing unit 104 determines whether or not the decrease in luminance from the current pixel to the adjacent pixel is greater than or equal to the threshold ThB based on the luminance difference calculated in S123. If the decrease in luminance is greater than or equal to the threshold ThB, the process proceeds to S126. On the other hand, if the decrease in luminance is not equal to or greater than the threshold ThB, the process proceeds to S127. If the luminance has increased, it is determined that the decrease in luminance is not greater than or equal to the threshold ThB, and the process proceeds to S127.

(S126)影処理部104は、隣接画素に文字フラグを設定する。S126の処理が完了すると、処理はS128へと進む。
(S127)影処理部104は、隣接画素に影フラグを設定する。S127の処理が完了すると、処理はS128へと進む。
(S126) The shadow processing unit 104 sets a character flag in the adjacent pixel. When the process of S126 is completed, the process proceeds to S128.
(S127) The shadow processing unit 104 sets a shadow flag in the adjacent pixel. When the process of S127 is completed, the process proceeds to S128.

(S128)影処理部104は、追跡対象の画素を探索し終えたか否かを判定する。追跡対象の画素を探索し終えている場合、処理はS129へと進む。一方、追跡対象の画素を探索し終えていない場合、処理はS123へと進む。   (S128) The shadow processing unit 104 determines whether or not the search for pixels to be tracked has been completed. If the search for the pixel to be tracked has been completed, the process proceeds to S129. On the other hand, if the search for pixels to be tracked has not been completed, the process proceeds to S123.

(S129)影処理部104は、現ターンでフラグを設定したかを判定する。現ターンは、現在設定されている現在画素について実行したS122以降の処理である。現在画素を基準とする隣接画素に影フラグも文字フラグも設定されていない場合、現在画素から先は影の部分が続いていないと判断される。従って、現ターンで各隣接画素にいずれのフラグも設定されていない場合、図13に示した一連の処理は終了する。一方、現ターンで少なくとも1つの隣接画素に影フラグ又は文字フラグが設定された場合、処理はS130へと進む。   (S129) The shadow processing unit 104 determines whether a flag is set in the current turn. The current turn is the process after S122 executed for the current pixel that is currently set. If neither a shadow flag nor a character flag is set for an adjacent pixel based on the current pixel, it is determined that no shadow portion continues from the current pixel. Therefore, if no flag is set for each adjacent pixel in the current turn, the series of processes shown in FIG. 13 ends. On the other hand, if a shadow flag or a character flag is set for at least one adjacent pixel in the current turn, the process proceeds to S130.

(S130)影処理部104は、影フラグ又は文字フラグが設定された1以上の隣接画素を現在画素に設定し、現在画素の設定を更新する。S130の処理が完了すると、処理はS122へと進む。   (S130) The shadow processing unit 104 sets one or more adjacent pixels in which the shadow flag or the character flag is set as the current pixel, and updates the setting of the current pixel. When the process of S130 is completed, the process proceeds to S122.

(追跡対象の設定)
ここで、図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 shadow processing unit 104 determines whether a plurality of stages have been searched. For example, as shown in FIG. 14, in the case where the shadow portion is traced in the Y direction starting from the shadow end point, the shadow processing unit 104 has tracked the shadow over two or more steps. It is determined whether or not. If a plurality of stages are being tracked, the process proceeds to S132. On the other hand, when a plurality of stages are not tracked (when the shadow end point is the current pixel), the process proceeds to S134.

(S132)影処理部104は、影の端点と、影フラグ又は文字フラグを設定した画素との位置関係から影の延伸方向を計算する。例えば、図14の例(図中の矢印を参照)では、Y方向に3画素、X方向に2画素移動する方向に影が延伸しており、影の延伸方向として傾き2/3が得られる。   (S132) The shadow processing unit 104 calculates the extension direction of the shadow from the positional relationship between the end point of the shadow and the pixel for which the shadow flag or the character flag is set. For example, in the example of FIG. 14 (see the arrow in the figure), the shadow extends in the direction of moving 3 pixels in the Y direction and 2 pixels in the X direction, and a slope of 2/3 is obtained as the extending direction of the shadow. .

(S133)影処理部104は、S132で計算した影の延伸方向に沿って追跡対象を設定する。例えば、影処理部104は、図14に示すように、影の延伸方向に沿って現在画素(この例ではXが7〜9、Yが4の範囲にある画素)に隣接する範囲(この例ではXが7〜10、Yが5の範囲)を追跡対象に設定する。このように、追跡対象の画素を制限することで、輝度差の計算処理、及び、影フラグ又は文字フラグの設定に関する判定処理にかかる負荷が低減される。S133の処理が完了すると、図15に示した一連の処理は終了する。   (S133) The shadow processing unit 104 sets a tracking target along the extension direction of the shadow calculated in S132. For example, as illustrated in FIG. 14, the shadow processing unit 104 has a range (in this example) that is adjacent to the current pixel (in this example, a pixel in a range where X is 7 to 9 and Y is 4) along the extending direction of the shadow. Then, X is in the range of 7 to 10 and Y is 5). In this way, by limiting the pixels to be tracked, the load on the brightness difference calculation process and the determination process related to the setting of the shadow flag or the character flag is reduced. When the process of S133 is completed, the series of processes illustrated in FIG.

(S134)影処理部104は、現在画素の周囲に追跡対象を設定する。例えば、影処理部104は、現在画素を基準に縦方向、横方向、斜め方向に隣接する画素を追跡対象に設定する。この場合、S133の処理とは異なり影の延伸方向は考慮されない。S134の処理が完了すると、図15に示した一連の処理は終了する。   (S134) The shadow processing unit 104 sets a tracking target around the current pixel. For example, the shadow processing unit 104 sets pixels adjacent in the vertical direction, the horizontal direction, and the diagonal direction as tracking targets based on the current pixel. In this case, unlike the process of S133, the extending direction of the shadow is not considered. When the process of S134 is completed, the series of processes shown in FIG.

(追加探索)
ここで、図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 shadow processing unit 104 counts the number of endpoints on the upper side.
(S142) The shadow processing unit 104 specifies a pattern similar to the shape of the shadow from the patterns corresponding to the number of end points counted in S141.

例えば、影処理部104は、S111〜S116の処理を実行し、図17のT11、T12に示すように影の延伸方向に沿って影の部分を追跡する。図17の例では、T13に示すように、上辺から延伸する4本の直線的な影の部分が特定されている。この場合、上辺に位置する端点数は4である。ここで、影処理部104は、形状情報113を参照し、端点数が4のパターンP4A、P4Bを抽出する。さらに、影処理部104は、T13の(A)及び(B)の部分が下辺の端部まで延伸していないことを形状の特徴として認識し、この形状の特徴に適合するパターンP4Bを特定する。   For example, the shadow processing unit 104 executes the processes of S111 to S116, and tracks the shadow portion along the shadow extension direction as indicated by T11 and T12 in FIG. In the example of FIG. 17, as indicated by T13, four linear shadow portions extending from the upper side are specified. In this case, the number of end points located on the upper side is four. Here, the shadow processing unit 104 refers to the shape information 113 and extracts the patterns P4A and P4B having four end points. Further, the shadow processing unit 104 recognizes that the portions (A) and (B) of T13 do not extend to the end of the lower side as a feature of the shape, and specifies a pattern P4B that matches the feature of this shape. .

(S143)影処理部104は、S142でパターンを特定できたか否かを判定する。パターンを特定できた場合、処理はS144へと進む。一方、パターンを特定できなかった場合、図16に示した一連の処理は終了する。   (S143) The shadow processing unit 104 determines whether or not the pattern has been identified in S142. If the pattern can be specified, the process proceeds to S144. On the other hand, when the pattern cannot be specified, the series of processes shown in FIG. 16 ends.

(S144)影処理部104は、S142で特定したパターンに基づいて影の延伸方向を設定し、追跡及びフラグの設定を実行する。図17の例では、パターンP4Bが特定されており、パターンP4Bに基づいてT14の(A)及び(B)の部分を架橋するように影の部分を追跡する。追跡方法及びフラグの設定方法は、上述したS114と同じである。図17の例では、(A)の部分と(B)の部分とを架橋する画素に対して影フラグ又は文字フラグが設定されている。S144の処理が完了すると、図16に示した一連の処理は終了する。   (S144) The shadow processing unit 104 sets the extension direction of the shadow based on the pattern specified in S142, and executes tracking and flag setting. In the example of FIG. 17, the pattern P4B is specified, and the shadow portion is traced so as to bridge the portions (A) and (B) of T14 based on the pattern P4B. The tracking method and flag setting method are the same as in S114 described above. In the example of FIG. 17, a shadow flag or a character flag is set for a pixel that bridges the portion (A) and the portion (B). When the process of S144 is completed, the series of processes illustrated in FIG. 16 ends.

以上、文字認識処理の流れについて説明した。
(追加探索の変形例)
ここで、図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 shadow processing unit 104 counts the number of endpoints on the upper side. In addition, the shadow processing unit 104 counts the number of endpoints on the lower side.
(S153) The shadow processing unit 104 determines whether or not the number of end points on the upper side is the same as the number of end points on the lower side. If the number of endpoints on the upper side is the same as the number of endpoints on the lower side, the process proceeds to S154. On the other hand, if the number of endpoints on the upper side is not the same as the number of endpoints on the lower side, the process proceeds to S155.

(S154)影処理部104は、形状情報113を参照し、S151でカウントした端点数に対応し、且つ上辺の端点と下辺の端点とを各々直線で結ぶパターンを抽出する。例えば、図19に示すように、上辺に4つの端点が検出され、下辺に4つの端点が検出された場合、上辺の端点数が4のパターンのうちパターンP4Aが抽出される。なお、結ぶ端点の組み合わせ方法としては、例えば、左から何番目であるかを認識し、同じ順番の端点を抽出して結ぶ方法を適用できる。S154の処理が完了すると、処理はS157へと進む。   (S154) The shadow processing unit 104 refers to the shape information 113 and extracts a pattern corresponding to the number of end points counted in S151 and connecting the end points on the upper side and the end points on the lower side with straight lines. For example, as shown in FIG. 19, when four end points are detected on the upper side and four end points are detected on the lower side, the pattern P4A is extracted from the patterns having four upper end points. As a method of combining the end points, for example, a method of recognizing the number from the left and extracting and connecting the end points in the same order can be applied. When the process of S154 is completed, the process proceeds to S157.

(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 shadow processing unit 104 identifies a pattern similar to the shape of the shadow from the patterns corresponding to the number of end points counted in S151.
For example, the shadow processing unit 104 executes the processes of S111 to S116, and tracks the shadow portion along the shadow extension direction as indicated by T11 and T12 in FIG. In the example of FIG. 17, as indicated by T13, four linear shadow portions extending from the upper side are specified. In this case, the number of end points located on the upper side is four. Here, the shadow processing unit 104 refers to the shape information 113 and extracts the patterns P4A and P4B having four end points. Further, the shadow processing unit 104 recognizes that the portions (A) and (B) of T13 do not extend to the end of the lower side as a feature of the shape, and specifies a pattern P4B that matches the feature of this shape. . When the process of S155 is completed, the process proceeds to S156.

(S156)影処理部104は、S155でパターンを特定できたか否かを判定する。パターンを特定できた場合、処理はS157へと進む。一方、パターンを特定できなかった場合、図18に示した一連の処理は終了する。   (S156) The shadow processing unit 104 determines whether or not the pattern has been identified in S155. If the pattern can be specified, the process proceeds to S157. On the other hand, when the pattern cannot be specified, the series of processes shown in FIG. 18 ends.

(S157)影処理部104は、S154で抽出又はS155で特定したパターンに基づいて影の延伸方向を設定し、追跡及びフラグの設定を実行する。追跡方法及びフラグの設定方法は、上述したS114と同じである。S157の処理が完了すると、図18に示した一連の処理は終了する。   (S157) The shadow processing unit 104 sets the extension direction of the shadow based on the pattern extracted in S154 or specified in S155, and executes tracking and flag setting. The tracking method and flag setting method are the same as in S114 described above. When the process of S157 is completed, the series of processes illustrated in FIG.

更なる変形例として、例えば、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 shadow processing unit 104 determines whether a plurality of stages have been searched. For example, as shown in FIG. 14, in the case where the shadow portion is traced in the Y direction starting from the shadow end point, the shadow processing unit 104 has tracked the shadow over two or more steps. It is determined whether or not. If a plurality of stages are being tracked, the process proceeds to S162. On the other hand, when a plurality of stages are not tracked (when the shadow end point is the current pixel), the process proceeds to S165.

(S162)影処理部104は、影の端点と、影フラグ又は文字フラグを設定した画素との位置関係から影の延伸方向を計算する。例えば、図14の例(図中の矢印を参照)では、Y方向に3画素、X方向に2画素移動する方向に影が延伸しており、影の延伸方向として傾き2/3が得られる。   (S162) The shadow processing unit 104 calculates the extension direction of the shadow from the positional relationship between the shadow end point and the pixel for which the shadow flag or the character flag is set. For example, in the example of FIG. 14 (see the arrow in the figure), the shadow extends in the direction of moving 3 pixels in the Y direction and 2 pixels in the X direction, and a slope of 2/3 is obtained as the extending direction of the shadow. .

(S163)影処理部104は、端点の幅を計算する。なお、端点の幅は、端点探索の実行時に予め計算して保持しておいてもよい。
(S164)影処理部104は、S162で計算した影の延伸方向に沿って、S163で計算した端点の幅に予め設定したマージン(例えば、5%など)を加えた幅を有する線状の領域を追跡対象に設定する。このように、追跡対象の画素を制限することで、輝度差の計算処理、及び、影フラグ又は文字フラグの設定に関する判定処理にかかる負荷が低減される。S164の処理が完了すると、図20に示した一連の処理は終了する。
(S163) The shadow processing unit 104 calculates the width of the end point. The end point width may be calculated and held in advance when the end point search is executed.
(S164) The shadow processing unit 104 is a linear region having a width obtained by adding a preset margin (for example, 5%) to the end point width calculated in S163 along the shadow extension direction calculated in S162. Is set as the tracking target. In this way, by limiting the pixels to be tracked, the load on the brightness difference calculation process and the determination process related to the setting of the shadow flag or the character flag is reduced. When the process of S164 is completed, the series of processes shown in FIG.

(S165)影処理部104は、現在画素の周囲に追跡対象を設定する。例えば、影処理部104は、現在画素を基準に縦方向、横方向、斜め方向に隣接する画素を追跡対象に設定する。この場合、S164の処理とは異なり影の延伸方向は考慮されない。S165の処理が完了すると、図20に示した一連の処理は終了する。   (S165) The shadow processing unit 104 sets a tracking target around the current pixel. For example, the shadow processing unit 104 sets pixels adjacent in the vertical direction, the horizontal direction, and the diagonal direction as tracking targets based on the current pixel. In this case, unlike the process of S164, the extension direction of the shadow is not considered. When the process of S165 is completed, the series of processes illustrated in FIG.

以上、文字認識処理の流れに係る変形例について説明した。
[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 supplementary note 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.

(付記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 appendix 1 or 2, wherein the processing for extending the tracking range in the direction and specifying the pixel is continued.

(付記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 attachment 3, wherein the tracking range is limited to specify the pixel.

(付記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 supplementary note 5, wherein the tracking range is limited so that the tracking direction is maintained when the computer sequentially tracks adjacent pixels starting from the identified pixel.

(付記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 claim 5 or 7, further comprising: specifying the shape of the shadow to be performed, and continuing the process of specifying the pixel by extending a tracking range in a direction along the specified shape.

(付記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 claim 8, wherein processing for specifying the pixel is performed by limiting a tracking range.

(付記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 Supplementary Note 6 or 12.

10 画像処理装置
11 記憶部
12 演算部
Th1 第1の閾値
Th2 第2の閾値
Pin 入力画像
PxS 画素
DESCRIPTION OF SYMBOLS 10 Image processing apparatus 11 Memory | storage part 12 Calculation part Th1 1st threshold value Th2 2nd threshold value Pin Input image PxS Pixel

Claims (6)

背景色を有する背景の上に前記背景色とは異なる色で記載された文字を有する被写体を撮像した入力画像と、前記背景から前記背景に影が重なる領域への輝度変化の判定に用いる第1の閾値と、前記背景に影が重なる領域から前記文字に影が重なる領域への輝度変化の判定に用いる第2の閾値と、を記憶する記憶部と、
前記入力画像内で前記被写体の端部に位置する画素について輝度の減少を検出し、当該輝度の減少が前記第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.
前記演算部は、前記被写体の端部に位置する画素のうち前記第1のフラグが設定された連続する画素の集合の数をカウントし、前記被写体の対向する二辺の一方についてカウントした前記集合の数と、他方についてカウントした前記集合の数とが同じ場合、前記一方の辺に位置する前記画素の集合と、前記他方の辺に位置する前記画素の集合とを結ぶ直線上に追跡範囲を制限して前記画素を特定する処理を実行する
請求項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.
JP2014149350A 2014-07-23 2014-07-23 Image processing apparatus, image processing method, and program Active JP6331819B2 (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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