JP2018137636A - Image processing device and image processing program - Google Patents

Image processing device and image processing program Download PDF

Info

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
Application number
JP2017031321A
Other languages
Japanese (ja)
Other versions
JP6797046B2 (en
Inventor
広樹 飛奈
Hiroki Hina
広樹 飛奈
和美 鈴木
Kazumi Suzuki
和美 鈴木
和樹 中島
Kazuki Nakajima
和樹 中島
賢吾 稲村
Kengo Inamura
賢吾 稲村
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.)
Hitachi Information and Telecommunication Engineering Ltd
Original Assignee
Hitachi Information and Telecommunication Engineering 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 Hitachi Information and Telecommunication Engineering Ltd filed Critical Hitachi Information and Telecommunication Engineering Ltd
Priority to JP2017031321A priority Critical patent/JP6797046B2/en
Publication of JP2018137636A publication Critical patent/JP2018137636A/en
Application granted granted Critical
Publication of JP6797046B2 publication Critical patent/JP6797046B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a technique capable of executing correction processing with high accuracy so that a precise looked-down image can be obtained for a card region regarding image processing related to photographic image data on a card or the like for identity check.SOLUTION: An image processing device includes an image correction unit that applies image correction processing to an image of photographic image data on an input identity card and outputs post-correction image data in a looked-down state from a vertical direction of a card surface. The image correction unit detects (S22) a color boundary point based on difference of colors between a card region and a background region from the image during the image correction processing (S2), detects (S26) the card region on the basis of the color boundary point, makes a conversion (S27) so that a trapezoidal distortion of the card region becomes a right angle quadrangle, and thereby obtain a post-correction image in the looked-down state.SELECTED DRAWING: Figure 5

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.

特開2011−9986号公報JP 2011-9986 A

上記カメラによる本人確認証のカードの撮像画像データは、カード表面に記載の文字等の情報が、人や計算機によって認識できる、または認識しやすいことが望ましい。そのためには、基本的に、カード表面に対する垂直方向から俯瞰して撮影した画像(俯瞰画像と記載する場合がある)が使用されることが望ましい。その俯瞰画像では、理想的には、カード表面が直角四角形として写っている。   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 Patent Document 1, detection is performed using a facial photograph in the card as a feature. However, in the case of a card without a facial photograph, when it is difficult to detect a boundary line of a facial photograph, This is not effective when there are large individual differences. In Patent Document 1, contour extraction and Hough transform are used for card area detection. However, when the color difference between the background area and the card area is small, or when the brightness in the image is uneven. Is not valid.

本発明の目的は、本人確認証のカード等の撮像画像データに関する画像処理技術に関して、カード領域に対する正確な俯瞰画像が得られるように高精度の補正処理ができる技術を提供することである。   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.

本発明の実施の形態の画像処理装置を含むシステムの構成を示す図である。It is a figure which shows the structure of the system containing the image processing apparatus of embodiment of this invention. 実施の形態で、対象のカードの表面のレイアウトの構成例を示す図である。In embodiment, it is a figure which shows the structural example of the layout of the surface of the object card | curd. 実施の形態で、システムにおける利用概要を示す図である。In an embodiment, it is a figure showing an outline of use in a system. 実施の形態で、OCR装置における画像処理機能の各部の処理の概要を示す図である。In an embodiment, it is a figure showing an outline of processing of each part of an image processing function in an OCR device. 実施の形態で、OCR装置における画像処理のフローを示す図である。In an embodiment, it is a figure showing a flow of image processing in an OCR device. 実施の形態で、入力画像データに対応する画像の例を示す図である。In an embodiment, it is a figure showing an example of an image corresponding to input image data. 実施の形態で、他の画像の例を示す図である。In an embodiment, it is a figure showing an example of other pictures. 実施の形態で、他の画像の例を示す図である。In an embodiment, it is a figure showing an example of other pictures. 実施の形態で、S21に係わる画像の状態の第1例を示す図である。In an embodiment, it is a figure showing the 1st example of the state of the picture concerning S21. 実施の形態で、S21に係わる画像の状態の第2例を示す図である。In embodiment, it is a figure which shows the 2nd example of the state of the image concerning S21. 実施の形態で、S22の処理に係わる画像の状態を示す図である。In an embodiment, it is a figure showing a state of an image concerning processing of S22. 実施の形態で、S23の処理に係わる画像の状態を示す図である。In an embodiment, it is a figure showing a state of an image concerning processing of S23. 実施の形態で、S24の処理に係わる画像の状態を示す図である。In an embodiment, it is a figure showing a state of an image concerning processing of S24. 実施の形態で、S25の処理、及びS26の処理に係わる画像の状態を示す図である。In an embodiment, it is a figure showing the state of the image concerning processing of S25 and processing of S26. 実施の形態で、S27の処理に係わる画像の状態を示す図である。In an embodiment, it is a figure showing a state of an image concerning processing of S27. 実施の形態で、S22の処理の詳細についての説明図である。In embodiment, it is explanatory drawing about the detail of the process of S22. 実施の形態で、S22の色差をプロットしたグラフを示す図である。It is a figure which shows the graph which plotted the color difference of S22 in embodiment. 実施の形態で、S23の処理の詳細についての説明図である。In embodiment, it is explanatory drawing about the detail of the process of S23. 実施の形態で、S23の第3処理例の詳細についての説明図である。In embodiment, it is explanatory drawing about the detail of the 3rd process example of S23. 実施の形態で、S24の処理の詳細についての説明図である。In embodiment, it is explanatory drawing about the detail of the process of S24. 実施の形態で、ノイズ低減処理についての説明図である。In embodiment, it is explanatory drawing about a noise reduction process.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において同一部には原則として同一符号を付し、その繰り返しの説明は省略する。   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 apparatus 1. This system has an OCR device 1 and a camera 2. The user uses the OCR device 1 and the camera 2. The user has a personal identification card 3 such as a health insurance card. Note that the user who uses the two devices of the OCR device 1 and the camera 2 may be the same user or different users. For example, a resident may take an image of his / her card 3 with the camera 2, and a staff member of an administrative organization may input the captured image data into the OCR device 1.

OCR装置1は、スキャナ機能やOCR機能を備える専用の装置であり、更に特有の画像処理機能を備える画像処理装置である。スキャナ機能やOCR機能については、公知技術が適用可能であり、説明を省略する。   The OCR device 1 is a dedicated device having a scanner function and an OCR function, and further an image processing device having a unique image processing function. Known techniques can be applied to the scanner function and the OCR function, and a description thereof will be omitted.

