JP2007156741A - Character extraction method, character extraction device, and program - Google Patents

Character extraction method, character extraction device, and program Download PDF

Info

Publication number
JP2007156741A
JP2007156741A JP2005349745A JP2005349745A JP2007156741A JP 2007156741 A JP2007156741 A JP 2007156741A JP 2005349745 A JP2005349745 A JP 2005349745A JP 2005349745 A JP2005349745 A JP 2005349745A JP 2007156741 A JP2007156741 A JP 2007156741A
Authority
JP
Japan
Prior art keywords
image
region
character
edge extraction
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.)
Withdrawn
Application number
JP2005349745A
Other languages
Japanese (ja)
Inventor
Tomohiro Uchiyama
知大 内山
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.)
Koito Industries Ltd
Original Assignee
Koito Industries 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 Koito Industries Ltd filed Critical Koito Industries Ltd
Priority to JP2005349745A priority Critical patent/JP2007156741A/en
Publication of JP2007156741A publication Critical patent/JP2007156741A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To appropriately extract a character region from an image including a boundary between a shadow and a sunny place. <P>SOLUTION: Smoothing processing and edge extraction processing are operated to an object image, and first labeling processing for classifying the image for every continuous region is operated to the processed image, and the region whose size is larger than an upper limit size as a predetermined character is erased in the respective continuous regions whose labeling has been operated by the first labeling processing, and expansion/contraction processing is operated to the erased image, and second labeling processing is operated to the contracted image, and the region included inside the region whose labeling has been operated by the second labeling processing is detected in the respective regions whose labeling has been operated remaining in the erased image (image before expansion/contraction), and the detected region is erased from the erased image. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、画像内の文字を抽出するための技術に関する。   The present invention relates to a technique for extracting characters in an image.

画像内の文字を抽出する方法には、画像の濃度ヒストグラムを作成し、その谷部分を見つけて適当なしきい値を設定し、該しきい値で画像を2値化する判別分析法や、画像を複数の領域に分割し、領域毎に上記の判別分析法を適用する方法などが知られている(たとえば、特許文献1参照。)。   A method of extracting characters in an image includes a discriminant analysis method in which a density histogram of an image is created, a valley portion is found and an appropriate threshold value is set, and the image is binarized with the threshold value. Is divided into a plurality of regions, and a method of applying the above discriminant analysis method for each region is known (see, for example, Patent Document 1).

特開平09−259220号公報JP 09-259220 A

解像度を高くして車のナンバープレートを屋外で撮影した画像から文字を抽出するような場合には、ナンバープレートを保持する枠やバンパーなどの周辺環境の影響を受けて、ナンバープレート内の一部の領域に影やコントラスト差が発生することがあり、特に、車の後部にあるナンバープレートにおいて発生し易い。   When characters are extracted from an image of a car license plate taken outdoors with high resolution, a part of the license plate is affected by the surrounding environment such as the frame holding the license plate and the bumper. Shadows and contrast differences may occur in this area, and this is particularly likely to occur in the license plate at the rear of the car.

図12(a)に示すように、影のない画像(以後、この画像を標準画像と呼ぶ。)については、図12(b)のように従来の判別分析法で画像を2値化することによって文字を抽出可能であるが、図13(a)のように、文字の途中に影と日向の境界が存在するような画像(以後、この画像を影あり画像と呼ぶ。)の場合には、判別分析法による2値化処理では、図13(b)のように、文字を上手く抽出することができなかった。また、ナンバープレートにおいては自家用と事業用とで文字と背景との明暗が逆転しているので、文字抽出を適切に行なうためには自家用と事業用とを判別することも重要になる。   As shown in FIG. 12A, for an image without a shadow (hereinafter, this image is referred to as a standard image), the image is binarized by a conventional discriminant analysis method as shown in FIG. 12B. In the case of an image in which a boundary between the shadow and the sun exists in the middle of the character as shown in FIG. 13A (hereinafter, this image is referred to as an image with a shadow). In the binarization processing by the discriminant analysis method, characters cannot be extracted well as shown in FIG. In addition, in the license plate, the contrast between the character and the background is reversed for private use and business use. Therefore, it is important to distinguish between private use and business use in order to perform character extraction appropriately.

本発明は、上記の問題を解決しようとするものであり、影などの影響を受けることなく画像内の文字を抽出することのできる文字抽出方法、文字抽出装置およびプログラムを提供することを目的としている。   An object of the present invention is to provide a character extraction method, a character extraction device, and a program capable of extracting characters in an image without being affected by a shadow or the like. Yes.

また、文字と背景との明暗の逆転に影響されずに文字を抽出することのできる文字抽出方法、文字抽出装置、文字色判定方法、文字色判定装置およびプログラムを提供することを目的としている。   It is another object of the present invention to provide a character extraction method, a character extraction device, a character color determination method, a character color determination device, and a program that can extract characters without being affected by the reversal of brightness and darkness between the characters and the background.

上記の目的は以下に示す各項の発明により達成される。   The above object can be achieved by the inventions of the following items.

(1)画像内から文字を抽出する文字抽出方法において、
元画像に対してエッジ抽出処理を施すステップと、
前記エッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を有する
ことを特徴とする文字抽出方法。
(1) In a character extraction method for extracting characters from an image,
Performing edge extraction processing on the original image;
Performing a first labeling process for dividing the image for each continuous region on the image after the edge extraction process;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure And a character extracting method comprising the steps of:

上記発明では、元画像にエッジ抽出処理を施し、抽出した輪郭線で区切られた連続領域毎にラベリングする。仮に文字の途中に影と日向との境界があれば、文字を構成する連続領域が該境界により複数の領域に分割される。そこで、小さい領域は文字の一部である可能性があるので残し、文字として扱うべき上限サイズより大きな領域を消去する。この状態では「8」や「口」などの文字を構成する線の内側にも領域が残っているので、画像を膨張収縮して内側の領域を文字の線と連結させた画像を作成し、膨張収縮前の画像と対比し、膨張収縮前は独立した領域であったが膨張収縮後は内側に連結されてしまった領域を見出し、該領域を膨張収縮前の画像から削除する。これにより、「8」や「口」などの内側に残っていた領域が削除され、残った領域は文字として抽出された領域になる。   In the above invention, the original image is subjected to edge extraction processing, and is labeled for each continuous region divided by the extracted contour line. If there is a boundary between the shadow and the sun in the middle of the character, the continuous area constituting the character is divided into a plurality of areas by the boundary. Therefore, there is a possibility that the small area may be a part of the character, so that the area larger than the upper limit size to be handled as the character is deleted. In this state, since the area remains inside the line that constitutes the character such as “8” and “mouth”, the image is expanded and contracted to create an image in which the inner area is connected to the character line, In contrast to the image before expansion and contraction, an area that is an independent area before expansion and contraction but is connected to the inside after expansion and contraction is found, and the area is deleted from the image before expansion and contraction. As a result, the remaining areas such as “8” and “mouth” are deleted, and the remaining areas are extracted as characters.

(2)前記エッジ抽出処理は、輪郭線が文字の輪郭の外側に出るように施す
ことを特徴とする(1)に記載の文字抽出方法。
(2) The character extraction method according to (1), wherein the edge extraction process is performed so that a contour line is outside a contour of a character.

上記発明では、輪郭線が文字の輪郭の外側に出るようにエッジ抽出処理が施される。これにより、文字を構成する線が細くなったり、かすれたりすることが防止される。   In the above invention, the edge extraction processing is performed so that the contour line is outside the contour of the character. Thereby, it is prevented that the line which comprises a character becomes thin or faded.

(3)画像内から文字を抽出する文字抽出方法において、
元画像に第1のエッジ抽出処理を施した画像を生成するステップと、
前記第1のエッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定の結果に応じて選択するステップと、
前記選択された処理方法で前記元画像に対して前記第2のエッジ抽出処理を施すステップと、
前記第2のエッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を有する
ことを特徴とする文字抽出方法。
(3) In a character extraction method for extracting characters from an image,
Generating an image obtained by performing a first edge extraction process on the original image;
The original image before the first edge extraction processing is performed using the luminance of the inner region and the luminance of the outer region of any contour line surrounding the region of a character size extracted by the first edge extraction processing. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determining step;
A processing method in the second edge extraction process is selected according to the result of the determination so that the outline comes out of the outline of the character when the second edge extraction process is performed on the original image. Steps,
Performing the second edge extraction process on the original image with the selected processing method;
Subjecting the image after the second edge extraction processing to a first labeling process for dividing the image into continuous regions;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure And a character extracting method comprising the steps of:

上記発明では、第1のエッジ抽出処理により、輪郭線を描き出し、閉じた輪郭線の内外の輝度を比較することで、白地に黒文字が存在する画像か、黒地に白文字が存在する画像かを判定する。内外の輝度を比較する際の境界となる閉じた輪郭線は、該輪郭線で囲まれた閉領域が文字の一部であろうと推定される大きさや位置にあるものを選出する。判定結果から、白地に黒文字の場合は黒領域の外側に輪郭線が出るように第2のエッジ抽出処理を施し、黒地に白文字の場合は白領域の外側に輪郭線が出るように第2のエッジ抽出処理を施す。これにより、白地に黒文字と黒地に白文字のいずれであっても、文字領域が細ることなくエッジ抽出される。   In the above invention, the first edge extraction process draws a contour line and compares the brightness of the inside and outside of the closed contour line to determine whether the image has a black character on a white background or an image having a white character on a black background. judge. A closed contour line that becomes a boundary when comparing the internal and external luminances is selected so that the closed region surrounded by the contour line is estimated to be a part of the character. From the determination result, the second edge extraction process is performed so that the outline appears outside the black area when the black character is on the white background, and the second edge is drawn so that the outline appears outside the white area when the white character is on the black background. The edge extraction process is performed. As a result, the edge is extracted without thinning the character region regardless of whether the character is a black character on a white background or a white character on a black background.

その後、第2のエッジ抽出処理で抽出した輪郭線で区切られた連続領域毎にラベリングし、その中で、文字として扱うべき上限サイズより大きな領域を消去する。さらに、膨張処理、収縮処理を施して内側の領域を連結された画像を作成し、膨張収縮前の画像と対比し、膨張収縮前は独立した領域であったが膨張収縮後は内側に連結されてしまった領域を見出し、該領域を膨張収縮前の画像から削除する。これにより、「8」や「口」などの内側に残っていた領域が削除され、残った領域は文字として抽出された領域になる。   After that, labeling is performed for each continuous area divided by the contour extracted by the second edge extraction process, and an area larger than the upper limit size to be treated as a character is erased. Furthermore, an image in which the inner area is connected by performing expansion processing and contraction processing is created, and compared with the image before expansion / contraction, it was an independent area before expansion / contraction, but it is connected inside after expansion / contraction. An area that has been lost is found, and the area is deleted from the image before expansion and contraction. As a result, the remaining areas such as “8” and “mouth” are deleted, and the remaining areas are extracted as characters.

(4)白地に黒文字が存するか黒地に白文字が存するかを判定する文字色判定方法において、
元画像に対してエッジ抽出処理を施した画像を生成するステップと、
前記エッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと
を有する
ことを特徴とする文字色判定方法。
(4) In a character color determination method for determining whether a black character exists on a white background or a white character exists on a black background,
Generating an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the character-sized area extracted by the edge extraction process are compared in the original image before the edge extraction process, and the outer Determining that a black character exists on a white background when the luminance of the region is higher than the luminance of the inner region, and determining that a white character exists on the black background when the luminance of the inner region is higher than the luminance of the outer region. A character color determination method characterized by the above.

上記発明では、エッジ抽出処理により、輪郭線を描き出し、閉じた輪郭線の内外の輝度を比較することで、白地に黒文字が存在する画像か、黒地に白文字が存在する画像かを判定する。内外の輝度を比較する際の境界となる閉じた輪郭線は、該輪郭線で囲まれた閉領域が文字の一部であろうと推定される大きさや位置にあるものを選出する。   In the above-described invention, an outline is drawn by edge extraction processing, and the brightness inside and outside the closed outline is compared to determine whether the image has a black character on a white background or an image having a white character on a black background. A closed contour line that becomes a boundary when comparing the internal and external luminances is selected so that the closed region surrounded by the contour line is estimated to be a part of the character.

(5)画像内から文字を抽出する文字抽出装置において、
元画像に対してエッジ抽出処理を施すエッジ抽出部と、
前記エッジ抽出部でエッジ抽出処理を施した後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施す第1のラベリング部と、
前記第1のラベリング部でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去する領域絞込み部と、
前記領域絞込み部による消去後の画像に対して膨張処理を施した画像を生成する膨張処理部と、
前記膨張処理部で膨張処理を施した後の画像に対して収縮処理を施す収縮処理部と、
前記収縮処理部で収縮処理を施した後の画像に対して第2のラベリング処理を施す第2のラベリング部と、
前記領域絞込み部による消去後の画像に残っているラベリングされた各領域の中で、前記第2のラベリング部でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除する削除部と
を有する
ことを特徴とする文字抽出装置。
(5) In a character extraction device that extracts characters from an image,
An edge extraction unit that performs edge extraction processing on the original image;
A first labeling unit that performs a first labeling process that divides the image for each continuous region with respect to the image after performing the edge extraction process in the edge extraction unit;
A region narrowing unit for erasing a region larger than the upper limit size as a predetermined character in each continuous region labeled by the first labeling unit;
An expansion processing unit that generates an image obtained by performing expansion processing on the image after erasure by the region narrowing unit;
A contraction processing unit that performs contraction processing on the image after the expansion processing is performed by the expansion processing unit;
A second labeling unit that performs a second labeling process on the image after the contraction process is performed by the contraction processing unit;
Among the labeled regions remaining in the image after erasure by the region narrowing unit, a region included inside the region labeled by the second labeling unit is detected, and the detected region is And a deletion unit for deleting from the image after erasure.

(6)前記エッジ抽出部は、輪郭線が文字の輪郭の外側に出るように前記エッジ抽出処理を施す
ことを特徴とする(5)に記載の文字抽出装置。
(6) The character extraction device according to (5), wherein the edge extraction unit performs the edge extraction processing so that a contour line is outside a contour of a character.

(7)画像内から文字を抽出する文字抽出装置において、
元画像に対して第1のエッジ抽出処理を施した画像を生成する第1のエッジ抽出部と、
前記第1のエッジ抽出部によって抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定する判定部と、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定部での判定結果に応じて選択する選択部と、
前記選択部で選択した処理方法で前記元画像に対して前記第2のエッジ抽出処理を施す第2のエッジ抽出部と、
前記第2のエッジ抽出部で前記第2のエッジ抽出処理を施した後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施す第1のラベリング部と、
前記第1のラベリング部でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去する領域絞込み部と、
前記領域絞込み部による消去後の画像に対して膨張処理を施した画像を生成する膨張処理部と、
前記膨張処理部で膨張処理を施した後の画像に対して収縮処理を施す収縮処理部と、
前記収縮処理部で収縮処理を施した後の画像に対して第2のラベリング処理を施す第2のラベリング部と、
前記領域絞込み部による消去後の画像に残っているラベリングされた各領域の中で、前記第2のラベリング部でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除する削除部と
を有する
ことを特徴とする文字抽出装置。
(7) In a character extraction device that extracts characters from an image,
A first edge extraction unit that generates an image obtained by performing a first edge extraction process on an original image;
The original image before the first edge extraction processing is performed on the brightness of the inner area and the brightness of the outer area of any one of the outlines surrounding the character-sized area extracted by the first edge extraction unit. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determination unit for determining;
The processing method in the second edge extraction process is set according to the determination result in the determination unit so that the contour line appears outside the outline of the character when the second edge extraction process is performed on the original image. Selecting part to select,
A second edge extraction unit that performs the second edge extraction process on the original image by the processing method selected by the selection unit;
A first labeling unit that performs a first labeling process that divides the image for each continuous region with respect to the image after the second edge extraction unit performs the second edge extraction process;
A region narrowing unit for erasing a region larger than the upper limit size as a predetermined character in each continuous region labeled by the first labeling unit;
An expansion processing unit that generates an image obtained by performing expansion processing on the image after erasure by the area narrowing unit;
A contraction processing unit that performs contraction processing on the image after the expansion processing is performed by the expansion processing unit;
A second labeling unit that performs a second labeling process on the image after the contraction process is performed by the contraction processing unit;
Among the labeled regions remaining in the image after erasure by the region narrowing unit, a region included inside the region labeled by the second labeling unit is detected, and the detected region is And a deletion unit that deletes the deleted image from the deleted image.

(8)白地に黒文字が存するか黒地に白文字が存するかを判定する文字色判定装置において、
元画像にエッジ抽出処理を施した画像を生成するエッジ抽出部と、
前記エッジ抽出部によって抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定する判定部と
を有する
ことを特徴とする文字色判定装置。
(9)画像内から文字を抽出するためのプログラムであって、
コンピュータに、
元画像に対してエッジ抽出処理を施すステップと、
前記エッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を実行させるためのプログラム。
(8) In a character color determination apparatus for determining whether black characters exist on a white background or white characters exist on a black background,
An edge extraction unit that generates an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the area of the character size extracted by the edge extraction unit is compared in the original image before the edge extraction processing, and the outer A determination unit that determines that a black character exists on a white background when the luminance of the region is higher than the luminance of the inner region, and determines that a white character exists on a black background when the luminance of the inner region is higher than the luminance of the outer region; A character color determination device characterized by comprising:
(9) A program for extracting characters from an image,
On the computer,
Performing edge extraction processing on the original image;
Performing a first labeling process for dividing the image for each continuous region on the image after the edge extraction process;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure A program for executing the steps to be executed.

(10)前記エッジ抽出処理は、輪郭線が文字の輪郭の外側に出るように施す
ことを特徴とする(9)に記載のプログラム。
(10) The program according to (9), wherein the edge extraction processing is performed so that a contour line appears outside a contour of a character.

(11)画像内から文字を抽出するためのプログラムであって、
コンピュータに、
元画像に対して第1のエッジ抽出処理を施した画像を生成するステップと、
前記第1のエッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定の結果に応じて選択するステップと、
前記選択された処理方法で前記元画像に対して前記第2のエッジ抽出処理を施すステップと、
前記第2のエッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を実行させるためのプログラム。
(11) A program for extracting characters from an image,
On the computer,
Generating an image obtained by performing a first edge extraction process on the original image;
The original image before the first edge extraction processing is performed using the luminance of the inner region and the luminance of the outer region of any contour line surrounding the region of a character size extracted by the first edge extraction processing. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determining step;
A processing method in the second edge extraction process is selected according to the result of the determination so that the outline comes out of the outline of the character when the second edge extraction process is performed on the original image. Steps,
Performing the second edge extraction process on the original image with the selected processing method;
Subjecting the image after the second edge extraction processing to a first labeling process for dividing the image into continuous regions;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure. A program for executing the steps to be executed.

(12)白地に黒文字が存するか黒地に白文字が存するかを判定するためのプログラムであって、
コンピュータに、
元画像に対してエッジ抽出処理を施した画像を生成するステップと、
前記エッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと
を実行させるためのプログラム。
(12) A program for determining whether a black character exists on a white background or a white character exists on a black background,
On the computer,
Generating an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the character-sized area extracted by the edge extraction process are compared in the original image before the edge extraction process, and the outer When the brightness of the area is higher than the brightness of the inner area, it is determined that a black character exists on a white background, and when the brightness of the inner area is higher than the brightness of the outer area, a step of determining that a white character exists on the black background is executed. Program to let you.

本発明に係わる文字抽出方法、文字抽出装置および文字抽出のプログラムによれば、影などの影響を受けることなく、画像内の文字を抽出することができる。   According to the character extraction method, the character extraction device, and the character extraction program according to the present invention, characters in an image can be extracted without being affected by a shadow or the like.

特に、白地に黒文字の画像であるか黒地に白文字の画像かを判定し、該判定結果に応じた処理を施すので、文字と背景との明暗の逆転に影響されることなく文字を抽出できる。   In particular, since it is determined whether the image is a black character on a white background or a white character image on a black background, and processing is performed according to the determination result, the character can be extracted without being affected by the reversal of light and dark between the character and the background. .

また、エッジ抽出処理で得た輪郭線の中で文字らしいサイズの領域を囲むいずれかの輪郭線を特定し、該輪郭線の内外で輝度を対比し、その対比結果に基づいて白地に黒文字の画像であるか黒地に白文字の画像かを判定するものでは、影などの影響を受けることなく、簡単な処理で、白地に黒文字か黒地に白文字かを判定することができる。   Also, one of the outlines surrounding the area of character size is specified in the outline obtained by the edge extraction process, the brightness is compared inside and outside the outline, and the black character is displayed on the white background based on the comparison result. In the case of determining whether the image is an image or a white character image on a black background, it is possible to determine whether the character is a black character on a white background or a white character on a black background with a simple process without being affected by a shadow or the like.

以下、図面に基づき本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本実施の形態に係わる文字抽出装置10の構成を示している。文字抽出装置10は、判別分析法を用いて画像全体を1つのしきい値で2値化するのではなく、文字のエッジ情報を用いて文字領域か否かを判断することで文字抽出を行うようになっている。文字抽出装置10は、画像入力部11と、画像記憶部12と、表示操作部13と、処理部20とから構成される。   FIG. 1 shows a configuration of a character extraction apparatus 10 according to the present embodiment. The character extraction device 10 does not binarize the entire image with one threshold value using the discriminant analysis method, but performs character extraction by determining whether or not it is a character region using character edge information. It is like that. The character extraction device 10 includes an image input unit 11, an image storage unit 12, a display operation unit 13, and a processing unit 20.

画像入力部11は、文字抽出の対象となる元画像を文字抽出装置10に入力する機能を果たす。画像入力部11は、デジタルカメラやスキャナなどでもよいし、デジタルカメラなどで撮影した画像の画像データを通信ケーブルやメモリカードを介して入力するものであってもよい。   The image input unit 11 has a function of inputting an original image that is a character extraction target to the character extraction device 10. The image input unit 11 may be a digital camera, a scanner, or the like, or may input image data of an image taken with a digital camera or the like via a communication cable or a memory card.

画像記憶部12は、画像入力部11から入力された画像データや処理中・処理後の画像データを記憶するためのメモリである。   The image storage unit 12 is a memory for storing the image data input from the image input unit 11 and the image data being processed and processed.

処理部20は、CPU(Central Processing Unit)を主要部として構成され、各種の画像処理を実行したり文字抽出装置10全体の動作を制御したりする機能を果たす。表示操作部13は、ユーザインターフェース機能を果たし、処理対象の画像や操作画面などを表示するための液晶ディスプレイ、ユーザから各種の操作を受け付けるための操作スイッチなどで構成される。   The processing unit 20 includes a central processing unit (CPU) as a main part, and performs functions of executing various image processing and controlling the operation of the entire character extraction device 10. The display operation unit 13 performs a user interface function, and includes a liquid crystal display for displaying a processing target image, an operation screen, and the like, an operation switch for receiving various operations from the user, and the like.

処理部20は、文字抽出に関して、平滑化部21と、第1のエッジ抽出部22と、判定部23と、選択部24と、第2のエッジ抽出部25と、第1のラベリング部26と、領域絞込み部27と、膨張処理部28と、収縮処理部29と、第2のラベリング部31と、削除部32としての機能を果たす。   Regarding the character extraction, the processing unit 20 includes a smoothing unit 21, a first edge extraction unit 22, a determination unit 23, a selection unit 24, a second edge extraction unit 25, and a first labeling unit 26. The region narrowing unit 27, the expansion processing unit 28, the contraction processing unit 29, the second labeling unit 31, and the deletion unit 32 are provided.

平滑化部21は、画像を平滑化する。第1のエッジ抽出部22は、この平滑化画像に対して第1のエッジ抽出処理を施した画像を生成する。第1のエッジ抽出部22は平滑化画像(元画像)自体は壊さないように処理される。判定部23は、第1のエッジ抽出部22でエッジ抽出処理を施した画像を解析して、白地に黒文字が存する画像か黒地に白文字が存する画像かを判定する。選択部24は、この判定結果に応じて第2のエッジ抽出部25が行なう第2のエッジ抽出処理の処理方法を選択する。詳細には、輪郭線(エッジ)が文字の輪郭の外側に出るように第2のエッジ抽出処理における処理方法を判定部23での判定結果に応じて選択する。   The smoothing unit 21 smoothes the image. The 1st edge extraction part 22 produces | generates the image which performed the 1st edge extraction process with respect to this smoothed image. The first edge extraction unit 22 is processed so as not to break the smoothed image (original image) itself. The determination unit 23 analyzes the image subjected to the edge extraction processing by the first edge extraction unit 22 to determine whether the image has a black character on a white background or an image having a white character on a black background. The selection unit 24 selects a processing method of the second edge extraction process performed by the second edge extraction unit 25 according to the determination result. Specifically, the processing method in the second edge extraction process is selected according to the determination result in the determination unit 23 so that the contour line (edge) comes out of the contour of the character.

第2のエッジ抽出部25は、選択部24で選択された処理方法により、元画像(平滑化画像)に対して第2のエッジ抽出処理を施す。第1のラベリング部26は、第2のエッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施す。領域絞込み部27は、第1のラベリング部26によってラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去する。膨張処理部28は、領域絞込み部27による消去後の画像に対して膨張処理を施し、収縮処理部29は膨張処理後の画像に対して収縮処理を施す。第2のラベリング部31は、収縮処理後の画像に対して第2のラベリング処理を施す。削除部32は、領域絞込み部27による消去後の画像に残っているラベリングされた各領域の中で、第2のラベリング部31でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を、領域絞込み部27による消去後の画像からさらに削除する。削除後に残った領域が文字として抽出された領域になる。   The second edge extraction unit 25 performs a second edge extraction process on the original image (smoothed image) by the processing method selected by the selection unit 24. The first labeling unit 26 performs a first labeling process for dividing the image for each continuous region on the image after the second edge extraction process. The area narrowing unit 27 erases an area larger than the upper limit size as a predetermined character in each continuous area labeled by the first labeling unit 26. The expansion processing unit 28 performs expansion processing on the image after being erased by the area narrowing unit 27, and the contraction processing unit 29 performs contraction processing on the image after expansion processing. The second labeling unit 31 performs a second labeling process on the image after the contraction process. The deletion unit 32 detects a region included inside the region labeled by the second labeling unit 31 among the labeled regions remaining in the image after deletion by the region narrowing unit 27, and The detected area is further deleted from the image after being erased by the area narrowing unit 27. The area remaining after deletion becomes the area extracted as a character.

図2は、文字抽出装置10が、解像度を高くして車のナンバープレートを撮影した画像を対象にして文字抽出し、文字認識するまでの動作全体の流れを示している。なお、文字抽出とは、画像中から文字とその他の部分とを分離することで、本実施の形態では、文字を白画素に、その他を黒画素にした画像を作成することを指す。   FIG. 2 shows the flow of the entire operation from when the character extraction device 10 extracts characters for an image obtained by shooting a car license plate with a high resolution and recognizes the characters. Note that character extraction refers to creating an image in which characters are white pixels and others are black pixels by separating the characters and other parts from the image.

まず、自家用・事業用判定処理でナンバープレートが自家用(白地に黒(実際は緑)文字)か事業用(黒(実際は緑)地に白文字)かを判定する(ステップS101)。この判定結果に基づき、文字が白色となって抽出されるように文字抽出処理を行なう(ステップS102)。抽出した文字の位置を基準にして画像内からナンバープレートの位置を特定して(ステップS103)ナンバープレート領域を切り出し(ステップS104)、切り出したナンバープレート領域を対象に、再度、文字抽出処理を行ない(ステップS105)、該文字抽出された画像から文字認識して(ステップS106)処理を終了する(エンド)。   First, it is determined whether the license plate is for private use (black (actually green) on a white background) or business (black (actually green) on white)) in the private / business judgment processing (step S101). Based on the determination result, a character extraction process is performed so that the characters are extracted in white (step S102). The position of the license plate is specified from the image based on the extracted character position (step S103), and the license plate area is cut out (step S104), and the character extraction process is performed again on the cut out license plate area. (Step S105) Characters are recognized from the extracted character image (Step S106), and the process is terminated (End).

本処理では、当初は解像度を半分にして画像処理を高速に行なうようにし、ナンバープレート領域が画像内で小さい場合には、元の解像度でナンバープレート領域を切り出し、該切り出した領域に対して、再度、文字抽出処理を行なうことで、1文字を構成する画素数が少なくなって、文字抽出や文字認識の精度が低下することを防止している。   In this processing, initially, the resolution is halved and image processing is performed at high speed. When the license plate area is small in the image, the license plate area is cut out at the original resolution, By performing the character extraction process again, the number of pixels constituting one character is reduced and the accuracy of character extraction and character recognition is prevented from being lowered.

なお、ナンバープレートを画面いっぱいに撮影していることが明らかな場合など、ナンバープレート部を切り出す必要がない場合には、ナンバー位置特定処理(ステップS103)、ナンバー切り出し処理(ステップS104)および再度の文字抽出処理(ステップS105)は不要となる。   When it is clear that the license plate has been photographed on the entire screen, when it is not necessary to cut out the license plate portion, the number position specifying process (step S103), the number cutting process (step S104), and the The character extraction process (step S105) becomes unnecessary.

図3は、自家用・事業用判定処理(色判定処理)の流れを示している。まず、平滑化部21で対象画像を平滑化して局所的なノイズを削除した平滑化画像(元画像とする)を作成し(ステップS201)、該平滑化画像に対して第1のエッジ抽出部22で第1のエッジ抽出処理を行なってエッジ抽出画像を生成する(ステップS202)。第1のエッジ抽出処理はどのような手法でもかまわないが、ここでは、図12(a)に示すように、ナンバープレートが画像の中心に比較的大きく撮影されることを前提として、平滑化画像の中心部を対象に第1のエッジ抽出処理を施す。また、注目画素を中心とした3×3領域の中で最小の輝度値と最大の輝度値との差分を求め、該差分が固定のしきい値以上の場合に、注目画素を輪郭線となる画素(ここでは白画素)にする2値化手法、すなわち、3×3領域のmin-max差分処理を固定しきい値で2値化する手法を用いている。   FIG. 3 shows the flow of the private / business determination process (color determination process). First, the smoothing unit 21 smoothes the target image to create a smoothed image (original image) from which local noise has been deleted (step S201), and a first edge extracting unit is applied to the smoothed image. The first edge extraction process is performed at 22 to generate an edge extraction image (step S202). The first edge extraction process may be any method, but here, as shown in FIG. 12A, the smoothed image is assumed on the assumption that the license plate is photographed relatively large at the center of the image. The first edge extraction process is performed on the center of the target. Also, the difference between the minimum luminance value and the maximum luminance value in the 3 × 3 region centered on the pixel of interest is obtained, and when the difference is equal to or greater than a fixed threshold value, the pixel of interest becomes an outline. A binarization method using pixels (here, white pixels), that is, a method of binarizing 3 × 3 area min-max difference processing with a fixed threshold is used.

図4(a)は、上記ステップS201、S202の処理を図12(a)の標準画像に施した結果であり、図4(b)は、図13(a)の影あり画像に上記処理を施した結果である。エッジ(輪郭線)部分は白画素、その他は黒画素になっている。   FIG. 4A shows the result of applying the processes of steps S201 and S202 to the standard image of FIG. 12A, and FIG. 4B shows the process for the shadowed image of FIG. This is the result. Edge (contour) portions are white pixels, and others are black pixels.

判定部23は、このエッジ抽出画像内での画素の連続性を検査して連続領域毎に画像を区分けするラベリング処理を行ない、これらラベリングされた連続領域の中で文字らしい大きさのものを1つ特定する(ステップS203)。たとえば、ナンバープレートが画像の中心に比較的大きく撮影されるという条件において撮影画像に現れる標準的な文字サイズを予め規定しておき、輪郭線で囲まれた連続領域の大きさが該文字サイズに最も近いものを、文字らしい連続領域に特定する。   The determination unit 23 performs a labeling process for examining the continuity of the pixels in the edge extracted image and dividing the image for each continuous region. Among the labeled continuous regions, the one having a character-like size is selected. Are identified (step S203). For example, a standard character size that appears in a photographed image under the condition that a license plate is photographed relatively large in the center of the image is defined in advance, and the size of a continuous area surrounded by a contour line is the character size. The closest one is specified as a continuous area that seems to be a character.

判定部23は、特定した連続領域を囲む輪郭線の内側領域の輝度値と外側領域の輝度値とを、第1のエッジ抽出処理を施す前の平滑化画像において対比し(ステップS204)、外側領域の輝度値が内側領域の輝度値より高いときは(ステップS205;Y)、自家用(白地に黒文字が存する)と判定し(ステップS206)、内側領域の輝度値が外側領域の輝度値より高いときは(ステップS205;N)、事業用(黒地に白文字が存する)と判定して(ステップS207)処理を終了する(エンド)。内外の輝度値の比較においては、数画素の平均を用いると精度が向上する。   The determination unit 23 compares the luminance value of the inner area of the contour line surrounding the identified continuous area with the luminance value of the outer area in the smoothed image before the first edge extraction process (step S204), and When the luminance value of the area is higher than the luminance value of the inner area (step S205; Y), it is determined that the area is for personal use (black characters exist on a white background) (step S206), and the luminance value of the inner area is higher than the luminance value of the outer area. If so (step S205; N), it is determined that it is for business use (white characters are present on a black background) (step S207), and the processing is ended (END). In the comparison of the inner and outer luminance values, accuracy is improved by using an average of several pixels.

図4のエッジ抽出画像を見ると、自家用・事業用の判定を行なわずに、該画像から直接文字抽出できそうであるが、該画像の輪郭線は、実際の文字の輪郭の内外に股がるように抽出されているので、この輪郭線をそのまま使用し、その内側を文字領域として抽出すると、文字領域(文字の線)が細くなったり、かすれたりしてしまう。また、輪郭線を含めて文字領域とすると、近接する他の領域が連結するなどの影響が現れてしまう。   Looking at the edge-extracted image in FIG. 4, it seems that characters can be directly extracted from the image without making a private / business decision, but the outline of the image has a crotch in and out of the actual character outline. If the contour line is used as it is and the inside is extracted as a character area, the character area (character line) becomes thin or blurred. In addition, if a character region including a contour line is used, an influence such as connection of other adjacent regions appears.

そこで、本実施の形態では、エッジ抽出処理で抽出される輪郭線が文字の輪郭の外側に必ず出るように、自家用・事業用判定処理の判定結果に基づいてエッジ抽出処理の処理方法を選択し、該選択した処理方法でエッジ抽出処理をやり直すようになっている。輪郭線が輪郭の外側に出るようにしてエッジ抽出処理を施し、該輪郭線の内側を文字領域とすれば、細くなったり、太くなったりせずに文字領域を抽出することができる。   Therefore, in the present embodiment, the processing method of the edge extraction process is selected based on the determination result of the private / business determination process so that the contour line extracted by the edge extraction process always comes out of the outline of the character. The edge extraction process is redone using the selected processing method. If the edge extraction process is performed so that the contour line goes out of the contour and the inside of the contour line is used as the character region, the character region can be extracted without being thinned or thickened.

図5は、上記エッジ抽出処理のやり直しを含む、文字抽出処理の流れを示している。平滑化部21で対象画像を平滑化して局所的なノイズを削除した平滑化画像を生成する(ステップS301)。次に、選択部24は自家用・事業用判定処理の判定結果に応じて第2のエッジ抽出処理での処理方法を選択し、第2のエッジ抽出部25は、選択部24が選択した処理方法で先の平滑化画像に対して第2のエッジ抽出処理を行なう(ステップS302からS306)。   FIG. 5 shows a flow of character extraction processing including redoing of the edge extraction processing. The smoothing unit 21 smoothes the target image to generate a smoothed image from which local noise has been deleted (step S301). Next, the selection unit 24 selects a processing method in the second edge extraction process according to the determination result of the private / business determination process, and the second edge extraction unit 25 selects the processing method selected by the selection unit 24. The second edge extraction process is performed on the previous smoothed image (steps S302 to S306).

具体的には、前処理として、平滑化画像の画素毎に、その画素を注目画素とした5×5領域内(注目画素を除く、もしくは注目画素を含んでもかまわない)での最小輝度値と最大輝度値とを調べ、これらの輝度値を注目画素の座標に関連付けて所定のデータテーブルに登録する(ステップS302)。自家用・事業用判定処理の判定結果が自家用(白地に黒文字)の場合は(ステップS303;Y)、各画素(注目画素)の輝度値とその画素に関連付けて先のデータテーブルに登録されている最小輝度値(注目画素近傍5×5領域内の最小輝度値)との差分を求め(ステップS304)、該差分が所定のしきい値以上の場合にその注目画素を黒画素(輪郭線を構成する画素)にする(ステップS306)。   Specifically, as preprocessing, for each pixel of the smoothed image, the minimum luminance value in the 5 × 5 region (not including the target pixel or including the target pixel) in which the pixel is the target pixel The maximum brightness value is checked, and these brightness values are associated with the coordinates of the target pixel and registered in a predetermined data table (step S302). If the result of the personal / business determination processing is for personal use (black characters on a white background) (step S303; Y), the brightness value of each pixel (target pixel) and the pixel are registered in the previous data table. A difference from the minimum luminance value (minimum luminance value in the 5 × 5 area near the target pixel) is obtained (step S304), and when the difference is equal to or greater than a predetermined threshold, the target pixel is a black pixel (contour line is configured). (Step S306).

一方、自家用・事業用判定処理の判定結果が事業用(黒地に白文字)の場合は(ステップS303;N)、各画素(注目画素)の輝度値とその画素に関連付けて先のデータテーブルに登録されている最大輝度値(注目画素近傍5×5領域内の最大輝度値)との差分を求め(ステップS305)、該差分が所定のしきい値以上の場合にその注目画素を黒画素(輪郭線を構成する画素)にする(ステップS306)。   On the other hand, if the determination result of the private / business determination processing is for business (white characters on a black background) (step S303; N), the brightness value of each pixel (target pixel) and the previous data table are associated with the pixel. A difference from the registered maximum luminance value (maximum luminance value in the 5 × 5 region near the target pixel) is obtained (step S305). If the difference is equal to or greater than a predetermined threshold value, the target pixel is determined as a black pixel ( Pixels constituting the contour line) (step S306).

これにより、白地に黒文字か黒字に白文字かにかかわらず、第2のエッジ抽出処理により、輪郭線が文字の輪郭の外側に出たエッジ抽出画像が取得される。なお、ここでは、注目画素近傍の5×5領域を用いることで2画素分の幅の輪郭線が得られる。図6(a)は、上記のステップS301〜S306の処理を図12(a)の標準画像に施した結果であり、図6(b)は、図13(a)の影あり画像に同様の処理を施した結果である。   As a result, regardless of whether the character is black on a white background or white on a black character, the second edge extraction process acquires an edge extracted image in which the contour line is outside the character contour. Here, a 5 × 5 region in the vicinity of the target pixel is used to obtain a contour line with a width of two pixels. FIG. 6A shows the result of applying the processes of steps S301 to S306 to the standard image of FIG. 12A, and FIG. 6B is the same as the shadowed image of FIG. This is the result of processing.

次に、領域絞込み部27は、上記処理で得たエッジ抽出画像に対して、輪郭線以外の部分について画素の連続性を検査し、画像を連続領域毎に区分けするラベリング処理(第1のラベリング処理)を行なう。そして、各連続領域の面積、縦横の長さを基に、文字とはいえない連続領域を消去する(ステップS307)。文字の途中に影と日向との境界があると文字が***して小さい領域になるので、小さい連続領域は文字の可能性がある。そこで小さい連続領域は残しておき、予め定めた文字としての上限サイズより大きい連続領域のみを消去する。但し、明らかにノイズと呼べる極小領域は除去する。図7(a)は図6(a)の画像に、図7(b)は図6(b)の画像にそれぞれ上記の領域絞り込み処理を施した結果である。図7に示す消去後の画像では、背景が黒に、消去されずに残った連続領域が白になっている。   Next, the region narrowing unit 27 checks the continuity of the pixels in the portion other than the contour line with respect to the edge extracted image obtained by the above processing, and performs a labeling process (first labeling) for dividing the image into continuous regions. Process). Then, based on the area and vertical / horizontal length of each continuous area, a continuous area that cannot be called a character is deleted (step S307). If there is a boundary between the shadow and the sun in the middle of the character, the character will split and become a small region, so a small continuous region may be a character. Therefore, a small continuous area is left and only a continuous area larger than the upper limit size as a predetermined character is deleted. However, a minimal region that can be clearly called noise is removed. FIG. 7A shows the result of the area narrowing process performed on the image of FIG. 6A, and FIG. 7B shows the result of the above-described area narrowing process performed on the image of FIG. 6B. In the image after erasure shown in FIG. 7, the background is black, and the continuous area remaining without erasure is white.

図7に示す消去後の画像では、「0」や「6」の文字の内側に、文字以外の余計な白い領域が残っている。そこで、このような余計な白領域を削除するために、まず、膨張処理部28で画像に膨張処理を施し、さらにこの膨張処理後の画像に収縮処理部29で収縮処理を施して(ステップS308)、内側の白領域をその外側の領域に連結させた画像を生成する。そして、この画像に対して第2のラベリング部31でもう一度ラベリング処理を行なう(ステップS309)。図8(a)は図7(a)の画像に、図8(b)は図7(b)の画像にそれぞれ膨張処理および収縮処理を施した結果である。   In the image after erasure shown in FIG. 7, an extra white area other than characters remains inside the characters “0” and “6”. Therefore, in order to delete such an extra white area, first, the expansion processing unit 28 performs expansion processing on the image, and further performs contraction processing on the image after the expansion processing by the contraction processing unit 29 (step S308). ), An image in which the inner white area is connected to the outer area is generated. Then, the second labeling unit 31 performs another labeling process on this image (step S309). FIG. 8A shows the result of applying the expansion process and the contraction process to the image of FIG. 7A, and FIG. 8B shows the image of FIG. 7B.

次に、図7に示す消去後の画像に残っていた各連続領域と、膨張収縮処理後の画像に対して第2のラベリング処理を施して得た各連続領域とを比較し、消去後の画像に存する連続領域の中で第2のラベリング処理でラベリングされた連続領域の内側に包含されてしまった領域を検出し、該検出された領域を、消去後の画像(膨張処理前の画像)から削除する(ステップS310)。   Next, each continuous area remaining in the image after erasure shown in FIG. 7 is compared with each continuous area obtained by performing the second labeling process on the image after the expansion / contraction process. An area included in the continuous area labeled by the second labeling process in the continuous area existing in the image is detected, and the detected area is used as an image after erasure (an image before the expansion process). (Step S310).

ここでは、膨張収縮処理前の画像に存する各領域(処理前領域)の座標と膨張収縮処理後の画像に存する各領域(処理後領域)との座標を比較し、処理後領域の中に明らかに含まれている処理前領域を見出し、該処理前領域を膨張収縮処理前の画像から削除する。明らかに含まれるとは、たとえば、領域の外側端部より数画素分内側に含まれていることをいう。膨張収縮させると元の画像よりも1画素ぐらい太ることがあり得るので、1画素程度内側に存在するならば、削除せずに残し、たとえば、5画素位内側に存在する領域は、明らかに内側に含まれるとして削除する。   Here, the coordinates of each region (pre-processing region) existing in the image before the expansion / contraction processing are compared with the coordinates of each region (post-processing region) existing in the image after the expansion / contraction processing, and are clearly shown in the post-processing region. The pre-process area included in the image is found and the pre-process area is deleted from the image before the expansion / contraction process. “Clearly included” means, for example, being included several pixels inside the outer edge of the region. If it expands and contracts, it may be about 1 pixel thicker than the original image, so if it exists inside about 1 pixel, leave it without deleting, for example, the area inside about 5 pixels is clearly inside Delete as included in.

図9(a)は図8(a)の画像に対して、図9(b)は図8(b)の画像に対してそれぞれ、図5のステップS310の削除処理を施した結果を示している。図9の画像は、不要な領域が消去された文字抽出画像になっている。なお、文字抽出画像から直接、文字認識してもよいし、文字抽出画像からナンバープレート領域を特定して切り出し、該切り出したナンバープレート領域に対して文字抽出処理を再度施して得た画像から文字認識してもよい。   FIG. 9A shows the result of the deletion process of step S310 of FIG. 5 for the image of FIG. 8A, and FIG. 9B shows the result of the deletion process of step S310 of FIG. Yes. The image in FIG. 9 is a character extraction image from which unnecessary areas have been erased. Character recognition may be performed directly from the character extraction image, or a license plate area may be identified and cut out from the character extraction image, and characters may be extracted from the image obtained by performing character extraction processing again on the cut out license plate area. You may recognize it.

次に、上記の膨張収縮処理(ステップS307、S308)と、内側に包含された領域の削除処理(ステップS309、S310)とについて詳しく説明する。   Next, the expansion / contraction process (steps S307 and S308) and the process of deleting the area included inside (steps S309 and S310) will be described in detail.

膨張処理は、図10(a)に示すように、対象となる画素値(ここでは白)の領域を周囲へ広げる処理であり、4近傍に膨張させる場合は上下左右の隣接4画素に領域拡張し、8近傍に膨張させる場合は周囲の8画素に領域拡張する。収縮処理は、図10(b)に示すように、膨張処理と反対で、黒画素(膨張処理で対象とした画素値と反対の画素値)の領域を広げる処理である。   As shown in FIG. 10A, the expansion process is a process of expanding the region of the target pixel value (in this case, white) to the surroundings. When expanding to the vicinity of 8, the area is expanded to the surrounding 8 pixels. As shown in FIG. 10B, the contraction process is a process of expanding a black pixel (a pixel value opposite to the pixel value targeted by the expansion process) opposite to the expansion process.

図11は、膨張収縮処理により、内側領域51が外側領域52に連結される様子を示している。なお、同図は黒画素を膨張収縮するように描いてある。図11(a)は膨張処理前の画像で、外側領域52の中に、内側領域51が存在している。図11(b)は、図11(a)の画像の黒領域を4近傍で膨張させた結果を示している。膨張で増えた画像には斜線を付してある。図11(c)は図11(b)の膨張画像に4近傍の収縮処理を施した結果である。膨張処理により黒画素(図中は斜線の画素)で埋って繋がった箇所には、もはや白画素が存在しないので、収縮処理を施しても繋がったままの状態で残り、そうでないところは元の状態(大きさ)に戻る。図11(c)では、斜線を付した画素は膨張処理で増加したが収縮処理で収縮されずに残った画素を示しており、図11(a)にあった内側領域51が外側領域52に繋がって連結領域53を形成している。   FIG. 11 shows how the inner region 51 is connected to the outer region 52 by the expansion / contraction process. In the figure, black pixels are drawn so as to expand and contract. FIG. 11A is an image before the expansion process, and an inner area 51 exists in the outer area 52. FIG. 11B shows the result of expanding the black region of the image of FIG. The image increased by the expansion is hatched. FIG. 11C shows the result of performing the contraction process in the vicinity of 4 on the expanded image of FIG. Since the white pixels no longer exist at the places where the black pixels (hatched pixels in the figure) are connected by the expansion processing, the white pixels no longer exist, and remain connected even when the contraction processing is performed. Return to state (size). In FIG. 11C, the hatched pixels indicate the pixels that have been increased by the expansion process, but remain without being contracted by the contraction process, and the inner area 51 in FIG. The connection region 53 is formed by being connected.

図11(a)に示す膨張収縮前の画像の存する領域51、52と、図11(c)に示す膨張収縮処理後の画像に存する連結領域53とを対比すると、内側領域51は連結領域53の外側端部から見て充分内側に包含されている。そのため、削除処理により、内側領域51は膨張収縮前の画像から消去される。   Comparing the areas 51 and 52 where the image before expansion / contraction shown in FIG. 11A exists with the connection area 53 shown in the image after expansion / contraction processing shown in FIG. 11C, the inner area 51 is connected to the connection area 53. It is contained sufficiently inside as viewed from the outer end of the. Therefore, the inner region 51 is erased from the image before expansion / contraction by the deletion process.

たとえば、図7(a)の文字「0」には、内側に孤立した白領域が存在するが、図8(a)の膨張収縮処理後の画像では、内側に孤立していた白領域が文字「0」を構成していた外側領域と繋がっている。また、図7(b)の影あり画像については、文字「0」およびその内側にあった白領域がそれぞれ影と日向との境界線により上下に分断されているが、図8(b)の膨張収縮処理後の画像では、内側に孤立していた白領域が文字「0」を構成していた外側領域と繋がって連結されている。   For example, the character “0” in FIG. 7A has an isolated white area inside, but in the image after the expansion / contraction process in FIG. 8A, the white area isolated inside is the character. It is connected to the outer area constituting “0”. In the shadowed image in FIG. 7B, the character “0” and the white area inside the character “0” are divided vertically by the boundary line between the shadow and the sun, respectively. In the image after the expansion / contraction process, the white area isolated on the inner side is connected and connected to the outer area forming the character “0”.

このように膨張収縮処理により外側領域に連結されてしまった内側領域を、膨張収縮前の画像から削除すると、図9(b)に示すように、文字の内側にある孤立した領域を、影が存在していても消去することができ、影の影響を受けず文字領域を抽出することができる。   When the inner region that has been connected to the outer region by the expansion / contraction process is deleted from the image before the expansion / contraction, as shown in FIG. 9B, an isolated region inside the character is shadowed. Even if it exists, it can be erased, and the character area can be extracted without being affected by the shadow.

なお、「0」などの文字自体が影と日向との境界により途切れていなければ、閉領域の内側に孤立して存在する領域を検出して消去するという処理により文字「0」の内側にある白領域を消去することができる。しかし、図7(b)のように影と日向との境界で文字「0」が途切れている場合には閉領域にならないので、上記の手法では内側の白領域を消去できない。これに対し、本発明では、膨張収縮処理を施し、該処理により連結されて内側に包含されてしまった領域を削除するという方法を採るので、影の境界で文字が途切れている場合でも内側の余計な領域を上手く削除することができる。   If the character itself such as “0” is not interrupted by the boundary between the shadow and the sun, it is inside the character “0” by the process of detecting and erasing an area that is isolated inside the closed area. The white area can be erased. However, as shown in FIG. 7B, when the character “0” is interrupted at the boundary between the shadow and the sun, the closed area is not formed, so that the inner white area cannot be erased by the above method. On the other hand, in the present invention, a method of performing expansion / contraction processing and deleting regions that are connected by the processing and included in the inner side is adopted. The extra area can be deleted successfully.

なお、図9(b)に示すように文字抽出後の画像にも影の境界が出て、たとえば「0」の文字が上下に途切れているが、この画像に対してさらに膨張収縮処理を施したり、この画像から文字領域を判断し、細い線状の途切れを連結させたりするなどの処理を施せば、一つの領域にすることができる。   Note that, as shown in FIG. 9B, a shadow boundary also appears in the image after character extraction, for example, the character “0” is broken up and down, but this image is further expanded and contracted. If a character area is determined from this image and processing such as connecting thin line breaks is performed, it can be made into one area.

以上、本発明の実施の形態を図面によって説明してきたが、具体的な構成は実施の形態に示したものに限られるものではなく、本発明の要旨を逸脱しない範囲における変更や追加があっても本発明に含まれる。   The embodiment of the present invention has been described with reference to the drawings. However, the specific configuration is not limited to that shown in the embodiment, and there are changes and additions within the scope of the present invention. Are also included in the present invention.

本実施の形態では文字抽出装置10を専用の装置として構成したが、本発明は、汎用のコンピュータ装置や携帯型端末装置を文字抽出装置10として機能させるためのプログラムとして構成されてもよい。   Although the character extraction device 10 is configured as a dedicated device in the present embodiment, the present invention may be configured as a program for causing a general-purpose computer device or a portable terminal device to function as the character extraction device 10.

また、実施の形態では、車のナンバープレートから文字を抽出する場合を例に説明したが、本発明はこれに限定されるものではない。また、対象画像が、白地に黒文字であるか黒地に白文字であるかのいずれか一方に固定されている場合や、外部から白地に黒文字の画像か黒地に白文字の画像かを示す情報が提供される場合には、白地に黒文字か黒地に白文字かの判定処理は省略してもよい。   Moreover, although embodiment demonstrated the case where the character was extracted from the license plate of a car as an example, this invention is not limited to this. In addition, when the target image is fixed to either a black character on a white background or a white character on a black background, information indicating whether the target image is a black character image on a white background or a white character image on a black background from the outside. If provided, the determination process of whether the white character is black or the black character may be omitted.

本実施の形態では、撮影条件により、画像内の文字がある程度のサイズになっていることを前提にし、予め定めた文字としての上限サイズ以上の大きさをもつ領域を絞り込み処理(図5のS307)において消去するようにしたが、かかる前提は必須ではない。たとえば、別途の方法でナンバープレート領域や文字の存在する領域を特定し、該特定した領域外の余計な画像を消去すれば、先の前提は不要になる。   In the present embodiment, it is assumed that the characters in the image have a certain size depending on the shooting conditions, and an area having a size larger than the upper limit size as a predetermined character is narrowed down (S307 in FIG. 5). ), But this assumption is not essential. For example, if a license plate region or a region where characters are present is specified by another method and an unnecessary image outside the specified region is deleted, the above assumption is not necessary.

本発明の実施の形態に係わる文字抽出装置の構成を示すブロック図である。It is a block diagram which shows the structure of the character extraction apparatus concerning embodiment of this invention. 本発明の実施の形態に係わる文字抽出装置が文字抽出して文字認識するまでの動作全体を示す流れ図である。It is a flowchart which shows the whole operation | movement until the character extraction apparatus concerning embodiment of this invention extracts a character and recognizes a character. 本発明の実施の形態に係わる文字抽出装置が行なう自家用・事業用判定処理(色判定処理)を示す流れ図である。It is a flowchart which shows the private use / business use determination process (color determination process) which the character extraction device concerning embodiment of this invention performs. 標準画像および影あり画像に対して平滑化処理と第1のエッジ抽出処理とを施した結果の画像を例示した説明図である。It is explanatory drawing which illustrated the image of the result of having performed the smoothing process and the 1st edge extraction process with respect to the standard image and the image with a shadow. 本発明の実施の形態に係わる文字抽出装置が行なう文字抽出処理を示す流れ図である。It is a flowchart which shows the character extraction process which the character extraction apparatus concerning embodiment of this invention performs. 標準画像および影あり画像に対して、輪郭線が文字の輪郭の外側に出るようにしてエッジ抽出処理を施した結果の画像を例示した説明図である。It is explanatory drawing which illustrated the image of the result of having performed the edge extraction process so that a contour line may come out of the outline of a character with respect to a standard image and a shadowed image. 図6の各画像をラベリングし、文字としての上限サイズ以上の領域を消去した結果の画像を例示した説明図である。It is explanatory drawing which illustrated the image as a result of labeling each image of FIG. 6, and deleting the area | region beyond the upper limit size as a character. 図7の各画像に、膨張処理を施した結果の画像を例示した説明図である。It is explanatory drawing which illustrated the image of the result of performing the expansion process to each image of FIG. 図6の各画像から、膨張収縮処理によって連結された内側領域を削除した結果の画像(最終的な文字抽出画像)を例示した説明図である。It is explanatory drawing which illustrated the image (final character extraction image) as a result of deleting the inner area | region connected by the expansion / contraction process from each image of FIG. 膨張処理および収縮処理の説明図である。It is explanatory drawing of an expansion process and a contraction process. 膨張収縮処理により内側領域が連結される様子を例示した説明図である。It is explanatory drawing which illustrated a mode that an inner side area | region was connected by the expansion / contraction process. 標準的なナンバープレートの画像(標準画像)とこれを判別分析法で2値化した画像とを示す説明図である。It is explanatory drawing which shows the image (standard image) of a standard license plate, and the image binarized by this discriminant analysis method. 影と日向との境界のあるナンバープレート画像(影あり画像)とこれを判別分析法で2値化した画像とを示す説明図である。It is explanatory drawing which shows the number plate image (image with a shadow) with the boundary of a shadow and the sun, and the image binarized by the discriminant analysis method.

符号の説明Explanation of symbols

10…文字抽出装置
11…画像入力部
12…画像記憶部
13…表示操作部
20…処理部
21…平滑化部
22…第1のエッジ抽出部
23…判定部
24…選択部
25…第2のエッジ抽出部
26…第1のラベリング部
27…領域絞込み部
28…膨張処理部
29…収縮処理部
31…第2のラベリング部
32…削除部
51…内側領域
52…外側領域
53…連結領域
DESCRIPTION OF SYMBOLS 10 ... Character extracting device 11 ... Image input part 12 ... Image memory | storage part 13 ... Display operation part 20 ... Processing part 21 ... Smoothing part 22 ... 1st edge extraction part 23 ... Determination part 24 ... Selection part 25 ... 2nd Edge extraction unit 26 ... first labeling unit 27 ... area narrowing unit 28 ... expansion processing unit 29 ... shrinkage processing unit 31 ... second labeling unit 32 ... deleting unit 51 ... inner region 52 ... outer region 53 ... connected region

Claims (12)

画像内から文字を抽出する文字抽出方法において、
元画像に対してエッジ抽出処理を施すステップと、
前記エッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を有する
ことを特徴とする文字抽出方法。
In a character extraction method for extracting characters from an image,
Performing edge extraction processing on the original image;
Performing a first labeling process for dividing the image for each continuous region on the image after the edge extraction process;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure And a character extracting method comprising the steps of:
前記エッジ抽出処理は、輪郭線が文字の輪郭の外側に出るように施す
ことを特徴とする請求項1に記載の文字抽出方法。
The character extraction method according to claim 1, wherein the edge extraction processing is performed so that a contour line is outside a contour of a character.
画像内から文字を抽出する文字抽出方法において、
元画像に第1のエッジ抽出処理を施した画像を生成するステップと、
前記第1のエッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定の結果に応じて選択するステップと、
前記選択された処理方法で前記元画像に対して前記第2のエッジ抽出処理を施すステップと、
前記第2のエッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を有する
ことを特徴とする文字抽出方法。
In a character extraction method for extracting characters from an image,
Generating an image obtained by performing a first edge extraction process on the original image;
The original image before the first edge extraction processing is performed using the luminance of the inner region and the luminance of the outer region of any contour line surrounding the region of a character size extracted by the first edge extraction processing. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determining step;
A processing method in the second edge extraction process is selected according to the result of the determination so that the outline comes out of the outline of the character when the second edge extraction process is performed on the original image. Steps,
Performing the second edge extraction process on the original image with the selected processing method;
Subjecting the image after the second edge extraction processing to a first labeling process for dividing the image into continuous regions;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure And a character extracting method comprising the steps of:
白地に黒文字が存するか黒地に白文字が存するかを判定する文字色判定方法において、
元画像に対してエッジ抽出処理を施した画像を生成するステップと、
前記エッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと
を有する
ことを特徴とする文字色判定方法。
In the character color determination method for determining whether a black character exists on a white background or a white character exists on a black background,
Generating an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the character-sized area extracted by the edge extraction process are compared in the original image before the edge extraction process, and the outer Determining that a black character exists on a white background when the luminance of the region is higher than the luminance of the inner region, and determining that a white character exists on the black background when the luminance of the inner region is higher than the luminance of the outer region. A character color determination method characterized by the above.
画像内から文字を抽出する文字抽出装置において、
元画像に対してエッジ抽出処理を施すエッジ抽出部と、
前記エッジ抽出部でエッジ抽出処理を施した後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施す第1のラベリング部と、
前記第1のラベリング部でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去する領域絞込み部と、
前記領域絞込み部による消去後の画像に対して膨張処理を施した画像を生成する膨張処理部と、
前記膨張処理部で膨張処理を施した後の画像に対して収縮処理を施す収縮処理部と、
前記収縮処理部で収縮処理を施した後の画像に対して第2のラベリング処理を施す第2のラベリング部と、
前記領域絞込み部による消去後の画像に残っているラベリングされた各領域の中で、前記第2のラベリング部でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除する削除部と
を有する
ことを特徴とする文字抽出装置。
In a character extraction device that extracts characters from an image,
An edge extraction unit that performs edge extraction processing on the original image;
A first labeling unit that performs a first labeling process that divides the image for each continuous region with respect to the image after performing the edge extraction process in the edge extraction unit;
A region narrowing unit for erasing a region larger than the upper limit size as a predetermined character in each continuous region labeled by the first labeling unit;
An expansion processing unit that generates an image obtained by performing expansion processing on the image after erasure by the region narrowing unit;
A contraction processing unit that performs contraction processing on the image after the expansion processing is performed by the expansion processing unit;
A second labeling unit that performs a second labeling process on the image after the contraction process is performed by the contraction processing unit;
Among the labeled regions remaining in the image after erasure by the region narrowing unit, a region included inside the region labeled by the second labeling unit is detected, and the detected region is And a deletion unit for deleting from the image after erasure.
前記エッジ抽出部は、輪郭線が文字の輪郭の外側に出るように前記エッジ抽出処理を施す
ことを特徴とする請求項5に記載の文字抽出装置。
The character extraction device according to claim 5, wherein the edge extraction unit performs the edge extraction processing so that a contour line is outside a contour of a character.
画像内から文字を抽出する文字抽出装置において、
元画像に対して第1のエッジ抽出処理を施した画像を生成する第1のエッジ抽出部と、
前記第1のエッジ抽出部によって抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定する判定部と、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定部での判定結果に応じて選択する選択部と、
前記選択部で選択した処理方法で前記元画像に対して前記第2のエッジ抽出処理を施す第2のエッジ抽出部と、
前記第2のエッジ抽出部で前記第2のエッジ抽出処理を施した後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施す第1のラベリング部と、
前記第1のラベリング部でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去する領域絞込み部と、
前記領域絞込み部による消去後の画像に対して膨張処理を施した画像を生成する膨張処理部と、
前記膨張処理部で膨張処理を施した後の画像に対して収縮処理を施す収縮処理部と、
前記収縮処理部で収縮処理を施した後の画像に対して第2のラベリング処理を施す第2のラベリング部と、
前記領域絞込み部による消去後の画像に残っているラベリングされた各領域の中で、前記第2のラベリング部でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除する削除部と
を有する
ことを特徴とする文字抽出装置。
In a character extraction device that extracts characters from an image,
A first edge extraction unit that generates an image obtained by performing a first edge extraction process on an original image;
The original image before the first edge extraction processing is performed on the brightness of the inner area and the brightness of the outer area of any one of the outlines surrounding the character-sized area extracted by the first edge extraction unit. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determination unit for determining;
The processing method in the second edge extraction process is set according to the determination result in the determination unit so that the contour line appears outside the outline of the character when the second edge extraction process is performed on the original image. Selecting part to select,
A second edge extraction unit that performs the second edge extraction process on the original image by the processing method selected by the selection unit;
A first labeling unit that performs a first labeling process that divides the image for each continuous region with respect to the image after the second edge extraction unit performs the second edge extraction process;
A region narrowing unit for erasing a region larger than the upper limit size as a predetermined character in each continuous region labeled by the first labeling unit;
An expansion processing unit that generates an image obtained by performing expansion processing on the image after erasure by the region narrowing unit;
A contraction processing unit that performs contraction processing on the image after the expansion processing is performed by the expansion processing unit;
A second labeling unit that performs a second labeling process on the image after the contraction process is performed by the contraction processing unit;
Among the labeled regions remaining in the image after erasure by the region narrowing unit, a region included inside the region labeled by the second labeling unit is detected, and the detected region is And a deletion unit for deleting from the image after erasure.
白地に黒文字が存するか黒地に白文字が存するかを判定する文字色判定装置において、
元画像にエッジ抽出処理を施した画像を生成するエッジ抽出部と、
前記エッジ抽出部によって抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定する判定部と
を有する
ことを特徴とする文字色判定装置。
In a character color determination apparatus for determining whether a black character exists on a white background or a white character exists on a black background,
An edge extraction unit that generates an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the area of the character size extracted by the edge extraction unit is compared in the original image before the edge extraction processing, and the outer A determination unit that determines that a black character exists on a white background when the luminance of the region is higher than the luminance of the inner region, and determines that a white character exists on a black background when the luminance of the inner region is higher than the luminance of the outer region; A character color determination device characterized by comprising:
画像内から文字を抽出するためのプログラムであって、
コンピュータに、
元画像に対してエッジ抽出処理を施すステップと、
前記エッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を実行させるためのプログラム。
A program for extracting characters from an image,
On the computer,
Performing edge extraction processing on the original image;
Performing a first labeling process for dividing the image for each continuous region on the image after the edge extraction process;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure. A program for executing the steps to be executed.
前記エッジ抽出処理は、輪郭線が文字の輪郭の外側に出るように施す
ことを特徴とする請求項9に記載のプログラム。
The program according to claim 9, wherein the edge extraction processing is performed so that a contour line is outside a contour of a character.
画像内から文字を抽出するためのプログラムであって、
コンピュータに、
元画像に対して第1のエッジ抽出処理を施した画像を生成するステップと、
前記第1のエッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記第1のエッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと、
前記元画像に対して第2のエッジ抽出処理を施した場合に輪郭線が文字の輪郭の外側に出るように、前記第2のエッジ抽出処理における処理方法を前記判定の結果に応じて選択するステップと、
前記選択された処理方法で前記元画像に対して前記第2のエッジ抽出処理を施すステップと、
前記第2のエッジ抽出処理後の画像に対して、連続領域毎に画像を区分けする第1のラベリング処理を施すステップと、
前記第1のラベリング処理でラベリングされた各連続領域の中で、予め定めた文字としての上限サイズより大きい領域を消去するステップと、
前記消去後の画像に対して膨張処理を施した画像を生成するステップと、
前記膨張処理後の画像に対して収縮処理を施すステップと、
前記収縮処理後の画像に対して第2のラベリング処理を施すステップと、
前記消去後の画像に存するラベリングされた各領域の中で前記第2のラベリング処理でラベリングされた領域の内側に包含された領域を検出し、該検出された領域を前記消去後の画像から削除するステップと
を実行させるためのプログラム。
A program for extracting characters from an image,
On the computer,
Generating an image obtained by performing a first edge extraction process on the original image;
The original image extracted by the first edge extraction process before the first edge extraction process is performed on the brightness of the inner area and the brightness of the outer area of any contour line surrounding the character-sized area. In contrast, when the luminance of the outer region is higher than the luminance of the inner region, it is determined that black characters exist on a white background, and when the luminance of the inner region is higher than the luminance of the outer region, white characters exist on a black background. A determining step;
A processing method in the second edge extraction process is selected according to the result of the determination so that the outline comes out of the outline of the character when the second edge extraction process is performed on the original image. Steps,
Performing the second edge extraction process on the original image with the selected processing method;
Subjecting the image after the second edge extraction processing to a first labeling process for dividing the image into continuous regions;
Erasing an area larger than the upper limit size as a predetermined character in each continuous area labeled in the first labeling process;
Generating an image obtained by subjecting the erased image to expansion processing;
Performing a contraction process on the image after the expansion process;
Applying a second labeling process to the image after the contraction process;
In each of the labeled regions existing in the image after erasure, a region included inside the region labeled by the second labeling process is detected, and the detected region is deleted from the image after erasure. A program for executing the steps to be executed.
白地に黒文字が存するか黒地に白文字が存するかを判定するためのプログラムであって、
コンピュータに、
元画像に対してエッジ抽出処理を施した画像を生成するステップと、
前記エッジ抽出処理で抽出された、文字らしいサイズの領域を囲むいずれかの輪郭線の内側領域の輝度と外側領域の輝度とを前記エッジ抽出処理を施す前の前記元画像において対比し、前記外側領域の輝度が前記内側領域の輝度より高いときは白地に黒文字が存すると判定し、前記内側領域の輝度が前記外側領域の輝度より高いときは黒地に白文字が存すると判定するステップと
を実行させるためのプログラム。
A program for determining whether black characters exist on a white background or white characters on a black background,
On the computer,
Generating an image obtained by performing edge extraction processing on the original image;
The brightness of the inner area and the brightness of the outer area of any one of the contour lines surrounding the character-sized area extracted by the edge extraction process are compared in the original image before the edge extraction process, and the outer When the brightness of the area is higher than the brightness of the inner area, it is determined that a black character exists on a white background, and when the brightness of the inner area is higher than the brightness of the outer area, a step of determining that a white character exists on the black background is executed. Program to let you.
JP2005349745A 2005-12-02 2005-12-02 Character extraction method, character extraction device, and program Withdrawn JP2007156741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005349745A JP2007156741A (en) 2005-12-02 2005-12-02 Character extraction method, character extraction device, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005349745A JP2007156741A (en) 2005-12-02 2005-12-02 Character extraction method, character extraction device, and program

Publications (1)

Publication Number Publication Date
JP2007156741A true JP2007156741A (en) 2007-06-21

Family

ID=38241038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005349745A Withdrawn JP2007156741A (en) 2005-12-02 2005-12-02 Character extraction method, character extraction device, and program

Country Status (1)

Country Link
JP (1) JP2007156741A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010186246A (en) * 2009-02-10 2010-08-26 Nec Corp Image processing apparatus, method, and program
JP2013200872A (en) * 2012-03-26 2013-10-03 Tata Consultancy Services Ltd System and method for processing image for identifying alphanumeric characters present in series
JP2016024694A (en) * 2014-07-23 2016-02-08 富士通株式会社 Image processing apparatus, image processing method, and program
CN108205675A (en) * 2016-12-20 2018-06-26 浙江宇视科技有限公司 The processing method and equipment of a kind of license plate image
JP2020513133A (en) * 2017-09-20 2020-04-30 ジョンアン インフォメーション テクノロジー サービシズ カンパニー リミテッド Image quality evaluation method and apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010186246A (en) * 2009-02-10 2010-08-26 Nec Corp Image processing apparatus, method, and program
JP2013200872A (en) * 2012-03-26 2013-10-03 Tata Consultancy Services Ltd System and method for processing image for identifying alphanumeric characters present in series
JP2016024694A (en) * 2014-07-23 2016-02-08 富士通株式会社 Image processing apparatus, image processing method, and program
CN108205675A (en) * 2016-12-20 2018-06-26 浙江宇视科技有限公司 The processing method and equipment of a kind of license plate image
JP2020513133A (en) * 2017-09-20 2020-04-30 ジョンアン インフォメーション テクノロジー サービシズ カンパニー リミテッド Image quality evaluation method and apparatus

Similar Documents

Publication Publication Date Title
CN110678901B (en) Information processing apparatus, information processing method, and computer-readable storage medium
KR102492369B1 (en) Binarization and normalization-based inpainting for text removal
KR101015663B1 (en) Method for recognizing character and apparatus therefor
JP5455038B2 (en) Image processing apparatus, image processing method, and program
JP6089886B2 (en) Region dividing method and inspection apparatus
JP2017535891A (en) Method and apparatus for detecting text
JP2007156741A (en) Character extraction method, character extraction device, and program
JP6183038B2 (en) Region extraction apparatus, region extraction method and program
JP2008011484A (en) Apparatus and method for extracting character and graphic string, program for executing the method, recording medium with the program stored therein
JP2018152026A (en) Character recognition method and computer program
JP4804382B2 (en) Image processing method, image processing program, and image processing apparatus
JP2010074342A (en) Image processing apparatus, image forming apparatus, and program
US20110187721A1 (en) Line drawing processing apparatus, storage medium storing a computer-readable program, and line drawing processing method
JP2010186246A (en) Image processing apparatus, method, and program
KR100667156B1 (en) Apparatus and method for character recognition by selecting character region in camera document image captured by portable camera
JP6338234B2 (en) Region dividing method, region dividing program and image processing system
US9773472B2 (en) Text extraction from graphical user interface content
US9031324B2 (en) Image-processing device specifying encircling line for identifying sub-region of image
JP4587698B2 (en) Character component extractor
AU2018229526B2 (en) Recursive contour merging based detection of text area in an image
JP2003046746A (en) Method and apparatus for processing image
JP2006072839A (en) Image processing method, image processing apparatus, image processing program and recording medium
JP4890351B2 (en) Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method
TWI633498B (en) Image processing device, image processing method, and program product
CN106934814B (en) Background information identification method and device based on image

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090203