JP2018137636A - Image processing device and image processing program - Google Patents
Image processing device and image processing program Download PDFInfo
- Publication number
- JP2018137636A JP2018137636A JP2017031321A JP2017031321A JP2018137636A JP 2018137636 A JP2018137636 A JP 2018137636A JP 2017031321 A JP2017031321 A JP 2017031321A JP 2017031321 A JP2017031321 A JP 2017031321A JP 2018137636 A JP2018137636 A JP 2018137636A
- Authority
- JP
- Japan
- Prior art keywords
- image
- color
- card
- color boundary
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 185
- 238000003702 image correction Methods 0.000 claims abstract description 72
- 238000000034 method Methods 0.000 claims abstract description 53
- 238000006243 chemical reaction Methods 0.000 claims abstract description 8
- 239000013598 vector Substances 0.000 claims description 84
- 230000008569 process Effects 0.000 claims description 41
- 240000004050 Pentaglottis sempervirens Species 0.000 claims description 10
- 235000004522 Pentaglottis sempervirens Nutrition 0.000 claims description 10
- 230000009466 transformation Effects 0.000 claims description 10
- 230000008859 change Effects 0.000 claims description 9
- 238000012795 verification Methods 0.000 claims description 6
- 238000012937 correction Methods 0.000 abstract description 41
- 239000003086 colorant Substances 0.000 abstract description 7
- 238000012015 optical character recognition Methods 0.000 description 54
- 230000006870 function Effects 0.000 description 17
- 230000009467 reduction Effects 0.000 description 11
- 230000004048 modification Effects 0.000 description 10
- 238000012986 modification Methods 0.000 description 10
- 238000001514 detection method Methods 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 7
- 238000003384 imaging method Methods 0.000 description 7
- 230000036541 health Effects 0.000 description 6
- 230000005855 radiation Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000001815 facial effect Effects 0.000 description 3
- 230000000052 comparative effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 229930091051 Arenine Natural products 0.000 description 1
- 125000002066 L-histidyl group Chemical group [H]N1C([H])=NC(C([H])([H])[C@](C(=O)[*])([H])N([H])[H])=C1[H] 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011946 reduction process Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Editing Of Facsimile Originals (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Description
本発明は、画像処理技術に関し、特に、本人確認証等の画像データを補正する技術に関する。 The present invention relates to an image processing technique, and more particularly, to a technique for correcting image data such as an identification card.
利用者の運転免許証や健康保険証等の本人確認証のカードの画像データを本人確認等に用いる場合がある。例えば、ユーザがカメラ(デジタルカメラやタブレット端末やスマートフォンに搭載のカメラ等)によってカードの表面を撮像する。その撮像画像データが、OCR(Optical Character Recognition;光学文字認識/光学文字読み取り)機能を備える装置に入力される。その装置は、専用のOCR装置、あるいはOCRソフトウェアを備えるPC等である。その装置は、その入力画像データに対する拡大/縮小等の補正処理を含む画像処理を行い、補正後画像データとして、カード表面の画像を得る。また、その装置は、その画像に対してOCR処理を行うことで、カード表面に記載の文字情報を得る。 In some cases, the image data of a personal identification card such as a driver's license or health insurance card is used for identity verification. For example, the user images the surface of the card with a camera (such as a camera mounted on a digital camera, a tablet terminal, or a smartphone). The captured image data is input to an apparatus having an OCR (Optical Character Recognition) function. The device is a dedicated OCR device or a PC equipped with OCR software. The apparatus performs image processing including correction processing such as enlargement / reduction on the input image data, and obtains an image on the card surface as corrected image data. Further, the device obtains character information described on the card surface by performing OCR processing on the image.
従来のOCR装置では、用紙からスキャナ等によって画像を取得し、その用紙領域の画像が、正立した状態(実物に対して像の上下左右等が同じ状態)の直角四角形の画像であることを前提に、予め設定された読み取り位置で、OCR処理を行っている。その用紙領域の画像に歪みがある場合、OCRの精度が低下する。 In a conventional OCR apparatus, an image is acquired from a sheet by a scanner or the like, and the image in the sheet area is a right-angled square image in an upright state (the image is vertically and horizontally and the like is in the same state). As a premise, OCR processing is performed at a preset reading position. When the image of the paper area is distorted, the accuracy of OCR is lowered.
上記本人確認証等の画像処理に係わる先行技術例としては、特開2011−9986号公報(特許文献1)が挙げられる。特許文献1では、身分証明書撮影システム等として、身分証明書を撮影した画像の、あおり歪みを正確に補正できるようにする旨や、以下の旨が記載されている。そのシステムでは、撮像装置により得られた画像において、顔が検出された場合に、写真領域を検出し、得られた写真の大きさを用いて、あおり補正後の画像のアスペクト比を補正する。 JP-A-2011-9986 (Patent Document 1) can be cited as an example of prior art relating to image processing such as identification verification. Japanese Patent Application Laid-Open No. 2004-228561 describes that an identification image capturing system or the like is capable of accurately correcting distortion of an image obtained by capturing an identity card, and the following. In the system, when a face is detected in an image obtained by an imaging device, a photo area is detected, and the aspect ratio of the image after tilt correction is corrected using the size of the obtained photo.
上記カメラによる本人確認証のカードの撮像画像データは、カード表面に記載の文字等の情報が、人や計算機によって認識できる、または認識しやすいことが望ましい。そのためには、基本的に、カード表面に対する垂直方向から俯瞰して撮影した画像(俯瞰画像と記載する場合がある)が使用されることが望ましい。その俯瞰画像では、理想的には、カード表面が直角四角形として写っている。 It is desirable that information such as characters written on the card surface can be recognized by a person or a computer or can be easily recognized in the imaged image data of the personal identification card by the camera. For this purpose, it is basically desirable to use an image (may be referred to as a bird's-eye view image) that is taken from a direction perpendicular to the card surface. In the overhead view image, ideally, the card surface is shown as a right-angled square.
しかしながら、ユーザによる撮像時には、カード表面に対する撮像方向に関して、垂直方向からの傾き角度のズレが生じ得る。そのズレがある場合、撮像画像において、カード表面は、直角四角形ではなく、台形状に歪んだ画像として写っている。このような歪みを持つ画像データの場合、文字等の情報が認識しにくくなっている。そのため、OCR装置やPC等の画像処理装置では、OCR等の所定の処理に適した画像となるように、その撮像画像に対し、所定の補正処理を含む画像処理を行うことが望ましい。その補正処理では、例えば、撮像画像からカード表面の画像領域(カード領域と記載する場合がある)に対応する四角形が検出される。その補正処理では、その四角形に台形状の歪みがある場合、その台形状の歪みが、直角四角形になるように変換される。このような歪み補正処理によって、正確な俯瞰画像が得られる。 However, at the time of image capturing by the user, a tilt angle deviation from the vertical direction may occur with respect to the image capturing direction with respect to the card surface. When there is a deviation, the card surface is captured as a trapezoidally distorted image in the captured image instead of a right-angled quadrangle. In the case of image data having such distortion, information such as characters is difficult to recognize. Therefore, in an image processing apparatus such as an OCR apparatus or a PC, it is desirable to perform image processing including predetermined correction processing on the captured image so that an image suitable for predetermined processing such as OCR is obtained. In the correction process, for example, a quadrangle corresponding to an image area on the card surface (may be described as a card area) is detected from the captured image. In the correction processing, when the quadrangle has a trapezoidal distortion, the trapezoidal distortion is converted into a right-angled quadrangle. An accurate overhead view image is obtained by such distortion correction processing.
従来の画像処理装置は、上記撮像画像データに対する補正処理を行う場合、以下のように、精度等の点で課題がある。補正処理の精度が低い場合、その画像では、人による文字等の情報の視認がしにくくなり、計算機によるOCRの精度も低下してしまう。 When performing a correction process on the captured image data, the conventional image processing apparatus has problems in terms of accuracy and the like as follows. When the accuracy of the correction process is low, it becomes difficult for a person to visually recognize information such as characters in the image, and the accuracy of OCR by the computer is also reduced.
(1)撮像画像からカード領域の四角形を正確に推定して検出することが難しい場合がある。例えば、撮像時の撮像方向や照明状態等に応じて、画像の背景領域に対しカード領域の四角形の辺が不鮮明になっている場合がある。画像の背景領域とカード領域とで、明るさの差、即ち色の差が小さい場合、四角形の辺、即ち背景領域とカード領域との境界線が、明瞭には現れない。その画像からカード領域の四角形に対応する4つの辺や4つの角点を正確に検出することが難しい場合が多い。即ち、カード領域の検出精度が低い。カード領域を正確に検出できていない場合、台形状の歪みを補正する際の精度も低くなる。 (1) It may be difficult to accurately estimate and detect the quadrangle of the card area from the captured image. For example, the square side of the card area may be unclear with respect to the background area of the image, depending on the imaging direction at the time of imaging, lighting conditions, and the like. When the brightness difference, that is, the color difference between the background area and the card area of the image is small, the side of the rectangle, that is, the boundary line between the background area and the card area does not appear clearly. In many cases, it is difficult to accurately detect four sides and four corner points corresponding to the quadrangle of the card area from the image. That is, the detection accuracy of the card area is low. If the card area cannot be detected accurately, the accuracy in correcting the trapezoidal distortion is also lowered.
(2)また、例えば運転免許証等の場合、表面の規定のレイアウトとして、罫線、マーク、写真等の特徴情報が比較的多い。よって、その特徴情報を利用して補正処理を行うことができる。一方、例えば健康保険証等の特定の種類のカードの場合、表面の規定のレイアウトとして、罫線、マーク、写真等の特徴情報が比較的少ない。そのカードでは、記載項目(氏名等)は規定されているが、記載項目毎の文字の配置位置については、カード毎の個体差が比較的大きい。各利用者のカード表面内の同じ位置座標の画素をみても、異なる色(画素値)となっていることも多い。このようなカードの場合、補正処理の際に、特徴情報を利用しにくく、カード領域を検出しにくい。即ち、補正処理の精度が低くなる。 (2) For example, in the case of a driver's license or the like, the surface layout has a relatively large amount of feature information such as ruled lines, marks, and photographs. Therefore, correction processing can be performed using the feature information. On the other hand, in the case of a specific type of card such as a health insurance card, for example, characteristic information such as ruled lines, marks, photographs, etc. is relatively small as a prescribed layout on the surface. In the card, description items (name, etc.) are prescribed, but the individual difference for each card is relatively large with respect to the character arrangement position for each description item. Even when the pixels at the same position coordinates on the card surface of each user are viewed, they often have different colors (pixel values). In the case of such a card, it is difficult to use the feature information and to detect the card area during the correction process. That is, the accuracy of the correction process is lowered.
なお、特許文献1では、カード内の顔写真を特徴として利用して検出しているが、顔写真が無いカードの場合や、顔写真の境界線が検出しにくい場合や、顔写真の配置位置の個体差が大きい場合等には、有効ではない。また、特許文献1では、カード領域の検出に輪郭抽出及びハフ変換を用いているが、背景領域とカード領域との色の差が少ない場合や、画像内の明るさにムラがある場合には、有効ではない。
In
本発明の目的は、本人確認証のカード等の撮像画像データに関する画像処理技術に関して、カード領域に対する正確な俯瞰画像が得られるように高精度の補正処理ができる技術を提供することである。 An object of the present invention is to provide a technique capable of performing a high-precision correction process so that an accurate overhead image with respect to a card area can be obtained with respect to an image processing technique related to captured image data such as a personal identification card.
本発明のうち代表的な実施の形態は、画像処理装置であって、以下に示す構成を有することを特徴とする。 A typical embodiment of the present invention is an image processing apparatus having the following configuration.
一実施の形態の画像処理装置は、入力された本人確認証のカードの撮像画像データの画像に対し、画像補正処理を行って、カード表面を垂直方向から俯瞰した状態の補正後画像データを出力する、画像補正部を備え、前記画像補正部は、前記画像補正処理で、前記画像から、カード領域と背景領域との色の差に基づいた色境界点を検出し、前記色境界点に基づいて、前記カード領域を検出し、前記カード領域の台形状の歪みが直角四角形になるように変換を行うことで、前記俯瞰した状態の補正後画像データを得る。 The image processing apparatus according to the embodiment performs image correction processing on the image of the captured image data of the input identification card and outputs corrected image data in a state where the card surface is viewed from the vertical direction. An image correction unit, wherein the image correction unit detects a color boundary point based on a color difference between a card area and a background area from the image in the image correction process, and based on the color boundary point Then, the card area is detected and converted so that the trapezoidal distortion of the card area becomes a right-angled square, thereby obtaining the corrected image data in the overhead view.
本発明のうち代表的な実施の形態によれば、本人確認証のカード等の撮像画像データに関する画像処理技術に関して、カード領域に対する正確な俯瞰画像が得られるように高精度の補正処理ができる。 According to a typical embodiment of the present invention, high-accuracy correction processing can be performed with respect to an image processing technique related to captured image data such as a card for identity verification so that an accurate overhead image for a card area can be obtained.
以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において同一部には原則として同一符号を付し、その繰り返しの説明は省略する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.
(実施の形態)
図1〜図21を用いて、本発明の実施の形態の画像処理装置について説明する。
(Embodiment)
The image processing apparatus according to the embodiment of the present invention will be described with reference to FIGS.
[画像処理装置(1)]
図1は、実施の形態の画像処理装置を含む、システムの構成を示す。実施の形態の画像処理装置は、OCR装置1として構成されている。このシステムは、OCR装置1、カメラ2を有する。ユーザは、OCR装置1、カメラ2を使用する。ユーザは、健康保険証等の本人確認証のカード3を所持している。なお、OCR装置1及びカメラ2の2つの装置を使用するユーザは、同一ユーザでも別ユーザでもよい。例えば、住民が自分のカード3をカメラ2で撮像し、行政機関の職員がその撮像画像データをOCR装置1に入力してもよい。
[Image processing apparatus (1)]
FIG. 1 shows a system configuration including an image processing apparatus according to an embodiment. The image processing apparatus according to the embodiment is configured as an
OCR装置1は、スキャナ機能やOCR機能を備える専用の装置であり、更に特有の画像処理機能を備える画像処理装置である。スキャナ機能やOCR機能については、公知技術が適用可能であり、説明を省略する。
The
ユーザは、カード3の表面をカメラ2によって撮像する。カメラ2は、デジタルカメラでもよいし、タブレット端末やスマートフォン等に備えるカメラ機能を用いてもよい。カメラ2は、カード3の撮像画像データを取得し、記憶し、出力が可能である。ユーザは、カメラ2によって得たカード3の画像データ4Aを、OCR装置1に入力する。OCR装置1は、その画像データ4Aを、任意手段によって入力する。例えば、OCR装置1は、カメラ2と通信接続され、カメラ2から通信で画像データ4Aを入力してもよい。あるいは、OCR装置1は、通信網を介してPC等と接続され、カメラ2の画像データ4Aが格納されたそのPC等からその画像データ4Aを入力してもよい。あるいは、OCR装置1は、カメラ2の画像データ4Aが格納されたメモリカードが接続され、そのメモリカードから画像データ4Aを読み出して入力してもよい。
The user images the surface of the
OCR装置1は、入力された画像データ4A(記憶装置102の画像データ122)に対して、補正処理を含む画像処理を行う。この補正処理は、拡大/縮小、位置シフト、回転等の公知の処理の他に、特有の歪み補正処理を含む。この歪み補正処理は、画像内のカード領域の台形状の歪みを、直角四角形の俯瞰画像になるように変換する処理である。これにより、補正後画像データとして、OCR処理や人の視認に適した画像データが得られる。OCR装置1は、補正後画像データに対してOCR処理を行い、その結果の文字データ123を得る。
The
OCR装置1は、演算装置101、記憶装置102、スキャナ装置103、通信インタフェース装置104、入出力インタフェース装置105、入力装置106、表示装置107、外部記憶装置108等を有し、それらがバスを介して接続されている。
The
演算装置101は、CPU、RAM、ROM等を含み、CPU等によるソフトウェアプログラム処理に基づいて、画像処理機能を実現する。詳しくは、CPUは、記憶装置102内の画像処理プログラム121をメモリに読み出して、画像処理プログラム121に従って処理を実行する。これにより、画像処理機能を構成する画像読み取り部11等の各部が実現される。演算装置101の画像処理機能は、各部として、画像読み取り部11、画像データ入力部12、画像補正部13、光学文字認識部14、文字データ出力部15、画像データ出力部16、設定部17等を含む。
The
記憶装置102には、画像処理プログラム121、画像データ122、文字データ123、設定情報124等が記憶されている。画像処理プログラム121は、予めOCR装置1内に格納、実装されていてもよいし、通信網上のサーバ等からダウンロードされてインストールされてもよい。画像データ122は、カメラ2によりカード3の表面が撮像された画像データ4Aの入力に基づいた画像データであり、補正前後の各画像データを含む。文字データ123は、画像データ122に基づいてOCR処理によって抽出された文字情報を含むデータである。設定情報124は、画像処理機能に係わる設定情報である。
The
画像読み取り部11は、スキャナ装置103を制御して、用紙から画像を読み取る。スキャナ装置103は、公知の機構を有する。実施の形態では、用紙からの画像ではなく、カメラ3の画像データ4Aを用いる。
The image reading unit 11 controls the
画像処理装置としては、上記専用のOCR装置1に限らずに可能である。変形例として、PCとOCRソフトウェアで構成される形態でもよい。そのOCRソフトウェアは、前述のOCR機能及び画像処理機能を備える画像処理プログラムに相当する。PCは、CPU等によって、ストレージ等に格納されている画像処理プログラムを読み出して実行し、図1の画像補正部13等を同様に実現する。
The image processing apparatus is not limited to the
[画像処理装置(2)]
実施の形態の画像処理装置は、カード3の画像データにおいて、背景領域とカード領域との間に色の差があることに着目する。画像処理装置は、背景領域とカード領域との境界線(四角形の4つの辺)を探索、推定することで、画像内のカード領域の位置を検出する。画像処理装置は、画像の枠の端点と中心点とを結ぶ探索線上で、色の差の境界点である色境界点を探索する。画像処理装置は、探索で得た複数の色境界点を集めてグループ化する。画像処理装置は、グループ毎に、カード領域の辺に対応付けられる近似直線を引く。画像処理装置は、4つの近似直線を用いて、カード領域の4つの角点を検出する。画像処理装置は、検出したカード領域の4つの角点に基づいて、公知の射影変換を行うことで、カード領域の台形状の歪みが直角四角形になるように変換する。これにより、高精度の俯瞰画像、即ちカード表面に対して垂直方向から撮像したような画像が得られる。
[Image processing apparatus (2)]
The image processing apparatus according to the embodiment pays attention to the fact that there is a color difference between the background area and the card area in the image data of the
画像処理装置は、その直角四角形を含む補正後画像から、必要に応じて、拡大/縮小、位置シフト、回転、切り出し等の公知の処理を行って、正立した状態のカード領域を含む、最終的な俯瞰画像を得る。例えば、画像処理装置は、補正後画像が、そのカードの規定の縦横比を持つ画像になるように、拡大/縮小を行う。最終的な俯瞰画像では、カード領域が、所定の好適なサイズ、比率、位置、向き等を持つ直角四角形として得られる。 The image processing apparatus performs a known process such as enlargement / reduction, position shift, rotation, and clipping from the corrected image including the right-angled rectangle as necessary, and includes an upright card area. A typical bird's-eye view image. For example, the image processing apparatus performs enlargement / reduction so that the corrected image becomes an image having a prescribed aspect ratio of the card. In the final bird's-eye view image, the card area is obtained as a right-angled rectangle having a predetermined suitable size, ratio, position, orientation, and the like.
実施の形態の画像処理装置は、カード撮像画像における矩形枠の中心点と、枠線上の複数の各々の端点とを結ぶ、放射状に拡がる線を、探索線(放射線)として設定する。画像処理装置は、その探索線上で、背景領域の色とカード領域の色との境界点である色境界点を探索する。画像処理装置は、探索で得られた複数の色境界点について、色境界点同士のベクトルを計算する。画像処理装置は、そのベクトルの向きを表す角度の類似性に基づいて、複数の色境界点を、4つのグループに分ける。グループは、カード領域の辺に対応付けられる。画像処理装置は、グループ毎の色境界点を用いて近似直線を引くことで、カード領域の4つの辺を検出する。画像処理装置は、4つの辺における4つの交点として、カード領域の4つの角点を検出する。画像処理装置は、4つの角点に基づいて、台形状の歪みが直角四角形になるように射影変換を行う。 The image processing apparatus according to the embodiment sets a radially expanding line connecting a center point of a rectangular frame in a card image and a plurality of end points on the frame line as a search line (radiation). The image processing apparatus searches for a color boundary point that is a boundary point between the color of the background area and the color of the card area on the search line. The image processing apparatus calculates a vector between color boundary points for a plurality of color boundary points obtained by the search. The image processing apparatus divides the plurality of color boundary points into four groups based on the similarity of angles representing the direction of the vector. A group is associated with a side of the card area. The image processing apparatus detects the four sides of the card area by drawing an approximate line using the color boundary points for each group. The image processing apparatus detects four corner points of the card area as four intersections on the four sides. Based on the four corner points, the image processing apparatus performs projective transformation so that the trapezoidal distortion becomes a right-angled square.
実施の形態の画像処理装置は、健康保険証等のカード3のカメラ2による撮像画像データに関する画像処理によって、カード領域の検出精度を向上でき、正確な俯瞰画像を得ることができる。特に、カメラ2によるカード3の撮影時の方向や照明状態等が適切ではなく、台形状の歪みがある画像の場合でも、カード領域の検出精度、及び歪み補正の精度を高くできる。また、特に、レイアウトにおける特徴情報が少ない種類のカード3で、台形状の歪みがある画像の場合でも、カード領域の検出精度、及び歪み補正の精度を高くできる。
The image processing apparatus according to the embodiment can improve the detection accuracy of the card area and obtain an accurate bird's-eye view image by image processing related to imaged image data by the
[本人確認証カード]
図2は、対象のカード3の表面のレイアウトの構成例として、健康保険証の場合を示す。なお、図2では、レイアウトをモノクロで簡略化して示しているが、実際のカードでは、所定のカラーのデザインを有する。このカード3では、文字項目が多く、罫線、マーク、写真等の特徴情報が少ない。カード3は、表面において直角四角形であり、規定のサイズを有し、縦の長さV0、横の長さH0、厚さを有し、4つの角点はアール加工で丸くなっている。
[Identification card]
FIG. 2 shows the case of a health insurance card as a configuration example of the layout of the surface of the
[画像処理装置(3)]
図3は、実施の形態の画像処理装置を含むシステムにおける利用概要を示す。図3の(A)は、ユーザがカメラ2によってカード3を撮像する例を示す。カードとして、例えば運転免許証の場合、カード面内に、罫線等の特徴情報が多い。カード3として、例えば図2のように健康保険証の場合、カード3の表面内に、罫線等の特徴情報が少ない。実施の形態では、このような特徴情報が少ない種類のカード3の場合にも、有効な画像補正を実現する。
[Image processing apparatus (3)]
FIG. 3 shows an outline of use in a system including the image processing apparatus according to the embodiment. FIG. 3A shows an example in which the user images the
図3の(B)は、画像データ入力の例を示す。入力の画像データ4Aは、背景領域の上にカード領域を有する。この例では、カード領域に、台形状の歪みがある。これは、撮像時の撮像方向のズレによって生じている。また、この例では、背景領域とカード領域との間で、明るさの差、即ち色の差が小さく、カード領域の4つの辺の境界線が不鮮明になっている。
FIG. 3B shows an example of image data input. The
図3の(C)は、画像補正により得られた補正後画像データの例を示す。この補正後画像データでは、カード領域が、正確な俯瞰画像として取得されている。正確な俯瞰画像とは、カード領域が直角四角形となっている画像である。この俯瞰画像では、カード面内の記載文字情報を人が視認することがしやすくなっている。また、この俯瞰画像では、OCR処理によってカード面内の記載文字情報を認識しやすくなっている。なお、補正後画像データとしては、背景領域を切り落としてカード領域のみを切り出した画像としてもよい。補整後画像データ及びOCRによる文字情報は、所定の用途に利用できる。例えば、行政機関等において提出する書類に利用できる。 FIG. 3C shows an example of corrected image data obtained by image correction. In this corrected image data, the card area is acquired as an accurate overhead image. An accurate bird's-eye view image is an image in which the card area is a right-angled square. In this bird's-eye view image, it is easy for a person to visually recognize the written character information in the card surface. Moreover, in this bird's-eye view image, the character information in the card surface is easily recognized by OCR processing. The corrected image data may be an image obtained by cutting out the background area and cutting out only the card area. The corrected image data and the character information by OCR can be used for a predetermined use. For example, it can be used for documents to be submitted in administrative agencies.
[画像処理装置(4)]
図4は、実施の形態の画像処理装置であるOCR装置1における画像処理機能の各部の処理の概要を示す。画像データ入力部12は、ユーザ操作に基づいて、画像処理の対象となる画像データ4Aを入力する。例えば、画像データ入力部12は、カメラ2の画像データ4Aを、通信インタフェース装置104や入出力インタフェース装置105を通じて入力し、記憶装置102に画像データ122、特に補正前画像データ4Bとして格納する。画像データ入力部12は、記憶装置102の画像データ122から必要に応じて補正前画像データ4Bを読み出し、画像補正部13に入力する。
[Image processing apparatus (4)]
FIG. 4 shows an outline of processing of each part of the image processing function in the
画像補正部13は、入力画像データである補正前画像データ4Bに対し、所定の補正処理を含む画像処理を行う。画像補正部13は、設定部17による設定情報124に基づいて、画像処理を行う。画像補正部13は、補正後画像データ4Cを出力し、記憶装置102内に格納する。
The
光学文字認識部(OCR部)14は、入力画像データである補正後画像データ4Cに対し、公知の光学文字認識処理(OCR処理)を行い、その結果である文字データ123を得る。光学文字認識部14は、文字データ123を出力し、記憶装置102内に格納する。
The optical character recognition unit (OCR unit) 14 performs a known optical character recognition process (OCR process) on the corrected
文字データ出力部15は、ユーザ操作に基づいて、文字データ123をユーザや外部装置に対して出力する。例えば、文字データ出力部15は、表示装置107の画面に文字データ123の内容を表示する。例えば、文字データ出力部15は、文字データ123を、通信インタフェース装置104を通じて、外部装置に送信する。
The character
画像データ出力部16は、ユーザ操作に基づいて、補正後画像データ4Cをユーザや外部装置に対して出力する。例えば、画像データ出力部16は、表示装置107の画面に補正後画像データ4Cの内容を表示する。例えば、画像データ出力部16は、補正後画像データ4Cを、通信インタフェース装置104を通じて、外部装置に送信する。
The image
設定部17は、ユーザに対して設定画面を提供し、ユーザ操作に基づいて、画像処理機能に係わるユーザ設定を行う。設定部17は、設定情報124を記憶装置102に保存する。
The setting
[画像処理フロー]
図5は、OCR装置1における画像処理のフローを示す。本フローは、画像補正処理後にOCR処理を行って文字データを出力する場合の流れを示す。図5は、ステップS1〜S5を有する。ステップS2は、ステップS2A〜S2Cを含む。ステップS2Aは、ステップS21〜S27を含む。以下、ステップの順に説明する。
[Image processing flow]
FIG. 5 shows a flow of image processing in the
(S1) 図4のように、OCR装置1の画像データ入力部12は、カメラ2からの画像データ4Aを補正前画像データ4Bとして入力する。
(S1) As shown in FIG. 4, the image
(S2) OCR装置1の画像補正部13は、入力の補正前画像データ4Bに対して、画像補正処理を行い、補正後画像データ4Cを得る。S2の画像補正処理は、特有の歪み補正処理を行うステップS2A、拡大/縮小等の処理を行うステップS2B、位置シフト、回転、切り出し等の処理を行うステップS2Cを含む。S2BやS2Cは、公知の処理である。
(S2) The
(S2A) 画像補正部13は、S2Aで、特有の歪み補正処理を行う。この歪み補正処理は、カード領域及び位置を検出し、カード領域の台形状の歪みを直角四角形になるように補正する処理である。
(S2A) The
(S21) 画像補正部13は、S2Aの歪み補正処理の際、まず、S21で、補正前画像データ4Bの画像における複数の端点を計算する。画像補正部13は、画像の中心点と複数の各々の端点とを結ぶ各々の線を、探索線(放射線)として設定する。詳しくは、後述の図9等で示す。
(S21) When performing the distortion correction processing in S2A, the
(S22) 画像補正部13は、S21の探索線に基づいて、複数の各々の探索線上で、背景領域とカード領域との色の差の境界点である色境界点を探索する。画像補正部13は、ある探索線から順に、同様にその処理を繰り返す。これにより、複数の色境界点が得られる。詳しくは、後述の図11等で示す。
(S22) Based on the search line of S21, the
(S23) 画像補正部13は、S22の色境界点に基づいて、色境界点同士のベクトルを計算する。詳しくは、後述の図12等で示す。
(S23) The
(S24) 画像補正部13は、S23のベクトルに基づいて、色境界点をグループ化する。グループは、カード領域の四角形の辺に対応付けられる。詳しくは、後述の図13等で示す。
(S24) The
(S25) 画像補正部13は、S24のグループに基づいて、近似直線を計算する。近似直線は、カード領域の四角形の辺に対応付けられる。詳しくは、後述の図14等で示す。
(S25) The
(S26) 画像補正部13は、S25の近似直線に基づいて、交点を計算することで、カード領域の四角形の4つの角点を計算する。詳しくは、後述の図14等で示す。
(S26) The
(S27) 画像補正部13は、S26の4つの角点に基づいて、公知の射影変換処理により、カード領域の四角形の台形状の歪みが直角四角形になるように補正する。詳しくは、後述の図15で示す。
(S27) Based on the four corner points of S26, the
(S2B) 画像補正部13は、S2Aで得た射影変換後の画像及び4つの角点に基づいて、S2Bで、カード領域の四角形が、規定の縦横比を持ち好適なサイズの四角形となるように、画像の拡大/縮小処理等を行う。
(S2B) Based on the image after the projective transformation obtained in S2A and the four corner points, the
(S2C) 画像補正部13は、S2Bで得た画像に基づいて、S2Cで、画像内のカード領域の四角形の位置が好適な位置となるように位置シフト処理を行う。また、画像補正部13は、画像内のカード領域の向きが好適な向きとなるように、面内での回転処理を行う。また、画像補正部13は、画像内からカード領域のみを切り出す場合には、そのカード領域を切り出す処理を行う。なお、S2B,S2Cの処理は、適宜省略可能である。
(S2C) Based on the image obtained in S2B, the
(S3) OCR部14は、S2で得られた補正後画像データ4Cに基づいて、まず、OCRのための読み取り位置及び領域を検出する。この読み取り位置及び領域は、例えばユーザ設定によって設定される。例えば、入力画像の原点を、矩形の左上の点とする。所定の位置座標の点(x1,y1)が読み取り開始位置(読み取り領域の左上の点)として設定される。所定の位置座標の点(x2,y2)が読み取り終了位置(読み取り領域の右下の点)として設定される。
(S3) Based on the corrected
(S4) OCR部14は、補正後画像データ4Cの読み取り領域に対し、OCR処理を行って文字を抽出し、結果である文字データ123を得る。
(S4) The
(S5) OCR部14は、S4で得た文字データ123に基づいて、OCRの後処理を行う。文字データ出力部15は、結果である文字情報を表示装置107の画面に表示する。ユーザは、画面に表示された文字情報を確認、チェックし、問題がある場合には修正する。
(S5) The
[入力画像例(1)]
図6は、S21に係わる、入力の画像データ4A(補正前画像データ4B)に対応する画像5の例を示す。画像5は、矩形を有し、左上の点を、位置座標の原点(0,0)とする。画像5内の画素の位置座標を(x,y)で表す。X方向は面内水平方向(横方向)、Y方向は面内垂直方向(縦方向)である。画像の横の長さX1、縦の長さY1とする。右上の角点の位置座標が(X1,0)、左下の角点が(0,Y1)、右下の角点が(X1,Y1)である。画像5の中心点を点G0とし、位置座標が(X1/2,Y1/2)である。また、説明上、画像5内でのカード領域7の中心点を点C0とする。画像5内には、背景領域6とカード領域7とがある。画像5は、説明のためモノクロで簡略化して示しているが、実際にはフルカラーであり、撮像時の照明等の状況に応じて、グラデーションやムラも有する。
[Input image example (1)]
FIG. 6 shows an example of the
図6の例では、画像5は、撮像方向として、カード表面に対する垂直方向に対し、ある程度の傾き角度があることで、カード領域7が台形状に歪んでいる場合を示す。また、本例では、カード領域7の縦横比は、規定の縦横比とは異なっており、X方向がやや拡大されている場合を示す。また、本例では、画像5内のカード領域7の配置の位置が、画像5の中心点G0に対して少しずれて配置されている場合を示す。
In the example of FIG. 6, the
[入力画像例(2)]
図7は、他の画像5の例を示す。本例では、画像5内で、背景領域6とカード領域7との境界線、即ちカード3の表面の縁である4つの辺が、不鮮明になっている部分が多い場合を示す。例えば、カード領域7の上辺や下辺は、殆ど映っていない。このような画像の場合、従来技術では、カード領域7の正確な検出が難しい。
[Input image example (2)]
FIG. 7 shows an example of another
[入力画像例(3)]
図8は、他の画像5の例を示す。本例では、画像5内で、カード領域7の台形状の歪みは小さいが、カード領域7が左上寄りの位置で、面内で斜めに回転した状態で配置されており、画像5のサイズに対してカード領域7のサイズが比較的小さい。このような画像5の場合、補正処理として、拡大、位置シフト、回転等の処理を行う必要がある。
[Input image example (3)]
FIG. 8 shows an example of another
[画像処理(1)−S21]
図9は、S21の画像端点計算処理に係わる画像5の状態として、端点及び探索線を設定した状態を示す。画像補正部13は、画像5の矩形枠の4つの枠線上に、所定の端点(画像端点ともいう)を設定する。端点をpiで表し、小さい四角で示す。本例では、座標系において、画像5の右辺中間点を端点p1(位置座標としては(X1,Y1/2))とし、その点から上に4つの辺上を反時計周りに進んで、各々の端点を設定してゆく。画像補正部13は、各端点の位置座標を計算する。本例では、合計32個の端点p1〜p32が設定される場合を示すが、これに限らず可能である。例えば、原点(0,0)の付近に第1の端点p1が設定されてもよい。
[Image processing (1) -S21]
FIG. 9 shows a state in which an end point and a search line are set as the state of the
画像5の右辺では、右上の角点(端点p5)と右下の角点(端点p29)との間で、角点を含め、9個の端点{p1〜p5,p29〜p32}が等間隔(縦の長さY1の8分の1)で設定されている。上辺では、右上の角点(端点p5)と左上の角点(端点p13)との間で、角点を含め、9個の端点{p5〜p13}が等間隔(横の長さX1の8分の1)で設定されている。右辺の等間隔と上辺の等間隔とが異なる場合を示すが、これに限らず設定可能である。同様に、左辺に9個の端点{p13〜p21}が設定されており、下辺に9個の端点{p21〜p29}が設定されている。
On the right side of the
画像補正部13は、探索線の設定にあたり、画像5の中心点G0を用いる。画像補正部13は、中心点G0と、複数の各々の端点とを結ぶ線を、探索線(放射線)として設定する。中心点G0から周りに放射状に探索線が延びている。探索線(放射線)をLiで表し、破線で示す。本例では、探索線L1〜L32が設定されている。探索線Liの一方端が中心点G0であり、他方端が端点piである。本例では、画像5の矩形枠の角点にも端点が設定されている。
The
図10は、画像5の端点及び探索線の他の設定例を示す。中心点G0の周りに、一定の角度α(例えば約11度)の間隔で探索線を設定する場合を示す。これにより、画像5の矩形枠の枠線上において、複数の端点(合計32個)が設定されている。本例では、画像5の矩形枠の角点には端点が設定されていない。
FIG. 10 shows another setting example of the end points and search lines of the
[画像処理(2)−S22]
図11は、S22の色境界点探索処理に係わる画像5の状態を示す。各々の探索線上で、端点から中心点G0への方向で、色境界点を探索する様子を示す。背景領域6とカード領域7との色境界点をqiで表し、小さい菱形で示す。中心点G0と端点piとの間の探索線Li上における色境界点qiとする。端点p1の探索線L1から順に、反時計回りで端点p32の探索線L32まで、探索が行われる。32本の探索線L1〜L32において、色境界点q1〜q32が得られている。本例では、32個の色境界点がうまく検出できた場合を示すが、一部の色境界点がうまく検出できない場合もあり得る。
[Image processing (2) -S22]
FIG. 11 shows the state of the
[画像処理(3)−S23]
図12は、S23のベクトル計算処理に係わる画像5の状態として、ベクトル等を示す。複数の色境界点{q1〜q32}における、位置が近い隣り合う色境界点同士の間が、ベクトルで接続されている。色境界点間のベクトルを、ベクトルv1〜v32で示す。本例では、32個のベクトルがうまく検出できた場合を示す。例えば、ベクトルv1は、色境界点q1を始点とし、色境界点q2を終点とするベクトルであり、面内での角度の情報を持つ。
[Image processing (3) -S23]
FIG. 12 shows a vector or the like as the state of the
本例では、32個の色境界点の間で、隣り合う色境界点同士でベクトルを設定することで、色境界点と同じ数の32個のベクトルが設定される場合である。これに限らず可能である。後述の変形例では、例えば1個ずつ色境界点を飛ばしてベクトルを設定することで、色境界点の数よりも少ない数のベクトルを設定することも可能である。 In this example, 32 vectors having the same number as the color boundary points are set by setting vectors between adjacent color boundary points between the 32 color boundary points. This is not limited to this. In a modification described later, it is possible to set a smaller number of vectors than the number of color boundary points, for example, by setting vectors by skipping color boundary points one by one.
[画像処理(4)−S24]
図13は、S24のグループ化処理に係わる画像5の状態として、グループ等を示す。4つのグループをg1〜g4で示す。本例では、カード領域7の右辺の付近において、6個の色境界点q1〜q4,q31,q32を有し、それらを結ぶ5個のベクトルv1〜v3,v31,v32を有する。5個のベクトルv1〜v3,v31,v32は、角度が類似である(言い換えると角度の差が所定値未満である)。そのため、それらに対応する6個の色境界点が、1つのグループg1としてグループ化されている。同様に、カード領域7の上辺の付近では、9個の色境界点q5〜q13を有し、それらを結ぶ8個のベクトルv5〜v12を有し、それらの9個の色境界点が1つのグループg2としてグループ化されている。カード領域7の左辺の付近では、6個の色境界点q14〜q19を有し、それらを結ぶ5個のベクトルv14〜v18を有し、それらの6個の色境界点が1つのグループg3としてグループ化されている。カード領域7の下辺の付近では、10個の色境界点q20〜q30を有し、それらを結ぶ9個のベクトルv20〜v29を有し、それらの10個の色境界点が1つのグループg4としてグループ化されている。
[Image processing (4) -S24]
FIG. 13 shows a group or the like as the state of the
なお、カード領域7の角点の付近にあるベクトルv4,v13,v19,v30は、他のベクトルとは角度が非類似(言い換えると角度の差が所定値以上である)となっている。そのため、グループ化の際に、それらのベクトルに関する色境界点は、考慮から除外している。
It should be noted that the vectors v4, v13, v19, v30 in the vicinity of the corner points of the
[画像処理(5)−S25]
図14は、S25の近似直線計算処理、及びS26の交点計算処理に係わる画像5の状態として、近似直線及び交点等を示す。画像補正部13は、グループ毎の色境界点を用いて近似直線を引く。図14では、画像5内で、グループg1の色境界点を用いて、近似直線M1が設定されている。同様に、グループg2の色境界点を用いて、近似直線M2が設定されている。グループg3の色境界点を用いて、近似直線M3が設定されている。グループg4の色境界点を用いて、近似直線M4が設定されている。近似直線は、例えば公知の最小二乗法(残差の二乗和を最小とする方法)を用いて計算できる。
[Image processing (5) -S25]
FIG. 14 shows approximate straight lines, intersections, and the like as the states of the
[画像処理(6)−S26]
画像補正部13は、近似直線の交点を計算する。図14の画像5では、4つの近似直線M1〜M4を用いて、それらの4つの交点Q1〜Q4が計算されている。例えば、近似直線M1と近似直線M2との交点Q1等である。交点を二重丸で示す。これらの4つの交点Q1〜Q4が、カード領域7の4つの角点として推定される点である。
[Image processing (6) -S26]
The
[画像処理(7)−S27]
図15は、S27の射影変換に係わる画像5の状態を示す。画像補正部13は、4つの交点Q1〜Q4を用いて、公知の射影変換を行う。変換前の4点で示される台形は、変換後の4点で示される直角四角形になる。図15の(A)は、射影変換前の画像5における4つの交点Q1〜Q4を示す。点C0aは、変換前のカード領域7の交点Q1〜Q4に対する中心点を示す。
[Image processing (7) -S27]
FIG. 15 shows the state of the
図15の(B)は、射影変換後の画像5における4つの交点Q1b〜Q4bを示す。なお、点C0bは、変換後のカード領域7bの交点Q1b〜Q4bに対する中心点を示す。カード領域7bは、変換後の交点Q1b〜Q4bで規定される直角四角形内の領域を示す。背景領域6bは、カード領域7b以外の領域を示す。
FIG. 15B shows four intersections Q1b to Q4b in the
その後、適宜、画像補正部13は、前述のS2Bの拡大/縮小やS2Cの処理を行う。画像補正部13は、補正後画像データ4Cとして、図15の(B)の画像5、あるいはその中から切り出したカード領域7bの画像を出力する。
Thereafter, the
[S22−詳細]
各ステップの処理の詳細について説明する。
[S22-Details]
Details of the processing of each step will be described.
図16は、S22の色境界点探索処理の詳細についての説明図である。画像5のうちの右上の一部領域を拡大で示す。S22で、画像補正部13は、画像5内のブロック単位で大まかに色の変化度合いが大きい箇所を特定し、その後、画素単位で詳しく色境界点を探索する。S22の処理は、以下のようなステップS22a〜S22fを有する。
FIG. 16 is an explanatory diagram illustrating details of the color boundary point search process in S22. A partial region at the upper right of the
(S22a) 画像補正部13は、前述の探索線(図11)の上を通るブロックをつくる。図16では、例として1つの探索線Liを示す。探索線Liに対応する端点piや色境界点qiを示す。画像5の上辺で右上の角点の近くにある端点piの場合を示す。ブロックは、例えば所定のサイズの正方形の画素領域とする。ブロックの例をブロックb1〜b6等で示す。例えば、ブロックb1は、端点piを対角点とする。ブロックb1の他方の対角点の付近で探索線Liが通る画素位置が、次のブロックb2の対角点(点r1)である。ブロックb2の他方の対角点の付近で探索線Liが通る画素位置が、次のブロックb3の対角点(点r2)である。同様に、順に、ブロックb4〜b6等が設定されている。また、結果から見て、色境界点qiを含んだブロックb3を、n番目(#n)のブロックとして示す。このn番目のブロックに対し、ブロックb1はn−2番目(#n−2)、ブロックb2はn−1番目(#n−1)、ブロックb4はn+1番目(#n+1)、ブロックb5はn+2番目(#n+2)である。探索範囲160は、ブロックb2,b3,b4の部分を示し、n番目のブロックb3の前後のブロックb2,b4を含む部分である。
(S22a) The
ブロックは、上記構成に限らず可能であり、例えば斜めの状態(探索線の方向に対して直交する辺を持つ形状)としてもよいし、長方形や他の形状としてもよい。 The block is not limited to the above-described configuration, and may be, for example, an oblique state (a shape having a side perpendicular to the direction of the search line), a rectangle, or another shape.
(S22b) 画像補正部13は、探索線Li上のブロック毎に順次に、ブロック内の画素値を用いて、ブロックの代表色(ciとする)を計算する。代表色は、例えば、ブロック内の全画素値の統計値として、平均値、最頻値等を用いることができる。本例では、ブロックb1の代表色c1等を示す。
(S22b) The
(S22c) 画像補正部13は、探索線Li上で順次に、ブロック間で代表色を比較し、注目したブロック(例えば#n,b3)の代表色(c3)が、1つ前のブロック(#n−1,b2)の代表色(c2)から大きく変化したかどうかを判断する。その判断では、例えば、所定の閾値を用いる。画像補正部13は、前後のブロックの代表色の差分値が、その閾値以上かどうかを判断する。画像補正部13は、注目したブロックの代表色が1つ前のブロックの代表色から大きく変化した場合、即ち差分値が閾値以上である場合、1つ前のブロック(#n−1,b2)から1つ後のブロック(#n+1,b4)までを、次の探索範囲160として設定する。S22cまでの処理は、探索線Li上で色境界点qiがありそうな箇所を大まかに特定している処理であり、おそらくn番目のブロック(#n)内であると推定される。推定したn番目のブロックに対して前後のブロックを含む範囲を探索範囲160として、次のS22d以降の処理で詳しく探索される。
(S22c) The
(S22d) 画像補正部13は、探索範囲160のブロック(例えばb2,b3,b4)について、色境界点qiを探索するため、以下の処理を行う。画像補正部13は、まず、n−1番目(あるいはn−2番目としてもよい)のブロック(#n−1,b2)の代表色(c2)を、背景色CB(背景領域6の代表色)として一時的に設定する。
(S22d) The
(S22e) 画像補正部13は、n+1番目(あるいはn+2番目としてもよい)のブロック(#n+1,b4)内で、画素値を用いて、背景色と文字成分の黒色(規定の色)とを除いた色を、カード色CC(カード領域7の代表色)として一時的に設定する。このカード色CCは、実際のカード3の表面の基本色に対応している。ここで除く規定の色とは、カード3の表面において規定のレイアウトとして記載される文字情報、マーク、その他の項目に関するすべての色である。例えば、赤色のマークがある場合、その赤色も除かれる。
(S22e) The
(S22f) 画像補正部13は、探索範囲160のブロック(b2,b3,b4)を通る探索線Li上の全画素について、探索開始点(点r1)から探索終了点(点r4)まで探索を行う。画像補正部13は、探索範囲160内において、着目の画素の色と背景色CBとの色差SB、及び着目の画素の色とカード色CCとの色差SCを計算し、それらのデータ値をメモリに一時的に保持する。
(S22f) The
図17は、色差SB及び色差SCのデータ値をプロットしたグラフを示す。横軸は探索範囲160内の放射線Li上の画素(点r1から点r4まで)、縦軸は色差の値を示す。曲線171は背景色CBとの色差SBを示し、曲線172はカード色CCとの色差SCを示す。点173は、色差SBの曲線171と色差SCの曲線172との交点を示す。点173に対応する画素が、色境界点qiとして決定される。点173は、背景色CBから遠くなり、カード色CCに近付いた点である。
FIG. 17 shows a graph plotting data values of the color difference SB and the color difference SC. The horizontal axis represents pixels on the radiation Li within the search range 160 (from point r1 to point r4), and the vertical axis represents the color difference value. A
なお、S22fの処理としては、基本的に、確実性を優先する場合、探索開始点(点r1)から順に探索終了点(点r4)まで画素値を調べるが、処理高速性を優先する場合、点173が得られた時点でその画素を色境界点qiとして決定し、処理を終了としてもよい。
As the processing of S22f, basically, when certainty is given priority, pixel values are examined in order from the search start point (point r1) to the search end point (point r4), but when priority is given to processing speed, When the
画像補正部13は、上記のような処理を、複数の各々の探索線について同様に繰り返す。なお、上記処理例では、端点piから中心点G0に向かって探索したが、変形例としては、同様に、中心点G0から端点piに向かって探索してもよい。また、複数の探索線の探索に関して、演算装置101の構成(例えば並列演算が可能な場合)によっては、順次ではなく、同時並列で探索処理を進めてもよい。
The
補足説明として、色差(S22の色差SB,SC)の定義は以下である。画素毎に、R(赤),G(緑),B(青)の各色の階調値(例えば256階調)を有する。前述の背景色CBやカード色CCも、それぞれ、R,G,Bの階調値を有する。前述の処理の際、注目画素値と背景色CBの画素値との間で、色差SBとして、ユークリッド距離が計算される。同様に、注目画素値とカード色CCの画素値との間で、色差SCとして、ユークリッド距離が計算される。例えば、色差SBであるユークリッド距離は、以下の式で表すことができる。注目画素値を{Kr,Kg,Kb}で表す。Kr等は階調値を示す。背景色CBの画素値を{K1r,K1g,K1b}で表す。式として、√{(Kr−K1r)^2+(Kg−K1g)^2+(Kb−K1b)^2}である。なお、明るさは、例えば、画素のR,G,Bの階調値のうちの最大値を用いて規定される。 As a supplementary explanation, the definition of the color difference (color differences SB and SC of S22) is as follows. Each pixel has gradation values (for example, 256 gradations) of R (red), G (green), and B (blue) colors. The aforementioned background color CB and card color CC also have gradation values of R, G, and B, respectively. During the above-described processing, the Euclidean distance is calculated as the color difference SB between the target pixel value and the pixel value of the background color CB. Similarly, the Euclidean distance is calculated as the color difference SC between the target pixel value and the pixel value of the card color CC. For example, the Euclidean distance that is the color difference SB can be expressed by the following equation. The pixel value of interest is represented by {Kr, Kg, Kb}. Kr and the like indicate gradation values. The pixel value of the background color CB is represented by {K1r, K1g, K1b}. As an equation, √ {(Kr−K1r) ^ 2 + (Kg−K1g) ^ 2 + (Kb−K1b) ^ 2}. Note that the brightness is defined using, for example, the maximum value among the R, G, and B gradation values of the pixel.
[S23−詳細]
図18は、S23のベクトル計算処理の詳細についての説明図である。以下では、変形例を含め、いくつかの可能な処理例を示す。
[S23-Details]
FIG. 18 is an explanatory diagram for details of the vector calculation processing of S23. In the following, some possible processing examples including modifications are shown.
図18の(A)は、第1処理例を示す。第1処理例は、図12と同様の基本処理であるが、画像5内で一番近い位置にある隣り合う色境界点同士でベクトルを設定する処理である。本例では、図12の画像5のうち上半分の領域を示す。カード領域7の上辺の付近に、9個の色境界点q5〜q13が並んでいる。隣り合う色境界点q5〜q13の間で、8個のベクトルv5〜v12が設定されている。例えば、図11のように反時計周りに調べてゆく場合において、色境界点q5に対し、左側にある一番近い色境界点は、色境界点q6である。そのため、色境界点q5から色境界点q6へのベクトルv5が設定される。次に、色境界点q6から、左側にある一番近い色境界点q7へ、同様にベクトルv6が設定される。
FIG. 18A shows a first processing example. The first processing example is the same basic processing as that in FIG. 12, but is a processing for setting a vector between adjacent color boundary points at the closest positions in the
図18の(B)は、変形例として、第2処理例を示す。第2処理例は、並んでいる複数の色境界点について、N個(例えば1個)ずつ飛ばす方式で、色境界点を選択して、選択した色境界点の間にベクトルを設定する処理である。この第2処理例によれば、計算する対象となる色境界点及びベクトルを削減して、処理時間を短縮できる。本例では、色境界点q5から、1つ隣の色境界点q6を飛ばして、次の色境界点q7を選択し、色境界点q5から色境界点q7へのベクトルva1が設定されている。次に、色境界点q7から、1つ隣の色境界点q8を飛ばして、次の色境界点q9を選択し、色境界点q7から色境界点q9へのベクトルva2が設定されている。同様に、ベクトルva3,va4が設定されている。この場合、得られるベクトルは約半数となっている。 FIG. 18B shows a second processing example as a modification. The second processing example is a process of selecting a color boundary point and setting a vector between the selected color boundary points by skipping N (for example, one) each of a plurality of arranged color boundary points. is there. According to this second processing example, it is possible to reduce the processing time by reducing the color boundary points and vectors to be calculated. In this example, the next color boundary point q7 is selected from the color boundary point q5 by skipping the next color boundary point q6, and the vector va1 from the color boundary point q5 to the color boundary point q7 is set. . Next, the next color boundary point q9 is selected from the color boundary point q7 by skipping the next color boundary point q8, and the vector va2 from the color boundary point q7 to the color boundary point q9 is set. Similarly, vectors va3 and va4 are set. In this case, the obtained vector is about half.
図18の(C)は、変形例として、第3処理例を示す。第3処理例は、並んでいる複数の色境界点について、順次に1個ずつ飛ばす方式で色境界点を選択し、選択した隣り合う色境界点の間にベクトルを設定する。更に、選択した隣り合う色境界点の中間点を、新たな色境界点として置き換えるように設定する。この処理の目的は、ベクトルに関する角度計算を平均化させて、色境界点が密の場合のベクトルのグループ化の精度を向上させることである。中間点である新色境界点を黒丸点で示す。本例では、まず、色境界点q5の次の色境界点q6に着目すると、その前後の色境界点q5,q7の間にベクトルvb1が設定されると共に、色境界点q5,q7の間の中間点が、色境界点q6に代わる新色境界点q6bとして設定される(なお、重なるのでずらして図示している)。次に、色境界点q6の次の色境界点q7に着目すると、その前後の色境界点q6,q8の間にベクトルvb2が設定されると共に、色境界点q6,q8の間の中間点が、色境界点q7に代わる新色境界点q7bとして設定される。同様に、各ベクトルvb3〜vb7及び新色境界点q8b〜q12bが得られる。この場合、以降の処理では、新色境界点q6b〜q12b等が使用される。 FIG. 18C shows a third processing example as a modification. In the third processing example, color boundary points are selected by a method of sequentially skipping one by one for a plurality of arranged color boundary points, and a vector is set between the selected adjacent color boundary points. Furthermore, it is set so that an intermediate point between the selected adjacent color boundary points is replaced with a new color boundary point. The purpose of this process is to average the angle calculations for the vectors to improve the vector grouping accuracy when the color boundary points are dense. The new color boundary point which is an intermediate point is indicated by a black dot. In this example, when attention is paid to the color boundary point q6 next to the color boundary point q5, the vector vb1 is set between the color boundary points q5 and q7 before and after the color boundary point q5, and between the color boundary points q5 and q7. The intermediate point is set as a new color boundary point q6b in place of the color boundary point q6 (note that it is shifted because it overlaps). Next, paying attention to the color boundary point q7 next to the color boundary point q6, the vector vb2 is set between the preceding and following color boundary points q6 and q8, and the intermediate point between the color boundary points q6 and q8 is The color boundary point q7b is set as a new color boundary point q7b. Similarly, vectors vb3 to vb7 and new color boundary points q8b to q12b are obtained. In this case, new color boundary points q6b to q12b are used in the subsequent processing.
図19は、第3処理例の詳細を示す。図19の(A)は、前述の図10の設定例に対応した画像5の下半分の領域を示す。領域191は、複数の色境界点が相対的に密に配置されている領域の例を示す。領域192は、複数の色境界点が相対的に疎に配置されている領域の例を示す。例えば、領域191は、カード領域7の下辺の中間付近であり、5個の色境界点が含まれている。それに対し、領域192は、領域191と同じような横幅で、カード領域7の下辺の右端付近であり、2個の色境界点が含まれている。図11のように、中心点G0から放射状に探索を行うことから、このように画像5内で色境界点が密な領域と疎な領域とが生じる。
FIG. 19 shows details of the third processing example. FIG. 19A shows a lower half area of the
図19の(B)は、色境界点が密な領域の例に関して、画素レベルで拡大したマトリクスで示す。図19の(B)は、第1処理例で、隣り合う色境界点同士でベクトルを計算する場合を示す。探索された色境界点に対応する画素を、画素px1〜px6で示す。色境界点の画素px1〜px6の間のベクトルを、ベクトルvc1〜vc5で示す。本例では、複数の色境界点の画素の位置に関してY方向でずれがある。画素px4は、他の画素に比べてY方向で上にずれている。画素px1,px2の間のベクトルvc1は、その向きを表す角度が180である(ベクトルvc2,vc5も同じ)。なお、ここでは、角度の基準として、面内のX軸の右を0度とし、反時計周りに360度まで角度をとるとする。一方、ずれがある色境界点の画素px4に関して、ベクトルvc3では角度が153度であり、ベクトルvc4では角度が207度である。 FIG. 19B shows a matrix enlarged at the pixel level for an example of an area where the color boundary points are dense. FIG. 19B shows a case where a vector is calculated between adjacent color boundary points in the first processing example. Pixels corresponding to the searched color boundary points are indicated by pixels px1 to px6. Vectors between the pixels px1 to px6 at the color boundary points are indicated by vectors vc1 to vc5. In this example, there is a shift in the Y direction with respect to the pixel positions of a plurality of color boundary points. The pixel px4 is shifted upward in the Y direction compared to the other pixels. The vector vc1 between the pixels px1 and px2 has an angle representing the direction of 180 (the same applies to the vectors vc2 and vc5). Here, as an angle reference, it is assumed that the right of the in-plane X axis is 0 degree and the angle is set to 360 degrees counterclockwise. On the other hand, regarding the pixel px4 at the color boundary point having a deviation, the angle is 153 degrees in the vector vc3, and the angle is 207 degrees in the vector vc4.
S21で画像端点及び探索線の数を多く設定した場合、色境界点の数が多くなり、色境界点同士の距離がとても小さくなる場合がある。上記例のように、色境界点が密な領域では、色境界点の位置の1画素の差でも、ベクトルの角度が急激に変化する場合がある。この場合、S24でベクトルをグループ化する際の判定の条件を、例えば角度差が10度以内とした場合、1画素の差で、例えばベクトルvc1とベクトルvc3とが異なるグループに分類されることになる。これは、分類の精度が低くなるので望ましくない。 When a large number of image end points and search lines are set in S21, the number of color boundary points increases, and the distance between the color boundary points may become very small. As in the above example, in an area where the color boundary points are dense, the angle of the vector may change abruptly even with a difference of one pixel at the position of the color boundary points. In this case, if the determination condition when grouping the vectors in S24 is, for example, an angle difference of 10 degrees or less, the vector vc1 and the vector vc3 are classified into different groups with a difference of one pixel, for example. Become. This is undesirable because it reduces the accuracy of the classification.
そこで、第3処理例では、ベクトルのグループ化の精度を高める。図19の(C)は、(B)と同様の色境界点が密な領域の例に関して、第3処理例を適用してベクトルを計算し、新色境界点を設定する場合を示す。新色境界点に対応する画素を、画素px2b〜px5bで示す。1つ飛ばしで設定されるベクトルを、ベクトルvd1〜vd4で示す。例えば、画素px1から画素px3へのベクトルvd1は、角度が180度であり、画素px2は、新色境界点の画素px2bになっている。画素px2から画素px4へのベクトルvd2は、角度が170度であり、画素px3は、新色境界点の画素px3bになっている。画素px3から画素px5へのベクトルvd3は、角度が180度であり、画素px4は、新色境界点の画素px4bになっている。画素px4から画素px6へのベクトルvd4は、角度が190度であり、画素px5は、新色境界点の画素px5bになっている。 Therefore, in the third processing example, the accuracy of vector grouping is increased. FIG. 19C shows a case where a vector is calculated by applying the third processing example and a new color boundary point is set with respect to an example of an area having a dense color boundary point similar to FIG. Pixels corresponding to the new color boundary point are indicated by pixels px2b to px5b. Vectors set by one skip are indicated by vectors vd1 to vd4. For example, the vector vd1 from the pixel px1 to the pixel px3 has an angle of 180 degrees, and the pixel px2 is the pixel px2b of the new color boundary point. The vector vd2 from the pixel px2 to the pixel px4 has an angle of 170 degrees, and the pixel px3 is the pixel px3b of the new color boundary point. The vector vd3 from the pixel px3 to the pixel px5 has an angle of 180 degrees, and the pixel px4 is the pixel px4b of the new color boundary point. The vector vd4 from the pixel px4 to the pixel px6 has an angle of 190 degrees, and the pixel px5 is the pixel px5b of the new color boundary point.
このように、色境界点が密な領域を考慮して、第3処理例を適用し、前後の色境界点を用いて色境界点同士の距離を確保する。これにより、(B)の第1処理例の場合よりも、ベクトルの角度の変化の差が小さくなっており、ベクトルvc3のように角度が急に変化することを抑えられる。得られた複数の新色境界点においては、位置のずれが小さくなっている。 As described above, the third processing example is applied in consideration of a region where the color boundary points are dense, and the distance between the color boundary points is secured using the front and rear color boundary points. Thereby, the difference in the change in the angle of the vector is smaller than in the case of the first processing example of (B), and it is possible to suppress the angle from changing suddenly as in the vector vc3. At the plurality of new color boundary points obtained, the positional deviation is small.
第3処理例の計算方法は、画像5内のすべての色境界点について行ってもよいし、例えば、所定の閾値を用いて色境界点同士の距離が近いと判断した場合の該当する色境界点のみについて行ってもよい。第3処理例を適用する場合、より精度を高めることができる。
The calculation method of the third processing example may be performed for all the color boundary points in the
[S24−詳細]
図20は、S24のグループ化処理の詳細についての説明図である。画像補正部13は、前述の図13の例のように得られた複数のベクトルを用いて、ベクトルに対応付けられた色境界点を、ベクトルの角度の類似性に基づいて、グループに分類する。分類されたグループが、カード領域7の辺に対応付けられる。図20では、ある画像の例(多数の色境界点を含む場合)におけるベクトルの角度のヒストグラムを示す。横軸はベクトルの角度(0〜360度)を示す。縦軸は頻度値を示す。破線円は、ベクトルの角度に関するグループとして、グループ201〜204を示す。グループ201は、角度が90度付近であるベクトルを含むグループであり、図13のカード領域7の右辺のグループg1に対応する。グループ202は、角度が180度付近であるベクトルを含むグループであり、上辺のグループg2に対応する。グループ203は、角度が270度付近であるベクトルを含むグループであり、左辺のグループg3に対応する。グループ204は、角度が360度(0度)付近であるベクトルを含むグループであり、下辺のグループg4に対応する。
[S24-Details]
FIG. 20 is an explanatory diagram for details of the grouping process of S24. The
S24の処理は、例えば以下のような処理を含む。(S24a)画像補正部13は、ベクトルの角度を用いて、図20のようなヒストグラムを作成する。(S24b)画像補正部13は、ヒストグラムから、角度及び頻度値に関する4つのピーク部分を探す。(S24c)画像補正部13は、4つのピーク部分に対応付けられる4つのベクトルを、4つのグループg1〜g4に分類する。(S24d)画像補正部13は、それぞれのグループで、ピーク部分に対応するベクトルの付近にある複数のベクトルを、そのグループに属するものとして分類する。画像補正部13は、グループ内のベクトルに対応付けられる色境界点を、そのグループに属するものとして分類する。
The process of S24 includes the following processes, for example. (S24a) The
カード領域7の一辺における複数の色境界点間の複数のベクトルは、角度が概ね類似となる。そのため、その類似性に基づいてグループに分けることができる。通常、処理がうまくいった場合、カード領域7の上下左右の4つの辺に対応して、4つのグループが検出できる。
A plurality of vectors between a plurality of color boundary points on one side of the
なお、S24の処理に関する変形例としては、ベクトルの角度ではなく、色境界点の画素の位置座標を用いてグループ化を行う処理としてもよい。あるいは、ベクトルの角度と色境界点の画素の位置座標との両方を用いてグループ化を行う処理としてもよい。 Note that, as a modified example related to the processing of S24, grouping may be performed using the position coordinates of the pixels of the color boundary point instead of the vector angle. Alternatively, the grouping may be performed using both the vector angle and the pixel coordinate of the color boundary point.
[ノイズ低減処理]
図21は、更に、ノイズ低減のための処理例についての説明図を示す。実施の形態の画像処理装置は、この処理を行うことにより、画像5内のノイズを低減し、より精度を高めることができる。図21の(A)は、画像5の一部における明るさムラやノイズの例を示す。本例では、画像5内のX方向で明るさにムラがある場合を簡略的な表現で示す(カード領域7でのムラは省略する)。X方向右側の領域ほど明るく(即ち色が白に近い)、左側の領域ほど暗い(即ち色が黒に近い)。また、本例では、画像5内にノイズが含まれている。ノイズ箇所を白や黒の点で示す。
[Noise reduction processing]
FIG. 21 is an explanatory diagram of a processing example for noise reduction. By performing this process, the image processing apparatus according to the embodiment can reduce noise in the
図21の(B)は、ノイズ低減のために画像5に適用するフィルタの例として、公知のぼかしフィルタを示す。画像補正部13は、入力の画像5を処理する際に、画素毎に、ぼかしフィルタを適用する。左側は、ある画素(pix5)とその周辺の画素を含む9個の画素を示す。右側は、ぼかしフィルタであるガウシアンフィルタの構成を示す。画素毎にフィルタの係数を示す。例えば、中心の画素(pix5)については、その画素値の16分の4の値を使用することを示す。上下左右にある画素(pix2,pix4,pix6,pix8)については、画素値の16分の2の値を使用することを示す。斜めの角点にある画素(pix1,pix3,pix7,pix9)については、画素値の16分の1の値を使用することを示す。各画素値に係数を乗算した値の総和値が、中心の画素(pix5)の新たな画素値として適用される。
FIG. 21B shows a known blur filter as an example of a filter applied to the
ぼかしフィルタの適用によって、画像5内のノイズが低減される。画像補正部13は、その画像5を用いて、前述の色境界点の探索等の処理を行う。これにより、カード領域7の検出等の精度を高めることができる。
By applying the blur filter, noise in the
実施の形態の画像処理の方式では、従来技術とは異なり、画像5内の背景領域6とカード領域7との色の差を用いて境界線を検出している。そのため、実施の形態の画像処理の方式は、画像5内の背景領域6の色とカード領域7の色との組み合わせのバリエーションに関して有効である。ただし、カメラ2による撮像画像は、上記例のように明るさムラやノイズを含む場合があり、画素レベルでみると、その画素の色が、背景領域6の色なのか、カード領域7の色なのか、ノイズその他なのか、判断が難しい場合がある。言い換えると、画素間の色の変化が、背景領域6からカード領域7への変化に対応するのか、それ以外の要因による変化に対応するのか、判断が難しい場合がある。
In the image processing system according to the embodiment, unlike the prior art, the boundary line is detected using the color difference between the
そこで、実施の形態では、まず、前述のように、ブロック単位で色の変化を調べる処理を行うことで、明るさムラやノイズによる影響を少なくしている。更に、上記のようにフィルタを用いたノイズ低減の処理を適用することで、明るさムラやノイズによる影響を少なくしている。 Therefore, in the embodiment, first, as described above, by performing the process of examining the color change in units of blocks, the influence of brightness unevenness and noise is reduced. Furthermore, by applying the noise reduction processing using a filter as described above, the influence of brightness unevenness and noise is reduced.
[効果等]
上記のように、実施の形態の画像処理装置によれば、本人確認証のカード3の撮像画像データに関する画像処理に関して、カード領域7に対する正確な俯瞰画像が得られるように高精度の補正処理ができる。特に、カメラ2によるカード3の撮像時の方向や照明状態等が適切ではなく、カード領域7に台形状の歪みがある画像の場合でも、カード領域7の検出精度を高くでき、歪み補正処理の精度を高くできる。特に、レイアウトにおける特徴情報が少ない種類のカード3の場合でも、カード領域7の検出精度及び歪み補正処理の精度を高くできる。実施の形態の画像処理装置によれば、カード3の表面のレイアウトや色、撮影時の背景の色等に関して、バリエーションが多い場合や、明るさにムラがある画像の場合でも、俯瞰画像への補正の精度を従来技術よりも高くすることができる。
[Effects]
As described above, according to the image processing apparatus of the embodiment, with respect to the image processing related to the captured image data of the
[比較例]
実施の形態の画像処理装置に対する比較例として、従来例の画像処理装置では、画像からカード領域の4つの辺を検出する場合、以下のような処理を行う。その画像処理装置は、入力画像であるフルカラー画像から、二値画像(画素値を白黒の二値に変換した画像)を生成する。その画像処理装置は、二値画像から、カード領域の4つの辺の直線部分を検出し、それらの直線の交点を、カード領域の4つの角点として検出する。その画像処理装置は、それらの4つの角点を用いて、射影変換を行うことで、カード領域の形状が直角四角形になるように補正する。しかしながら、二値画像においてカード領域の4つの辺が明瞭に写っていない場合、その補正ができない、または精度が低下する。例えば、カード領域と背景領域との明るさの差が小さい場合や明るさにムラがある場合、4つの辺の直線が写った二値画像が生成できない。
[Comparative example]
As a comparative example for the image processing apparatus according to the embodiment, the conventional image processing apparatus performs the following processing when detecting four sides of the card area from the image. The image processing apparatus generates a binary image (an image obtained by converting pixel values into black and white binary) from a full-color image that is an input image. The image processing apparatus detects straight line portions of four sides of the card area from the binary image, and detects intersections of the straight lines as four corner points of the card area. The image processing apparatus corrects the shape of the card area to be a right-angled square by performing projective transformation using these four corner points. However, when the four sides of the card area are not clearly shown in the binary image, the correction cannot be performed or the accuracy is lowered. For example, when the difference in brightness between the card area and the background area is small or the brightness is uneven, a binary image in which straight lines of four sides are reflected cannot be generated.
また、特許文献1のような技術の場合には、カード領域内の顔写真領域を特徴として利用し、その顔写真領域の形状、大きさや比率を用いて、カード領域の形状、大きさや比率を補正することができる。しかしながら、顔写真領域をうまく検出できない場合、その補正ができない、または精度が低下する。
In the case of the technique such as
[変形例]
実施の形態の画像処理装置の変形例として以下が挙げられる。図5のS2B,S2Cの公知の処理は、必要に応じて、S2Aの処理よりも前に行ってもよい。
[Modification]
Examples of modifications of the image processing apparatus according to the embodiment include the following. The known processes of S2B and S2C in FIG. 5 may be performed before the process of S2A as necessary.
実施の形態では、画像5の中心点G0から探索線を設定した。変形例として、画像5内のカード領域7に対応する台形状の領域の中心点(図6の点C0)を、概略位置座標でよいので任意の手法によって検出し設定する。そして、その台形状の領域の中心点C0から、同様に探索線Li及び端点piが設定される。
In the embodiment, the search line is set from the center point G0 of the
探索線Li及び端点piの設定数は、任意でよく、精度と処理速度とのバランス等を考慮して適宜設定すればよい。各種の設定は、実装上の設計事項としてもよいし、ユーザ設定を可能としてもよい。設定部17は、各種の設定の設定情報124を管理する。
The number of search lines Li and end points pi may be set arbitrarily, and may be set as appropriate in consideration of the balance between accuracy and processing speed. Various settings may be a design item on mounting, or user settings may be possible. The setting
実施の形態では、S22の色境界点qiの探索の際、複数の各々の探索線Liについて、判定用の閾値として、一律に固定の設定値を用いた。これに限らず、変形例では、探索線Li毎に、異なる閾値を適用してもよい。設定情報124にその閾値が含まれている。また、ある探索線Li上で、ある閾値を用いて判定した結果、色境界点qiが検出できなかったとする。その場合に、その閾値を他の値に変更し、その探索線Li上での探索を再試行させてもよい。例えば、最初は一律に基準の閾値を適用する。再試行時には、基準の閾値から、正負の各方向に、所定値で増減させることで、変更後の閾値を決めて適用する。
In the embodiment, when searching for the color boundary point qi in S22, a fixed set value is uniformly used as a determination threshold for each of the plurality of search lines Li. Not only this but in a modification, you may apply a different threshold value for every search line Li. The setting
S22の探索で、複数の探索線のうち一部の探索線で色境界点が検出できなくても、十分な数の色境界点が検出できた場合には、S23以降の処理を成立とする。即ち、ある程度以上の精度で、S25の4つの近似直線、S26の4つの角点が得られる。精度を考慮し、この十分な数の色境界点に関する最低数が設定されてもよい。例えば、画像5の辺毎に、その最低数として2とする。辺で2つの色境界点が検出できた場合、その2点を結ぶ近似直線をひくことができる。
If a sufficient number of color boundary points are detected even if some of the plurality of search lines cannot be detected in the search in S22, the processing from S23 is established. . That is, four approximate straight lines S25 and four corner points S26 are obtained with a certain degree of accuracy. In consideration of accuracy, a minimum number for this sufficient number of color boundary points may be set. For example, the minimum number is 2 for each side of the
また、S22の探索で、端点及び探索線の全数のうち、辺に対応付けられるグループ毎に、所定率(%)の数以上で色境界点が検出できた場合には、成立と判定してもよい。成立の場合、それらの色境界点を用いて、4つの近似直線及び角点が計算される。また、辺のグループ毎に所定数以上の色境界点が検出できずに不成立となった場合に、閾値を変更して再試行を行うようにしてもよい。 Further, in the search of S22, if the color boundary points can be detected at a predetermined rate (%) or more for each group associated with the side out of the total number of end points and search lines, it is determined to be established. Also good. If true, four approximate straight lines and corner points are calculated using these color boundary points. In addition, when a predetermined number or more of color boundary points cannot be detected for each group of sides and it is not established, the threshold value may be changed and a retry may be performed.
以上、本発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されず、その要旨を逸脱しない範囲で種々変更可能である。 Although the present invention has been specifically described above based on the embodiments, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention.
1…OCR装置、2…カメラ、3…カード、5…画像、6…背景領域、7…カード領域、13…画像補正部。
DESCRIPTION OF
Claims (6)
前記画像補正部は、前記画像補正処理で、前記画像から、カード領域と背景領域との色の差に基づいた色境界点を検出し、前記色境界点に基づいて、前記カード領域を検出し、前記カード領域の台形状の歪みが直角四角形になるように変換を行うことで、前記俯瞰した状態の補正後画像データを得る、
画像処理装置。 An image correction unit is provided that performs image correction processing on the image of the captured image data of the input identity verification card and outputs corrected image data in a state where the card surface is viewed from the vertical direction;
The image correction unit detects a color boundary point based on a color difference between a card area and a background area from the image and detects the card area based on the color boundary point in the image correction process. , By performing the conversion so that the trapezoidal distortion of the card area becomes a right-angled square, to obtain the corrected image data in the bird's-eye view state,
Image processing device.
前記画像補正部は、
前記画像内の一点と前記画像の枠線上の複数の各々の端点との間を結ぶ、複数の探索線を設定し、
前記複数の各々の探索線上で、前記色境界点を探索して、複数の色境界点を検出し、
前記複数の色境界点における前記色境界点同士を結ぶベクトルの類似性に基づいて、前記複数の色境界点を、4つのグループに分類し、
前記4つのグループの各々のグループ毎に、属する色境界点を用いて近似直線を引くことで、4つの近似直線を検出し、
前記4つの近似直線に基づいて、4つの交点を検出し、
前記4つの交点に基づいて、射影変換を行うことで、前記俯瞰した状態の補正後画像データを得る、
画像処理装置。 The image processing apparatus according to claim 1.
The image correction unit
Setting a plurality of search lines connecting between a point in the image and a plurality of end points on a border of the image;
Searching the color boundary points on each of the plurality of search lines to detect a plurality of color boundary points;
Classifying the plurality of color boundary points into four groups based on the similarity of vectors connecting the color boundary points in the plurality of color boundary points;
For each of the four groups, four approximate lines are detected by drawing approximate lines using the color boundary points to which the groups belong;
Based on the four approximate lines, four intersections are detected,
By performing projective transformation based on the four intersections, the corrected image data in the overhead state is obtained.
Image processing device.
前記画像補正部は、
前記探索線上に画素のブロックを設定し、
前記ブロック毎に代表色を計算し、
前記ブロック毎の代表色の変化度合いが大きいブロックを含む探索範囲を決定し、
前記背景領域の背景色を設定し、
前記カード領域のカード色を設定し、
前記探索範囲のブロックの前記探索線上で、画素毎に、前記背景色との第1色差、及び前記カード色との第2色差を計算し、
前記第1色差と前記第2色差との交点を、前記色境界点として決定する、
画像処理装置。 The image processing apparatus according to claim 2.
The image correction unit
Setting a block of pixels on the search line;
Calculate a representative color for each block,
Determining a search range including a block having a large degree of change in the representative color for each block;
Set the background color of the background area,
Set the card color of the card area,
On the search line of the search range block, for each pixel, calculate a first color difference with the background color and a second color difference with the card color;
An intersection of the first color difference and the second color difference is determined as the color boundary point;
Image processing device.
前記画像補正部は、
前記複数の色境界点において、隣り合う色境界点同士、または、N個ずつ飛ばした色境界点同士を結ぶ前記ベクトルを計算し、
前記ベクトルの向きを表す角度のヒストグラムに基づいて、前記4つのグループに分類する、
画像処理装置。 The image processing apparatus according to claim 2.
The image correction unit
In the plurality of color boundary points, calculating the vector connecting adjacent color boundary points or color boundary points skipped by N pieces,
Classify into the four groups based on a histogram of angles representing the orientation of the vectors;
Image processing device.
前記画像補正部は、
前記N個ずつ飛ばした色境界点同士を結ぶ前記ベクトルの中間点の画素を、新たな色境界点として置き換える、
画像処理装置。 The image processing apparatus according to claim 4.
The image correction unit
Replacing the pixel at the midpoint of the vector connecting the color boundary points skipped by N as new color boundary points;
Image processing device.
入力された本人確認証のカードの撮像画像データの画像に対し、画像補正処理を行って、カード表面を垂直方向から俯瞰した状態の補正後画像データを出力する、画像補正部を実現するプログラムを備え、
前記画像補正部は、前記画像補正処理で、前記画像から、カード領域と背景領域との色の差に基づいた色境界点を検出し、前記色境界点に基づいて、前記カード領域を検出し、前記カード領域の台形状の歪みが直角四角形になるように変換を行うことで、前記俯瞰した状態の補正後画像データを得る、
画像処理プログラム。 An image processing program for causing an image processing apparatus to perform image processing,
A program that realizes an image correction unit that performs image correction processing on an image of imaged image data of an input identity verification card and outputs corrected image data in a state where the card surface is viewed from the vertical direction. Prepared,
The image correction unit detects a color boundary point based on a color difference between a card area and a background area from the image and detects the card area based on the color boundary point in the image correction process. , By performing the conversion so that the trapezoidal distortion of the card area becomes a right-angled square, to obtain the corrected image data in the bird's-eye view state,
Image processing program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017031321A JP6797046B2 (en) | 2017-02-22 | 2017-02-22 | Image processing equipment and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017031321A JP6797046B2 (en) | 2017-02-22 | 2017-02-22 | Image processing equipment and image processing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018137636A true JP2018137636A (en) | 2018-08-30 |
JP6797046B2 JP6797046B2 (en) | 2020-12-09 |
Family
ID=63365810
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017031321A Active JP6797046B2 (en) | 2017-02-22 | 2017-02-22 | Image processing equipment and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6797046B2 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110929684A (en) * | 2019-12-09 | 2020-03-27 | 北京光年无限科技有限公司 | Content identification method and device for picture book |
JP2020057348A (en) * | 2018-03-30 | 2020-04-09 | エーオー カスペルスキー ラボAO Kaspersky Lab | System and method for identifying image containing identification document |
CN111311504A (en) * | 2020-01-03 | 2020-06-19 | 上海锦商网络科技有限公司 | Image processing method for mobile phone applet, label identification method and device |
JP2020178192A (en) * | 2019-04-16 | 2020-10-29 | 株式会社リコー | Edge detection device, tilt correction device, read device, image processing device, and edge detection method |
JP7540442B2 (en) | 2019-09-12 | 2024-08-27 | 日本電気株式会社 | Image analysis device, control method, and program |
-
2017
- 2017-02-22 JP JP2017031321A patent/JP6797046B2/en active Active
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020057348A (en) * | 2018-03-30 | 2020-04-09 | エーオー カスペルスキー ラボAO Kaspersky Lab | System and method for identifying image containing identification document |
JP2020178192A (en) * | 2019-04-16 | 2020-10-29 | 株式会社リコー | Edge detection device, tilt correction device, read device, image processing device, and edge detection method |
JP7211238B2 (en) | 2019-04-16 | 2023-01-24 | 株式会社リコー | Edge detection device, tilt correction device, reading device, image processing device, and edge detection method |
JP7540442B2 (en) | 2019-09-12 | 2024-08-27 | 日本電気株式会社 | Image analysis device, control method, and program |
CN110929684A (en) * | 2019-12-09 | 2020-03-27 | 北京光年无限科技有限公司 | Content identification method and device for picture book |
CN110929684B (en) * | 2019-12-09 | 2023-04-18 | 北京光年无限科技有限公司 | Content identification method and device for picture book |
CN111311504A (en) * | 2020-01-03 | 2020-06-19 | 上海锦商网络科技有限公司 | Image processing method for mobile phone applet, label identification method and device |
Also Published As
Publication number | Publication date |
---|---|
JP6797046B2 (en) | 2020-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3477931B1 (en) | Image processing method and device, readable storage medium and electronic device | |
JP6797046B2 (en) | Image processing equipment and image processing program | |
US8494256B2 (en) | Image processing apparatus and method, learning apparatus and method, and program | |
US7606439B2 (en) | Method for extracting raw data from an image resulting from a camera shot | |
KR101036787B1 (en) | Motion vector calculation method, hand-movement correction device using the method, imaging device, and motion picture generation device | |
JP6688277B2 (en) | Program, learning processing method, learning model, data structure, learning device, and object recognition device | |
CN108830133B (en) | Contract image picture identification method, electronic device and readable storage medium | |
CN110400278B (en) | Full-automatic correction method, device and equipment for image color and geometric distortion | |
US8923610B2 (en) | Image processing apparatus, image processing method, and computer readable medium | |
CN109711268B (en) | Face image screening method and device | |
CN111598074A (en) | Edge detection method and apparatus, electronic device, and storage medium | |
JP2006119817A (en) | Image processor | |
CN108197624A (en) | The recognition methods of certificate image rectification and device, computer storage media | |
JPWO2020213166A1 (en) | Image processing device, image processing method, and image processing program | |
JP5201184B2 (en) | Image processing apparatus and program | |
JP5051671B2 (en) | Information processing apparatus, information processing method, and program | |
CN115410191A (en) | Text image recognition method, device, equipment and storage medium | |
US8824734B2 (en) | Device, method and recording to determine depressed portions of image regions using shortcut line analysis | |
US11625886B2 (en) | Storage medium storing program, training method of machine learning model, and image generating apparatus | |
CN111091513B (en) | Image processing method, device, computer readable storage medium and electronic equipment | |
WO2022056875A1 (en) | Method and apparatus for segmenting nameplate image, and computer-readable storage medium | |
JP4708866B2 (en) | Lookup table creation device and method, and lookup table creation program | |
JP2006107018A (en) | Method and apparatus for image analysis, method and system for image processing, and operation program therefor | |
JP2004185183A (en) | Image correction device, character recognition method, and image correction program | |
CN112070081A (en) | Intelligent license plate recognition method based on high-definition video |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200109 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200911 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200923 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20201013 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20201027 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20201117 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6797046 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |