JP6677412B2 - IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM - Google Patents
IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM Download PDFInfo
- Publication number
- JP6677412B2 JP6677412B2 JP2018217892A JP2018217892A JP6677412B2 JP 6677412 B2 JP6677412 B2 JP 6677412B2 JP 2018217892 A JP2018217892 A JP 2018217892A JP 2018217892 A JP2018217892 A JP 2018217892A JP 6677412 B2 JP6677412 B2 JP 6677412B2
- Authority
- JP
- Japan
- Prior art keywords
- line segment
- image
- extraction device
- line
- rectangle
- 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
Links
Landscapes
- Image Analysis (AREA)
Description
本発明は、画像抽出装置、画像抽出装置の制御方法及びプログラムに関する。 The present invention relates to an image extraction device , a control method of the image extraction device , and a program.
近年、カメラ機能を備えたスマートフォンや携帯電話機、タブレットなどの携帯端末が普及し、手軽に写真撮影が行えるようになっている。 2. Description of the Related Art In recent years, mobile terminals such as smartphones, mobile phones, and tablets having a camera function have become widespread, and photography can be easily performed.
またこのような携帯端末を用いて撮影された写真を加工して利用するアプリケーションソフトウェアも様々に開発されている。例えば、携帯端末を用いて撮影した名刺を電子化する技術が開発されている(例えば特許文献1参照)。 Also, various kinds of application software for processing and using photographs taken using such portable terminals have been developed. For example, a technology for digitizing a business card photographed using a portable terminal has been developed (for example, see Patent Document 1).
また、画像中のエッジ点の集合から輪郭を抽出する技術も開発されている(例えば特許文献2参照)。 Further, a technique for extracting a contour from a set of edge points in an image has been developed (for example, see Patent Document 2).
しかしながら、携帯端末で実行されるアプリケーションソフトウェアは、ユーザの待ち時間が長くならないように高速に動作することが求められ、特許文献1のように名刺を電子化する場合も同様である。 However, application software executed on a mobile terminal is required to operate at high speed so as not to lengthen the user's waiting time, and the same applies to the case where a business card is digitized as in Patent Document 1.
そのため、カメラにより撮影された静止画像から、名刺のような多角形の撮影対象物の輪郭をなす線分をより高速に特定可能とするような技術が求められている。 Therefore, there is a need for a technique that enables a line segment forming a contour of a polygonal object to be photographed such as a business card to be specified at higher speed from a still image photographed by a camera.
本発明は上記課題を鑑みてなされたものであり、画像から名刺のような矩形の輪郭をより高速に特定することを可能とする画像抽出装置、画像抽出装置の制御方法及びプログラムを提供することを一つの目的とする。 The present invention has been made in view of the above problems, and provides an image extraction device, a control method of the image extraction device , and a program that can more quickly specify a rectangular outline such as a business card from an image. For one purpose.
一つの側面に係る画像抽出装置は、画像から矩形を抽出する画像抽出装置であって、前記画像から線分の抽出を行う線分抽出部と、前記画像から抽出された前記線分のうち共通の端点を有して互いに角度をなす2本の線分を線分ペアとして抽出した上で、前記線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分の長さを調整して矩形を形成する多角形形成部と、前記組み合わせ毎に、前記矩形を形成するために必要な前記線分の長さの調整量の度合いを表す値を算出する調整度算出部と、前記組み合わせ毎に形成される矩形の中から、前記調整量の度合いが小さい組み合わせから順に、前記画像から抽出すべき矩形の輪郭を特定する輪郭特定部と、を備える。 An image extraction device according to one aspect is an image extraction device that extracts a rectangle from an image, and includes a line segment extraction unit that extracts a line segment from the image, and a common line segment among the line segments extracted from the image. After extracting two line segments having an end point and forming an angle with each other as a line segment pair, the length of four line segments is determined for each combination in which two line segment pairs are selected from the line segment pairs. A polygon forming unit that forms a rectangle by adjusting the length, and an adjustment degree calculation unit that calculates, for each combination, a value representing the degree of adjustment of the length of the line segment required to form the rectangle And an outline specifying unit that specifies the outline of a rectangle to be extracted from the image in the order of the degree of the adjustment amount from the rectangles formed for each of the combinations.
その他、本願が開示する課題、及びその解決方法は、発明を実施するための形態の欄の記載、及び図面の記載等により明らかにされる。 In addition, the problems disclosed by the present application and the solutions thereof will be clarified by the description of the embodiments for carrying out the invention, the description of the drawings, and the like.
画像から矩形の輪郭をより高速に特定することが可能となる。 It is possible to specify a rectangular outline from an image at higher speed.
本明細書および添付図面の記載により、少なくとも以下の事項が明らかとなる。以下、本発明をその一実施形態に即して添付図面を参照しつつ説明する。 At least the following matters will be made clear by the description in the present specification and the accompanying drawings. Hereinafter, the present invention will be described in accordance with one embodiment 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 device 100 according to an embodiment of the present invention. The line segment extraction device 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, and a tablet.
そして本実施形態に係る線分抽出装置100は、名刺を撮影すると、その静止画像400(後述)の画像解析を行い、静止画像400から名刺の輪郭を特定し、名刺の部分の画像(名刺の輪郭で囲まれた部分の画像)を名刺画像410として抽出する。このようにして名刺を電子化することができる。 Then, when the line segment extraction device 100 according to the present embodiment captures a business card, it performs image analysis of the still image 400 (described later), specifies the outline of the business card from the still image 400, and obtains an image of the business card portion (the business card The image of the part surrounded by the outline) is extracted as the business card image 410. Thus, the business card can be digitized.
<ハードウェア構成>
線分抽出装置100のハードウェア構成図を図1に示す。線分抽出装置100は、CPU110、メモリ120、通信装置130、記憶装置140、入力装置150、出力装置160、及び記録媒体読取装置170を備えて構成される。
<Hardware configuration>
FIG. 1 shows a hardware configuration diagram of the line segment extraction device 100. 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 the program 700 executed by the line segment extraction device 100 and various data. By reading the program 700 and data stored in the storage device 140 into the memory 120 and executing them by the CPU 110, various functions of the line segment extraction device 100 are realized. Here, the storage device 140 is a nonvolatile storage device such as a hard disk, a solid state drive (SSD), and a flash memory.
記録媒体読取装置170は、SDカード等の記録媒体800に記録されたプログラム700やデータを読み取り、記憶装置140に格納する。 The recording medium reader 170 reads the program 700 and data recorded on a recording medium 800 such as an SD card, and stores the program 700 and data 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 another computer (not shown) via a communication network (not shown) such as a LAN (Local Area Network) or the Internet. For example, the program 700 and the data described above may be stored in another computer, and the line segment extracting apparatus 100 may download the data and the program 700 from this computer.
入力装置150は、ユーザによるコマンドやデータの入力を受け付ける各種ボタンやスイッチ、キーボード、タッチパネルディスプレイ上でのタッチ位置を検出するタッチセンサ、マイクなどの入力インタフェース、加速度センサ、温度センサ、カメラ151などである。 The input device 150 includes various buttons and switches for receiving command and data input by the user, a keyboard, an input interface such as a touch sensor for detecting a touch position on a touch panel display, 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, and lighting.
<機能構成>
図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 device 100. The line segment extraction device 100 includes an image acquisition unit 101, an image display unit 102, and an image extraction unit 104. Further, 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 identification unit 907.
これらの各機能は、線分抽出装置100のハードウェアによって本実施形態に係るプログラム700が実行されることにより実現される。 These functions are realized by executing the program 700 according to the present embodiment by the hardware of the line segment extraction device 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, for example, the camera 151.
静止画像400は、カメラ151のシャッターを押下した瞬間に得られる1枚の写真の画像であっても良いし、動画として撮影された複数フレームからなる個々の画像であっても良い。さらに静止画像400は、動画の撮影開始前や、写真撮影時のシャッターを押下する前にディスプレイ161に表示される、CCD(Charge Coupled Device)によって検出されている画像であっても良い。 The still image 400 may be an image of a single 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 captured as a moving image. Furthermore, the still image 400 may be an image detected by a CCD (Charge Coupled Device), which is displayed on the display 161 before the start of capturing a moving image or before the shutter is pressed during photographing.
またこの静止画像400には、名刺だけでなく、名刺の背景や人物などのように名刺以外のものが写っていてもよい。また1つの静止画像400内に複数枚の名刺が写っていても良い。 The still image 400 may include not only a business card but also a background other than a business card, such as a background of a business card or a person. Further, a plurality of business cards may be included in one still image 400.
画像表示部102は、画像取得部101が取得した名刺の静止画像400を表示する。画像表示部102は例えばタッチパネル型のディスプレイ161を用いて実現される。 The image display unit 102 displays the still image 400 of the business card 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に示すように、本実施形態では、複数枚の名刺を同時に撮影する場合にそれぞれの名刺の向きが揃っていなくても良い。 FIG. 3 shows a state in which the still image 400 is displayed on the display 161 of the line segment extraction device 100. The example shown in FIG. 3 shows a case where three business cards are photographed simultaneously. As shown in FIG. 3, in the present embodiment, when a plurality of business cards are photographed at the same time, the directions of the respective business cards do not have to be aligned.
そして以下に詳しく述べるように、本実施形態に係る線分抽出装置100は、この静止画像400から名刺の輪郭を高速に特定し、名刺の部分の画像(名刺の輪郭で囲まれた部分の画像)を名刺画像410として抽出する。 Then, as described in detail below, the line segment extracting apparatus 100 according to the present embodiment specifies the outline of the business card from the still image 400 at high speed, and outputs the image of the business card portion (the image of the portion surrounded by the business card outline). ) Is extracted 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 so as to overlap the business card image 410 in order to show the extracted business card image 410 to the user. In the present embodiment, the business card marker 500 is a circular image of a predetermined color, but the display mode is not particularly limited. By displaying the business card marker 500 over the business card image 410 in this manner, the user can confirm that the business card has been correctly extracted.
図2に戻って、画像抽出部104について説明する。 Returning to FIG. 2, the image extracting unit 104 will be described.
画像抽出部104は、静止画像400から名刺画像410を抽出する。 The image extracting unit 104 extracts a business card image 410 from the still image 400.
以下、図4〜図14を参照しながら、画像抽出部104の機能及び処理手順を具体的に説明する。 Hereinafter, the functions and processing procedures of the image extracting unit 104 will be specifically described with reference to FIGS.
まず、名刺画像410が抽出される前の静止画像400を図4に示す。画像取得部101がこのような静止画像400を取得すると、エッジ検出部901はこの静止画像400のサイズを画素数に応じて所定の大きさに調整した後、静止画像400からエッジ420を検出する。エッジ検出部901は、例えばCanny法やSobel Filterを用いた手法などの周知の技術を用いてエッジを検出する。 First, FIG. 4 shows a still image 400 before the business card image 410 is extracted. When the image acquisition unit 101 acquires such a still image 400, the edge detection unit 901 adjusts the size of the still image 400 to a predetermined size according to the number of pixels, and then detects the edge 420 from the still image 400. . The edge detection unit 901 detects an edge by using a known technique such as a method using a Canny method or a Sobel Filter.
エッジ検出部901が静止画像400からエッジ420を検出した様子を図5に示す。 FIG. 5 shows how the edge detection unit 901 has detected 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 an intersection 422 between 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 edge 420. . The state 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との交差する点が複数の画素に分散することがある。 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 at which individual pixels can be identified. Therefore, when the intersection angle between the edge 420 and the first mesh line 421 is small, the point where the edge 420 intersects with the first mesh line 421 is dispersed into a plurality of pixels as shown in FIG. 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 intersects with the first mesh line 421 are distributed to a plurality of pixels, as shown in FIG. A point (for example, a middle point) is selected and specified as the intersection 422. According to such an embodiment, it is possible to specify the intersection 422 between the edge 420 and the first mesh line 421 with pixel-by-pixel accuracy. FIG. 6C shows how the first intersection specifying unit 902 finds the intersection 422 in this manner.
そうすると次に、第1交点結合部903は、図6(D)及び図6(E)に示すように、隣接する2本の第1メッシュライン421のペアのそれぞれについて、互いの第1メッシュライン421上の交点422同士を直線の結合線423で結ぶ。 Then, as shown in FIG. 6D and FIG. 6E, the first intersection coupling unit 903 performs the first mesh line operation for each pair of two adjacent first mesh lines 421. The intersection points 422 on the line 421 are connected by a straight connection line 423.
そして第1線分特定部904は、図6(F)に示すように、交点422で繋がる複数の結合線423からなり、延伸方向の角度差が所定範囲以内(例えば±5°以内)である結合線423の集合を、線分430として抽出する。なおこのとき、第1線分特定部904は、第1メッシュライン421に対して所定角度以上(例えば45°以上)の交角を有する結合線423の集合を、線分430として抽出する。 Then, as shown in FIG. 6F, the first line segment specifying unit 904 is composed of a plurality of connection lines 423 connected at the intersection 422, and the angle difference in the stretching direction is within a predetermined range (for example, within ± 5 °). A set of connection lines 423 is extracted as a line segment 430. At this time, the first line segment identification unit 904 extracts, as the line segment 430, a set of connection lines 423 having an intersection angle of a predetermined angle or more (for example, 45 ° or more) with respect to the first mesh line 421.
その後、第2交点特定部905、第2交点結合部906及び第2線分特定部907は、第1メッシュライン421の延伸方向と直交する第2メッシュライン421(不図示)を用いて、それぞれ第1交点特定部902、第1交点結合部903及び第1線分特定部904と同様の処理を行うことにより、さらに線分430を抽出する。 Thereafter, the second intersection specifying unit 905, the second intersection connecting unit 906, and the second line segment specifying unit 907 use a second mesh line 421 (not shown) orthogonal to the extending direction of the first mesh line 421, respectively. A line segment 430 is further extracted by performing the same processing as that of the first intersection specifying unit 902, the first intersection connecting 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 between the plurality of second mesh lines 421 extending at predetermined intervals in the second direction orthogonal to the first mesh lines 421 and the edges 420. Then, for each pair of two adjacent second mesh lines 421, the second intersection connection unit 906 connects the intersections 422 on the second mesh lines 421 with a straight connection line 423. Then, the second line segment identification unit 907 includes a plurality of connection lines 423 connected at the intersection 422, and the second line segment identification unit 907 includes a second connection line 423 of a set of connection lines 423 in which the angle difference in the extending direction is within a predetermined range (for example, within ± 5 °). A set of connection lines 423 having an intersection angle exceeding the complementary angle of the predetermined angle (eg, exceeding 45 °) with the mesh line 421 is extracted as a line segment 430.
このような態様によって、線分430を抽出する際に、交点422に対する処理を行なえば済み、エッジ420上の多数の点に対する処理を不要にできるので、より高速に線分430の抽出を行うことが可能となる。 According to such an embodiment, when the line segment 430 is extracted, the process for the intersection 422 may be performed, and the process for a large number of points on the edge 420 can be omitted. Becomes possible.
またハフ変換等を用いて直線を検出する場合とは異なり、静止画像400内の被写体の境界を有限長の線分430として抽出できるため、以下に述べるように、これらの線分430を組み合わせて多角形432を形成する際に、多角形432の周長に対する線分430の調整部分431の長さ(調整量)の比率を算出することが可能となる。 Also, unlike the case where a straight line is detected by using the Hough transform or the like, since the boundary of the subject in the still image 400 can be extracted as a line segment 430 of a finite length, as described below, these line segments 430 are combined. When forming the polygon 432, it is possible to calculate the ratio of the length (adjustment amount) of the adjustment portion 431 of the line segment 430 to the circumference of the polygon 432.
また第1メッシュライン421と第2メッシュライン421とを用いてエッジ420との交点422を求めることによって、エッジ420が静止画像400内でどの方向に延伸していても、メッシュライン421との交角が45°以上となるような交点422を特定することができるため、エッジ420上の交点422の位置をより正確に特定することが可能となる。 Further, by determining the intersection 422 with the edge 420 using the first mesh line 421 and the second mesh line 421, even if the edge 420 extends in any direction in the still image 400, the intersection angle with the mesh line 421 is obtained. Can be specified such that the angle of intersection is equal to or greater than 45 °, so that the position of the intersection 422 on the edge 420 can be specified more accurately.
なお、メッシュライン421の間隔を狭くすると交点422の数を増やすことができるため、より正確に線分430の抽出を行うことが可能であるが、その分処理時間が増大する。メッシュライン421は、例えば静止画像400内に50本〜100本程度となるような間隔で引くと良いが、種々変更することが可能である。 Note that when the interval between the mesh lines 421 is reduced, 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. The mesh lines 421 are preferably drawn at intervals of, for example, about 50 to 100 lines in the still image 400, but can be variously changed.
このようにして、第1線分特定部904及び第2線分特定部907によって、静止画像400から線分430が特定される。静止画像400から線分430が特定された様子を図8に示す。 In this way, the first line segment specifying unit 904 and the second line segment specifying unit 907 specify the line segment 430 from the still image 400. FIG. 8 shows how the line segment 430 is specified from the still image 400.
その後、多角形形成部910は、静止画像400から抽出された線分430の中から名刺の辺の数に応じた本数の線分(つまり、4本の線分)を選ぶ組み合わせ毎に、線分430の長さを調整して、名刺と同じ数の頂点を有する多角形(つまり四角形)432を形成する。 After that, the polygon forming unit 910 selects a line segment corresponding to the number of business card sides (that is, four line segments) from the line segments 430 extracted from the still image 400 for each combination. The length of the minute 430 is adjusted to form a polygon 432 having the same number of vertices as the business card.
例えば、図9に示すように、静止画像400から5本の線分430A〜Eが抽出されたとすると、これらの線分430A〜Eから4本を選ぶ組み合わせは下記(1)〜(5)の5通りである(5C4=5)。 For example, as shown in FIG. 9, when five line segments 430A to 430E are extracted from the still image 400, combinations of selecting four line segments from these line segments 430A to 430 are as follows (1) to (5). is a five types (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
The polygon forming unit 910 attempts to form a square 432 using each line segment 430 for each of these combinations. However, since the polygon forming portion 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 combinations (3) and (5) including these three line segments 430 at the same time Can be removed from the combination. According to such an embodiment, it is possible to efficiently eliminate unnecessary processing and extract business cards at higher speed.
このようにして、多角形形成部910は、図10(A)〜図10(C)に示すような3通りの組み合わせの四角形432を形成する。図10(A)は(1)の組み合わせに対応し、図10(B)は(2)の組み合わせに対応し、図10(C)は(4)の組み合わせに対応する。 In this way, the polygon forming unit 910 forms a quadrangle 432 of three combinations as shown in FIGS. 10A to 10C. FIG. 10A corresponds to the combination of (1), FIG. 10B corresponds to the combination of (2), and FIG. 10C corresponds to the combination of (4).
このようにして、図10(A)〜図10(C)に示した各組み合わせについて、多角形形成部910が四角形432を形成する様子を、それぞれ図11(A)〜図11(C)に示す。 In this manner, for each combination shown in FIGS. 10A to 10C, a state in which the polygon forming unit 910 forms the square 432 is shown 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 unit 910 forms the square 432 by adjusting the length of the line segments 430A, 430B, 430C, and 430D. In FIG. 11A, an adjustment portion of the length of each line segment 430 is indicated by a broken line as an adjustment portion 431.
多角形形成部910は、図11(B)(C)に示すケースでも同様に、線分430の長さを調整して、四角形432を形成する。 The polygon forming unit 910 forms the square 432 by adjusting the length of the line segment 430 in the case shown in FIGS.
そうすると調整度算出部920は、上記各組み合わせ毎に、四角形432を形成するために必要な線分430の長さの調整量の度合いを表す値を算出する。例えば調整度算出部920は、線分430の長さを調整して形成される四角形432の周長に対する調整部分431の長さ(調整量)の比率を算出する。 Then, the adjustment degree calculation unit 920 calculates a value indicating the degree of adjustment of the length of the line segment 430 required to form the square 432 for each combination. For example, the adjustment degree calculation unit 920 calculates the ratio of the length (adjustment amount) of the adjustment portion 431 to the circumference of the rectangle 432 formed by adjusting the length of the line segment 430.
そして輪郭特定部930は、この調整量の度合いが小さい組み合わせから順に、組み合わせを構成する各線分430を、名刺の輪郭として割り当てていく。 Then, the contour specifying unit 930 assigns each line segment 430 constituting the combination as a 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 the adjustment amount is small in the order of FIGS. 11A, 11B, and 11C, the contour specifying unit 930 firstly determines the line segment 430 of the combination shown in FIG. (Line segments 430A, 430B, 430C, and 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 the business card, the remaining line segment is only one line segment 430E, and the square 432 can no longer be formed.
このようにして本実施形態に係る線分抽出装置100は名刺の輪郭を特定する。図3に示したように、静止画像400内に複数枚の名刺が存在する場合であっても、各線分430の組み合わせ毎の調整量の度合いが小さい順に、名刺の輪郭として特定することが可能である。 Thus, the line segment extraction device 100 according to the present embodiment specifies the outline of the business card. As shown in FIG. 3, even when a plurality of business cards exist in the still image 400, the outline of the business card can be specified 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 device 100 according to the present embodiment further includes a shape comparison unit 940.
形状比較部940は、線分430の長さを調整して形成される四角形432の形状を表す指標値を、名刺の形状を表す基準値と比較する。 The shape comparing unit 940 compares an index value representing the shape of the square 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を名刺の輪郭として特定する。 Then, the contour specifying unit 930 combines, in order from the combination of the line segments 430 where the square 432 is formed such that the index value is within a predetermined range with respect to the reference value, the combination in which the degree of the adjustment amount is small, in order. 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 the adjacent line segments 430 with a reference value in the square 432 formed by combining four line segments 430. If the reference value is set to, for example, 90 ° ± 5 °, the contour specifying unit 930 sets the inner angle of 90 ° ± 5 ° in various rectangles 432 formed by combining four line segments 430. A rectangle or a square 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. According to such an embodiment, it is possible to more accurately specify a business card.
あるいは、形状比較部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 square 432 formed by combining four line segments 430. As a reference value, for example, if the short side is set to 50 mm to 60 mm and the long side is set to 85 mm to 95 mm, the contour specifying unit 930 includes various rectangles 432 formed by combining four line segments 430. A rectangle having such a side length is selected, and a 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. According to such an embodiment, the business card can be specified more accurately.
次に、本実施形態に係る線分抽出装置100の処理の流れについて、図12〜図14に示すフローチャートを参照しながら説明する。 Next, the flow of processing of the line segment extraction device 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 extracting apparatus 100 acquires a still image 400 by photographing a business card (S1000). The image acquisition unit 101 is realized using, for example, the camera 151.
次に、線分抽出装置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 device 100 adjusts one side of the still image 400 to be 1000 pixels or less. According to such an embodiment, it is possible to reduce the processing amount when the line segment extracting apparatus 100 performs the image analysis, and to quickly specify the outline of the business card from the still image 400.
次に線分抽出装置100は、静止画像400からエッジ420を検出した後(S1020)、エッジを検出した静止画像400から線分430を抽出する(S1030)。 Next, after detecting the edge 420 from the still image 400 (S1020), the line segment extracting apparatus 100 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 extracting apparatus 100 extracts the line segment 430 from the still image 400.
まず線分抽出装置100は、エッジ420が検出された静止画像400を取得する(S2000)。 First, the line segment extraction device 100 acquires the still image 400 in which the edge 420 has been detected (S2000).
そして線分抽出装置100は、静止画像400内で第1方向に所定間隔で延伸する複数の第1メッシュライン421を引く(S2010)。 Then, the line segment extraction device 100 draws a plurality of first mesh lines 421 extending at predetermined intervals 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, for each pair of two adjacent first mesh lines 421, the line segment extraction device 100 connects the intersection points 422 on the first mesh lines 421 with a straight connection line 423 (S2030).
そして線分抽出装置100は、交点422で繋がる複数の結合線423からなり、延伸方向の角度差が所定範囲以内である結合線423の集合を、線分430の候補とする(S2040)。 Then, the line segment extracting apparatus 100 sets, as candidates for the line segment 430, a set of the connection lines 423 including a plurality of connection lines 423 connected at the intersection 422 and having an angle difference in the extending direction within a predetermined range (S2040).
このとき線分抽出装置100は、線分430の候補とした結合線423の集合のうち、その結合線423の位置にエッジ420が抽出されていないものを除いたうえで、線分430を抽出する(S2050)。 At this time, the line segment extracting apparatus 100 extracts the line segment 430 from the set of the connection lines 423 that are candidates for the line segment 430, excluding the one whose edge 420 is not extracted at the position of the connection 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 ° (S2060, S2070), and performs the processing of S2010 to S2050. repeat. To perform the same processing by rotating the still image 400 by 90 ° is that the second intersection specifying unit 905, the second intersection connecting unit 906, and the second line segment specifying unit 907 use the second mesh line 421 described above. This is equivalent to performing a process of extracting the line segment 430.
そして線分抽出装置100は、静止画像400の向きを−90°回転して元に戻し(S2080)、検出した線分430を出力する(S2090)。 Then, the line segment extraction device 100 rotates the direction of the still image 400 by −90 ° to return to the original position (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 square 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 firstly has a number of line segments corresponding to the number of business card sides (that is, four line segments) from among the line segments 430 extracted from the still image 400. The length of the line segment 430 is adjusted for each combination for selecting the line segment, thereby forming a polygon 432 (that is, a square 432) having the same number of vertices as the business card (S3000).
そして線分抽出装置100は、これらの四角形432の内、四角形432の成す角(内角)が例えば90°±5°の範囲にないものを除去する(S3010、S3020)。このような態様によって、無駄な処理を効率的に省き、名刺の抽出をより高速に行うことが可能となる。 Then, the line segment extracting apparatus 100 removes, out of these quadrangles 432, those whose angle (inner angle) formed by the quadrilateral 432 is not in the range of, for example, 90 ± 5 ° (S3010, S3020). According to such an embodiment, it is possible to efficiently eliminate unnecessary processing and extract business cards at higher speed.
そして線分抽出装置100は、四角形432を構成する線分430の各組み合わせ毎に、四角形432を形成するために必要な線分430の長さの調整量の度合いを表す値(ペナルティ)を算出し(S3030)、出力する(S3040)。例えば調整度算出部920は、四角形432の周長に対する調整部分431の長さ(調整量)の比率をペナルティとして算出する。 Then, the line segment extraction device 100 calculates, for each combination of the line segments 430 constituting the rectangle 432, a value (penalty) representing the degree of the amount of adjustment of the length of the line segment 430 required to form the rectangle 432. (S3030) and output (S3040). For example, the adjustment degree calculation unit 920 calculates the ratio of the length (adjustment amount) of the adjustment portion 431 to the circumference of the rectangle 432 as a penalty.
そして線分抽出装置100は、ペナルティが小さい順に、上記線分430の組み合わせを並び替える(S3050)。 Then, the line segment extracting 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 as the outline of the business card in order from the combination having the smallest penalty (S3060 to S3090). When the line segment 430 that can form the square 432 is gone (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 extracting apparatus 100 also displays the business card marker 500 so as to overlap with the business card image 410 in a portion surrounded by the outline of the business card.
図12に戻って、線分抽出装置100は、このようにして静止画像400から名刺の輪郭を特定したら、次のフレームの静止画像400についても同様に処理を行う。このようにして、線分抽出装置100は、動画などのような連続する静止画像400についても、名刺の輪郭を特定することが可能である。 Returning to FIG. 12, when the outline of the business card is specified from the still image 400 in this way, the line segment extracting apparatus 100 performs the same process on the still image 400 of the next frame. In this way, the line segment extraction device 100 can specify the outline of the business card even for a continuous still image 400 such as a moving image.
==他の実施形態==
上記実施形態では、多角形形成部910は、静止画像400から抽出された線分430の中から名刺の辺の数に応じた本数の線分(つまり、4本の線分)を選ぶ組み合わせ毎に、線分430の長さを調整して、名刺と同じ数の頂点を有する多角形(つまり四角形)432を形成したが、この場合、抽出されたn本の線分430から、4頂点の四角形432を形成する場合には、単純にはnC4通りの組み合わせが存在するため、計算量はnの4乗のオーダとなる。
== Other Embodiments ==
In the above-described embodiment, the polygon forming unit 910 selects 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 for each combination. 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 When the square 432 is formed, since there are simply four combinations of n C, 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 forms an angle with each other having a common end point among the line segments 430 extracted from the still image 400 (for example, in a range of 90 ° ± 5 °). The two line segments 430 are extracted as a line segment pair, and the length of the four line segments 430 is determined for each combination in which 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 consisting of two line segments 430 that intersect at once at an angle that is substantially orthogonal to each other (within 90 ° ± 5 °) ( The shape of the line segment pair is "" or "" in a bracket shape, and the line segment pairs are combined to form a square 432.
このような態様によれば、組み合わせの数がnC2+(n/2)C2となるため、計算量をnの2乗のオーダにすることができる。これにより、より高速に名刺の輪郭を特定することが可能となる。 According to such an embodiment, since the number of combinations is n C 2 + (n / 2) C 2 , the amount of calculation can be on the order of the square of n. As a result, it is possible to more quickly specify the outline of the business card.
なお、線分ペアを形成する2本の線分430の端点が共通するとは、第1の線分430の端点と、第2の線分430の端点とが、同一ピクセル上に位置する場合だけでなく、所定範囲内(例えば10ピクセル以内)に位置する場合を含む。 Note that the end points of the two line segments 430 forming a line segment pair are common only when the end point of the first line segment 430 and the end point of the second line segment 430 are located on the same pixel. But not within a predetermined range (for example, within 10 pixels).
以上、本実施形態に係る線分抽出装置100、線分抽出装置100の制御方法、及びプログラム700について詳細に説明したが、本実施形態によれば、静止画像400から線分430をより高速に特定することが可能となる。 As described above, the line segment extraction device 100, the control method of the line segment extraction device 100, and the program 700 according to the present embodiment have been described in detail. It becomes possible to specify.
なお上述した実施の形態は本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明はその趣旨を逸脱することなく変更、改良され得るとともに、本発明にはその等価物も含まれる。 It should be noted that the above-described embodiment is intended to facilitate understanding of the present invention, and is not intended to limit the present invention. The present invention can be changed and improved without departing from the gist thereof, and the present invention also includes equivalents thereof.
例えば、上記実施形態では、静止画像400から名刺の輪郭を特定する場合を例に説明したが、名刺のような四角形の平面の輪郭を特定するだけでなく、一般的に三角形や五角形、六角形などの多角形の平面の輪郭を特定する場合にも同様に適用することができる。 For example, in the above-described embodiment, the case where the outline of the business card is specified from the still image 400 has been described as an example, but not only the outline of a rectangular plane such as a business card is specified, but also a triangle, a pentagon, and a hexagon The same can be applied to the case where the outline of a polygonal plane 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 形状比較部
100 line segment extraction device 101 image acquisition unit 102 image display unit 104 image extraction unit 110 CPU
Reference Signs List 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 connection line 430 line segment 431 line segment adjustment part 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 specifying unit 904 First line specifying unit 905 Second intersection specifying unit 906 Second intersection connecting unit 907 2 line segment specifying section 910 Polygon forming section 920 Adjustment degree calculating section 930 Outline specifying section 940 Shape comparing section
Claims (9)
前記画像から線分の抽出を行う線分抽出部と、
前記画像から抽出された前記線分のうち共通の端点を有して互いに角度をなす2本の線分を線分ペアとして抽出した上で、前記線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分の長さを調整して矩形を形成する多角形形成部と、
前記組み合わせ毎に、前記矩形を形成するために必要な前記線分の長さの調整量の度合いを表す値を算出する調整度算出部と、
前記組み合わせ毎に形成される矩形の中から、前記調整量の度合いが小さい組み合わせから順に、前記画像から抽出すべき矩形の輪郭を特定する輪郭特定部と、
を備える
ことを特徴とする画像抽出装置。 An image extraction device for extracting a rectangle from an image,
A line segment extraction unit that performs line segment extraction from the image,
After extracting two line segments having a common end point and forming an angle from each other among the line segments extracted from the image as a line segment pair, two line segment pairs are extracted from the line segment pairs. A polygon forming unit that adjusts the length of the four line segments to form a rectangle for each combination to be selected;
For each combination, an adjustment degree calculation unit that calculates a value indicating a degree of an adjustment amount of the length of the line segment necessary to form the rectangle,
From among the rectangles formed for each of the combinations, an outline specifying unit that specifies the outline of the rectangle to be extracted from the image in order from the combination having the smaller adjustment amount ,
An image extraction device comprising:
前記線分の長さを調整して形成される矩形の形状を表す所定の指標値を、前記画像から特定すべき矩形の形状を表す基準値と比較する形状比較部と、
をさらに備え、
前記輪郭特定部は、前記指標値が前記基準値に対して所定範囲内となるような矩形が形成される前記線分ペアの組み合わせの中で、前記調整量の度合いが小さい組み合わせから順に、前記組み合わせを構成する各線分を前記画像から抽出すべき矩形の輪郭として特定する
ことを特徴とする画像抽出装置。 The image extraction device according to claim 1 ,
A shape comparison unit that compares a predetermined index value representing a rectangular shape formed by adjusting the length of the line segment with a reference value representing a rectangular shape to be identified from the image,
Further comprising
The outline identification unit is configured such that the index value falls within a predetermined range with respect to the reference value. An image extracting apparatus, wherein each line segment constituting a combination is specified as a rectangular outline to be extracted from the image.
前記指標値及び前記基準値は、前記矩形をなす隣り合う二辺の交角を含む
ことを特徴とする画像抽出装置。 The image extraction device according to claim 2 ,
The image extraction device, wherein the index value and the reference value include an intersection angle between two adjacent sides forming the rectangle.
前記指標値及び前記基準値は、前記矩形をなす各辺の長さを含む
ことを特徴とする画像抽出装置。 The image extraction device according to claim 2 or 3 ,
The image extraction device according to claim 1, wherein the index value and the reference value include a length of each side of the rectangle.
前記調整量の度合いを示す値は、前記線分の長さを調整して形成される矩形の周長に対する前記調整量の比率である
ことを特徴とする画像抽出装置。 The image extraction device according to any one of claims 1 to 4 ,
The image extraction device according to claim 1, wherein the value indicating the degree of the adjustment amount is a ratio of the adjustment amount to a circumference of a rectangle formed by adjusting the length of the line segment.
前記線分抽出部は、
前記画像からエッジを検出するエッジ検出部と、
前記画像内で第1方向に所定間隔で延伸する複数の第1平行線と、前記エッジと、の交点を求める第1交点特定部と、
隣接する2本の第1平行線の各ペアについて、互いの第1平行線上の前記交点同士を直線の結合線で結ぶ第1交点結合部と、
前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する第1線分特定部と、
を備えることを特徴とする画像抽出装置。 The image extraction device according to any one of claims 1 to 5 ,
The line segment extraction unit includes:
An edge detection unit that detects an edge from the image,
A first intersection specifying unit that obtains an intersection between the 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 connecting portion connecting the intersections on the first parallel lines with a straight connecting line;
A first line segment identification unit that is composed of a plurality of the connection lines connected at the intersections, and extracts a set of the connection lines in which the angle difference in the stretching direction is within a predetermined range, as the line segment,
An image extraction device comprising:
前記線分抽出部は、さらに、
前記画像内で前記第1方向と直交する第2方向に所定間隔で延伸する複数の第2平行線と、前記エッジと、の交点を求める第2交点特定部と、
隣接する2本の第2平行線の各ペアについて、互いの第2平行線上の前記交点同士を直線の結合線で結ぶ第2交点結合部と、
前記交点で繋がる複数の前記結合線からなり、延伸方向の角度差が所定範囲以内である前記結合線の集合を、前記線分として抽出する第2線分特定部と、
を備え、
前記第1線分特定部は、前記第1平行線に対して所定角度以上の交角を有する前記結合線の集合を、前記線分として抽出し、
前記第2線分特定部は、前記第2平行線に対して前記所定角度の余角を超える交角を有する前記結合線の集合を、前記線分として抽出する
ことを特徴とする画像抽出装置。 The image extraction device according to claim 6 ,
The line segment extraction unit further includes:
A plurality of second parallel lines extending at predetermined intervals in a second direction orthogonal to the first direction in the image, and a second intersection specifying unit for obtaining an intersection with the edge;
For each pair of two adjacent second parallel lines, a second intersection connecting portion connecting the intersections on each other's second parallel lines with a straight connecting line;
A second line segment identification unit that is composed of a plurality of the connection lines connected at the intersection, and extracts a set of the connection lines in which the angle difference in the stretching direction is within a predetermined range, as the line segment,
With
The first line segment identification unit extracts, as the line segment, a set of the connection lines having an intersection angle equal to or greater than a predetermined angle with respect to the first parallel line,
The image extraction device, wherein the second line segment identification unit extracts, as the line segment, a set of the connection lines having an intersection angle exceeding the complementary angle of the predetermined angle with respect to the second parallel line.
前記画像抽出装置が、
前記画像から線分を抽出し、
前記画像から抽出された前記線分のうち共通の端点を有して互いに角度をなす2本の線分を線分ペアとして抽出した上で、前記線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分の長さを調整して矩形を形成し、
前記組み合わせ毎に、前記矩形を形成するために必要な前記線分の長さの調整量の度合いを表す値を算出し、
前記組み合わせ毎に形成される矩形の中から、前記調整量の度合いが小さい組み合わせから順に、前記画像から抽出すべき矩形の輪郭を特定する、
ことを特徴とする画像抽出装置の制御方法。 A control method of an image extraction device for extracting a rectangle from an image,
The image extraction device,
Extracting a line segment from the image,
After extracting two line segments having a common end point and forming an angle from each other among the line segments extracted from the image as a line segment pair, two line segment pairs are extracted from the line segment pairs. For each combination you choose, adjust the length of the four line segments to form a rectangle,
For each combination, calculate a value representing the degree of adjustment of the length of the line segment required to form the rectangle,
From among the rectangles formed for each of the combinations, the outline of the rectangle to be extracted from the image is specified in order from the combination having the smaller adjustment degree .
A method for controlling an image extracting apparatus, comprising:
前記画像から線分を抽出する手順と、
前記画像から抽出された前記線分のうち共通の端点を有して互いに角度をなす2本の線分を線分ペアとして抽出した上で、前記線分ペアの中から2つの線分ペアを選ぶ組み合わせ毎に、4本の線分の長さを調整して矩形を形成する手順と、
前記組み合わせ毎に、前記矩形を形成するために必要な前記線分の長さの調整量の度合いを表す値を算出する手順と、
前記組み合わせ毎に形成される矩形の中から、前記調整量の度合いが小さい組み合わせから順に、前記画像から抽出すべき矩形の輪郭を特定する手順と、
を実行させるためのプログラム。 A program for extracting a rectangle from an image, comprising:
Extracting a line segment from the image;
After extracting two line segments having a common end point and forming an angle from each other among the line segments extracted from the image as a line segment pair, two line segment pairs are extracted from the line segment pairs. A procedure of adjusting the length of the four line segments to form a rectangle for each combination to be selected;
For each combination, a step of calculating a value representing the degree of adjustment of the length of the line segment required to form the rectangle;
A procedure for identifying the outline of a rectangle to be extracted from the image , in the order of the degree of the adjustment amount, from among the rectangles formed for each combination,
A program for executing
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018217892A JP6677412B2 (en) | 2018-11-21 | 2018-11-21 | IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018217892A JP6677412B2 (en) | 2018-11-21 | 2018-11-21 | IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017084433A Division JP6447890B2 (en) | 2017-04-21 | 2017-04-21 | Line segment extractor, control method and program for line segment extractor |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019050030A JP2019050030A (en) | 2019-03-28 |
| JP6677412B2 true JP6677412B2 (en) | 2020-04-08 |
Family
ID=65906320
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2018217892A Active JP6677412B2 (en) | 2018-11-21 | 2018-11-21 | IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6677412B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022260803A1 (en) * | 2021-06-08 | 2022-12-15 | Microsoft Technology Licensing, Llc | Target region extraction for digital content addition |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112734780B (en) * | 2020-12-25 | 2021-09-14 | 哈尔滨市科佳通用机电股份有限公司 | Method for identifying deformation fault of pull ring of derailment automatic braking pull ring device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8098936B2 (en) * | 2007-01-12 | 2012-01-17 | Seiko Epson Corporation | Method and apparatus for detecting objects in an image |
| JP6543025B2 (en) * | 2014-09-12 | 2019-07-10 | キヤノン株式会社 | Image processing apparatus and image processing method |
-
2018
- 2018-11-21 JP JP2018217892A patent/JP6677412B2/en active Active
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022260803A1 (en) * | 2021-06-08 | 2022-12-15 | Microsoft Technology Licensing, Llc | Target region extraction for digital content addition |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2019050030A (en) | 2019-03-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6011470B2 (en) | Apparatus, method and program for analyzing preliminary image | |
| US11283987B2 (en) | Focus region display method and apparatus, and storage medium | |
| US8633999B2 (en) | Methods and apparatuses for foreground, top-of-the-head separation from background | |
| US10291843B2 (en) | Information processing apparatus having camera function and producing guide display to capture character recognizable image, control method thereof, and storage medium | |
| CN107622497B (en) | Image cropping method and device, computer readable storage medium and computer equipment | |
| CN108694400A (en) | Information processing unit, its control method and storage medium | |
| JP6677412B2 (en) | IMAGE EXTRACTION DEVICE, IMAGE EXTRACTION DEVICE CONTROL METHOD, AND PROGRAM | |
| JP6669390B2 (en) | Information processing apparatus, information processing method, and program | |
| JP6098784B2 (en) | Image processing apparatus and program | |
| WO2022213784A1 (en) | Image processing method and apparatus, and electronic device and storage medium | |
| JP6447890B2 (en) | Line segment extractor, control method and program for line segment extractor | |
| JP7027043B2 (en) | Information processing equipment, information processing methods and programs | |
| US20210281742A1 (en) | Document detections from video images | |
| JP6077873B2 (en) | Image processing apparatus and image processing method | |
| JP6563084B1 (en) | Card number recognition apparatus and card number recognition method | |
| TWI395469B (en) | Method for image pickup and image pickup device using the same | |
| KR20140134844A (en) | Method and device for photographing based on objects | |
| JP2013247531A (en) | Image processing apparatus and document reading system comprising the same | |
| JP6598402B1 (en) | Receipt and other form image automatic acquisition / reading method, program, and portable terminal device | |
| CN115812177A (en) | Image processing device, imaging device, image processing method, and program | |
| JP6677410B2 (en) | Information processing apparatus, control method for information processing apparatus, and program | |
| JP6244787B2 (en) | Image recognition apparatus, image recognition method, and image recognition program | |
| CN107909030A (en) | Processing method, terminal and the computer-readable recording medium of portrait photo | |
| JP2009130840A (en) | Imaging apparatus, control method thereof, and program | |
| JP2018191094A (en) | Document reader, document reader control method, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20181207 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181207 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20191030 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20191112 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20191227 |
|
| 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: 20200218 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200306 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6677412 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |