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

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

Info

Publication number
JP2019003534A
JP2019003534A JP2017119485A JP2017119485A JP2019003534A JP 2019003534 A JP2019003534 A JP 2019003534A JP 2017119485 A JP2017119485 A JP 2017119485A JP 2017119485 A JP2017119485 A JP 2017119485A JP 2019003534 A JP2019003534 A JP 2019003534A
Authority
JP
Japan
Prior art keywords
pixel
target
comparison
image
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017119485A
Other languages
Japanese (ja)
Inventor
和也 米澤
Kazuya Yonezawa
和也 米澤
瀬川 英吾
Eigo Segawa
英吾 瀬川
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 JP2017119485A priority Critical patent/JP2019003534A/en
Publication of JP2019003534A publication Critical patent/JP2019003534A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

To provide an image processing program that can create a background image with a small amount of operations.SOLUTION: An image processing program causes a computer to execute processing of setting, in an object image including an object and including a plurality of areas different in brightness, one or more sets of a pixel of interest and a comparison pixel that is a pixel separated from the pixel of interest by a predetermined interval, along a direction of the boundary of the difference in brightness, comparing the pixel of interest with the comparison pixel included in the same set, and when a result of comparison satisfies a predetermined condition, converting the pixel of interest into the comparison pixel.SELECTED DRAWING: Figure 8

Description

本発明は、画像処理プログラム、画像処理装置、及び画像処理方法に関する。   The present invention relates to an image processing program, an image processing apparatus, and an image processing method.

情景画像中から、看板や標識などに書かれた文字、記号、図形等の対象物を読み取るために、対象物を抽出することが行われている。
文字等の対象物の抽出手法の一つとして、何らかの方法で対象物を除いた背景画像を作成し、元画像との差分を取る方法があるが、背景画像は一様とは限らず、照明条件などによって対象物に影がかかる場合がある。この場合、対象物を抽出するためには、対象物に影がかかっていても背景画像を正確に作成する必要がある。
An object is extracted from a scene image in order to read objects such as characters, symbols, and figures written on a signboard or a sign.
One method of extracting objects such as characters is to create a background image that excludes the object by some method and take the difference from the original image, but the background image is not always uniform, The object may be shaded depending on conditions. In this case, in order to extract the object, it is necessary to accurately create a background image even if the object is shaded.

そこで、文字等の対象物や背景に影がかかっていても正確に背景画像を作成するため、文字サイズ以上の最大値フィルタと最小値フィルタを順次かけることにより、文字部分を背景に置き換える方法が提案されている(例えば、特許文献1及び非特許文献1参照)。   Therefore, in order to accurately create a background image even if the object or background such as text is shadowed, there is a method to replace the character part with the background by sequentially applying the maximum value filter and minimum value filter that are larger than the character size. It has been proposed (see, for example, Patent Document 1 and Non-Patent Document 1).

特開昭63−153682号公報JP-A-63-153682

三島忠明ら、“画像処理を用いた車番認識システムの開発”電気学会論文誌 D,産業応用部門誌 109.5 (1989):333−338Tadaaki Mishima et al., “Development of a car number recognition system using image processing” IEICE Transactions D, Journal of Industrial Applications 109.5 (1989): 333-338

しかしながら、従来技術では、各画素に対してフィルタ範囲の全画素を比較するため、大きな演算量になり、背景画像の作成に時間がかかってしまうという問題がある。   However, in the conventional technique, since all the pixels in the filter range are compared with each pixel, there is a problem that a large amount of calculation is required and it takes time to create a background image.

一つの側面では、少ない演算量で背景画像を作成することができる画像処理プログラム、画像処理装置、及び画像処理方法を提供することを目的とする。   In one aspect, an object is to provide an image processing program, an image processing apparatus, and an image processing method capable of creating a background image with a small amount of calculation.

一つの実施態様では、画像処理プログラムは、対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素を比較画素に変換する、処理をコンピュータに実行させる。
In one embodiment, the image processing program is separated from the target pixel and the target pixel by a predetermined interval along a boundary direction having different brightnesses in the target image including a plurality of regions having the target object and different brightnesses. Set one or more pairs with comparison pixels that are pixels,
The target pixel and the comparison pixel included in the same set are compared, and when the result of the comparison satisfies a predetermined condition, the process of converting the target pixel into the comparison pixel is executed by the computer.

一つの側面では、少ない演算量で背景画像を作成することができる画像処理プログラム、画像処理装置、及び画像処理方法を提供することができる。   In one aspect, an image processing program, an image processing apparatus, and an image processing method that can create a background image with a small amount of calculation can be provided.

図1は、従来の背景作成処理方法の一例を示す図である。FIG. 1 is a diagram illustrating an example of a conventional background creation processing method. 図2は、従来の背景作成処理方法の一例による処理回数を説明する図である。FIG. 2 is a diagram for explaining the number of processing times according to an example of a conventional background creation processing method. 図3は、画像処理装置の一例を示すハードウェア構成図である。FIG. 3 is a hardware configuration diagram illustrating an example of the image processing apparatus. 図4は、画像処理装置の一例を示す機能ブロック図である。FIG. 4 is a functional block diagram illustrating an example of the image processing apparatus. 図5は、影境界検出処理の一例を示す図である。FIG. 5 is a diagram illustrating an example of the shadow boundary detection process. 図6は、実施例1の画像処理装置における注目画素と比較画素との組を1組以上設定する設定処理の一例を示す図である。FIG. 6 is a diagram illustrating an example of setting processing for setting one or more pairs of the target pixel and the comparison pixel in the image processing apparatus according to the first embodiment. 図7は、実施例1の画像処理装置における注目画素と比較画素との組を1組以上設定する設定処理の他の一例を示す図である。FIG. 7 is a diagram illustrating another example of the setting process for setting one or more pairs of the target pixel and the comparison pixel in the image processing apparatus according to the first embodiment. 図8は、実施例1の画像処理装置全体の処理の流れの一例を示すフローチャートである。FIG. 8 is a flowchart illustrating an example of a processing flow of the entire image processing apparatus according to the first embodiment. 図9は、実施例1の文字認識処理装置の一例を示す機能ブロック図である。FIG. 9 is a functional block diagram illustrating an example of a character recognition processing apparatus according to the first embodiment. 図10は、実施例1の文字認識処理装置全体の処理の流れの一例を示すフローチャートである。FIG. 10 is a flowchart illustrating an example of a process flow of the entire character recognition processing apparatus according to the first embodiment. 図11は、実施例2における画像処理装置の注目画素と比較画素との組を1組以上設定する設定処理の一例を示す図である。FIG. 11 is a diagram illustrating an example of setting processing for setting one or more sets of target pixels and comparison pixels of the image processing apparatus according to the second embodiment. 図12は、実施例3における画像処理装置の注目画素と比較画素との組を1組以上設定する設定処理の一例を示す図である。FIG. 12 is a diagram illustrating an example of a setting process for setting one or more sets of target pixels and comparison pixels of the image processing apparatus according to the third embodiment. 図13は、実施例4における文字の配列及び影のかかる状態を変化させた対象画像の一例を示す図である。FIG. 13 is a diagram illustrating an example of a target image in which a character arrangement and a shadowed state are changed in the fourth embodiment. 図14は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 14 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図15は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 15 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図16は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 16 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図17は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 17 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図18は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 18 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図19は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 19 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図20は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 20 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment. 図21は、実施例4における文字の配列及び影がかかった状態を変化させた対象画像の他の一例を示す図である。FIG. 21 is a diagram illustrating another example of the target image in which the character arrangement and the shadowed state are changed according to the fourth embodiment.

本発明の画像処理装置は、まず、対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と注目画素から所定間隔離間した画素である比較画素との組を1組以上設定する。次に、同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素を比較画素に変換することで、少ない演算量で背景画像を作成できる。   An image processing apparatus according to an embodiment of the present invention first includes a target pixel that includes a target object and includes a plurality of regions having different brightnesses, and pixels that are spaced apart from the target pixel by a predetermined interval along boundary directions having different brightnesses. One or more sets of comparison pixels are set. Next, compare the target pixel and the comparison pixel included in the same group, and if the comparison result satisfies the predetermined condition, convert the target pixel to the comparison pixel to create a background image with a small amount of calculation it can.

具体的には、まず、画像処理装置は、対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と注目画素から所定間隔離間した画素である比較画素との組を1組以上設定する。
対象物としては、特に制限はなく、目的に応じて適宜選択することができ、例えば、文字、図形、記号、又はこれらを組み合わせて配列したものなどが挙げられる。具体的には、文字列、文字列と記号の組み合わせ、文字列と図形の組み合わせなどが挙げられる。文字としては、例えば、数字、英字、平仮名、片仮名などが挙げられる。なお、文字としては、文字の種類(フォント)、文字間隔、文字の大きさ(例えば、文字幅、文字高さ)などが規格化されているものが好ましい。
文字の大きさ(例えば、文字幅、文字高さ)が規格化されておらず異なる場合には、最大の文字幅を文字の大きさ、又は最大の文字の高さを文字の大きさとする。また。文字列において文字間隔が規格化されておらず異なる場合には、最小の文字間隔を文字間隔とする。
文字列の方向についても特に制限はなく、目的に応じて適宜選択することができ、縦方向に配置した文字列、横方向に配置した文字列、ランダムに配置した文字列などが挙げられる。
対象物を含む対象画像としては、例えば、文字等が描かれている看板、文字等が描かれている標識、ナンバープレート、ゼッケン等を撮影した画像などが挙げられる。
Specifically, first, the image processing apparatus includes a target image including a target object and a plurality of regions having different brightnesses, and is separated from the target pixel and the target pixel by a predetermined interval along boundary directions having different brightnesses. One or more sets of comparison pixels that are the selected pixels are set.
There is no restriction | limiting in particular as a target object, According to the objective, it can select suitably, For example, what arranged the character, the figure, the symbol, or these combined, etc. are mentioned. Specifically, a character string, a combination of a character string and a symbol, a combination of a character string and a figure, and the like can be given. Examples of characters include numbers, alphabetic characters, hiragana and katakana. In addition, it is preferable that the character has a standardized character type (font), character spacing, character size (for example, character width, character height), and the like.
When the character size (for example, character width, character height) is not standardized and is different, the maximum character width is the character size, or the maximum character height is the character size. Also. When the character spacing is not standardized in the character string, the minimum character spacing is set as the character spacing.
The direction of the character string is not particularly limited and can be appropriately selected according to the purpose. Examples include a character string arranged in the vertical direction, a character string arranged in the horizontal direction, and a character string arranged at random.
Examples of the target image including the target object include a signboard on which characters and the like are drawn, a sign on which characters and the like are drawn, an image obtained by photographing a license plate, a bib, and the like.

明るさが異なる複数の領域を含む対象画像としては、例えば、対象物及び対象物の背景に影がかかった対象画像、照明やライトの向きにより対象物の背景の見え方が異なる対象画像、天候変化により対象物の背景の見え方が異なる対象画像などが挙げられる。
明るさとしては、例えば、輝度、反射率、濃度、明度などが挙げられる。
対象物や対象物の背景にかかった影としては、例えば、対象画像の水平方向に対して平行方向の直線状の影、対象画像の水平方向に対して所定の角度の直線状の影、対象画像の水平方向に対して垂直方向の直線状の影などが挙げられる。
対象画像の背景における明るさが異なる境界角度は、対象物からエッジを抽出し、対象物における輪郭線の角度分布を求め、最頻値となる角度から求めることができる。
Examples of the target image including a plurality of regions with different brightness include a target image in which the target and the background of the target are shaded, a target image in which the background of the target is different depending on the direction of illumination and light, and weather Examples include target images in which the background of an object is different depending on the change.
Examples of brightness include brightness, reflectance, density, and brightness.
Examples of the shadow on the object and the background of the object include, for example, a linear shadow parallel to the horizontal direction of the target image, a linear shadow at a predetermined angle with respect to the horizontal direction of the target image, and the target Examples include a linear shadow in the vertical direction with respect to the horizontal direction of the image.
The boundary angle with different brightness in the background of the target image can be determined from the angle that is the mode value by extracting the edge from the target object, determining the angular distribution of the contour line in the target object.

注目画素とは、対象物を構成する画素であり、対応する比較画素と組を形成する。
比較画素とは、注目画素から所定間隔離間した画素であり、背景を構成する画素であることが好ましく、対象物の背景の明るさが異なる画素(例えば、影がかかった画素)も含まれる。
所定間隔離間とは、比較画素が背景に含まれるように注目画素から所定間隔をおいて、設けられていることを意味する。所定間隔としては、例えば、背景における明るさの異なる境界方向に対して平行方向の文字列の場合には、文字間隔である。また、所定間隔としては、例えば、背景における明るさの異なる境界方向に対して垂直方向の文字列の場合には、文字高さの半分である。
A pixel of interest is a pixel that constitutes an object, and forms a set with a corresponding comparison pixel.
The comparison pixel is a pixel that is spaced from the target pixel by a predetermined interval, and is preferably a pixel that constitutes the background, and includes pixels with different background brightness (for example, a shadowed pixel) of the object.
The predetermined spacing means that the comparison pixel is provided at a predetermined interval from the target pixel so that the comparison pixel is included in the background. The predetermined interval is, for example, a character interval in the case of a character string parallel to the boundary direction with different brightness in the background. The predetermined interval is, for example, half the character height in the case of a character string in the direction perpendicular to the boundary direction with different brightness in the background.

次に、画像処理装置は、使用するフィルタの種類を選択する。フィルタの種類の選択は、対象画像全体の輝度値のヒストグラムをとり、画素数が少ない部分(文字列)が明るいか又は暗いかにより、最大値フィルタ及び最小値フィルタのいずれかを選択することができる。
画像処理装置は、対象物の輝度値が、背景又は影がかかった背景の輝度値より低いことが既知の場合には、対処物の注目画素をフィルタ内の最大輝度値に置換する最大値フィルタを用いる。一方、画像処理装置は、対象物の輝度値が背景又は影がかかった背景の輝度値より高いことが既知の場合には、対象物の注目画素をフィルタ内の最小輝度値に置換する最小値フィルタを用いる。
最大値フィルタは、対象物の輝度値が背景の輝度値より低い場合には、対象物の注目画素をフィルタ内の最大輝度値に置換する処理を行う。
最小値フィルタは、対象物の輝度値が背景の輝度値より高い場合には、対象物の注目画素をフィルタ内の最小輝度値に置換する処理を行う。
最大値フィルタによる処理は、例えば、3×3画素の領域の最大輝度値を求め、その最大輝度値を注目画素の輝度値と置換する処理をラスタースキャンで全面走査するもので、二値画像の膨張処理に相当する。一方、最小値フィルタによる処理は、例えば、3×3画素の領域の最小輝度値を注目画素の輝度値と置換する処理であり、二値画像の収縮処理に相当する。
Next, the image processing apparatus selects the type of filter to be used. The filter type can be selected by taking a histogram of luminance values of the entire target image and selecting either the maximum value filter or the minimum value filter depending on whether the portion (character string) with a small number of pixels is bright or dark. it can.
When it is known that the luminance value of the object is lower than the luminance value of the background or the shadowed background, the image processing apparatus replaces the target pixel of the countermeasure object with the maximum luminance value in the filter. Is used. On the other hand, when it is known that the luminance value of the target object is higher than the luminance value of the background or the shadowed background, the image processing apparatus replaces the target pixel of the target object with the minimum luminance value in the filter. Use a filter.
When the luminance value of the object is lower than the luminance value of the background, the maximum value filter performs processing for replacing the target pixel of the object with the maximum luminance value in the filter.
When the luminance value of the target is higher than the luminance value of the background, the minimum value filter performs processing to replace the target pixel of the target with the minimum luminance value in the filter.
The processing by the maximum value filter is, for example, a process of finding the maximum luminance value of a 3 × 3 pixel region and replacing the maximum luminance value with the luminance value of the pixel of interest by scanning the entire surface by raster scanning. This corresponds to the expansion process. On the other hand, the process using the minimum value filter is a process of replacing the minimum luminance value of the 3 × 3 pixel area with the luminance value of the target pixel, and corresponds to a binary image contraction process.

次に、画像処理装置は、同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素を比較画素に変換する。
注目画素を比較画素に変換するとは、注目画素に設定されている色のパラメータを比較画素の色のパラメータに変換することを意味する。色のパラメータとしては、例えば、輝度、反射率、濃度、明度、彩度、色相などが挙げられる。
所定の条件としては、例えば、対象物の輝度値が背景の輝度値より低い場合に、注目画素の輝度値をより明るい輝度値に置換する。
所定の条件としては、例えば、対象物の輝度値が背景の輝度値より高い場合に、注目画素の輝度値をより暗い輝度値に置換する。
具体的には、所定の条件としては、最大値フィルタを用い、注目画素の輝度値と比較画素の輝度値とを比較し、注目画素の輝度値が比較画素の輝度値より低い場合に、注目画素の輝度値をより明るい輝度値に置換する。
一方、所定の条件としては、最小値フィルタを用い、注目画素の輝度値と比較画素の輝度値とを比較し、注目画素の輝度値が比較画素の輝度値より高い場合に、注目画素の輝度値をより暗い輝度値に置換する。
Next, the image processing apparatus compares the target pixel and the comparison pixel included in the same group, and converts the target pixel into the comparison pixel when the comparison result satisfies a predetermined condition.
Converting the target pixel into the comparison pixel means converting the color parameter set for the target pixel into the color parameter of the comparison pixel. Examples of the color parameter include brightness, reflectance, density, lightness, saturation, hue, and the like.
As the predetermined condition, for example, when the luminance value of the object is lower than the luminance value of the background, the luminance value of the target pixel is replaced with a brighter luminance value.
As the predetermined condition, for example, when the luminance value of the object is higher than the luminance value of the background, the luminance value of the target pixel is replaced with a darker luminance value.
Specifically, as the predetermined condition, a maximum value filter is used to compare the luminance value of the target pixel with the luminance value of the comparison pixel, and when the luminance value of the target pixel is lower than the luminance value of the comparison pixel, Replace the luminance value of the pixel with a brighter luminance value.
On the other hand, as a predetermined condition, the minimum value filter is used to compare the luminance value of the target pixel with the luminance value of the comparison pixel, and when the luminance value of the target pixel is higher than the luminance value of the comparison pixel, the luminance of the target pixel Replace the value with a darker luminance value.

次に、画像処理装置は、比較画素が、注目画素の左右両側に、対象画像に含まれる複数の対象物どうしの対象画像上での間隔をおいて、複数個設定されることが好ましい。これにより、画像処理装置は、少ない演算量で背景画像を作成できる。
また、画像処理装置は、比較画素が、注目画素の上下両側に、対象画像における対象物の高さの半分の間隔をおいて、2個設定されることが好ましい。これにより、画像処理装置は、明るさの異なる領域が対象物に対して垂直方向にかかっても、少ない演算量で背景画像を作成できる。
また、画像処理装置は、比較画素が、注目画素の左右両側に、対象物の間隔×tanθ(ただし、θは明るさの異なる境界方向と対象画像の水平方向とのなす角である)をおいて、(対象物の大きさ/対象物の間隔)個設定されることが好ましい。これにより、画像処理装置は、明るさの異なる領域が対象物に対して斜め方向にかかっても、少ない演算量で背景画像を作成できる。
対象物の大きさとは、対象物の最大の長さを意味し、例えば、対象物の最大幅、対象物の最大高さ、対象物の対角線の最大値などが挙げられる。
対象物の間隔とは、隣接する対象物の間隔の長さのうち最小の長さを意味し、対象物が文字列の場合には、文字間隔である。
(対象物の大きさ/対象物の間隔)の値は、偶数であることが好ましい。(対象物の大きさ/対象物の間隔)の値が奇数となる場合には、(対象物の大きさ/対象物の間隔)の値に1を足して偶数にしてから、画像処理を行うことができる。
Next, in the image processing apparatus, it is preferable that a plurality of comparison pixels are set on the left and right sides of the target pixel at intervals on the target image among a plurality of targets included in the target image. Thereby, the image processing apparatus can create a background image with a small amount of calculation.
In the image processing apparatus, it is preferable that two comparison pixels are set on the upper and lower sides of the target pixel with an interval half the height of the object in the target image. As a result, the image processing apparatus can create a background image with a small amount of calculation even when areas with different brightness are applied in a direction perpendicular to the object.
In addition, the image processing apparatus has a comparison pixel on the left and right sides of the target pixel with an interval of the object × tan θ (where θ is an angle formed by the boundary direction having different brightness and the horizontal direction of the target image). It is preferable that (object size / object interval) is set. As a result, the image processing apparatus can create a background image with a small amount of calculation even when regions of different brightness are applied obliquely to the object.
The size of the object means the maximum length of the object, and examples thereof include the maximum width of the object, the maximum height of the object, and the maximum value of the diagonal line of the object.
The interval between the objects means the minimum length of the intervals between the adjacent objects. When the object is a character string, it is a character interval.
The value of (object size / object interval) is preferably an even number. When the value of (object size / object interval) is an odd number, add 1 to the value of (object size / object interval) to make it even, and then perform image processing. be able to.

画像処理装置が行う各種処理は、画像処理装置を構成する制御部を有するコンピュータにより実行される。
コンピュータとしては、記憶、演算、制御などの装置を備えた機器であれば特に制限はなく、目的に応じて適宜選択することができ、例えば、パーソナルコンピュータなどが挙げられる。
Various processes performed by the image processing apparatus are executed by a computer having a control unit constituting the image processing apparatus.
The computer is not particularly limited as long as it is a device equipped with devices such as storage, calculation, and control, and can be appropriately selected according to the purpose. Examples thereof include a personal computer.

ここで、従来の背景作成処理方法では、図1に示すように、文字列「523」及び影20がかかっている背景を有する対象画像10の文字列「523」が背景19に比べて暗い場合は、まず、最大値フィルタ21による処理を数回実行し、画像12を得る。
次に、得られた画像12は、文字部分は除去されているが、本来影であるが非影に置換されているものが含まれており、影20の位置ずれが生じている。
背景画像11は、影20の位置ずれを戻すため、最小値フィルタ23による処理を数回実行することにより作成される。なお、図11中22は注目画素である。
次に、文字抽出結果13は、対象画像10から得られた背景画像11を差し引くことにより得られる。
Here, in the conventional background creation processing method, as shown in FIG. 1, the character string “523” and the character string “523” of the target image 10 having a background with a shadow 20 are darker than the background 19 First, the process by the maximum value filter 21 is executed several times to obtain the image 12.
Next, the obtained image 12 includes a character portion that has been removed but is originally a shadow but is replaced by a non-shadow, and the shadow 20 is misaligned.
The background image 11 is created by executing the process by the minimum value filter 23 several times in order to restore the positional deviation of the shadow 20. In FIG. 11, reference numeral 22 denotes a target pixel.
Next, the character extraction result 13 is obtained by subtracting the background image 11 obtained from the target image 10.

従来技術では、図2に示すように、最大値/最小値フィルタ処理を行う際に、各画素に対して、図2中矢印で示すようなラスタースキャンにより、逐次最大値又は最小値を探索するため、演算量が多くなる。即ち、図2の上図に示すように、全画素に対して最大値又は最小値の探索を行うと、処理回数は、N×N×2×W×H=2NWHとなる。ただし、Nはフィルタサイズ、Wは画像幅、Hは画像高さである。
また、図2の下図に示すように、注目画素22を通る横方向1ラインにフィルタ処理後、縦方向1ラインにフィルタ処理を行っても、同様の効果が得られる。この場合、処理回数は、(N+N)×2×W×H=4NWHとなる。
したがって、従来技術では、背景画像を作成するために行う最大値/最小値フィルタ処理は、各画素に対して、4N回の比較になり、大きな演算量となる。
In the prior art, as shown in FIG. 2, when the maximum value / minimum value filter processing is performed, each pixel is sequentially searched for a maximum value or a minimum value by a raster scan as indicated by an arrow in FIG. Therefore, the calculation amount increases. That is, as shown in the upper diagram of FIG. 2, when the search for the maximum value or the minimum value is performed for all the pixels, the number of times of processing is N × N × 2 × W × H = 2N 2 WH. However, N is a filter size, W is an image width, and H is an image height.
Further, as shown in the lower diagram of FIG. 2, the same effect can be obtained by performing the filtering process on one vertical line after the filtering process on one horizontal line passing through the target pixel 22. In this case, the number of processing times is (N + N) × 2 × W × H = 4NWH.
Therefore, in the prior art, the maximum value / minimum value filter processing performed to create the background image is compared 4N times for each pixel, resulting in a large amount of calculation.

本発明の画像処理装置は、対象物と対象物の間には背景があることに着目し、まず、明るさの異なる境界方向に沿って、注目画素と注目画素から所定間隔離間した画素である比較画素との組を1組以上設定する。次に、同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素を比較画素に変換する。これにより、画像処理装置は、各画素に対し、(R+1)回の比較で済み、少ない演算量で背景画像を作成することができる。ただし、Rは、(対象物の大きさ/対象物の間隔)である。   The image processing apparatus of the present invention pays attention to the fact that there is a background between the object, and first, the pixel is separated from the pixel of interest by a predetermined interval along the boundary direction with different brightness. One or more sets of comparison pixels are set. Next, the target pixel and the comparison pixel included in the same group are compared, and when the comparison result satisfies a predetermined condition, the target pixel is converted into a comparison pixel. Thereby, the image processing apparatus needs only (R + 1) comparisons for each pixel, and can create a background image with a small amount of calculation. However, R is (size of target object / interval of target object).

以下、本発明の一実施例を説明するが、本発明は、この実施例に何ら限定されるものではない。
以下では、対象物として「文字列」を含み、かつ影がかかった看板を撮影した対象画像を用いる。このため、「対象物」を「文字列」と、「明るさが異なる複数の領域を含む対象画像」を「影がかかった複数の領域を含む対象画像」と読み替えて説明する。
Hereinafter, although one Example of this invention is described, this invention is not limited to this Example at all.
In the following, a target image including a “character string” as a target object and a shadowed signboard is used. Therefore, “object” will be described as “character string”, and “target image including a plurality of areas with different brightness” will be read as “target image including a plurality of shadowed areas”.

(実施例1)
図3は、画像処理装置100のハードウェア構成の一例を示すブロック図である。
図3に示すように、画像処理装置100は以下の各部を有する。各部は、バス106を介してそれぞれ接続されている。
Example 1
FIG. 3 is a block diagram illustrating an example of a hardware configuration of the image processing apparatus 100.
As shown in FIG. 3, the image processing apparatus 100 includes the following units. Each unit is connected via a bus 106.

CPU(Central Processing Unit)101は、種々の制御や演算を行う処理装置である。CPU101は、主記憶装置102などが記憶するOS(Operating System)やプログラムを実行することにより、種々の機能を実現する。即ち、CPU101は、本実施例では、画像処理プログラムを実行することにより、後述する制御部120として機能する。
画像処理プログラムは、必ずしも最初から主記憶装置102、補助記憶装置103などに記憶されていなくともよい。また、インターネット、LAN(Local Area Network)、WAN(Wide Area Network)などを介して画像処理装置100に接続される他の情報処理装置などに画像処理プログラムを記憶させることができる。
A CPU (Central Processing Unit) 101 is a processing device that performs various controls and operations. The CPU 101 implements various functions by executing an OS (Operating System) and programs stored in the main storage device 102 and the like. That is, in this embodiment, the CPU 101 functions as a control unit 120 described later by executing an image processing program.
The image processing program is not necessarily stored in the main storage device 102, the auxiliary storage device 103, or the like from the beginning. Further, the image processing program can be stored in another information processing apparatus connected to the image processing apparatus 100 via the Internet, a LAN (Local Area Network), a WAN (Wide Area Network), or the like.

また、CPU101は、画像処理装置100全体の動作を制御する。なお、本実施例では、画像処理装置100全体の動作を制御する装置をCPU101としたが、これに限ることなく、例えば、FPGA(Field Programmable Gate Array)などとしてもよい。   The CPU 101 controls the operation of the entire image processing apparatus 100. In this embodiment, the CPU 101 is the device that controls the operation of the entire image processing apparatus 100. However, the present invention is not limited to this, and may be, for example, an FPGA (Field Programmable Gate Array).

主記憶装置102は、各種プログラムを記憶し、各種プログラムを実行するために必要なデータ等を記憶する。
主記憶装置102は、図示しない、ROM(Read Only Memory)と、RAM(Random Access Memory)と、を有する。
ROMは、BIOS(Basic Input/Output System)等の各種プログラムなどを記憶している。
RAMは、ROMに記憶された各種プログラムがCPU101により実行される際に展開される作業範囲として機能する。RAMとしては、特に制限はなく、目的に応じて適宜選択することができる。RAMとしては、例えば、DRAM(Dynamic Random Access Memory)、SRAM(Static Random Access Memory)などが挙げられる。
The main storage device 102 stores various programs, and stores data necessary for executing the various programs.
The main storage device 102 has a ROM (Read Only Memory) and a RAM (Random Access Memory) not shown.
The ROM stores various programs such as BIOS (Basic Input / Output System).
The RAM functions as a work range that is expanded when various programs stored in the ROM are executed by the CPU 101. There is no restriction | limiting in particular as RAM, According to the objective, it can select suitably. Examples of the RAM include DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory).

補助記憶装置103としては、各種情報を記憶できれば特に制限はなく、目的に応じて適宜選択することができ、例えば、ソリッドステートドライブ、ハードディスクドライブなどが挙げられる。また、補助記憶装置103は、CD(Compact Disc)ドライブ、DVD(Digital Versatile Disc)ドライブ、BD(Blu−ray(登録商標) Disc)ドライブなどの可搬記憶装置としてもよい。   The auxiliary storage device 103 is not particularly limited as long as various kinds of information can be stored, and can be appropriately selected according to the purpose. Examples thereof include a solid state drive and a hard disk drive. The auxiliary storage device 103 may be a portable storage device such as a CD (Compact Disc) drive, a DVD (Digital Versatile Disc) drive, or a BD (Blu-ray (registered trademark) Disc) drive.

入力装置104は、画像処理装置100に対する各種要求を受け付けることができれば特に制限はなく、適宜公知のものを用いることができ、例えば、カメラ、スキャナー、キーボード、マウス、タッチパネルなどが挙げられる。カメラとしては、例えば、CCDカメラ、CMOSカメラ、これらを用いたデジタルカメラなどが挙げられる。   The input device 104 is not particularly limited as long as it can accept various requests to the image processing apparatus 100, and a known device can be used as appropriate. Examples thereof include a camera, a scanner, a keyboard, a mouse, and a touch panel. Examples of the camera include a CCD camera, a CMOS camera, and a digital camera using these.

出力装置105は、特に制限はなく、適宜公知のものを用いることができ、例えば、ディスプレイ、スピーカーなどが挙げられる。ディスプレイとしては、特に制限はなく、適宜公知のものを用いることができ、例えば、液晶ディスプレイ、有機ELディスプレイなどが挙げられる。   There is no restriction | limiting in particular in the output device 105, A well-known thing can be used suitably, For example, a display, a speaker, etc. are mentioned. There is no restriction | limiting in particular as a display, A well-known thing can be used suitably, For example, a liquid crystal display, an organic EL display, etc. are mentioned.

なお、画像処理装置100は、ネットワーク上のコンピュータ群であるクラウドの一部であってもよい。   Note that the image processing apparatus 100 may be a part of a cloud that is a group of computers on a network.

図4は、画像処理装置100の機能構成の一例を示すブロック図である。
図4に示すように、画像処理装置100は、入力部110と、制御部120と、記憶部130とを有する。
FIG. 4 is a block diagram illustrating an example of a functional configuration of the image processing apparatus 100.
As illustrated in FIG. 4, the image processing apparatus 100 includes an input unit 110, a control unit 120, and a storage unit 130.

入力部110は、例えば、デジタルカメラなどで撮影した対象画像のデータを受け付ける。
記憶部130は、例えば、入力を受け付けた対象画像のデータ、作成した背景画像のデータや文字認識の結果などを記憶する。
For example, the input unit 110 receives data of a target image captured by a digital camera or the like.
The storage unit 130 stores, for example, data of a target image that has received an input, data of a created background image, a result of character recognition, and the like.

制御部120は、影境界検出部121と、設定部122と、画素比較部123と、を有する。ここで、制御部120の構成は、本発明の画像処理装置に該当する。制御部120を実施する処理は、本発明の画像処理方法に該当する。制御部120の処理をコンピュータに実行させるプログラムは、本発明の画像処理プログラムに該当する。   The control unit 120 includes a shadow boundary detection unit 121, a setting unit 122, and a pixel comparison unit 123. Here, the configuration of the control unit 120 corresponds to the image processing apparatus of the present invention. The processing for executing the control unit 120 corresponds to the image processing method of the present invention. The program that causes the computer to execute the processing of the control unit 120 corresponds to the image processing program of the present invention.

影境界検出部121は、文字列からエッジを抽出し、文字列における輪郭線の角度分布を求め、最頻値となる角度を文字列にかかった影の境界角度とする。
本実施例では、図5に示すように、白色の看板に黒色で「523」の文字列が描かれているものを撮影した画像を対象画像として用いる。なお、「523」の文字列において文字幅と文字間隔は既知である。
図5に示すように、対象画像から全方向のエッジ抽出処理を行い、得られた文字列の輪郭線との角度をヒストグラムとして表し、ヒストグラムの最頻値を文字列にかかった影20の境界方向とする。本実施例では、影20の境界(角度)は、図5に示すように、文字列にかかった影20の境界が直線状であり、かつ文字列方向と平行である。
エッジ抽出処理に用いられるフィルタとしては、例えば、微分フィルタ、プリューウィットフィルタ、ソーベルフィルタなどが挙げられる。
The shadow boundary detection unit 121 extracts edges from the character string, obtains an angle distribution of the contour line in the character string, and sets the angle that becomes the mode value as the boundary angle of the shadow applied to the character string.
In this embodiment, as shown in FIG. 5, an image obtained by photographing a white sign with a black character string “523” is used as a target image. Note that the character width and character spacing in the character string “523” are known.
As shown in FIG. 5, edge extraction processing in all directions is performed from the target image, the angle with the outline of the obtained character string is represented as a histogram, and the mode value of the histogram is the boundary of the shadow 20 applied to the character string. The direction. In this embodiment, the boundary (angle) of the shadow 20 is, as shown in FIG. 5, the boundary of the shadow 20 applied to the character string is linear and parallel to the character string direction.
Examples of the filter used for the edge extraction process include a differential filter, a pre-wit filter, and a Sobel filter.

<設定部>
設定部122は、文字列を含み、かつ影がかかった複数の領域を含む対象画像において、影の境界方向に沿って、注目画素と注目画素から所定間隔離間した画素である比較画素との組を1組以上設定する。
これにより、画像処理装置100は、少ない演算量で背景画像を作成することができる。
所定間隔離間とは、比較画素が背景又は影がかかった背景に含まれるように間隔をおいて配置されていることを意味し、本実施例では、隣接する文字どうしの最小の文字間隔である。
設定部122では、使用するフィルタの種類を選択する。フィルタの種類の選択は、対象画像全体の輝度値のヒストグラムをとり、画素数が少ない部分(文字列)が明るいか又は暗いかにより、最大値フィルタ及び最小値フィルタのいずれかを選択することができる。
文字列の輝度値が、背景又は影がかかった背景の輝度値より低い場合には、文字列の注目画素をフィルタ内の最大輝度値に置換する最大値フィルタを用いる。一方、文字列の輝度値が背景又は影がかかった背景の輝度値より高い場合には、文字列の注目画素をフィルタ内の最小輝度値に置換する最小値フィルタを用いる。
本実施例では、文字列の輝度値が背景又は影がかかった背景の輝度値より低いので、最大値フィルタを用いる。
<Setting section>
The setting unit 122 includes, in a target image including a character string and a plurality of shadowed regions, a set of a target pixel and a comparison pixel that is a pixel spaced from the target pixel by a predetermined distance along the shadow boundary direction. Set one or more sets.
Thereby, the image processing apparatus 100 can create a background image with a small amount of calculation.
The predetermined spacing means that the comparison pixels are arranged so as to be included in the background or the shaded background, and in this embodiment, is the minimum spacing between adjacent characters. .
The setting unit 122 selects the type of filter to be used. The filter type can be selected by taking a histogram of luminance values of the entire target image and selecting either the maximum value filter or the minimum value filter depending on whether the portion (character string) with a small number of pixels is bright or dark. it can.
When the luminance value of the character string is lower than the luminance value of the background or the shadowed background, a maximum value filter that replaces the target pixel of the character string with the maximum luminance value in the filter is used. On the other hand, when the luminance value of the character string is higher than the luminance value of the background or the shadowed background, a minimum value filter that replaces the target pixel of the character string with the minimum luminance value in the filter is used.
In this embodiment, since the luminance value of the character string is lower than the luminance value of the background or the background with shadow, the maximum value filter is used.

<画素比較部>
画素比較部123は、同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素の輝度値を比較画素の輝度値に変換する。
所定の条件としては、例えば、文字列の輝度値が背景の輝度値より低い場合に、注目画素の輝度値をより明るい輝度値に置換する。一方、所定の条件としては、例えば、文字列の輝度値が背景の輝度値より高い場合に、注目画素の輝度値をより暗い輝度値に置換する。
本実施例では、最大値フィルタを用い、注目画素の輝度値と比較画素の輝度値とを比較し、注目画素の輝度値が比較画素の輝度値より低い場合に、注目画素の輝度値をより明るい輝度値に置換する。
<Pixel comparison unit>
The pixel comparison unit 123 compares the target pixel and the comparison pixel included in the same group, and converts the luminance value of the target pixel into the luminance value of the comparison pixel when the comparison result satisfies a predetermined condition.
As the predetermined condition, for example, when the luminance value of the character string is lower than the luminance value of the background, the luminance value of the target pixel is replaced with a brighter luminance value. On the other hand, as the predetermined condition, for example, when the luminance value of the character string is higher than the luminance value of the background, the luminance value of the target pixel is replaced with a darker luminance value.
In this embodiment, the maximum value filter is used to compare the luminance value of the target pixel with the luminance value of the comparison pixel, and when the luminance value of the target pixel is lower than the luminance value of the comparison pixel, the luminance value of the target pixel is further increased. Replace with a bright luminance value.

ここで、図6に示す対象画像は、文字幅L1が文字間隔D1の2倍であるため、R=(文字幅L1/文字間隔D1)が2である。
図6に示すように、比較画素24が、中央に設けた注目画素22の左右両側に、文字間隔D1をおいて、R=(文字幅L1/文字間隔D1)=2個設定されたフィルタ25を用いる。このフィルタ25を用いると、2つの比較画素24の少なくともいずれかは、背景19又は影20がかかった背景に存在する(図6中(1)及び(2)参照)。
したがって、図6において、画素比較部123は、(1)における注目画素22を、影20がかかった背景に置換する。(2)における注目画素22は、背景19に置換される。(1)又は(2)と同様の処理を、文字列全体について行うことにより、対象画像から文字列を除いた背景画像が作成される。
図6では、注目画素22と比較画素24とを比較するので、比較画素数は、(R+1)=3回となる。各注目画素について比較画素数の処理を行えばよいので、処理回数は(R+1)×総画素数(W×H)となる(ただし、Wは画像幅、Hは画像高さである)。従来技術と比べて、総画素数(W×H)は変わらないが、比較回数は(R+1)=3回に減少するため、少ない演算量で背景画像を作成することができる。
Here, in the target image shown in FIG. 6, since the character width L1 is twice the character interval D1, R = (character width L1 / character interval D1) is 2.
As shown in FIG. 6, the comparison pixel 24 is a filter 25 in which R = (character width L1 / character spacing D1) = 2 with a character spacing D1 on the left and right sides of the target pixel 22 provided in the center. Is used. When this filter 25 is used, at least one of the two comparison pixels 24 exists in the background with the background 19 or the shadow 20 (see (1) and (2) in FIG. 6).
Therefore, in FIG. 6, the pixel comparison unit 123 replaces the target pixel 22 in (1) with the background with the shadow 20. The pixel of interest 22 in (2) is replaced with the background 19. By performing the same process as (1) or (2) for the entire character string, a background image is created by removing the character string from the target image.
In FIG. 6, since the target pixel 22 and the comparison pixel 24 are compared, the number of comparison pixels is (R + 1) = 3. Since it is sufficient to process the number of comparison pixels for each pixel of interest, the number of times of processing is (R + 1) × total number of pixels (W × H) (W is the image width and H is the image height). Compared with the prior art, the total number of pixels (W × H) is not changed, but the number of comparisons is reduced to (R + 1) = 3, so that a background image can be created with a small amount of calculation.

図7に示す対象画像は、文字幅L1が文字間隔D2の4倍、即ち、R=(文字幅L1/文字間隔D2)が4である。
図7に示すように、比較画素24が、中央に設けた注目画素22の左右両側に、文字間隔D2をおいて、R=(文字幅L1/文字間隔D2)=4個設定されたフィルタ25を用いる。このフィルタ25を用いると、4つの比較画素24のうち少なくともいずれかは背景19又は影20のかかった背景に存在する(図7中(1)〜(4)参照)。
したがって、図7において、画素比較部123は、(1)における注目画素22を、影20がかかった背景に置換する。(2)における注目画素22は、影20がかかった背景に置換される。(3)における注目画素22は、背景19に置換される。(4)における注目画素22は、背景19に置換される。(1)〜(4)と同様の処理を、文字列全体について行うことにより、対象画像から文字列を除いた背景画像が作成される。
図7では、注目画素22と比較画素24とを比較するので、比較画素数は、(R+1)=5回となる。各注目画素について比較画素数の処理を行えばよいので、処理回数は(R+1)×総画素数(W×H)となる。従来技術に比べて、総画素数(W×H)は変わらないが、比較回数は(R+1)=5回に減少するため、少ない演算量で背景画像を作成することができる。
In the target image shown in FIG. 7, the character width L1 is four times the character interval D2, that is, R = (character width L1 / character interval D2) is four.
As shown in FIG. 7, the comparison pixel 24 is a filter 25 in which R = (character width L1 / character spacing D2) = 4 with a character spacing D2 on the left and right sides of the target pixel 22 provided in the center. Is used. When this filter 25 is used, at least one of the four comparison pixels 24 exists in the background 19 or the background with the shadow 20 (see (1) to (4) in FIG. 7).
Accordingly, in FIG. 7, the pixel comparison unit 123 replaces the target pixel 22 in (1) with a background with a shadow 20. The target pixel 22 in (2) is replaced with a background with a shadow 20. The target pixel 22 in (3) is replaced with the background 19. The pixel of interest 22 in (4) is replaced with the background 19. By performing the same processing as (1) to (4) for the entire character string, a background image excluding the character string from the target image is created.
In FIG. 7, since the target pixel 22 and the comparison pixel 24 are compared, the number of comparison pixels is (R + 1) = 5. Since it is only necessary to process the number of comparison pixels for each target pixel, the number of times of processing is (R + 1) × total number of pixels (W × H). Compared to the prior art, the total number of pixels (W × H) is not changed, but the number of comparisons is reduced to (R + 1) = 5, so that a background image can be created with a small amount of calculation.

ここで、図8は、実施例1の画像処理装置全体の処理の流れの一例を示すフローチャートである。以下、図4を参照して、画像処理装置全体の処理の流れについて説明する。   Here, FIG. 8 is a flowchart illustrating an example of a processing flow of the entire image processing apparatus according to the first embodiment. Hereinafter, the flow of processing of the entire image processing apparatus will be described with reference to FIG.

ステップS101では、制御部120は、文字列のエッジを抽出し、文字列における輪郭線の角度分布を求め、最頻値となる角度を文字列にかかった影の境界角度とすると、処理をS102に移行する。   In step S101, the control unit 120 extracts the edge of the character string, obtains the angular distribution of the outline in the character string, and sets the angle that is the mode as the boundary angle of the shadow over the character string. Migrate to

ステップS102では、制御部120は、影の境界方向に沿って、注目画素と当該注目画素から所定間隔離間した画素である比較画素との組を1組以上設定すると、処理をS103に移行する。   In step S102, when the control unit 120 sets one or more sets of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined distance along the boundary direction of the shadow, the process proceeds to S103.

ステップS103では、制御部120は、同一の組に含まれる注目画素と比較画素とを比較し、比較の結果が所定の条件を満たす場合に、注目画素を比較画素に変換すると、本処理を終了する。   In step S103, the control unit 120 compares the target pixel and the comparison pixel included in the same group, and ends the process when the target pixel is converted into the comparison pixel when the comparison result satisfies a predetermined condition. To do.

したがって、実施例1では、文字列における文字間隔には、必ず背景又は影がかかった背景が存在することに着目し、文字間隔を含むように比較画素を設定する。これにより、従来のフィルタ内の全画素の比較から、少数の画素の比較に演算量を大幅に削減することができる。   Therefore, in the first embodiment, focusing on the fact that there is always a background or a shadowed background in the character spacing in the character string, the comparison pixels are set to include the character spacing. Thereby, it is possible to significantly reduce the amount of calculation from the comparison of all the pixels in the conventional filter to the comparison of a small number of pixels.

次に、図9は、対象物認識処理装置としての文字認識処理装置200の一例を示すブロック図である。
図9の文字認識処理装置200は、画像処理装置100と、差分画像作成部201と、二値画像作成部202と、認識処理部203とを有する。なお、図9の画像処理装置100は、図4の画像処理装置100と同様であるため、その説明を省略する。
Next, FIG. 9 is a block diagram illustrating an example of a character recognition processing device 200 as an object recognition processing device.
The character recognition processing device 200 of FIG. 9 includes an image processing device 100, a difference image creation unit 201, a binary image creation unit 202, and a recognition processing unit 203. The image processing apparatus 100 in FIG. 9 is the same as the image processing apparatus 100 in FIG.

<差分画像作成部>
差分画像作成部201は、画像処理装置100で作成された背景画像と元画像である対象画像との差分を取ることで対象画像から背景を除去した差分画像を作成する。
差分画像の作成は、ソフトウェアにより実行することができる。
<Difference image creation unit>
The difference image creation unit 201 creates a difference image in which the background is removed from the target image by taking the difference between the background image created by the image processing apparatus 100 and the target image that is the original image.
The creation of the difference image can be executed by software.

<二値画像作成部>
二値画像作成部202は、差分画像作成部201で作成された差分画像を二値化して二値画像を作成する。
二値化とは、画像を白と黒の2階調に変換する処理を意味する。予め閾値を決めておき、画素の輝度が閾値よりも大きければ白、小さければ黒に変換する。二値化を行うことにより、ぼやけている(薄い)画像を鮮明にすることができる。
<Binary image creation unit>
The binary image creation unit 202 binarizes the difference image created by the difference image creation unit 201 to create a binary image.
Binarization means processing for converting an image into two gradations of white and black. A threshold value is determined in advance. If the luminance of the pixel is larger than the threshold value, it is converted to white, and if it is smaller, it is converted to black. By performing binarization, a blurred (thin) image can be sharpened.

<認識処理部>
認識処理部203は、二値画像作成部202で作成された二値画像を入力とし、文字列の認識結果を出力する。
文字認識方法としては、特に制限はなく、目的に応じて適宜選択することができ、例えば、得られた二値画像をラベリング処理して文字列を取り出し、予め登録している文字の辞書とのマッチングを行う方法などが挙げられる。
<Recognition processing unit>
The recognition processing unit 203 receives the binary image created by the binary image creation unit 202 and outputs a character string recognition result.
The character recognition method is not particularly limited and can be appropriately selected according to the purpose.For example, the obtained binary image is labeled to extract a character string, and a pre-registered character dictionary is used. For example, a matching method may be used.