ユーザは、カード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 card 3 with the camera 2. The camera 2 may be a digital camera or a camera function provided in a tablet terminal, a smartphone, or the like. The camera 2 can acquire, store, and output captured image data of the card 3. The user inputs the image data 4 </ b> A of the card 3 obtained by the camera 2 to the OCR device 1. The OCR device 1 inputs the image data 4A by an arbitrary means. For example, the OCR device 1 may be communicatively connected to the camera 2 and input image data 4A from the camera 2 through communication. Alternatively, the OCR device 1 may be connected to a PC or the like via a communication network and input the image data 4A from the PC or the like in which the image data 4A of the camera 2 is stored. Alternatively, the OCR device 1 may be connected to a memory card storing the image data 4A of the camera 2 and read and input the image data 4A from the memory card.

OCR装置1は、入力された画像データ4A(記憶装置102の画像データ122)に対して、補正処理を含む画像処理を行う。この補正処理は、拡大/縮小、位置シフト、回転等の公知の処理の他に、特有の歪み補正処理を含む。この歪み補正処理は、画像内のカード領域の台形状の歪みを、直角四角形の俯瞰画像になるように変換する処理である。これにより、補正後画像データとして、OCR処理や人の視認に適した画像データが得られる。OCR装置1は、補正後画像データに対してOCR処理を行い、その結果の文字データ123を得る。   The OCR device 1 performs image processing including correction processing on the input image data 4A (image data 122 of the storage device 102). This correction processing includes specific distortion correction processing in addition to known processing such as enlargement / reduction, position shift, and rotation. This distortion correction process is a process of converting the trapezoidal distortion of the card area in the image so that it becomes a right-angled overhead view image. As a result, image data suitable for OCR processing and human visual recognition is obtained as the corrected image data. The OCR device 1 performs OCR processing on the corrected image data, and obtains character data 123 as a result.

OCR装置1は、演算装置101、記憶装置102、スキャナ装置103、通信インタフェース装置104、入出力インタフェース装置105、入力装置106、表示装置107、外部記憶装置108等を有し、それらがバスを介して接続されている。   The OCR device 1 includes an arithmetic device 101, a storage device 102, a scanner device 103, a communication interface device 104, an input / output interface device 105, an input device 106, a display device 107, an external storage device 108, etc., which are connected via a bus. Connected.

演算装置101は、CPU、RAM、ROM等を含み、CPU等によるソフトウェアプログラム処理に基づいて、画像処理機能を実現する。詳しくは、CPUは、記憶装置102内の画像処理プログラム121をメモリに読み出して、画像処理プログラム121に従って処理を実行する。これにより、画像処理機能を構成する画像読み取り部11等の各部が実現される。演算装置101の画像処理機能は、各部として、画像読み取り部11、画像データ入力部12、画像補正部13、光学文字認識部14、文字データ出力部15、画像データ出力部16、設定部17等を含む。   The arithmetic device 101 includes a CPU, RAM, ROM, and the like, and realizes an image processing function based on software program processing by the CPU or the like. Specifically, the CPU reads the image processing program 121 in the storage device 102 into the memory and executes processing according to the image processing program 121. Thereby, each unit such as the image reading unit 11 constituting the image processing function is realized. The image processing function of the arithmetic device 101 includes, as each unit, an image reading unit 11, an image data input unit 12, an image correction unit 13, an optical character recognition unit 14, a character data output unit 15, an image data output unit 16, a setting unit 17, and the like. including.

記憶装置102には、画像処理プログラム121、画像データ122、文字データ123、設定情報124等が記憶されている。画像処理プログラム121は、予めOCR装置1内に格納、実装されていてもよいし、通信網上のサーバ等からダウンロードされてインストールされてもよい。画像データ122は、カメラ2によりカード3の表面が撮像された画像データ4Aの入力に基づいた画像データであり、補正前後の各画像データを含む。文字データ123は、画像データ122に基づいてOCR処理によって抽出された文字情報を含むデータである。設定情報124は、画像処理機能に係わる設定情報である。   The storage device 102 stores an image processing program 121, image data 122, character data 123, setting information 124, and the like. The image processing program 121 may be stored and installed in the OCR device 1 in advance, or may be downloaded from a server on a communication network and installed. The image data 122 is image data based on the input of the image data 4A obtained by capturing the surface of the card 3 by the camera 2, and includes each image data before and after correction. The character data 123 is data including character information extracted by OCR processing based on the image data 122. The setting information 124 is setting information related to the image processing function.

画像読み取り部11は、スキャナ装置103を制御して、用紙から画像を読み取る。スキャナ装置103は、公知の機構を有する。実施の形態では、用紙からの画像ではなく、カメラ3の画像データ4Aを用いる。   The image reading unit 11 controls the scanner device 103 to read an image from a sheet. The scanner device 103 has a known mechanism. In the embodiment, the image data 4A of the camera 3 is used instead of the image from the paper.

画像処理装置としては、上記専用のOCR装置1に限らずに可能である。変形例として、PCとOCRソフトウェアで構成される形態でもよい。そのOCRソフトウェアは、前述のOCR機能及び画像処理機能を備える画像処理プログラムに相当する。PCは、CPU等によって、ストレージ等に格納されている画像処理プログラムを読み出して実行し、図1の画像補正部13等を同様に実現する。   The image processing apparatus is not limited to the dedicated OCR apparatus 1 described above. As a modification, it may be configured by PC and OCR software. The OCR software corresponds to an image processing program having the aforementioned OCR function and image processing function. The PC reads and executes an image processing program stored in a storage or the like by a CPU or the like, and similarly realizes the image correction unit 13 or the like in FIG.

[画像処理装置(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 card 3. The image processing apparatus detects the position of the card area in the image by searching and estimating the boundary lines (four sides of the quadrangle) between the background area and the card area. The image processing apparatus searches for a color boundary point that is a boundary point of a color difference on a search line that connects an end point and a center point of an image frame. The image processing apparatus collects and groups a plurality of color boundary points obtained by the search. The image processing apparatus draws an approximate line associated with the side of the card area for each group. The image processing apparatus detects four corner points of the card area using four approximate lines. The image processing apparatus performs a known projective transformation based on the detected four corner points of the card area, thereby converting the trapezoidal distortion of the card area into a right-angled square. As a result, a high-accuracy bird's-eye view image, that is, an image captured from a direction perpendicular to the card surface is obtained.

画像処理装置は、その直角四角形を含む補正後画像から、必要に応じて、拡大/縮小、位置シフト、回転、切り出し等の公知の処理を行って、正立した状態のカード領域を含む、最終的な俯瞰画像を得る。例えば、画像処理装置は、補正後画像が、そのカードの規定の縦横比を持つ画像になるように、拡大/縮小を行う。最終的な俯瞰画像では、カード領域が、所定の好適なサイズ、比率、位置、向き等を持つ直角四角形として得られる。   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 camera 2 of the card 3 such as a health insurance card. In particular, even in the case of an image having a trapezoidal distortion, such as the direction and illumination state when the card 3 is photographed by the camera 2, the card area detection accuracy and distortion correction accuracy can be increased. In particular, even in the case of an image having a trapezoidal distortion with a type of card 3 having little feature information in the layout, it is possible to increase the card area detection accuracy and the distortion correction accuracy.

[本人確認証カード]
図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 target card 3. In FIG. 2, the layout is shown in a simplified manner in monochrome, but an actual card has a predetermined color design. This card 3 has many character items and few feature information such as ruled lines, marks and photographs. The card 3 has a rectangular shape on the surface, has a prescribed size, has a vertical length V0, a horizontal length H0, and a thickness, and has four corner points rounded by a round process.

[画像処理装置(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 card 3 with the camera 2. For example, in the case of a driver's license as a card, there are many characteristic information such as ruled lines in the card surface. In the case of a health insurance card as shown in FIG. 2, for example, the card 3 has little feature information such as ruled lines on the surface of the card 3. In the embodiment, effective image correction is realized even in the case of a card 3 of a type having a small amount of feature information.

図3の(B)は、画像データ入力の例を示す。入力の画像データ4Aは、背景領域の上にカード領域を有する。この例では、カード領域に、台形状の歪みがある。これは、撮像時の撮像方向のズレによって生じている。また、この例では、背景領域とカード領域との間で、明るさの差、即ち色の差が小さく、カード領域の4つの辺の境界線が不鮮明になっている。   FIG. 3B shows an example of image data input. The input image data 4A has a card area on the background area. In this example, the card area has a trapezoidal distortion. This is caused by a shift in the imaging direction during imaging. Further, in this example, the brightness difference, that is, the color difference between the background area and the card area is small, and the boundary lines of the four sides of the card area are unclear.

図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 OCR apparatus 1 which is the image processing apparatus of the embodiment. The image data input unit 12 inputs image data 4A to be subjected to image processing based on a user operation. For example, the image data input unit 12 inputs the image data 4A of the camera 2 through the communication interface device 104 or the input / output interface device 105, and stores the image data 122 in the storage device 102 as the image data 122, particularly the pre-correction image data 4B. The image data input unit 12 reads out the pre-correction image data 4B from the image data 122 of the storage device 102 as necessary, and inputs it to the image correction unit 13.

画像補正部13は、入力画像データである補正前画像データ4Bに対し、所定の補正処理を含む画像処理を行う。画像補正部13は、設定部17による設定情報124に基づいて、画像処理を行う。画像補正部13は、補正後画像データ4Cを出力し、記憶装置102内に格納する。   The image correction unit 13 performs image processing including predetermined correction processing on the pre-correction image data 4B that is input image data. The image correction unit 13 performs image processing based on the setting information 124 by the setting unit 17. The image correction unit 13 outputs the corrected image data 4 </ b> C and stores it in the storage device 102.

光学文字認識部(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 image data 4C, which is input image data, and obtains character data 123 as a result. The optical character recognition unit 14 outputs the character data 123 and stores it in the storage device 102.

文字データ出力部15は、ユーザ操作に基づいて、文字データ123をユーザや外部装置に対して出力する。例えば、文字データ出力部15は、表示装置107の画面に文字データ123の内容を表示する。例えば、文字データ出力部15は、文字データ123を、通信インタフェース装置104を通じて、外部装置に送信する。   The character data output unit 15 outputs the character data 123 to the user or an external device based on a user operation. For example, the character data output unit 15 displays the contents of the character data 123 on the screen of the display device 107. For example, the character data output unit 15 transmits the character data 123 to the external device via the communication interface device 104.

画像データ出力部16は、ユーザ操作に基づいて、補正後画像データ4Cをユーザや外部装置に対して出力する。例えば、画像データ出力部16は、表示装置107の画面に補正後画像データ4Cの内容を表示する。例えば、画像データ出力部16は、補正後画像データ4Cを、通信インタフェース装置104を通じて、外部装置に送信する。   The image data output unit 16 outputs the corrected image data 4C to the user or an external device based on a user operation. For example, the image data output unit 16 displays the content of the corrected image data 4C on the screen of the display device 107. For example, the image data output unit 16 transmits the corrected image data 4C to the external device via the communication interface device 104.

設定部17は、ユーザに対して設定画面を提供し、ユーザ操作に基づいて、画像処理機能に係わるユーザ設定を行う。設定部17は、設定情報124を記憶装置102に保存する。   The setting unit 17 provides a setting screen to the user, and performs user settings related to the image processing function based on a user operation. The setting unit 17 stores the setting information 124 in the storage device 102.

[画像処理フロー]
図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 OCR device 1. This flow shows a flow in the case where character data is output by performing OCR processing after image correction processing. FIG. 5 includes steps S1 to S5. Step S2 includes steps S2A to S2C. Step S2A includes steps S21 to S27. Hereinafter, it demonstrates in order of a step.

(S1) 図4のように、OCR装置1の画像データ入力部12は、カメラ2からの画像データ4Aを補正前画像データ4Bとして入力する。   (S1) As shown in FIG. 4, the image data input unit 12 of the OCR device 1 inputs the image data 4A from the camera 2 as pre-correction image data 4B.

(S2) OCR装置1の画像補正部13は、入力の補正前画像データ4Bに対して、画像補正処理を行い、補正後画像データ4Cを得る。S2の画像補正処理は、特有の歪み補正処理を行うステップS2A、拡大/縮小等の処理を行うステップS2B、位置シフト、回転、切り出し等の処理を行うステップS2Cを含む。S2BやS2Cは、公知の処理である。   (S2) The image correction unit 13 of the OCR device 1 performs an image correction process on the input uncorrected image data 4B to obtain corrected image data 4C. The image correction processing in S2 includes step S2A for performing specific distortion correction processing, step S2B for performing processing such as enlargement / reduction, and step S2C for performing processing such as position shift, rotation, and clipping. S2B and S2C are known processes.

(S2A) 画像補正部13は、S2Aで、特有の歪み補正処理を行う。この歪み補正処理は、カード領域及び位置を検出し、カード領域の台形状の歪みを直角四角形になるように補正する処理である。   (S2A) The image correction unit 13 performs a specific distortion correction process in S2A. This distortion correction process is a process of detecting the card area and position and correcting the trapezoidal distortion of the card area so that it becomes a right-angled square.

(S21) 画像補正部13は、S2Aの歪み補正処理の際、まず、S21で、補正前画像データ4Bの画像における複数の端点を計算する。画像補正部13は、画像の中心点と複数の各々の端点とを結ぶ各々の線を、探索線(放射線)として設定する。詳しくは、後述の図9等で示す。   (S21) When performing the distortion correction processing in S2A, the image correction unit 13 first calculates a plurality of end points in the image of the pre-correction image data 4B in S21. The image correction unit 13 sets each line connecting the center point of the image and each of the plurality of end points as a search line (radiation). Details are shown in FIG.

(S22) 画像補正部13は、S21の探索線に基づいて、複数の各々の探索線上で、背景領域とカード領域との色の差の境界点である色境界点を探索する。画像補正部13は、ある探索線から順に、同様にその処理を繰り返す。これにより、複数の色境界点が得られる。詳しくは、後述の図11等で示す。   (S22) Based on the search line of S21, the image correction unit 13 searches for a color boundary point that is a boundary point of the color difference between the background area and the card area on each of the plurality of search lines. The image correction unit 13 repeats the processing in the same manner in order from a certain search line. Thereby, a plurality of color boundary points are obtained. Details are shown in FIG.

(S23) 画像補正部13は、S22の色境界点に基づいて、色境界点同士のベクトルを計算する。詳しくは、後述の図12等で示す。   (S23) The image correction unit 13 calculates a vector between the color boundary points based on the color boundary points in S22. Details are shown in FIG.

(S24) 画像補正部13は、S23のベクトルに基づいて、色境界点をグループ化する。グループは、カード領域の四角形の辺に対応付けられる。詳しくは、後述の図13等で示す。   (S24) The image correction unit 13 groups color boundary points based on the vector of S23. Groups are associated with square sides of the card area. Details are shown in FIG.

(S25) 画像補正部13は、S24のグループに基づいて、近似直線を計算する。近似直線は、カード領域の四角形の辺に対応付けられる。詳しくは、後述の図14等で示す。   (S25) The image correction unit 13 calculates an approximate straight line based on the group of S24. The approximate line is associated with a square side of the card area. Details are shown in FIG.

(S26) 画像補正部13は、S25の近似直線に基づいて、交点を計算することで、カード領域の四角形の4つの角点を計算する。詳しくは、後述の図14等で示す。   (S26) The image correcting unit 13 calculates the four corner points of the quadrangle of the card area by calculating the intersection based on the approximate straight line of S25. Details are shown in FIG.

(S27) 画像補正部13は、S26の4つの角点に基づいて、公知の射影変換処理により、カード領域の四角形の台形状の歪みが直角四角形になるように補正する。詳しくは、後述の図15で示す。   (S27) Based on the four corner points of S26, the image correction unit 13 corrects the square trapezoidal distortion of the card area so as to become a right-angled square by a known projective transformation process. Details are shown in FIG.

(S2B) 画像補正部13は、S2Aで得た射影変換後の画像及び4つの角点に基づいて、S2Bで、カード領域の四角形が、規定の縦横比を持ち好適なサイズの四角形となるように、画像の拡大/縮小処理等を行う。   (S2B) Based on the image after the projective transformation obtained in S2A and the four corner points, the image correction unit 13 causes the square of the card area to be a square having a specified aspect ratio and a suitable size in S2B. In addition, image enlargement / reduction processing or the like is performed.

(S2C) 画像補正部13は、S2Bで得た画像に基づいて、S2Cで、画像内のカード領域の四角形の位置が好適な位置となるように位置シフト処理を行う。また、画像補正部13は、画像内のカード領域の向きが好適な向きとなるように、面内での回転処理を行う。また、画像補正部13は、画像内からカード領域のみを切り出す場合には、そのカード領域を切り出す処理を行う。なお、S2B,S2Cの処理は、適宜省略可能である。   (S2C) Based on the image obtained in S2B, the image correction unit 13 performs a position shift process in S2C so that the square position of the card area in the image is a suitable position. Further, the image correction unit 13 performs in-plane rotation processing so that the card area in the image has a preferable orientation. Further, when only the card area is cut out from the image, the image correction unit 13 performs a process of cutting out the card area. Note that the processing of S2B and S2C can be omitted as appropriate.

(S3) OCR部14は、S2で得られた補正後画像データ4Cに基づいて、まず、OCRのための読み取り位置及び領域を検出する。この読み取り位置及び領域は、例えばユーザ設定によって設定される。例えば、入力画像の原点を、矩形の左上の点とする。所定の位置座標の点(x1,y1)が読み取り開始位置(読み取り領域の左上の点)として設定される。所定の位置座標の点(x2,y2)が読み取り終了位置(読み取り領域の右下の点)として設定される。   (S3) Based on the corrected image data 4C obtained in S2, the OCR unit 14 first detects a reading position and region for OCR. The reading position and area are set by user settings, for example. For example, the origin of the input image is the upper left point of the rectangle. A point (x1, y1) at a predetermined position coordinate is set as the reading start position (the upper left point of the reading area). A point (x2, y2) at a predetermined position coordinate is set as the reading end position (the lower right point of the reading area).

(S4) OCR部14は、補正後画像データ4Cの読み取り領域に対し、OCR処理を行って文字を抽出し、結果である文字データ123を得る。   (S4) The OCR unit 14 performs OCR processing on the read area of the corrected image data 4C to extract characters, and obtains character data 123 as a result.

(S5) OCR部14は、S4で得た文字データ123に基づいて、OCRの後処理を行う。文字データ出力部15は、結果である文字情報を表示装置107の画面に表示する。ユーザは、画面に表示された文字情報を確認、チェックし、問題がある場合には修正する。   (S5) The OCR unit 14 performs OCR post-processing based on the character data 123 obtained in S4. The character data output unit 15 displays the resulting character information on the screen of the display device 107. The user checks and checks the character information displayed on the screen, and corrects if there is a problem.

[入力画像例(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 image 5 corresponding to the input image data 4A (pre-correction image data 4B) related to S21. The image 5 has a rectangle, and the upper left point is the origin (0, 0) of the position coordinates. The position coordinates of the pixel in the image 5 are represented by (x, y). The X direction is the in-plane horizontal direction (lateral direction), and the Y direction is the in-plane vertical direction (vertical direction). It is assumed that the horizontal length X1 and the vertical length Y1 of the image. The position coordinates of the upper right corner point are (X1, 0), the lower left corner point is (0, Y1), and the lower right corner point is (X1, Y1). The center point of the image 5 is a point G0, and the position coordinates are (X1 / 2, Y1 / 2). For the sake of explanation, the center point of the card area 7 in the image 5 is defined as a point C0. In the image 5, there are a background area 6 and a card area 7. Although the image 5 is simplified and shown in monochrome for the sake of explanation, it is actually full color and has gradation and unevenness depending on the situation such as illumination at the time of imaging.

図6の例では、画像5は、撮像方向として、カード表面に対する垂直方向に対し、ある程度の傾き角度があることで、カード領域7が台形状に歪んでいる場合を示す。また、本例では、カード領域7の縦横比は、規定の縦横比とは異なっており、X方向がやや拡大されている場合を示す。また、本例では、画像5内のカード領域7の配置の位置が、画像5の中心点G0に対して少しずれて配置されている場合を示す。   In the example of FIG. 6, the image 5 shows a case where the card region 7 is distorted in a trapezoidal shape due to a certain tilt angle with respect to the direction perpendicular to the card surface as the imaging direction. In this example, the aspect ratio of the card area 7 is different from the prescribed aspect ratio, and the X direction is slightly enlarged. Further, in this example, a case where the position of the card area 7 in the image 5 is slightly shifted from the center point G0 of the image 5 is shown.

[入力画像例(2)]
図7は、他の画像5の例を示す。本例では、画像5内で、背景領域6とカード領域7との境界線、即ちカード3の表面の縁である4つの辺が、不鮮明になっている部分が多い場合を示す。例えば、カード領域7の上辺や下辺は、殆ど映っていない。このような画像の場合、従来技術では、カード領域7の正確な検出が難しい。
[Input image example (2)]
FIG. 7 shows an example of another image 5. In this example, a case where there are many portions in the image 5 where the boundary line between the background region 6 and the card region 7, that is, the four sides which are the edges of the surface of the card 3, is unclear. For example, the upper and lower sides of the card area 7 are hardly shown. In the case of such an image, it is difficult to accurately detect the card area 7 with the conventional technique.

[入力画像例(3)]
図8は、他の画像5の例を示す。本例では、画像5内で、カード領域7の台形状の歪みは小さいが、カード領域7が左上寄りの位置で、面内で斜めに回転した状態で配置されており、画像5のサイズに対してカード領域7のサイズが比較的小さい。このような画像5の場合、補正処理として、拡大、位置シフト、回転等の処理を行う必要がある。
[Input image example (3)]
FIG. 8 shows an example of another image 5. In this example, the distortion of the trapezoidal shape of the card area 7 is small in the image 5, but the card area 7 is arranged at a position near the upper left in a state of being rotated obliquely in the plane, and the size of the image 5 On the other hand, the size of the card area 7 is relatively small. In the case of such an image 5, it is necessary to perform processing such as enlargement, position shift, and rotation as correction processing.

[画像処理(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 image 5 related to the image end point calculation processing in S21. The image correction unit 13 sets predetermined end points (also referred to as image end points) on the four frame lines of the rectangular frame of the image 5. The end point is represented by pi and is represented by a small square. In this example, in the coordinate system, the middle point of the right side of the image 5 is set as the end point p1 (position coordinates are (X1, Y1 / 2)), and the four sides are advanced counterclockwise from that point. Set the end point of. The image correction unit 13 calculates the position coordinates of each end point. In this example, a case where a total of 32 end points p1 to p32 are set is shown, but this is not a limitation. For example, the first end point p1 may be set near the origin (0, 0).

画像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 image 5, nine end points {p1 to p5, p29 to p32} including the corner points are equally spaced between the upper right corner point (end point p5) and the lower right corner point (end point p29). It is set to (1/8 of the vertical length Y1). On the upper side, between the upper right corner point (end point p5) and the upper left corner point (end point p13), the nine end points {p5 to p13} including the corner points are equally spaced (8 in the horizontal length X1). 1). Although the case where the equal interval on the right side and the equal interval on the upper side are different is shown, the present invention is not limited to this and can be set. Similarly, nine end points {p13 to p21} are set on the left side, and nine end points {p21 to p29} are set on the lower side.

画像補正部13は、探索線の設定にあたり、画像5の中心点G0を用いる。画像補正部13は、中心点G0と、複数の各々の端点とを結ぶ線を、探索線(放射線)として設定する。中心点G0から周りに放射状に探索線が延びている。探索線(放射線)をLiで表し、破線で示す。本例では、探索線L1〜L32が設定されている。探索線Liの一方端が中心点G0であり、他方端が端点piである。本例では、画像5の矩形枠の角点にも端点が設定されている。   The image correction unit 13 uses the center point G0 of the image 5 when setting the search line. The image correction unit 13 sets a line connecting the center point G0 and each of the plurality of end points as a search line (radiation). Search lines extend radially from the center point G0. A search line (radiation) is represented by Li and is represented by a broken line. In this example, search lines L1 to L32 are set. One end of the search line Li is the center point G0, and the other end is the end point pi. In this example, end points are also set at corner points of the rectangular frame of the image 5.

図10は、画像5の端点及び探索線の他の設定例を示す。中心点G0の周りに、一定の角度α(例えば約11度)の間隔で探索線を設定する場合を示す。これにより、画像5の矩形枠の枠線上において、複数の端点(合計32個)が設定されている。本例では、画像5の矩形枠の角点には端点が設定されていない。   FIG. 10 shows another setting example of the end points and search lines of the image 5. A case where search lines are set around the center point G0 at intervals of a constant angle α (for example, about 11 degrees) is shown. Thereby, a plurality of end points (a total of 32) are set on the border of the rectangular frame of the image 5. In this example, end points are not set at corner points of the rectangular frame of the image 5.

[画像処理(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 image 5 related to the color boundary point search processing in S22. A state in which the color boundary point is searched in the direction from the end point to the center point G0 on each search line is shown. A color boundary point between the background area 6 and the card area 7 is represented by qi, and is represented by a small rhombus. A color boundary point qi on the search line Li between the center point G0 and the end point pi. The search is performed in order from the search line L1 of the end point p1 to the search line L32 of the end point p32 in the counterclockwise direction. In 32 search lines L1 to L32, color boundary points q1 to q32 are obtained. In this example, a case where 32 color boundary points are successfully detected is shown, but some color boundary points may not be detected well.

[画像処理(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 image 5 related to the vector calculation process of S23. Adjacent color boundary points at a plurality of color boundary points {q1 to q32} are connected by a vector. Vectors between color boundary points are indicated by vectors v1 to v32. In this example, a case where 32 vectors are successfully detected is shown. For example, the vector v1 is a vector having the color boundary point q1 as the start point and the color boundary point q2 as the end point, and has information on the angle in the plane.

本例では、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 image 5 related to the grouping process in S24. Four groups are indicated by g1 to g4. In this example, there are six color boundary points q1 to q4, q31 and q32 in the vicinity of the right side of the card area 7, and five vectors v1 to v3, v31 and v32 connecting them. The five vectors v1 to v3, v31, and v32 have similar angles (in other words, the angle difference is less than a predetermined value). Therefore, six color boundary points corresponding to them are grouped as one group g1. Similarly, in the vicinity of the upper side of the card area 7, there are nine color boundary points q5 to q13, eight vectors v5 to v12 connecting them, and the nine color boundary points are one. Grouped as group g2. Near the left side of the card area 7, there are six color boundary points q14 to q19, five vectors v14 to v18 connecting them, and these six color boundary points are set as one group g3. Grouped. In the vicinity of the lower side of the card area 7, there are ten color boundary points q20 to q30, nine vectors v20 to v29 connecting them, and these ten color boundary points are grouped as one group g4. Grouped.

なお、カード領域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 card area 7 are not similar in angle to other vectors (in other words, the angle difference is greater than or equal to a predetermined value). Therefore, the color boundary points related to these vectors are excluded from consideration when grouping.

[画像処理(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 image 5 related to the approximate straight line calculation processing in S25 and the intersection calculation processing in S26. The image correction unit 13 draws an approximate line using the color boundary point for each group. In FIG. 14, an approximate straight line M1 is set in the image 5 using the color boundary points of the group g1. Similarly, an approximate straight line M2 is set using the color boundary points of the group g2. An approximate straight line M3 is set using the color boundary points of the group g3. An approximate straight line M4 is set using the color boundary points of the group g4. The approximate straight line can be calculated using, for example, a known least square method (a method for minimizing the sum of squares of residuals).

[画像処理(6)−S26]
画像補正部13は、近似直線の交点を計算する。図14の画像5では、4つの近似直線M1〜M4を用いて、それらの4つの交点Q1〜Q4が計算されている。例えば、近似直線M1と近似直線M2との交点Q1等である。交点を二重丸で示す。これらの4つの交点Q1〜Q4が、カード領域7の4つの角点として推定される点である。
[Image processing (6) -S26]
The image correction unit 13 calculates the intersection of the approximate lines. In the image 5 of FIG. 14, four intersection points Q1 to Q4 are calculated using four approximate straight lines M1 to M4. For example, the intersection Q1 between the approximate straight line M1 and the approximate straight line M2. The intersection is indicated by a double circle. These four intersections Q1 to Q4 are points estimated as four corner points of the card area 7.

[画像処理(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 image 5 related to the projective transformation in S27. The image correction unit 13 performs a known projective transformation using the four intersection points Q1 to Q4. The trapezoid indicated by the four points before conversion becomes a right-angled square indicated by the four points after conversion. FIG. 15A shows four intersections Q1 to Q4 in the image 5 before projective transformation. A point C0a indicates a center point with respect to the intersections Q1 to Q4 of the card area 7 before conversion.

図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 image 5 after projective transformation. The point C0b indicates the center point with respect to the intersections Q1b to Q4b of the card area 7b after conversion. The card area 7b indicates an area within a right-angled rectangle defined by the intersections Q1b to Q4b after conversion. The background area 6b indicates an area other than the card area 7b.

その後、適宜、画像補正部13は、前述のS2Bの拡大/縮小やS2Cの処理を行う。画像補正部13は、補正後画像データ4Cとして、図15の(B)の画像5、あるいはその中から切り出したカード領域7bの画像を出力する。   Thereafter, the image correction unit 13 appropriately performs the above-described S2B enlargement / reduction and S2C processing. The image correction unit 13 outputs the image 5 in FIG. 15B or the image of the card area 7b cut out from the image 5 as the corrected image data 4C.

[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 image 5 is shown in an enlarged manner. In S <b> 22, the image correction unit 13 specifies a portion where the degree of color change is roughly large in units of blocks in the image 5, and then searches for color boundary points in detail in units of pixels. The process of S22 includes the following steps S22a to S22f.

(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 image correction unit 13 creates a block that passes on the above-described search line (FIG. 11). In FIG. 16, one search line Li is shown as an example. An end point pi and a color boundary point qi corresponding to the search line Li are shown. The case of the end point pi near the upper right corner point on the upper side of the image 5 is shown. The block is, for example, a square pixel area having a predetermined size. Examples of blocks are indicated by blocks b1 to b6 and the like. For example, the block b1 has the end point pi as a diagonal point. The pixel position through which the search line Li passes in the vicinity of the other diagonal point of the block b1 is the diagonal point (point r1) of the next block b2. The pixel position through which the search line Li passes in the vicinity of the other diagonal point of the block b2 is the diagonal point (point r2) of the next block b3. Similarly, blocks b4 to b6 and the like are set in order. From the result, the block b3 including the color boundary point qi is shown as the nth (#n) block. The block b1 is n-2th (# n-2), the block b2 is n-1th (# n-1), the block b4 is n + 1th (# n + 1), and the block b5 is n + 2 with respect to the nth block. (# N + 2). The search range 160 indicates the portions of the blocks b2, b3, and b4, and includes the blocks b2 and b4 before and after the nth block b3.

ブロックは、上記構成に限らず可能であり、例えば斜めの状態(探索線の方向に対して直交する辺を持つ形状)としてもよいし、長方形や他の形状としてもよい。   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 image correction unit 13 calculates the block representative color (ci) using the pixel values in the block sequentially for each block on the search line Li. As the representative color, for example, an average value, a mode value, or the like can be used as a statistical value of all the pixel values in the block. In this example, the representative color c1 and the like of the block b1 are shown.

(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 image correcting unit 13 sequentially compares the representative colors between the blocks on the search line Li, and the representative color (c3) of the focused block (eg, #n, b3) is the previous block ( It is determined whether or not there is a significant change from the representative color (c2) of # n-1, b2). In the determination, for example, a predetermined threshold is used. The image correction unit 13 determines whether the difference value between the representative colors of the preceding and succeeding blocks is equal to or greater than the threshold value. When the representative color of the target block has changed significantly from the representative color of the previous block, that is, when the difference value is equal to or greater than the threshold value, the image correcting unit 13 is the previous block (# n−1, b2). To the next block (# n + 1, b4) is set as the next search range 160. The processing up to S22c is processing that roughly specifies a place where the color boundary point qi is likely on the search line Li, and is presumed to be probably in the nth block (#n). The range including the preceding and succeeding blocks with respect to the estimated nth block is set as a search range 160, and the search is performed in detail in the processing subsequent to S22d.

(S22d) 画像補正部13は、探索範囲160のブロック(例えばb2,b3,b4)について、色境界点qiを探索するため、以下の処理を行う。画像補正部13は、まず、n−1番目(あるいはn−2番目としてもよい)のブロック(#n−1,b2)の代表色(c2)を、背景色CB(背景領域6の代表色)として一時的に設定する。   (S22d) The image correction unit 13 performs the following processing to search for the color boundary point qi for the blocks (for example, b2, b3, b4) in the search range 160. First, the image correction unit 13 uses the background color CB (representative color of the background region 6) as the representative color (c2) of the (n-1) th (or n-2th) block (# n-1, b2). ) As a temporary setting.

(S22e) 画像補正部13は、n+1番目(あるいはn+2番目としてもよい)のブロック(#n+1,b4)内で、画素値を用いて、背景色と文字成分の黒色(規定の色)とを除いた色を、カード色CC(カード領域7の代表色)として一時的に設定する。このカード色CCは、実際のカード3の表面の基本色に対応している。ここで除く規定の色とは、カード3の表面において規定のレイアウトとして記載される文字情報、マーク、その他の項目に関するすべての色である。例えば、赤色のマークがある場合、その赤色も除かれる。   (S22e) The image correction unit 13 uses the pixel value in the n + 1th (or n + 2th) block (# n + 1, b4) to obtain the background color and the black color (defined color) of the character component. The excluded color is temporarily set as the card color CC (representative color of the card area 7). This card color CC corresponds to the basic color of the surface of the actual card 3. The specified colors excluded here are all colors related to character information, marks, and other items described as a specified layout on the surface of the card 3. For example, if there is a red mark, the red color is also removed.

(S22f) 画像補正部13は、探索範囲160のブロック(b2,b3,b4)を通る探索線Li上の全画素について、探索開始点(点r1)から探索終了点(点r4)まで探索を行う。画像補正部13は、探索範囲160内において、着目の画素の色と背景色CBとの色差SB、及び着目の画素の色とカード色CCとの色差SCを計算し、それらのデータ値をメモリに一時的に保持する。   (S22f) The image correction unit 13 searches for all pixels on the search line Li passing through the block (b2, b3, b4) in the search range 160 from the search start point (point r1) to the search end point (point r4). Do. In the search range 160, the image correction unit 13 calculates a color difference SB between the color of the pixel of interest and the background color CB, and a color difference SC between the color of the pixel of interest and the card color CC, and stores these data values in the memory. Hold temporarily.

図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 curve 171 indicates the color difference SB from the background color CB, and a curve 172 indicates the color difference SC from the card color CC. A point 173 indicates an intersection point between the color difference SB curve 171 and the color difference SC curve 172. A pixel corresponding to the point 173 is determined as the color boundary point qi. A point 173 is a point that is far from the background color CB and approaches the card color CC.

なお、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 point 173 is obtained, the pixel may be determined as the color boundary point qi, and the process may be terminated.

画像補正部13は、上記のような処理を、複数の各々の探索線について同様に繰り返す。なお、上記処理例では、端点piから中心点G0に向かって探索したが、変形例としては、同様に、中心点G0から端点piに向かって探索してもよい。また、複数の探索線の探索に関して、演算装置101の構成(例えば並列演算が可能な場合)によっては、順次ではなく、同時並列で探索処理を進めてもよい。   The image correction unit 13 repeats the above processing in the same manner for each of a plurality of search lines. In the above processing example, the search is performed from the end point pi toward the center point G0. However, as a modified example, similarly, the search may be performed from the center point G0 toward the end point pi. In addition, regarding the search for a plurality of search lines, the search processing may be performed in parallel instead of sequentially depending on the configuration of the arithmetic device 101 (for example, when parallel operation is possible).

補足説明として、色差(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 image 5. In this example, the upper half area of the image 5 in FIG. 12 is shown. Nine color boundary points q5 to q13 are arranged in the vicinity of the upper side of the card area 7. Eight vectors v5 to v12 are set between adjacent color boundary points q5 to q13. For example, in the case of examining counterclockwise as shown in FIG. 11, the closest color boundary point on the left side with respect to the color boundary point q5 is the color boundary point q6. Therefore, a vector v5 from the color boundary point q5 to the color boundary point q6 is set. Next, the vector v6 is similarly set from the color boundary point q6 to the closest color boundary point q7 on the left side.

図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 image 5 corresponding to the setting example of FIG. 10 described above. An area 191 shows an example of an area where a plurality of color boundary points are relatively densely arranged. An area 192 shows an example of an area where a plurality of color boundary points are relatively sparsely arranged. For example, the area 191 is near the middle of the lower side of the card area 7 and includes five color boundary points. On the other hand, the area 192 has a horizontal width similar to that of the area 191 and is near the right end of the lower side of the card area 7 and includes two color boundary points. As shown in FIG. 11, since the search is performed radially from the center point G0, a region having a dense color boundary point and a region having a sparse color boundary point are generated in the image 5 as described above.

図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 image 5, for example, the corresponding color boundary when it is determined that the distance between the color boundary points is close using a predetermined threshold value. It may be done only for points. When the third processing example is applied, the accuracy can be further increased.

[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 image correction unit 13 classifies the color boundary points associated with the vectors into groups based on the similarity of the angles of the vectors using the plurality of vectors obtained as in the example of FIG. 13 described above. . The classified group is associated with the side of the card area 7. FIG. 20 shows a histogram of vector angles in an example of an image (including a large number of color boundary points). The horizontal axis indicates the vector angle (0 to 360 degrees). The vertical axis represents the frequency value. Dashed circles indicate groups 201 to 204 as groups relating to vector angles. The group 201 is a group including a vector whose angle is around 90 degrees, and corresponds to the group g1 on the right side of the card area 7 in FIG. The group 202 is a group including a vector whose angle is around 180 degrees, and corresponds to the group g2 on the upper side. The group 203 is a group including a vector whose angle is around 270 degrees, and corresponds to the group g3 on the left side. The group 204 is a group including a vector whose angle is around 360 degrees (0 degree), and corresponds to the lower group g4.

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 image correction unit 13 creates a histogram as shown in FIG. 20 using the angle of the vector. (S24b) The image correction unit 13 searches for four peak portions related to the angle and the frequency value from the histogram. (S24c) The image correcting unit 13 classifies the four vectors associated with the four peak portions into four groups g1 to g4. (S24d) In each group, the image correction unit 13 classifies a plurality of vectors near the vector corresponding to the peak portion as belonging to the group. The image correction unit 13 classifies the color boundary points associated with the vectors in the group as belonging to the group.

カード領域7の一辺における複数の色境界点間の複数のベクトルは、角度が概ね類似となる。そのため、その類似性に基づいてグループに分けることができる。通常、処理がうまくいった場合、カード領域7の上下左右の4つの辺に対応して、4つのグループが検出できる。   A plurality of vectors between a plurality of color boundary points on one side of the card area 7 are substantially similar in angle. Therefore, it can be divided into groups based on the similarity. Normally, when the processing is successful, four groups can be detected corresponding to the four sides of the card area 7 in the vertical and horizontal directions.

なお、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 image 5 and improve accuracy. FIG. 21A shows an example of uneven brightness and noise in a part of the image 5. In this example, a case where the brightness is uneven in the X direction in the image 5 is shown by a simple expression (the unevenness in the card area 7 is omitted). The region on the right side in the X direction is brighter (that is, the color is closer to white), and the region on the left side is darker (that is, the color is closer to black). In this example, noise is included in the image 5. Noise points are indicated by white or black dots.

図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 image 5 for noise reduction. The image correction unit 13 applies a blur filter for each pixel when processing the input image 5. The left side shows nine pixels including a certain pixel (pix5) and surrounding pixels. The right side shows the configuration of a Gaussian filter that is a blurring filter. A filter coefficient is shown for each pixel. For example, for the center pixel (pix5), it indicates that the value of 4/16 of the pixel value is used. For pixels on the top, bottom, left and right (pix2, pix4, pix6, pix8), it indicates that the value of 2/16 of the pixel value is used. For pixels (pix1, pix3, pix7, pix9) at diagonal corner points, it indicates that a value of 1/16 of the pixel value is used. A total value obtained by multiplying each pixel value by a coefficient is applied as a new pixel value of the center pixel (pix5).

ぼかしフィルタの適用によって、画像5内のノイズが低減される。画像補正部13は、その画像5を用いて、前述の色境界点の探索等の処理を行う。これにより、カード領域7の検出等の精度を高めることができる。   By applying the blur filter, noise in the image 5 is reduced. The image correction unit 13 uses the image 5 to perform processing such as the search for the color boundary point described above. Thereby, the precision of detection of the card area | region 7 etc. can be improved.

実施の形態の画像処理の方式では、従来技術とは異なり、画像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 background area 6 and the card area 7 in the image 5. Therefore, the image processing method according to the embodiment is effective with respect to variations in the combination of the color of the background area 6 and the color of the card area 7 in the image 5. However, the image captured by the camera 2 may include brightness unevenness and noise as in the above example. When viewed at the pixel level, the color of the pixel is the color of the background region 6 or the color of the card region 7. It may be difficult to determine whether it is noise or not. In other words, it may be difficult to determine whether a color change between pixels corresponds to a change from the background area 6 to the card area 7 or a change due to other factors.

そこで、実施の形態では、まず、前述のように、ブロック単位で色の変化を調べる処理を行うことで、明るさムラやノイズによる影響を少なくしている。更に、上記のようにフィルタを用いたノイズ低減の処理を適用することで、明るさムラやノイズによる影響を少なくしている。   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 card 3 of the identity verification card, high-precision correction processing is performed so that an accurate overhead image with respect to the card area 7 can be obtained. it can. In particular, even in the case of an image in which the card 2 is imaged by the camera 2 and the lighting state are not appropriate and the card area 7 has a trapezoidal distortion, the detection accuracy of the card area 7 can be increased, and distortion correction processing can be performed. The accuracy can be increased. In particular, even in the case of a type of card 3 with little feature information in the layout, the detection accuracy of the card area 7 and the accuracy of distortion correction processing can be increased. According to the image processing apparatus of the embodiment, even when there are a lot of variations in the layout and color of the surface of the card 3, the background color at the time of shooting, etc. The accuracy of correction can be made higher than that of the prior art.

[比較例]
実施の形態の画像処理装置に対する比較例として、従来例の画像処理装置では、画像からカード領域の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 Patent Document 1, the face photo area in the card area is used as a feature, and the shape, size, and ratio of the card area are determined using the shape, size, and ratio of the face photo area. It can be corrected. However, when the face photograph area cannot be detected well, the correction cannot be performed or the accuracy is lowered.

[変形例]
実施の形態の画像処理装置の変形例として以下が挙げられる。図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 image 5. As a modification, the center point (point C0 in FIG. 6) of the trapezoidal area corresponding to the card area 7 in the image 5 may be approximate position coordinates, and is detected and set by an arbitrary method. The search line Li and the end point pi are similarly set from the center point C0 of the trapezoidal region.

探索線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 unit 17 manages setting information 124 for various settings.

実施の形態では、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 information 124 includes the threshold value. Further, it is assumed that the color boundary point qi cannot be detected as a result of determination using a certain threshold on a certain search line Li. In that case, the threshold value may be changed to another value, and the search on the search line Li may be retried. For example, the reference threshold value is applied uniformly at the beginning. At the time of retry, the changed threshold value is determined and applied by increasing / decreasing by a predetermined value in each of positive and negative directions from the reference threshold value.

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 image 5. When two color boundary points can be detected on the side, an approximate straight line connecting the two points can be drawn.

また、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 SYMBOLS 1 ... OCR apparatus, 2 ... Camera, 3 ... Card, 5 ... Image, 6 ... Background area | region, 7 ... Card area | region, 13 ... Image correction part.

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.
請求項1記載の画像処理装置において、
前記画像補正部は、
前記画像内の一点と前記画像の枠線上の複数の各々の端点との間を結ぶ、複数の探索線を設定し、
前記複数の各々の探索線上で、前記色境界点を探索して、複数の色境界点を検出し、
前記複数の色境界点における前記色境界点同士を結ぶベクトルの類似性に基づいて、前記複数の色境界点を、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.
請求項2記載の画像処理装置において、
前記画像補正部は、
前記探索線上に画素のブロックを設定し、
前記ブロック毎に代表色を計算し、
前記ブロック毎の代表色の変化度合いが大きいブロックを含む探索範囲を決定し、
前記背景領域の背景色を設定し、
前記カード領域のカード色を設定し、
前記探索範囲のブロックの前記探索線上で、画素毎に、前記背景色との第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.
請求項2記載の画像処理装置において、
前記画像補正部は、
前記複数の色境界点において、隣り合う色境界点同士、または、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.
請求項4記載の画像処理装置において、
前記画像補正部は、
前記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.
JP2017031321A 2017-02-22 2017-02-22 Image processing equipment and image processing program Active JP6797046B2 (en)

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 (4)

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

Cited By (6)

* Cited by examiner, † Cited by third party
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
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
US8494256B2 (en) Image processing apparatus and method, learning apparatus and method, and program
KR101036787B1 (en) Motion vector calculation method, hand-movement correction device using the method, imaging device, and motion picture generation device
US7606439B2 (en) Method for extracting raw data from an image resulting from a camera shot
JP6797046B2 (en) Image processing equipment and image processing program
CN108830133B (en) Contract image picture identification method, electronic device and readable storage medium
US20110211233A1 (en) Image processing device, image processing method and computer program
CN106934806B (en) It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus
US8923610B2 (en) Image processing apparatus, image processing method, and computer readable medium
CN109711268B (en) Face image screening method and device
JP2006119817A (en) Image processor
JP2004166007A (en) Device, method and program for image processing, and storage medium
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
CN115410191A (en) Text image recognition method, device, equipment and storage medium
JP5708305B2 (en) Image recognition apparatus, image recognition method, and computer program for image recognition
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
JP5051671B2 (en) Information processing apparatus, information processing method, and program
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
JP2004185183A (en) Image correction device, character recognition method, and image correction program
CN112070081A (en) Intelligent license plate recognition method based on high-definition video
JP2006107018A (en) Method and apparatus for image analysis, method and system for image processing, and operation program therefor

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