Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6447890B2 - Line segment extractor, control method and program for line segment extractor - Google Patents
[go: Go Back, main page]

JP6447890B2 - Line segment extractor, control method and program for line segment extractor - Google Patents

Line segment extractor, control method and program for line segment extractor Download PDF

Info

Publication number
JP6447890B2
JP6447890B2 JP2017084433A JP2017084433A JP6447890B2 JP 6447890 B2 JP6447890 B2 JP 6447890B2 JP 2017084433 A JP2017084433 A JP 2017084433A JP 2017084433 A JP2017084433 A JP 2017084433A JP 6447890 B2 JP6447890 B2 JP 6447890B2
Authority
JP
Japan
Prior art keywords
line segment
image
line
intersection
polygon
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.)
Active
Application number
JP2017084433A
Other languages
Japanese (ja)
Other versions
JP2018181244A (en
Inventor
直視 相川
直視 相川
Original Assignee
ウォンテッドリー株式会社
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 ウォンテッドリー株式会社 filed Critical ウォンテッドリー株式会社
Priority to JP2017084433A priority Critical patent/JP6447890B2/en
Publication of JP2018181244A publication Critical patent/JP2018181244A/en
Application granted granted Critical
Publication of JP6447890B2 publication Critical patent/JP6447890B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Description

本発明は、線分抽出装置、線分抽出装置の制御方法及びプログラムに関する。   The present invention relates to a line segment extraction apparatus, a control method for the line segment extraction apparatus, and a program.

近年、カメラ機能を備えたスマートフォンや携帯電話機、タブレットなどの携帯端末が普及し、手軽に写真撮影が行えるようになっている。   In recent years, mobile terminals such as smartphones, mobile phones, and tablets equipped with a camera function have become widespread, and it has become possible to take pictures easily.

またこのような携帯端末を用いて撮影された写真を加工して利用するアプリケーションソフトウェアも様々に開発されている。例えば、携帯端末を用いて撮影した名刺を電子化する技術が開発されている(例えば特許文献1参照)。   Various application software that processes and uses photographs taken using such portable terminals have been developed. For example, a technique for digitizing a business card taken using a mobile terminal has been developed (see, for example, Patent Document 1).

また、画像中のエッジ点の集合から輪郭を抽出する技術も開発されている(例えば特許文献2参照)。   A technique for extracting a contour from a set of edge points in an image has also been developed (see, for example, Patent Document 2).

特開2003−296353号公報JP 2003-296353 A 特開2004−234278号公報JP 2004-234278 A

しかしながら、携帯端末で実行されるアプリケーションソフトウェアは、ユーザの待ち時間が長くならないように高速に動作することが求められ、特許文献1のように名刺を電子化する場合も同様である。   However, the application software executed on the portable terminal is required to operate at high speed so that the waiting time of the user does not become long, and the same applies to the case where the business card is digitized as in Patent Document 1.

そのため、カメラにより撮影された静止画像から、名刺のような多角形の撮影対象物の輪郭をなす線分をより高速に特定可能とするような技術が求められている。   For this reason, there is a demand for a technique that can identify a line segment that forms the outline of a polygonal object to be photographed, such as a business card, from a still image photographed by a camera.

本発明は上記課題を鑑みてなされたものであり、画像から線分をより高速に特定することを可能とする線分抽出装置、線分抽出装置の制御方法及びプログラムを提供することを一つの目的とする。   The present invention has been made in view of the above problems, and provides a line segment extraction apparatus, a line segment extraction apparatus control method, and a program capable of specifying a line segment from an image at higher speed. Objective.

一つの側面に係る線分抽出装置は、画像から線分を抽出する線分抽出装置であって、前記画像からエッジを検出するエッジ検出部と、前記画像内で第1方向に所定間隔で延伸する複数の第1平行線と、前記エッジと、の交点を求める第1交点特定部と、隣接する2本の第1平行線の各ペアについて、互いの第1平行線上の前記交点同士を直線の結合線で結ぶ第1交点結合部と、前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する第1線分特定部と、を備える。   A line segment extraction device according to one aspect is a line segment extraction device that extracts a line segment from an image, and an edge detection unit that detects an edge from the image and extends at a predetermined interval in the first direction in the image The intersections on the first parallel lines of each pair of the first intersection specifying part for obtaining the intersection of the plurality of first parallel lines and the edge and the two adjacent first parallel lines are straight lines. A first intersection connecting portion connected by the connecting line and a plurality of the connecting lines connected at the intersection, and a set of the connecting lines having an angle difference in the extending direction within a predetermined range is extracted as the line segment. A line segment specifying unit.

その他、本願が開示する課題、及びその解決方法は、発明を実施するための形態の欄の記載、及び図面の記載等により明らかにされる。   In addition, the problems disclosed by the present application and the solutions thereof will be clarified by the description in the column of the embodiment for carrying out the invention and the description of the drawings.

画像から線分をより高速に特定することが可能となる。   It becomes possible to identify a line segment from an image at higher speed.

本発明の一実施形態に係る線分抽出装置のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the line segment extraction apparatus which concerns on one Embodiment of this invention. 本発明の一実施形態に係る線分抽出装置の機能構成を示すである。It is a function structure of the line segment extraction apparatus which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像から名刺の輪郭を特定した様子を示す図である。It is a figure which shows a mode that the outline of the business card was specified from the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像を示す図である。It is a figure which shows the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像からエッジを検出した様子を示す図である。It is a figure which shows a mode that the edge was detected from the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像から線分を抽出する様子を示す図である。It is a figure which shows a mode that a line segment is extracted from the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像においてエッジとメッシュラインとの交点を特定する様子を示す図である。It is a figure which shows a mode that the intersection of an edge and a mesh line is specified in the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像から線分を抽出した様子を示す図である。It is a figure which shows a mode that the line segment was extracted from the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る静止画像から抽出された線分を示す図である。It is a figure which shows the line segment extracted from the still image which concerns on one Embodiment of this invention. 本発明の一実施形態に係る線分を組み合わせて多角形を形成する様子を示す図である。It is a figure which shows a mode that a polygon is formed combining the line segment which concerns on one Embodiment of this invention. 本発明の一実施形態に係る線分を組み合わせて多角形を形成する様子を示す図である。It is a figure which shows a mode that a polygon is formed combining the line segment which concerns on one Embodiment of this invention. 本発明の一実施形態に係る処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which concerns on one Embodiment of this invention. 本発明の一実施形態に係る処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which concerns on one Embodiment of this invention. 本発明の一実施形態に係る処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which concerns on one Embodiment of this invention.

本明細書および添付図面の記載により、少なくとも以下の事項が明らかとなる。以下、本発明をその一実施形態に即して添付図面を参照しつつ説明する。   At least the following matters will become apparent from the description of this specification and the accompanying drawings. Hereinafter, the present invention will be described in accordance with an embodiment thereof with reference to the accompanying drawings.

==線分抽出装置==
図1及び図2に、本発明の一実施形態に係る線分抽出装置100の構成を示す。本実施形態に係る線分抽出装置100は、例えばスマートフォンや携帯電話機、ノートパソコン、タブレットなどのカメラ機能を具備した携帯型の情報処理端末である。
== Line segment extraction device ==
1 and 2 show a configuration of a line segment extraction apparatus 100 according to an embodiment of the present invention. The line segment extraction apparatus 100 according to the present embodiment is a portable information processing terminal having a camera function such as a smartphone, a mobile phone, a notebook computer, or a tablet.

そして本実施形態に係る線分抽出装置100は、名刺を撮影すると、その静止画像400(後述)の画像解析を行い、静止画像400から名刺の輪郭を特定し、名刺の部分の画像(名刺の輪郭で囲まれた部分の画像)を名刺画像410として抽出する。このようにして名刺を電子化することができる。   Then, when the line segment extraction apparatus 100 according to the present embodiment captures a business card, the line segment extraction apparatus 100 performs image analysis of the still image 400 (described later), identifies the outline of the business card from the still image 400, and displays an image of the business card portion (name of the business card). The image of the part surrounded by the outline) is extracted as a business card image 410. In this way, the business card can be digitized.

<ハードウェア構成>
線分抽出装置100のハードウェア構成図を図1に示す。線分抽出装置100は、CPU110、メモリ120、通信装置130、記憶装置140、入力装置150、出力装置160、及び記録媒体読取装置170を備えて構成される。
<Hardware configuration>
A hardware configuration diagram of the line segment extraction apparatus 100 is shown in FIG. The line segment extraction device 100 includes a CPU 110, a memory 120, a communication device 130, a storage device 140, an input device 150, an output device 160, and a recording medium reading device 170.

記憶装置140は、線分抽出装置100によって実行されるプログラム700や各種のデータを格納する。記憶装置140に記憶されているプログラム700やデータがメモリ120に読み出されてCPU110によって実行されることにより、線分抽出装置100の各種機能が実現される。ここで、記憶装置140は例えばハードディスクやSSD(Solid State Drive)、フラッシュメモリ等の不揮発性の記憶装置である。   The storage device 140 stores a program 700 executed by the line segment extraction device 100 and various data. Various functions of the line segment extraction device 100 are realized by the program 700 and data stored in the storage device 140 being read into the memory 120 and executed by the CPU 110. Here, the storage device 140 is a nonvolatile storage device such as a hard disk, an SSD (Solid State Drive), or a flash memory.

記録媒体読取装置170は、SDカード等の記録媒体800に記録されたプログラム700やデータを読み取り、記憶装置140に格納する。   The recording medium reading device 170 reads the program 700 and data recorded on the recording medium 800 such as an SD card and stores it in the storage device 140.

通信装置130は、LAN(Local Area Network)やインターネット等の通信網(不図示)を介して他のコンピュータ(不図示)と各種データやプログラム700の授受を行う。例えば他のコンピュータに上述したプログラム700やデータを格納しておき、線分抽出装置100がこのコンピュータからデータやプログラム700をダウンロードするようにすることができる。   The communication device 130 exchanges various data and programs 700 with other computers (not shown) via a communication network (not shown) such as a LAN (Local Area Network) or the Internet. For example, the above-described program 700 and data can be stored in another computer, and the line segment extraction apparatus 100 can download the data and program 700 from this computer.

入力装置150は、ユーザによるコマンドやデータの入力を受け付ける各種ボタンやスイッチ、キーボード、タッチパネルディスプレイ上でのタッチ位置を検出するタッチセンサ、マイクなどの入力インタフェース、加速度センサ、温度センサ、カメラ151などである。   The input device 150 includes various buttons and switches that accept input of commands and data by a user, a keyboard, a touch sensor that detects a touch position on a touch panel display, an input interface such as a microphone, an acceleration sensor, a temperature sensor, a camera 151, and the like. is there.

また出力装置160は、例えばディスプレイ161などの表示装置、スピーカ、バイブレータ、照明などの出力ユーザインタフェースである。   The output device 160 is an output user interface such as a display device such as a display 161, a speaker, a vibrator, or illumination.

<機能構成>
図2に、線分抽出装置100の機能ブロック図を示す。線分抽出装置100は、画像取得部101、画像表示部102、画像抽出部104を含んで構成される。また画像抽出部104は、線分抽出部900、多角形形成部910、調整度算出部920、輪郭特定部930及び形状比較部940を含む。
<Functional configuration>
FIG. 2 shows a functional block diagram of the line segment extraction apparatus 100. The line segment extraction apparatus 100 includes an image acquisition unit 101, an image display unit 102, and an image extraction unit 104. The image extracting unit 104 includes a line segment extracting unit 900, a polygon forming unit 910, an adjustment degree calculating unit 920, a contour specifying unit 930, and a shape comparing unit 940.

またさらに、線分抽出部900は、エッジ検出部901、第1交点特定部902、第1交点結合部903、第1線分特定部904、第2交点特定部905、第2交点結合部906、及び第2線分特定部907を有する。   Furthermore, the line segment extracting unit 900 includes an edge detecting unit 901, a first intersection specifying unit 902, a first intersection connecting unit 903, a first line segment specifying unit 904, a second intersection specifying unit 905, and a second intersection connecting unit 906. , And a second line segment specifying unit 907.

これらの各機能は、線分抽出装置100のハードウェアによって本実施形態に係るプログラム700が実行されることにより実現される。   Each of these functions is realized by executing the program 700 according to the present embodiment by the hardware of the line segment extraction apparatus 100.

画像取得部101は、名刺を撮影して静止画像400を取得する。画像取得部101は例えばカメラ151を用いて実現される。   The image acquisition unit 101 acquires a still image 400 by photographing a business card. The image acquisition unit 101 is realized using a camera 151, for example.

静止画像400は、カメラ151のシャッターを押下した瞬間に得られる1枚の写真の画像であっても良いし、動画として撮影された複数フレームからなる個々の画像であっても良い。さらに静止画像400は、動画の撮影開始前や、写真撮影時のシャッターを押下する前にディスプレイ161に表示される、CCD(Charge Coupled Device)によって検出されている画像であっても良い。   The still image 400 may be an image of one photograph obtained at the moment when the shutter of the camera 151 is pressed, or may be an individual image composed of a plurality of frames taken as a moving image. Further, the still image 400 may be an image detected by a CCD (Charge Coupled Device) displayed on the display 161 before the start of moving image shooting or before pressing the shutter at the time of photographing.

またこの静止画像400には、名刺だけでなく、名刺の背景や人物などのように名刺以外のものが写っていてもよい。また1つの静止画像400内に複数枚の名刺が写っていても良い。   The still image 400 may include not only a business card but also a non-business card such as a business card background or a person. A plurality of business cards may be shown in one still image 400.

画像表示部102は、画像取得部101が取得した名刺の静止画像400を表示する。画像表示部102は例えばタッチパネル型のディスプレイ161を用いて実現される。   The image display unit 102 displays the business card still image 400 acquired by the image acquisition unit 101. The image display unit 102 is realized using, for example, a touch panel type display 161.

静止画像400が線分抽出装置100のディスプレイ161に表示されている様子を図3に示す。図3に示す例は、3枚の名刺が同時に撮影された場合の様子を示す。図3に示すように、本実施形態では、複数枚の名刺を同時に撮影する場合にそれぞれの名刺の向きが揃っていなくても良い。   A state in which the still image 400 is displayed on the display 161 of the line segment extraction apparatus 100 is shown in FIG. The example shown in FIG. 3 shows a state where three business cards are photographed simultaneously. As shown in FIG. 3, in the present embodiment, when a plurality of business cards are photographed simultaneously, the directions of the business cards need not be aligned.

そして以下に詳しく述べるように、本実施形態に係る線分抽出装置100は、この静止画像400から名刺の輪郭を高速に特定し、名刺の部分の画像(名刺の輪郭で囲まれた部分の画像)を名刺画像410として抽出する。   As will be described in detail below, the line segment extraction device 100 according to the present embodiment specifies the outline of the business card from the still image 400 at high speed, and the image of the business card part (the image of the part surrounded by the outline of the business card) ) As a business card image 410.

そして画像表示部102は、抽出した名刺画像410をユーザに示すために、名刺画像410に重ねて名刺マーカ500を表示する。名刺マーカ500は、本実施形態では円形で所定色の画像であるが、特に表示態様は限定されない。このように名刺マーカ500が名刺画像410に重ねて表示されることにより、ユーザは正しく名刺が抽出されたことを確認することができる。   Then, the image display unit 102 displays the business card marker 500 over the business card image 410 in order to show the extracted business card image 410 to the user. The business card marker 500 is a circular image of a predetermined color in the present embodiment, but the display mode is not particularly limited. Thus, by displaying the business card marker 500 superimposed on the business card image 410, the user can confirm that the business card has been correctly extracted.

図2に戻って、画像抽出部104について説明する。   Returning to FIG. 2, the image extraction unit 104 will be described.

画像抽出部104は、静止画像400から名刺画像410を抽出する。   The image extraction unit 104 extracts a business card image 410 from the still image 400.

以下、図4〜図14を参照しながら、画像抽出部104の機能及び処理手順を具体的に説明する。   Hereinafter, the function and processing procedure of the image extraction unit 104 will be described in detail with reference to FIGS.

まず、名刺画像410が抽出される前の静止画像400を図4に示す。画像取得部101がこのような静止画像400を取得すると、エッジ検出部901はこの静止画像400のサイズを画素数に応じて所定の大きさに調整した後、静止画像400からエッジ420を検出する。エッジ検出部901は、例えばCanny法やSobel Filterを用いた手法などの周知の技術を用いてエッジを検出する。   First, a still image 400 before the business card image 410 is extracted is shown in FIG. When the image acquisition unit 101 acquires such a still image 400, the edge detection unit 901 detects the edge 420 from the still image 400 after adjusting the size of the still image 400 to a predetermined size according to the number of pixels. . The edge detection unit 901 detects an edge using a known technique such as a technique using a Canny method or a Sobel Filter.

エッジ検出部901が静止画像400からエッジ420を検出した様子を図5に示す。   FIG. 5 shows how the edge detection unit 901 detects the edge 420 from the still image 400.

そうすると次に、第1交点特定部902が、静止画像400内で第1方向に所定間隔で延伸する複数の第1メッシュライン(第1平行線)421と、エッジ420と、の交点422を求める。その様子を図6(A)、図6(B)、図6(C)に示す。   Then, the first intersection specifying unit 902 obtains intersections 422 of the plurality of first mesh lines (first parallel lines) 421 extending at predetermined intervals in the first direction in the still image 400 and the edges 420. . This is shown in FIGS. 6A, 6B, and 6C.

図6(A)は、静止画像400から検出されたエッジ420と、静止画像400内で第1方向に延伸する複数の第1メッシュライン421と、を示す図である。   FIG. 6A is a diagram illustrating an edge 420 detected from the still image 400 and a plurality of first mesh lines 421 extending in the first direction in the still image 400.

この状態で第1交点特定部902は、図6(B)に示すように、エッジ420と第1メッシュライン421との交点422を特定する。   In this state, the first intersection specifying unit 902 specifies the intersection 422 between the edge 420 and the first mesh line 421 as shown in FIG.

なお、エッジ420や第1メッシュライン421は、静止画像400を個々の画素を識別できるレベルで見ると、図7(A)に示すような不連続の点の集合である。そのため、エッジ420と第1メッシュライン421との交角が小さい場合には、図7(B)に示すように、エッジ420と第1メッシュライン421との交差する点が複数の画素に分散することがある。   Note that the edge 420 and the first mesh line 421 are a set of discontinuous points as shown in FIG. 7A when the still image 400 is viewed at a level where individual pixels can be identified. Therefore, when the intersection angle between the edge 420 and the first mesh line 421 is small, as shown in FIG. 7B, the points where the edge 420 and the first mesh line 421 intersect are dispersed in a plurality of pixels. There is.

そのため、本実施形態では、エッジ420と第1メッシュライン421とが交差する点が複数の画素に分散した場合には、図7(C)に示すように、これらの交差する点の中の1点(例えば中点)を選び、交点422として特定する。このような態様によって、エッジ420と第1メッシュライン421との交点422を画素単位の精度で特定することが可能となる。第1交点特定部902がこのようにして交点422を求めた様子を図6(C)に示す。   Therefore, in the present embodiment, when the points where the edge 420 and the first mesh line 421 intersect are dispersed in a plurality of pixels, as shown in FIG. A point (for example, a middle point) is selected and specified as the intersection point 422. By such an aspect, it is possible to specify the intersection 422 between the edge 420 and the first mesh line 421 with accuracy in units of pixels. FIG. 6C shows how the first intersection specifying unit 902 obtains the intersection 422 in this way.

そうすると次に、第1交点結合部903は、図6(D)及び図6(E)に示すように、隣接する2本の第1メッシュライン421のペアのそれぞれについて、互いの第1メッシュライン421上の交点422同士を直線の結合線423で結ぶ。   Then, as shown in FIGS. 6 (D) and 6 (E), the first intersection coupling unit 903 then performs mutual first mesh lines for each pair of two adjacent first mesh lines 421. Intersection points 422 on 421 are connected by a straight coupling line 423.

そして第1線分特定部904は、図6(F)に示すように、交点422で繋がる複数の結合線423からなり、延伸方向の角度差が所定範囲以内(例えば±5°以内)である結合線423の集合を、線分430として抽出する。なおこのとき、第1線分特定部904は、第1メッシュライン421に対して所定角度以上(例えば45°以上)の交角を有する結合線423の集合を、線分430として抽出する。   As shown in FIG. 6 (F), the first line segment specifying unit 904 is composed of a plurality of connecting lines 423 connected at the intersection 422, and the angle difference in the extending direction is within a predetermined range (for example, within ± 5 °). A set of coupled lines 423 is extracted as a line segment 430. At this time, the first line segment identification unit 904 extracts a set of coupled lines 423 having an angle of intersection greater than or equal to a predetermined angle (for example, 45 degrees or greater) with respect to the first mesh line 421 as a line segment 430.

その後、第2交点特定部905、第2交点結合部906及び第2線分特定部907は、第1メッシュライン421の延伸方向と直交する第2メッシュライン421(不図示)を用いて、それぞれ第1交点特定部902、第1交点結合部903及び第1線分特定部904と同様の処理を行うことにより、さらに線分430を抽出する。   After that, the second intersection specifying unit 905, the second intersection coupling unit 906, and the second line segment specifying unit 907 are each using a second mesh line 421 (not shown) orthogonal to the extending direction of the first mesh line 421. A line segment 430 is further extracted by performing the same processing as the first intersection specifying unit 902, the first intersection coupling unit 903, and the first line segment specifying unit 904.

つまり、第2交点特定部905は、第1メッシュライン421に直交する第2方向に所定間隔で延伸する複数の第2メッシュライン421とエッジ420との交点422を求める。そして第2交点結合部906は、隣接する2本の第2メッシュライン421の各ペアについて、互いの第2メッシュライン421上の交点422同士を直線の結合線423で結ぶ。そして第2線分特定部907は、交点422で繋がる複数の結合線423からなり、延伸方向の角度差が所定範囲以内(例えば±5°以内)である結合線423の集合のうち、第2メッシュライン421と所定角度の余角を超える(例えば45°を超える)交角を有する結合線423の集合を、線分430として抽出する。   That is, the second intersection specifying unit 905 obtains the intersections 422 of the plurality of second mesh lines 421 extending at a predetermined interval in the second direction orthogonal to the first mesh lines 421 and the edges 420. The second intersection coupling unit 906 connects the intersections 422 on the second mesh lines 421 with a straight coupling line 423 for each pair of two adjacent second mesh lines 421. The second line segment identification unit 907 includes a plurality of coupled lines 423 connected at the intersection 422, and the second line segment specifying unit 907 is the second of the set of coupled lines 423 whose angle difference in the extending direction is within a predetermined range (for example, within ± 5 °). A set of coupled lines 423 having an intersection angle exceeding a predetermined angle (for example, exceeding 45 °) with the mesh line 421 is extracted as a line segment 430.

このような態様によって、線分430を抽出する際に、交点422に対する処理を行なえば済み、エッジ420上の多数の点に対する処理を不要にできるので、より高速に線分430の抽出を行うことが可能となる。   In this manner, when the line segment 430 is extracted, it is only necessary to perform processing for the intersection point 422, and processing for a large number of points on the edge 420 can be made unnecessary, so that the line segment 430 can be extracted at a higher speed. Is possible.

またハフ変換等を用いて直線を検出する場合とは異なり、静止画像400内の被写体の境界を有限長の線分430として抽出できるため、以下に述べるように、これらの線分430を組み合わせて多角形432を形成する際に、多角形432の周長に対する線分430の調整部分431の長さ(調整量)の比率を算出することが可能となる。   Unlike the case of detecting a straight line using Hough transform or the like, the boundary of the subject in the still image 400 can be extracted as a finite-length line segment 430. Therefore, as described below, these line segments 430 are combined. When the polygon 432 is formed, the ratio of the length (adjustment amount) of the adjustment portion 431 of the line segment 430 to the circumference of the polygon 432 can be calculated.

また第1メッシュライン421と第2メッシュライン421とを用いてエッジ420との交点422を求めることによって、エッジ420が静止画像400内でどの方向に延伸していても、メッシュライン421との交角が45°以上となるような交点422を特定することができるため、エッジ420上の交点422の位置をより正確に特定することが可能となる。   In addition, by obtaining the intersection 422 with the edge 420 using the first mesh line 421 and the second mesh line 421, the intersection angle with the mesh line 421 no matter which direction the edge 420 extends in the still image 400. Since it is possible to specify the intersection point 422 such that the angle is 45 ° or more, the position of the intersection point 422 on the edge 420 can be more accurately specified.

なお、メッシュライン421の間隔を狭くすると交点422の数を増やすことができるため、より正確に線分430の抽出を行うことが可能であるが、その分処理時間が増大する。メッシュライン421は、例えば静止画像400内に50本〜100本程度となるような間隔で引くと良いが、種々変更することが可能である。   Note that if the interval between the mesh lines 421 is narrowed, the number of intersections 422 can be increased, so that the line segment 430 can be extracted more accurately, but the processing time increases accordingly. For example, the mesh lines 421 may be drawn at intervals of about 50 to 100 in the still image 400, but various changes can be made.

このようにして、第1線分特定部904及び第2線分特定部907によって、静止画像400から線分430が特定される。静止画像400から線分430が特定された様子を図8に示す。   In this way, the line segment 430 is specified from the still image 400 by the first line segment specifying unit 904 and the second line segment specifying unit 907. A state in which the line segment 430 is specified from the still image 400 is shown in FIG.

その後、多角形形成部910は、静止画像400から抽出された線分430の中から名刺の辺の数に応じた本数の線分(つまり、4本の線分)を選ぶ組み合わせ毎に、線分430の長さを調整して、名刺と同じ数の頂点を有する多角形(つまり四角形)432を形成する。   Thereafter, the polygon forming unit 910 selects a line segment corresponding to the number of sides of the business card from the line segments 430 extracted from the still image 400 (that is, four line segments) for each combination. The length of the minute 430 is adjusted to form a polygon (that is, a quadrangle) 432 having the same number of vertices as the business card.

例えば、図9に示すように、静止画像400から5本の線分430A〜Eが抽出されたとすると、これらの線分430A〜Eから4本を選ぶ組み合わせは下記(1)〜(5)の5通りである(=5)。 For example, as shown in FIG. 9, if five line segments 430A to 430E are extracted from the still image 400, combinations of selecting four lines from these line segments 430A to E are the following (1) to (5). There are five ways ( 5 C 4 = 5).

(1)430A、430B、430C、430D
(2)430A、430B、430C、430E
(3)430A、430B、430D、430E
(4)430A、430C、430D、430E
(5)430B、430C、430D、430E
多角形形成部910はこれらの各組み合わせについて、各線分430を用いて四角形432の形成を試みる。ただし、多角形形成部910は、線分430Bと線分430Dと線分430Eが同一方向に延伸する平行線であることから、これら3つの線分430を同時に含む組み合わせ(3)と(5)は、組み合わせから外すこともできる。このような態様によって、無駄な処理を効率的に省き、名刺の抽出をより高速に行うことが可能となる。
(1) 430A, 430B, 430C, 430D
(2) 430A, 430B, 430C, 430E
(3) 430A, 430B, 430D, 430E
(4) 430A, 430C, 430D, 430E
(5) 430B, 430C, 430D, 430E
Polygon forming unit 910 attempts to form quadrilateral 432 using each line segment 430 for each of these combinations. However, since the polygon forming part 910 is a parallel line in which the line segment 430B, the line segment 430D, and the line segment 430E extend in the same direction, the combination (3) and (5) including these three line segments 430 simultaneously. Can also be removed from the combination. By such an aspect, it becomes possible to efficiently eliminate useless processing and extract business cards at a higher speed.

このようにして、多角形形成部910は、図10(A)〜図10(C)に示すような3通りの組み合わせの四角形432を形成する。図10(A)は(1)の組み合わせに対応し、図10(B)は(2)の組み合わせに対応し、図10(C)は(4)の組み合わせに対応する。   In this way, the polygon forming portion 910 forms a quadrilateral 432 having three combinations as shown in FIGS. 10 (A) to 10 (C). 10A corresponds to the combination (1), FIG. 10B corresponds to the combination (2), and FIG. 10C corresponds to the combination (4).

このようにして、図10(A)〜図10(C)に示した各組み合わせについて、多角形形成部910が四角形432を形成する様子を、それぞれ図11(A)〜図11(C)に示す。   In this way, for each combination shown in FIGS. 10A to 10C, the polygon forming portion 910 forms the quadrangle 432 in FIGS. 11A to 11C, respectively. Show.

図11(A)に示すケースでは、多角形形成部910は、線分430A、430B、430C、430Dの長さを調整して四角形432を形成している。そして図11(A)には、各線分430の長さの調整部分が調整部分431として破線で記載されている。   In the case shown in FIG. 11A, the polygon forming portion 910 forms a quadrangle 432 by adjusting the lengths of the line segments 430A, 430B, 430C, and 430D. In FIG. 11A, the adjustment part of the length of each line segment 430 is indicated by a broken line as the adjustment part 431.

多角形形成部910は、図11(B)(C)に示すケースでも同様に、線分430の長さを調整して、四角形432を形成する。   Similarly, in the case shown in FIGS. 11B and 11C, the polygon forming portion 910 adjusts the length of the line segment 430 to form the quadrangle 432.

そうすると調整度算出部920は、上記各組み合わせ毎に、四角形432を形成するために必要な線分430の長さの調整量の度合いを表す値を算出する。例えば調整度算出部920は、線分430の長さを調整して形成される四角形432の周長に対する調整部分431の長さ(調整量)の比率を算出する。   Then, the adjustment degree calculation unit 920 calculates a value representing the degree of adjustment amount of the length of the line segment 430 necessary for forming the quadrangle 432 for each of the above combinations. For example, the adjustment degree calculation unit 920 calculates the ratio of the length (adjustment amount) of the adjustment portion 431 to the circumferential length of the quadrangle 432 formed by adjusting the length of the line segment 430.

そして輪郭特定部930は、この調整量の度合いが小さい組み合わせから順に、組み合わせを構成する各線分430を、名刺の輪郭として割り当てていく。   The contour specifying unit 930 assigns each line segment 430 constituting the combination as the contour of the business card in order from the combination having the smallest adjustment amount.

例えば図11(A)(B)(C)の順で調整量の度合いを示す値が小さいと仮定した場合には、輪郭特定部930は、まず図11(A)で示す組み合わせの線分430(線分430A、430B、430C、430D)を、名刺の輪郭として特定する。   For example, when it is assumed that the value indicating the degree of adjustment amount is small in the order of FIGS. 11A, 11B, and 11C, the contour specifying unit 930 first sets the line segment 430 of the combination illustrated in FIG. (Line segments 430A, 430B, 430C, 430D) are specified as the outline of the business card.

このようにして、線分430A、430B、430C、430Dが名刺の輪郭として割り当てられると、残りは線分430E1本のみとなり、もはや四角形432を形成できないため、画像抽出部104の処理が終了する。   In this way, when the line segments 430A, 430B, 430C, and 430D are assigned as the outlines of business cards, the remaining line segment is only 430E1, and the quadrangle 432 can no longer be formed, so the processing of the image extraction unit 104 ends.