図10は、実施例1の文字認識処理装置全体の処理の流れの一例を示すフローチャートである。以下、図9を参照して、文字認識処理装置全体の処理の流れについて説明する。   FIG. 10 is a flowchart illustrating an example of a process flow of the entire character recognition processing apparatus according to the first embodiment. Hereinafter, the flow of processing of the entire character recognition processing apparatus will be described with reference to FIG.

図10のステップS101〜ステップS103は、図8のステップS101〜ステップS103と同様であるため、その説明を省略する。   Steps S101 to S103 in FIG. 10 are the same as steps S101 to S103 in FIG.

ステップS104では、差分画像作成部201は、S103において画像処理装置100から得られた背景画像と元画像である対象画像との差分を取ることにより、文字列を抽出した差分画像を作成すると、処理をS105に移行する。   In step S104, the difference image creation unit 201 creates a difference image from which a character string has been extracted by taking the difference between the background image obtained from the image processing apparatus 100 in step S103 and the target image that is the original image. The process proceeds to S105.

ステップS105では、二値画像作成部202は、差分画像作成部201から得られた差分画像を二値化して二値画像を作成すると、処理をS106に移行する。   In step S105, when the binary image creation unit 202 binarizes the difference image obtained from the difference image creation unit 201 to create a binary image, the process proceeds to S106.

ステップS106では、認識処理部203は、二値画像作成部202で作成した二値画像を入力とし、文字列の認識結果を出力すると、本処理を終了する。   In step S106, the recognition processing unit 203 receives the binary image created by the binary image creation unit 202 and outputs a character string recognition result. Then, the process ends.

(実施例2)
実施例2は、図11に示すように、影20の境界方向が文字列方向に対して垂直方向である以外は、実施例1と同様である。実施例2では、文字列の文字間隔の情報を用いることなく背景画像を作成できる。なお、文字高さH1は既知である
図11に示すように、比較画素24が、中央に設けた注目画素22の上下両側に、文字の高さH1の半分の間隔をおいて、2個設定されたフィルタ25を用いる。このフィルタ25を用いると、2つの比較画素24のうち少なくともいずれかは背景19又は影20のかかった背景に存在する。
実施例2では、処理回数は、3×W×H=3WHとなる。従来技術に比べて、総画素数(W×H)は変わらないが、比較回数は3回に減少するため、画像処理装置は、少ない演算量で背景画像を作成することができる。
(Example 2)
As shown in FIG. 11, the second embodiment is the same as the first embodiment except that the boundary direction of the shadow 20 is perpendicular to the character string direction. In the second embodiment, a background image can be created without using character spacing information of a character string. The character height H1 is already known. As shown in FIG. 11, two comparison pixels 24 are set on both the upper and lower sides of the target pixel 22 provided in the center with an interval half the character height H1. The filtered filter 25 is used. When this filter 25 is used, at least one of the two comparison pixels 24 exists in the background 19 or the background with the shadow 20.
In the second embodiment, the number of processes is 3 × W × H = 3WH. Compared to the prior art, the total number of pixels (W × H) is not changed, but the number of comparisons is reduced to 3, so that the image processing apparatus can create a background image with a small amount of calculation.

(実施例3)
実施例3は、図12に示すように、影20の境界が文字列に対して斜め方向にかかっている以外は、実施例1の図6と同様である。
図12に示す対象画像は、文字幅L1が文字間隔D1の2倍であるため、R=(文字幅L1/文字間隔D1)が2である。
図12に示すように、中央に設けた注目画素22の両側に、文字間隔D1×tanθ(ただし、θは影の境界方向と対象画像の水平方向とのなす角である)をおいて、(文字幅L1/文字間隔D1)=2個設定されたフィルタ25を用いる。このフィルタ25を用いると、2つの比較画素24の少なくともいずれかは、背景19又は影20がかかった背景に存在する。
したがって、実施例3では、注目画素22と比較画素24とを比較するので、比較画素数は、(R+1)=3回となる。各注目画素について比較画素数の処理を行えばよいので、処理回数は(R+1)×総画素数(W×H)となる。従来技術と比べて、総画素数(W×H)は変わらないが、比較回数は(R+1)=3回に減少するため、画像処理装置は、少ない演算量で背景画像を作成することができる。
Example 3
As shown in FIG. 12, the third embodiment is the same as the first embodiment shown in FIG. 6 except that the boundary of the shadow 20 is inclined with respect to the character string.
In the target image shown in FIG. 12, since the character width L1 is twice the character interval D1, R = (character width L1 / character interval D1) is 2.
As shown in FIG. 12, character spacing D1 × tan θ (where θ is an angle formed by the boundary direction of the shadow and the horizontal direction of the target image) is placed on both sides of the target pixel 22 provided in the center. The filter 25 in which the character width L1 / character spacing D1) = 2 is set is used. When this filter 25 is used, at least one of the two comparison pixels 24 exists in the background with the background 19 or the shadow 20.
Therefore, in Example 3, since the target pixel 22 and the comparison pixel 24 are compared, the number of comparison pixels is (R + 1) = 3. Since it is only necessary to process the number of comparison pixels for each target pixel, the number of times of processing is (R + 1) × total number of pixels (W × H). Compared with the prior art, the total number of pixels (W × H) does not change, but the number of comparisons decreases to (R + 1) = 3, so the image processing apparatus can create a background image with a small amount of computation. .

(実施例4)
図13〜図21に示すような、文字列の配置、及び影のかかり方の対象画像に対し、画像処理装置は、いずれも、実施例1から3のいずれかと同様の画像処理を行うことにより、少ない演算量で背景画像を作成することができる。
(Example 4)
The image processing apparatus performs the same image processing as in any one of the first to third embodiments on the target images to be subjected to the arrangement of the character strings and the shadows as illustrated in FIGS. 13 to 21. A background image can be created with a small amount of calculation.

以上の実施形態に関し、更に以下の付記を開示する。
(付記1)
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理をコンピュータに実行させることを特徴とする、画像処理プログラム。
(付記2)
前記比較画素が、前記注目画素の左右両側に、前記対象画像に含まれる複数の前記対象物どうしの前記対象画像上での間隔をおいて、複数個設定される、
ことを特徴とする、付記1に記載の画像処理プログラム。
(付記3)
前記比較画素が、前記注目画素の上下両側に、前記対象画像における前記対象物の高さの半分の間隔をおいて、2個設定される、
ことを特徴とする、付記1に記載の画像処理プログラム。
(付記4)
前記比較画素が、前記注目画素の左右両側に、前記対象物の間隔×tanθ(ただし、θは明るさの異なる境界方向と対象画像の水平方向とのなす角である)をおいて、(前記対象物の大きさ/前記対象物の間隔)個設定される、
ことを特徴とする、付記1に記載の画像処理プログラム。
(付記5)
前記所定の条件は、前記対象物の輝度値が前記背景の輝度値より低い場合に、前記注目画素の輝度値をより明るい輝度値に置換し、
前記所定の条件が、前記対象物の輝度値が前記背景の輝度値より高い場合に、前記注目画素の輝度値をより暗い輝度値に置換する、
ことを特徴とする、付記1から4のいずれか一項に記載の画像処理プログラム。
(付記6)
前記対象物からエッジを抽出し、前記対象物における輪郭線の角度分布を求め、最頻値となる角度を前記対象物の背景における明るさが異なる境界角度とする、
ことを特徴とする、付記1から5のいずれか一項に記載の画像処理プログラム。
(付記7)
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理を実行する制御部を有することを特徴とする、画像処理装置。
(付記8)
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理をコンピュータが実行することを特徴とする、画像処理方法。
(付記9)
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、処理を実行する制御部を有する画像処理装置と、
前記画像処理装置で作成された背景画像と前記対象画像との差分を取ることで前記対象画像から背景を除去した差分画像を作成する差分画像作成部と、
前記差分画像を二値化して二値画像を作成する二値画像作成部と、
前記二値画像を入力とし、対象物の認識結果を出力する認識処理部と、
を有することを特徴とする、対象物認識処理装置。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing program for causing a computer to execute processing.
(Appendix 2)
A plurality of the comparison pixels are set on the left and right sides of the target pixel at intervals on the target image between the plurality of objects included in the target image.
The image processing program according to attachment 1, wherein
(Appendix 3)
Two comparison pixels are set on both upper and lower sides of the target pixel with an interval half the height of the object in the target image.
The image processing program according to attachment 1, wherein
(Appendix 4)
The comparison pixel has an interval of the object × tan θ (where θ is an angle formed by a boundary direction having different brightness and a horizontal direction of the target image) on both the left and right sides of the target pixel. The size of the object / the distance between the objects is set.
The image processing program according to attachment 1, wherein
(Appendix 5)
The predetermined condition is that when the luminance value of the object is lower than the luminance value of the background, the luminance value of the target pixel is replaced with a brighter luminance value,
When the predetermined condition is that the luminance value of the object is higher than the luminance value of the background, the luminance value of the target pixel is replaced with a darker luminance value.
The image processing program according to any one of appendices 1 to 4, characterized in that:
(Appendix 6)
Extracting an edge from the object, obtaining an angular distribution of the contour line in the object, and setting the angle that is the mode as a boundary angle with different brightness in the background of the object,
The image processing program according to any one of appendices 1 to 5, characterized in that:
(Appendix 7)
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing apparatus comprising: a control unit that executes processing.
(Appendix 8)
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing method, wherein the processing is executed by a computer.
(Appendix 9)
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set the number of sets or more, compare the target pixel and the comparison pixel included in the same group, and execute the process of converting the target pixel to the comparison pixel when the comparison result satisfies a predetermined condition An image processing apparatus having a control unit;
A difference image creation unit that creates a difference image obtained by removing a background from the target image by taking a difference between the background image created by the image processing apparatus and the target image;
A binary image creation unit that binarizes the difference image to create a binary image;
A recognition processing unit that receives the binary image and outputs a recognition result of the object;
The object recognition processing apparatus characterized by having.