このようにして本実施形態に係る線分抽出装置100は名刺の輪郭を特定する。図3に示したように、静止画像400内に複数枚の名刺が存在する場合であっても、各線分430の組み合わせ毎の調整量の度合いが小さい順に、名刺の輪郭として特定することが可能である。   In this way, the line segment extraction device 100 according to the present embodiment specifies the outline of a business card. As shown in FIG. 3, even when there are a plurality of business cards in the still image 400, it is possible to specify the outline of the business cards in ascending order of the adjustment amount for each combination of the line segments 430. It is.

なお本実施形態に係る線分抽出装置100は、さらに形状比較部940を有している。   Note that the line segment extraction apparatus 100 according to the present embodiment further includes a shape comparison unit 940.

形状比較部940は、線分430の長さを調整して形成される四角形432の形状を表す指標値を、名刺の形状を表す基準値と比較する。   The shape comparison unit 940 compares the index value representing the shape of the quadrangle 432 formed by adjusting the length of the line segment 430 with a reference value representing the shape of the business card.

そして輪郭特定部930は、この指標値が基準値に対して所定範囲内となるような四角形432が形成される線分430の組み合わせの中で、上記調整量の度合いが小さい組み合わせから順に、組み合わせを構成する線分430を名刺の輪郭として特定する。 The outline specifying unit 930, among the combinations of line segments 430 this index value is rectangle 432 such that within a predetermined range with respect to the reference value is formed, in order from the combination degree of the adjustment amount is small, the combination Is specified as the outline of the business card.

例えば、形状比較部940は、4本の線分430を組み合わせて構成される四角形432において、隣り合う線分430の交角を基準値と比較する。基準値として、例えば90°±5°と定めておけば、輪郭特定部930は、4本の線分430を組み合わせて構成される様々な四角形432の中で、内角が90°±5°の範囲に入る長方形あるいは正方形であるものを選び、この中で、調整量の度合いが小さい組み合わせから順に、組み合わせを構成する線分430を名刺の輪郭として特定する。このような態様によって、より正確に名刺を特定することが可能となる。   For example, the shape comparison unit 940 compares the intersection angle of adjacent line segments 430 with a reference value in a quadrangle 432 configured by combining four line segments 430. For example, if the reference value is set to 90 ° ± 5 °, the contour specifying unit 930 has an inner angle of 90 ° ± 5 ° among various quadrilaterals 432 configured by combining four line segments 430. A rectangle or square that falls within the range is selected, and among these, the line segment 430 constituting the combination is specified as the outline of the business card in order from the combination having the smallest adjustment amount. By such an aspect, it becomes possible to specify a business card more accurately.

あるいは、形状比較部940は、4本の線分430を組み合わせて構成される四角形432において、各線分430の長さを基準値と比較する。基準値として、例えば短辺=50mm〜60mm、長辺=85mm〜95mmと定めておけば、輪郭特定部930は、4本の線分430を組み合わせて構成される様々な四角形432の中で、このような辺の長さを有する長方形であるものを選び、この中で、調整量の度合いが小さい組み合わせから順に、組み合わせを構成する線分430を名刺の輪郭として特定する。このような態様によっても、より正確に名刺を特定することが可能となる。   Alternatively, the shape comparison unit 940 compares the length of each line segment 430 with a reference value in a quadrangle 432 configured by combining four line segments 430. As a reference value, for example, if the short side = 50 mm to 60 mm and the long side = 85 mm to 95 mm are defined, the contour specifying unit 930 is composed of various quadrilaterals 432 configured by combining four line segments 430. A rectangle having such a side length is selected, and among these, the line segment 430 constituting the combination is specified as the outline of the business card in order from the combination having the smallest adjustment amount. Also according to such an aspect, it becomes possible to specify a business card more accurately.

次に、本実施形態に係る線分抽出装置100の処理の流れについて、図12〜図14に示すフローチャートを参照しながら説明する。   Next, the process flow of the line segment extraction apparatus 100 according to the present embodiment will be described with reference to the flowcharts shown in FIGS.

まず線分抽出装置100は、名刺を撮影して静止画像400を取得する(S1000)。画像取得部101は例えばカメラ151を用いて実現される。   First, the line segment extraction apparatus 100 captures a business card and acquires a still image 400 (S1000). The image acquisition unit 101 is realized using a camera 151, for example.

次に、線分抽出装置100は、この静止画像400のサイズを画素数に応じて定められた所定の大きさに調整する(S1010)。例えば線分抽出装置100は、静止画像400の1辺が1000ピクセル以下になるように調整する。このような態様によって、線分抽出装置100が画像解析を行う際の処理量を減らし、静止画像400から高速に名刺の輪郭の特定を行うことが可能となる。   Next, the line segment extraction device 100 adjusts the size of the still image 400 to a predetermined size determined according to the number of pixels (S1010). For example, the line segment extraction apparatus 100 adjusts so that one side of the still image 400 is 1000 pixels or less. With such an aspect, it is possible to reduce the processing amount when the line segment extraction apparatus 100 performs image analysis, and to specify the outline of a business card from the still image 400 at high speed.

次に線分抽出装置100は、静止画像400からエッジ420を検出した後(S1020)、エッジを検出した静止画像400から線分430を抽出する(S1030)。   Next, the line segment extraction apparatus 100 detects an edge 420 from the still image 400 (S1020), and then extracts a line segment 430 from the still image 400 from which the edge is detected (S1030).

線分抽出装置100が静止画像400から線分430を抽出する際の処理の流れを図13に示す。   FIG. 13 shows a processing flow when the line segment extraction apparatus 100 extracts the line segment 430 from the still image 400.

まず線分抽出装置100は、エッジ420が検出された静止画像400を取得する(S2000)。   First, the line segment extraction apparatus 100 acquires the still image 400 in which the edge 420 is detected (S2000).

そして線分抽出装置100は、静止画像400内で第1方向に所定間隔で延伸する複数の第1メッシュライン421を引く(S2010)。   Then, the line segment extraction apparatus 100 draws a plurality of first mesh lines 421 extending at a predetermined interval in the first direction in the still image 400 (S2010).

次に線分抽出装置100は、第1メッシュライン421とエッジ420との交点422を求める(S2020)。   Next, the line segment extraction device 100 obtains an intersection 422 between the first mesh line 421 and the edge 420 (S2020).

そして線分抽出装置100は、隣接する2本の第1メッシュライン421の各ペアについて、互いの第1メッシュライン421上の交点422同士を直線の結合線423で結ぶ(S2030)。   Then, the line segment extraction apparatus 100 connects the intersections 422 on the first mesh lines 421 with each other with the straight connection line 423 for each pair of two adjacent first mesh lines 421 (S2030).

そして線分抽出装置100は、交点422で繋がる複数の結合線423からなり、延伸方向の角度差が所定範囲以内である結合線423の集合を、線分430の候補とする(S2040)。   The line segment extraction apparatus 100 includes a plurality of coupled lines 423 connected at the intersection point 422, and a set of coupled lines 423 whose angle difference in the extending direction is within a predetermined range is set as a candidate for the line segment 430 (S2040).

このとき線分抽出装置100は、線分430の候補とした結合線423の集合のうち、その結合線423の位置にエッジ420が抽出されていないものを除いたうえで、線分430を抽出する(S2050)。   At this time, the line segment extraction apparatus 100 extracts the line segment 430 after excluding the set of the combined lines 423 that are candidates for the line segment 430 and the edge 420 is not extracted at the position of the combined line 423. (S2050).

このようにして第1方向に延伸する第1メッシュライン421についての処理を終えると、線分抽出装置100は、静止画像400を90°回転させて(S2060、S2070)、S2010〜S2050の処理を繰り返す。静止画像400を90°回転させて同様の処理を行うことは、上述した第2メッシュライン421を用いて第2交点特定部905、第2交点結合部906及び第2線分特定部907が、線分430を抽出する処理を行うことに相当する。 When the processing for the first mesh line 421 extending in the first direction is completed in this way, the line segment extraction device 100 rotates the still image 400 by 90 degrees (S2060, S2070), and performs the processing of S2010 to S2050. repeat. Performing the same processing by rotating the still image 400 by 90 ° means that the second intersection specifying unit 905, the second intersection connecting unit 906, and the second line segment specifying unit 907 are using the second mesh line 421 described above. This corresponds to performing a process of extracting the line segment 430.

そして線分抽出装置100は、静止画像400の向きを−90°回転して元に戻し(S2080)、検出した線分430を出力する(S2090)。 Then, the line segment extraction apparatus 100 rotates the direction of the still image 400 by −90 ° to restore it (S2080), and outputs the detected line segment 430 (S2090).

図12に戻って、線分抽出装置100は、抽出した線分430を組み合わせて形成できる四角形432を探索する(S1040)。   Returning to FIG. 12, the line segment extraction apparatus 100 searches for a quadrangle 432 that can be formed by combining the extracted line segments 430 (S1040).

具体的には図14に示すように、線分抽出装置100はまず、静止画像400から抽出された線分430の中から名刺の辺の数に応じた本数の線分(つまり、4本の線分)を選ぶ組み合わせ毎に、線分430の長さを調整して、名刺と同じ数の頂点を有する多角形432(つまり四角形432)を形成する(S3000)。   Specifically, as shown in FIG. 14, the line segment extracting apparatus 100 first has a number of line segments (that is, four line segments) corresponding to the number of sides of the business card among the line segments 430 extracted from the still image 400. For each combination of selecting (line segment), the length of the line segment 430 is adjusted to form a polygon 432 (that is, a quadrangle 432) having the same number of vertices as the business card (S3000).

そして線分抽出装置100は、これらの四角形432の内、四角形432の成す角(内角)が例えば90°±5°の範囲にないものを除去する(S3010、S3020)。このような態様によって、無駄な処理を効率的に省き、名刺の抽出をより高速に行うことが可能となる。   Then, the line segment extraction apparatus 100 removes those squares 432 whose angles (inner angles) formed by the squares 432 are not within a range of 90 ° ± 5 °, for example (S3010, S3020). By such an aspect, it becomes possible to efficiently eliminate useless processing and extract business cards at a higher speed.

そして線分抽出装置100は、四角形432を構成する線分430の各組み合わせ毎に、四角形432を形成するために必要な線分430の長さの調整量の度合いを表す値(ペナルティ)を算出し(S3030)、出力する(S3040)。例えば調整度算出部920は、四角形432の周長に対する調整部分431の長さ(調整量)の比率をペナルティとして算出する。   The line segment extraction apparatus 100 calculates a value (penalty) representing the degree of adjustment of the length of the line segment 430 necessary for forming the quadrilateral 432 for each combination of the line segments 430 constituting the quadrilateral 432. (S3030) and output (S3040). For example, the adjustment degree calculation unit 920 calculates, as a penalty, the ratio of the length (adjustment amount) of the adjustment portion 431 to the circumference of the quadrangle 432.

そして線分抽出装置100は、ペナルティが小さい順に、上記線分430の組み合わせを並び替える(S3050)。   Then, the line segment extraction apparatus 100 rearranges the combinations of the line segments 430 in ascending order of penalty (S3050).

そして線分抽出装置100は、ペナルティが小さい組み合わせから順に、組み合わせを構成する各線分430を、名刺の輪郭として割り当てていく(S3060〜S3090)。四角形432を構成し得る線分430が無くなった場合には(S3100)、名刺の輪郭として特定した線分430をディスプレイ161に表示する(S3110)。またこの時、線分抽出装置100は、名刺の輪郭で囲まれる部分の名刺画像410に重ねるようにして、名刺マーカ500も合わせて表示する。   Then, the line segment extraction device 100 assigns each line segment 430 constituting the combination in order from the combination with the smaller penalty as the outline of the business card (S3060 to S3090). When there is no line segment 430 that can form the quadrangle 432 (S3100), the line segment 430 specified as the outline of the business card is displayed on the display 161 (S3110). At this time, the line segment extraction device 100 also displays the business card marker 500 so as to overlap the business card image 410 of the portion surrounded by the outline of the business card.

図12に戻って、線分抽出装置100は、このようにして静止画像400から名刺の輪郭を特定したら、次のフレームの静止画像400についても同様に処理を行う。このようにして、線分抽出装置100は、動画などのような連続する静止画像400についても、名刺の輪郭を特定することが可能である。   Returning to FIG. 12, once the line segment extraction device 100 specifies the outline of the business card from the still image 400 in this way, the line segment extracting device 100 performs the same process on the still image 400 of the next frame. In this way, the line segment extraction apparatus 100 can specify the outline of a business card for a continuous still image 400 such as a moving image.

==他の実施形態==
上記実施形態では、多角形形成部910は、静止画像400から抽出された線分430の中から名刺の辺の数に応じた本数の線分(つまり、4本の線分)を選ぶ組み合わせ毎に、線分430の長さを調整して、名刺と同じ数の頂点を有する多角形(つまり四角形)432を形成したが、この場合、抽出されたn本の線分430から、4頂点の四角形432を形成する場合には、単純には通りの組み合わせが存在するため、計算量はnの4乗のオーダとなる。
== Other Embodiments ==
In the above embodiment, the polygon forming unit 910 selects, for each combination, the number of line segments (that is, four line segments) corresponding to the number of sides of the business card from the line segments 430 extracted from the still image 400. In addition, the length of the line segment 430 is adjusted to form a polygon (that is, a quadrangle) 432 having the same number of vertices as the business card. In this case, from the extracted n line segments 430, four vertices are formed. When the quadrangle 432 is formed, there are simply n C four combinations, and the amount of calculation is on the order of the fourth power of n.

そのため、この計算量を削減するために、多角形形成部910は、静止画像400から抽出された線分430のうち共通の端点を有して互いに角度をなす(例えば90°±5°の範囲内の角度をなす)2本の線分430を、線分ペアとして抽出した上で、これらの線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分430の長さを調整して四角形432を形成するようにしてもよい。   Therefore, in order to reduce the amount of calculation, the polygon forming unit 910 has a common end point among the line segments 430 extracted from the still image 400 and forms an angle with each other (for example, a range of 90 ° ± 5 °). The length of the four line segments 430 is extracted for each combination in which two line segments 430 are extracted as line segment pairs and two line segment pairs are selected from these line segment pairs. The square 432 may be formed by adjusting the height.