100 画像処理装置
110 入力部
120 制御部
121 影境界検出部
122 設定部
123 画素比較部
130 記憶部

DESCRIPTION OF SYMBOLS 100 Image processing apparatus 110 Input part 120 Control part 121 Shadow boundary detection part 122 Setting part 123 Pixel comparison part 130 Storage part

Claims (6)

対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理をコンピュータに実行させることを特徴とする、画像処理プログラム。
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing program for causing a computer to execute processing.
前記比較画素が、前記注目画素の左右両側に、前記対象画像に含まれる複数の前記対象物どうしの前記対象画像上での間隔をおいて、複数個設定される、
ことを特徴とする、請求項1に記載の画像処理プログラム。
A plurality of the comparison pixels are set on the left and right sides of the target pixel at intervals on the target image between the plurality of objects included in the target image.
The image processing program according to claim 1, wherein:
前記比較画素が、前記注目画素の上下両側に、前記対象画像における前記対象物の高さの半分の間隔をおいて、2個設定される、
ことを特徴とする、請求項1に記載の画像処理プログラム。
Two comparison pixels are set on both upper and lower sides of the target pixel with an interval half the height of the object in the target image.
The image processing program according to claim 1, wherein:
前記比較画素が、前記注目画素の左右両側に、前記対象物の間隔×tanθ(ただし、θは明るさの異なる境界方向と対象画像の水平方向とのなす角である)をおいて、(前記対象物の大きさ/前記対象物の間隔)個設定される、
ことを特徴とする、請求項1に記載の画像処理プログラム。
The comparison pixel has an interval of the object × tan θ (where θ is an angle formed by a boundary direction having different brightness and a horizontal direction of the target image) on both the left and right sides of the target pixel. The size of the object / the distance between the objects is set.
The image processing program according to claim 1, wherein:
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理を実行する制御部を有することを特徴とする、画像処理装置。
In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing apparatus comprising: a control unit that executes processing.
対象物を含み、かつ明るさが異なる複数の領域を含む対象画像において、明るさの異なる境界方向に沿って、注目画素と前記注目画素から所定間隔離間した画素である比較画素との組を1組以上設定し、
同一の組に含まれる前記注目画素と前記比較画素とを比較し、比較の結果が所定の条件を満たす場合に、前記注目画素を前記比較画素に変換する、
処理をコンピュータが実行することを特徴とする、画像処理方法。

In a target image that includes a plurality of regions that include a target object and have different brightness, a set of a target pixel and a comparison pixel that is a pixel spaced apart from the target pixel by a predetermined interval along a boundary direction having different brightness Set more than pairs,
Comparing the target pixel and the comparison pixel included in the same set, and if the result of the comparison satisfies a predetermined condition, the target pixel is converted into the comparison pixel;
An image processing method, wherein the processing is executed by a computer.

JP2017119485A 2017-06-19 2017-06-19 Image processing program, image processing apparatus, and image processing method Pending JP2019003534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017119485A JP2019003534A (en) 2017-06-19 2017-06-19 Image processing program, image processing apparatus, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017119485A JP2019003534A (en) 2017-06-19 2017-06-19 Image processing program, image processing apparatus, and image processing method

Publications (1)

Publication Number Publication Date
JP2019003534A true JP2019003534A (en) 2019-01-10

Family

ID=65006849

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017119485A Pending JP2019003534A (en) 2017-06-19 2017-06-19 Image processing program, image processing apparatus, and image processing method

Country Status (1)

Country Link
JP (1) JP2019003534A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020202452A (en) * 2019-06-07 2020-12-17 キヤノン株式会社 Image processing device, image processing method, and program
CN113379700A (en) * 2021-06-08 2021-09-10 展讯通信(上海)有限公司 Method, system, device and medium for detecting image quality

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020202452A (en) * 2019-06-07 2020-12-17 キヤノン株式会社 Image processing device, image processing method, and program
CN113379700A (en) * 2021-06-08 2021-09-10 展讯通信(上海)有限公司 Method, system, device and medium for detecting image quality
CN113379700B (en) * 2021-06-08 2022-11-25 展讯通信(上海)有限公司 Method, system, device and medium for detecting image quality

Similar Documents

Publication Publication Date Title
US8965123B2 (en) System and method for processing image for identifying alphanumeric characters present in a series
CN110033471B (en) Frame line detection method based on connected domain analysis and morphological operation
US9495343B2 (en) Horizontal and vertical line detection and removal for document images
CN108960229B (en) Multidirectional character detection method and device
US9275030B1 (en) Horizontal and vertical line detection and removal for document images
CN112184744B (en) Display screen edge defect detection method and device
RU2695054C1 (en) Detecting bar codes on images
US9082039B2 (en) Method and apparatus for recognizing a character based on a photographed image
Singh et al. Adaptive binarization of severely degraded and non-uniformly illuminated documents
CN113436222A (en) Image processing method, image processing apparatus, electronic device, and storage medium
JP2015115067A (en) Method and device for extracting distorted straight line from image
JP2019003534A (en) Image processing program, image processing apparatus, and image processing method
JP2018152026A (en) Character recognition method and computer program
JP2005165387A (en) Method and device for detecting stripe defective of picture and display device
Chavre et al. Scene text extraction using stroke width transform for tourist translator on android platform
Kumar et al. Fuzzy inference system based edge detection using fuzzy membership functions
Mohammad et al. Practical recognition system for text printed on clear reflected material
JP7402931B2 (en) METHODS, COMPUTER READABLE PROGRAMS AND SYSTEM
Dawadi et al. An approach of Devanagari license plate detection and recognition using deep learning
Huang et al. Apply Adaptive Threshold Operation and Conditional Connected-component to Image Text Recognition
Jambekar A Review of Optical Character Recognition System for Recognition of Printed Text
Aung Robust Local Thresholding Method for Segmentation of Non-Uniform Coloured Documents
Basavanna et al. Adaptive Histogram Analysis for Scene Text Binarization and Recognition
US9251568B1 (en) Pseudo-skeleton based image enhancement for document image reproduction
Yoshida et al. A binarization method for the character extraction from scene image by the blanket method