つまり、抽出されたn本の線分430から直接4本を選ぶのではなく、一旦、互いにほぼ直交する角度(90°±5°以内)で交わる2本の線分430からなる線分ペア(線分ペアの形状は、鍵括弧状の"「"、あるいは"」"となる)を抽出した上で、この線分ペア同士を組み合わせて四角形432を形成するようにする。   That is, instead of directly selecting four lines from the extracted n line segments 430, a line segment pair composed of two line segments 430 that intersect each other at an angle substantially perpendicular to each other (within 90 ° ± 5 °) ( The shape of the line segment pair is extracted as ““ ”or“ ”” in the form of a square bracket, and the quadrangle 432 is formed by combining these line segment pairs.

このような態様によれば、組み合わせの数が(n/2)となるため、計算量をnの2乗のオーダにすることができる。これにより、より高速に名刺の輪郭を特定することが可能となる。 According to such an aspect, since the number of combinations is n C 2 + (n / 2) C 2 , the calculation amount can be on the order of the square of n. As a result, the outline of the business card can be specified at a higher speed.

なお、線分ペアを形成する2本の線分430の端点が共通するとは、第1の線分430の端点と、第2の線分430の端点とが、同一ピクセル上に位置する場合だけでなく、所定範囲内(例えば10ピクセル以内)に位置する場合を含む。   Note that the end points of the two line segments 430 forming the line segment pair are common only when the end points of the first line segment 430 and the end points of the second line segment 430 are located on the same pixel. Not including the case of being located within a predetermined range (for example, within 10 pixels).

以上、本実施形態に係る線分抽出装置100、線分抽出装置100の制御方法、及びプログラム700について詳細に説明したが、本実施形態によれば、静止画像400から線分430をより高速に特定することが可能となる。   As described above, the line segment extraction apparatus 100, the control method of the line segment extraction apparatus 100, and the program 700 according to the present embodiment have been described in detail. However, according to the present embodiment, the line segment 430 can be generated from the still image 400 at higher speed. It becomes possible to specify.

なお上述した実施の形態は本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明はその趣旨を逸脱することなく変更、改良され得るとともに、本発明にはその等価物も含まれる。   The embodiments described above are for facilitating the understanding of the present invention, and are not intended to limit the present invention. The present invention can be changed and improved without departing from the gist thereof, and equivalents thereof are also included in the present invention.

例えば、上記実施形態では、静止画像400から名刺の輪郭を特定する場合を例に説明したが、名刺のような四角形の平面の輪郭を特定するだけでなく、一般的に三角形や五角形、六角形などの多角形の平面の輪郭を特定する場合にも同様に適用することができる。   For example, in the above embodiment, the case where the outline of a business card is specified from the still image 400 has been described as an example. However, not only the outline of a quadrangular plane such as a business card is specified, but also generally a triangle, pentagon, hexagon The present invention can be similarly applied to the case where the outline of a polygonal plane such as the above is specified.

100 線分抽出装置
101 画像取得部
102 画像表示部
104 画像抽出部
110 CPU
120 メモリ
130 通信装置
140 記憶装置
150 入力装置
151 カメラ
160 出力装置
161 ディスプレイ
170 記録媒体読取装置
400 静止画像
410 名刺画像
420 エッジ
421 メッシュライン
422 交点
423 結合線
430 線分
431 線分の調整部分
432 多角形(四角形)
500 名刺マーカ
700 プログラム
800 記録媒体
900 線分抽出部
901 エッジ検出部
902 第1交点特定部
903 第1交点結合部
904 第1線分特定部
905 第2交点特定部
906 第2交点結合部
907 第2線分特定部
910 多角形形成部
920 調整度算出部
930 輪郭特定部
940 形状比較部
DESCRIPTION OF SYMBOLS 100 Line segment extraction apparatus 101 Image acquisition part 102 Image display part 104 Image extraction part 110 CPU
120 Memory 130 Communication Device 140 Storage Device 150 Input Device 151 Camera 160 Output Device 161 Display 170 Recording Medium Reading Device 400 Still Image 410 Business Card Image 420 Edge 421 Mesh Line 422 Intersection 423 Join Line 430 Line Segment 431 Line Segment Adjustment Portion 432 Many Square (square)
500 Business card marker 700 Program 800 Recording medium 900 Line segment extraction unit 901 Edge detection unit 902 First intersection specifying unit 903 First intersection coupling unit 904 First line segment identifying unit 905 Second intersection identifying unit 906 Second intersection coupling unit 907 2-line segment specifying unit 910 polygon forming unit 920 adjustment degree calculating unit 930 contour specifying unit 940 shape comparing unit

Claims (11)

画像から線分を抽出する線分抽出装置であって、
前記画像からエッジを検出するエッジ検出部と、
前記画像内で第1方向に所定間隔で延伸する複数の第1平行線と、前記エッジと、の交点を求める第1交点特定部と、
隣接する2本の第1平行線の各ペアについて、互いの第1平行線上の前記交点同士を直線の結合線で結ぶ第1交点結合部と、
前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する第1線分特定部と、
を備えることを特徴とする線分抽出装置。
A line segment extraction device for extracting a line segment from an image,
An edge detection unit for detecting an edge from the image;
A first intersection specifying unit for obtaining an intersection of a plurality of first parallel lines extending at a predetermined interval in the first direction in the image and the edge;
For each pair of two adjacent first parallel lines, a first intersection coupling portion that connects the intersections on the first parallel lines with a straight coupling line;
A first line segment specifying unit configured to extract a set of the coupled lines, which is composed of a plurality of the coupled lines connected at the intersection, and whose angle difference in the extending direction is within a predetermined range, as the line segment;
A line segment extraction apparatus comprising:
請求項1に記載の線分抽出装置であって、
前記画像内で前記第1方向と直交する第2方向に所定間隔で延伸する複数の第2平行線と、前記エッジと、の交点を求める第2交点特定部と、
隣接する2本の第2平行線の各ペアについて、互いの第2平行線上の前記交点同士を直線の結合線で結ぶ第2交点結合部と、
前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する第2線分特定部と、
をさらに備え、
前記第1線分特定部は、前記第1平行線に対して所定角度以上の交角を有する前記結合線の集合を、前記線分として抽出し、
前記第2線分特定部は、前記第2平行線に対して前記所定角度の余角を超える交角を有する前記結合線の集合を、前記線分として抽出する
ことを特徴とする線分抽出装置。
The line segment extraction device according to claim 1,
A second intersection specifying unit for obtaining an intersection of a plurality of second parallel lines extending at a predetermined interval in a second direction orthogonal to the first direction in the image; and
For each pair of two adjacent second parallel lines, a second intersection coupling portion that connects the intersections on the second parallel lines with a straight coupling line;
A second line segment specifying unit that extracts a set of the coupled lines that are composed of a plurality of the coupled lines connected at the intersections and whose angle difference in the extending direction is within a predetermined range;
Further comprising
The first line segment specifying unit extracts the set of coupled lines having an angle of intersection greater than or equal to a predetermined angle with respect to the first parallel line as the line segment,
The second line segment specifying unit extracts, as the line segment, a set of coupled lines having an intersection angle exceeding a predetermined angle of the second parallel line. .
請求項1又は2に記載の線分抽出装置であって、
前記画像から抽出された前記線分の中から、前記画像から特定すべき多角形の辺の数に応じた本数の線分を選ぶ組み合わせ毎に、前記線分の長さを調整して前記多角形と同じ数の頂点を有する多角形を形成する多角形形成部と、
前記組み合わせ毎に形成される多角形の中から、前記画像から特定すべき多角形の輪郭を特定する輪郭特定部と、
を備えることを特徴とする線分抽出装置。
The line segment extraction device according to claim 1 or 2,
For each combination of selecting the number of line segments corresponding to the number of polygon sides to be identified from the image from the line segments extracted from the image, the length of the line segment is adjusted to adjust the length of the line segment. A polygon forming part that forms a polygon having the same number of vertices as a square;
Out of the polygons formed for each combination, an outline specifying unit that specifies the outline of the polygon to be specified from the image;
A line segment extraction apparatus comprising:
請求項3に記載の線分抽出装置であって、
前記組み合わせ毎に、前記多角形を形成するために必要な前記線分の長さの調整量の度合いを表す値を算出する調整度算出部と、
をさらに備え、
前記輪郭特定部は、前記調整量の度合いが小さい組み合わせから順に、前記組み合わせを構成する各線分を、前記画像から特定すべき多角形の輪郭として割り当てる
ことを特徴とする線分抽出装置。
The line segment extraction device according to claim 3,
An adjustment degree calculation unit that calculates a value representing a degree of adjustment amount of the length of the line segment necessary for forming the polygon for each combination;
Further comprising
The outline specifying unit assigns each line segment constituting the combination as a polygon outline to be specified from the image in order from a combination with a small degree of adjustment.
請求項4に記載の線分抽出装置であって、
前記線分の長さを調整して形成される多角形の形状を表す所定の指標値を、前記画像から特定すべき多角形の形状を表す基準値と比較する形状比較部と、
をさらに備え、
前記輪郭特定部は、前記指標値が前記基準値に対して所定範囲内となるような多角形が形成される前記線分の組み合わせの中で、前記調整量の度合いが小さい組み合わせから順に、前記組み合わせを構成する各線分を前記画像から特定すべき多角形の輪郭として割り当てる
ことを特徴とする線分抽出装置。
The line segment extraction device according to claim 4,
A shape comparison unit that compares a predetermined index value representing the shape of a polygon formed by adjusting the length of the line segment with a reference value representing the shape of the polygon to be identified from the image;
Further comprising
In the combination of the line segments in which the polygon is formed such that the index value is within a predetermined range with respect to the reference value, the contour specifying unit sequentially starts with the combination having the smallest adjustment amount. A line segment extracting apparatus, wherein each line segment constituting a combination is assigned as a polygonal outline to be specified from the image.
請求項5に記載の線分抽出装置であって、
前記指標値及び前記基準値は、前記多角形をなす隣り合う二辺の交角を含む
ことを特徴とする線分抽出装置。
The line segment extraction device according to claim 5,
The line value extracting apparatus, wherein the index value and the reference value include an intersection angle between two adjacent sides forming the polygon.
請求項5または6に記載の線分抽出装置であって、
前記指標値及び前記基準値は、前記多角形をなす各辺の長さを含む
ことを特徴とする線分抽出装置。
The line segment extraction device according to claim 5 or 6,
The line segment extraction apparatus, wherein the index value and the reference value include the length of each side forming the polygon.
請求項4〜7のいずれかに記載の線分抽出装置であって、  It is a line segment extraction device in any one of Claims 4-7,
前記調整量の度合いを示す値は、前記線分の長さを調整して形成される多角形の周長に対する前記調整量の比率である  The value indicating the degree of the adjustment amount is a ratio of the adjustment amount to the circumference of a polygon formed by adjusting the length of the line segment.
ことを特徴とする線分抽出装置。A line segment extraction apparatus characterized by that.
請求項3〜8のいずれかに記載の線分抽出装置であって、  A line segment extraction device according to any one of claims 3 to 8,
前記画像から特定すべき多角形は矩形であり、  The polygon to be identified from the image is a rectangle,
前記多角形形成部は、前記画像から抽出された前記線分のうち共通の端点を有して互いに角度をなす2本の線分を、線分ペアとして抽出した上で、前記線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分の長さを調整して前記画像から特定すべき多角形と同じ数の頂点を有する多角形を形成する  The polygon forming unit extracts two line segments that have a common end point and form an angle with each other among the line segments extracted from the image, and then extracts the line segment pairs. For each combination of selecting two line segment pairs, adjust the length of the four line segments to form a polygon having the same number of vertices as the polygon to be identified from the image.
ことを特徴とする線分抽出装置。A line segment extraction apparatus characterized by that.
画像から線分を抽出する線分抽出装置の制御方法であって、
前記線分抽出装置が、前記画像からエッジを検出し、
前記線分抽出装置が、前記画像内で第1方向に所定間隔で延伸する複数の第1平行線と、前記エッジと、の交点を求め、
前記線分抽出装置が、隣接する2本の第1平行線の各ペアについて、互いの第1平行線上の前記交点同士を直線の結合線で結び、
前記線分抽出装置が、前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する
ことを特徴とする線分抽出装置の制御方法。
A control method of a line segment extraction device that extracts a line segment from an image,
The line segment extraction device detects edges from the image;
The line segment extraction device obtains intersections between a plurality of first parallel lines extending at a predetermined interval in the first direction in the image and the edges,
The line segment extraction device connects the intersections on the first parallel lines of each pair of adjacent two first parallel lines with a straight connecting line,
The line segment extraction device includes a plurality of the connection lines connected at the intersection point, and extracts a set of the connection lines whose angle difference in the extending direction is within a predetermined range as the line segment. Control method of extraction device.
画像から線分を抽出するプログラムであって、コンピュータに、
前記画像からエッジを検出する手順と、
前記画像内で第1方向に所定間隔で延伸する複数の第1平行線と、前記エッジと、の交点を求める手順と、
隣接する2本の第1平行線の各ペアについて、互いの第1平行線上の前記交点同士を直線の結合線で結ぶ手順と、
前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する手順と、
を実行させるためのプログラム。
A program that extracts line segments from an image.
Detecting an edge from the image;
A procedure for obtaining an intersection of a plurality of first parallel lines extending in the first direction at a predetermined interval in the image and the edge;
For each pair of two adjacent first parallel lines, a procedure for connecting the intersections on the first parallel lines with each other by a straight connecting line;
A procedure of extracting the set of coupled lines, which is composed of a plurality of the coupled lines connected at the intersection, and whose angle difference in the extending direction is within a predetermined range, as the line segment;
A program for running
JP2017084433A 2017-04-21 2017-04-21 Line segment extractor, control method and program for line segment extractor Active JP6447890B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017084433A JP6447890B2 (en) 2017-04-21 2017-04-21 Line segment extractor, control method and program for line segment extractor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017084433A JP6447890B2 (en) 2017-04-21 2017-04-21 Line segment extractor, control method and program for line segment extractor

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2018217892A Division JP6677412B2 (en) 2018-11-21 2018-11-21 IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM

Publications (2)

Publication Number Publication Date
JP2018181244A JP2018181244A (en) 2018-11-15
JP6447890B2 true JP6447890B2 (en) 2019-01-09

Family

ID=64276952

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017084433A Active JP6447890B2 (en) 2017-04-21 2017-04-21 Line segment extractor, control method and program for line segment extractor

Country Status (1)

Country Link
JP (1) JP6447890B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7637552B2 (en) * 2021-03-31 2025-02-28 大和ハウス工業株式会社 Plate outline estimation device
CN115331013B (en) * 2022-10-17 2023-02-24 杭州恒生聚源信息技术有限公司 Data extraction method and processing equipment for line graph

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09305700A (en) * 1996-05-21 1997-11-28 Oki Electric Ind Co Ltd Image processor
JP4501701B2 (en) * 2005-01-25 2010-07-14 カシオ計算機株式会社 Image capturing apparatus, image processing method for image capturing apparatus, and program
JP4918167B1 (en) * 2011-03-31 2012-04-18 パナソニック株式会社 Image processing apparatus and document reading system having the same

Also Published As

Publication number Publication date
JP2018181244A (en) 2018-11-15

Similar Documents

Publication Publication Date Title
US12100160B2 (en) Edge detection method and device, electronic apparatus and storage medium
CN111507251A (en) Method, device and electronic device for locating answering area in test question image
JP5525757B2 (en) Image processing apparatus, electronic device, and program
US10303969B2 (en) Pose detection using depth camera
CN110136069B (en) Text image correction method, device and electronic equipment
ES2974080T3 (en) Procedure and apparatus for photographing images
JP2019087945A (en) INFORMATION PROCESSING APPARATUS, PROGRAM, AND INFORMATION PROCESSING METHOD
CN107295252A (en) Focusing area display methods, device and terminal device
CN114500857A (en) An image capturing method, device, terminal device and storage medium
JP2014053728A (en) Image processing device and program
JP6447890B2 (en) Line segment extractor, control method and program for line segment extractor
JP6542230B2 (en) Method and system for correcting projected distortion
JP6677412B2 (en) IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM
JP6669390B2 (en) Information processing apparatus, information processing method, and program
WO2022213784A1 (en) Image processing method and apparatus, and electronic device and storage medium
JP2014053716A (en) Image processing device and program
WO2024169384A1 (en) Gaze estimation method and apparatus, and readable storage medium and electronic device
JP7027043B2 (en) Information processing equipment, information processing methods and programs
US20210281742A1 (en) Document detections from video images
JP7183020B2 (en) Image processing device, image processing method, and program
JP2013242826A (en) Image processing device and document reading system including the same
JP6077873B2 (en) Image processing apparatus and image processing method
JP6255819B2 (en) COMPUTER PROGRAM FOR MEASUREMENT, MEASUREMENT DEVICE AND MEASUREMENT METHOD
JP2019220069A (en) Card number recognition device and card number recognition method
KR20140134844A (en) Method and device for photographing based on objects

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180905

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: 20181023

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181121

R150 Certificate of patent or registration of utility model

Ref document number: 6447890

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250