JP6354497B2 - Display area specifying device, display area specifying method, and program - Google Patents

Display area specifying device, display area specifying method, and program Download PDF

Info

Publication number
JP6354497B2
JP6354497B2 JP2014196832A JP2014196832A JP6354497B2 JP 6354497 B2 JP6354497 B2 JP 6354497B2 JP 2014196832 A JP2014196832 A JP 2014196832A JP 2014196832 A JP2014196832 A JP 2014196832A JP 6354497 B2 JP6354497 B2 JP 6354497B2
Authority
JP
Japan
Prior art keywords
display
color
hue
assigned
display element
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
JP2014196832A
Other languages
Japanese (ja)
Other versions
JP2016071418A (en
Inventor
勇作 藤井
勇作 藤井
瀬川 英吾
英吾 瀬川
上原 祐介
祐介 上原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2014196832A priority Critical patent/JP6354497B2/en
Publication of JP2016071418A publication Critical patent/JP2016071418A/en
Application granted granted Critical
Publication of JP6354497B2 publication Critical patent/JP6354497B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Document Processing Apparatus (AREA)
  • User Interface Of Digital Computer (AREA)

Description

本発明は、表示領域特定装置、表示領域特定方法、及びプログラムに関する。   The present invention relates to a display area specifying device, a display area specifying method, and a program.

インターネットの普及ととともに、インターネットを介して取得されるHTML文書を表示させるWebブラウザの種類が増加している。Webブラウザの種類に加え、Webブラウザのバージョン及び動作OS等の違いを考慮すると多数の組み合わせが存在する。   With the spread of the Internet, the types of Web browsers that display HTML documents obtained via the Internet are increasing. In addition to the types of Web browsers, there are many combinations in consideration of differences in Web browser versions and operating OSs.

しかしながら、各Webブラウザは、相互に描画特性が異なったり、独自の拡張機能を有していたりする。また、HTMLに関してWebブラウザごとに解釈が異なる定義が有る。その結果、WebブラウザごとにHTML文書の表示結果が異なる場合が有る。   However, the web browsers have different drawing characteristics from each other or have their own extended functions. Further, there is a definition regarding HTML that is interpreted differently for each Web browser. As a result, the display result of the HTML document may be different for each Web browser.

そこで、各WebブラウザによるHTML文書の表示結果における各HTML要素の表示領域を特定し、Webブラウザごとに特定された表示領域を比較することで、各WebブラウザによるHTML文書の表示結果について相違の有無を判定することが検討されている(例えば、特許文献1参照)。   Accordingly, by specifying the display area of each HTML element in the display result of the HTML document by each Web browser and comparing the display areas specified for each Web browser, there is a difference in the display result of the HTML document by each Web browser. Has been studied (see, for example, Patent Document 1).

特許文献1では、以下のような方法によって、Webブラウザによる表示結果における各HTML文書の表示領域が特定される。   In Patent Document 1, the display area of each HTML document in the display result by the Web browser is specified by the following method.

まず、HTML文書内のHTML要素が一つ選択され、当該HTML要素が黒で表示され、他のHTML要素が白で表示されるようにHTML文書が改変される。続いて、各Webブラウザによって改変後のHTML文書が表示され、各Webブラウザによる表示結果において、黒色の領域が、選択されたHTML要素の表示領域として特定される。   First, one HTML element in the HTML document is selected, and the HTML document is modified so that the HTML element is displayed in black and the other HTML elements are displayed in white. Subsequently, the modified HTML document is displayed by each Web browser, and in the display result by each Web browser, the black area is specified as the display area of the selected HTML element.

特開2010−39815号公報JP 2010-39815 A

しかしながら、特許文献1に記載された方法によれば、HTML文書内の各HTML要素に関して、(1)HTML文書の改変、(2)各Webブラウザの起動及び各Webブラウザによる当該HTML文書の表示、(3)当該HTML要素の表示領域の特定が繰り返し実行される必要が有る。例えば、HTML文書内に100個のHTML要素が存在すれば、(1)〜(3)が100回繰り返される必要が有り、非効率である。   However, according to the method described in Patent Document 1, with respect to each HTML element in the HTML document, (1) modification of the HTML document, (2) activation of each Web browser, and display of the HTML document by each Web browser, (3) It is necessary to repeatedly specify the display area of the HTML element. For example, if there are 100 HTML elements in the HTML document, (1) to (3) need to be repeated 100 times, which is inefficient.

そこで、一側面では、表示データ内の各表示要素の表示領域を効率的に特定可能とすることを目的とする。   In view of this, an object of one aspect is to make it possible to efficiently specify the display area of each display element in the display data.

一つの案では、表示領域特定装置は、表示データに含まれる各表示要素に相互に異なる色を割り当てる割当部と、各表示要素又は各表示要素の背景が、前記割当部によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更する変更部と、前記変更部による変更後の表示データをブラウザに表示させる表示部と、前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する特定部と、を有する。   In one proposal, the display area specifying device assigns a different color to each display element included in the display data, and assigns each display element or the background of each display element to the display element by the assignment unit. A change unit that changes the definition content of the display data so that the display data is displayed, a display unit that displays display data after the change by the change unit in a browser, and a display result of the display data by the browser For each color assigned to the display element, a specifying unit that specifies an area specified based on a pixel of the color as a display area of the display element to which the color is assigned. .

一側面によれば、表示データ内の各表示要素の表示領域を効率的に特定可能とすることができる。   According to one aspect, it is possible to efficiently specify the display area of each display element in the display data.

第一の実施の形態における比較装置のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the comparison apparatus in 1st embodiment. 第一の実施の形態における比較装置の機能構成例を示す図である。It is a figure which shows the function structural example of the comparison apparatus in 1st embodiment. 第一の実施の形態の比較装置が実行する処理手順の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the process sequence which the comparison apparatus of 1st embodiment performs. 評価対象のHTML文書の一例を示す図である。It is a figure which shows an example of the HTML document of evaluation object. 1つのHTML要素について着色のための改変が行われたHTML文書の一例を示す図である。It is a figure which shows an example of the HTML document by which the modification for coloring was performed about one HTML element. 着色対象の全てのHTML要素について着色のための改変が行われたHTML文書の一例を示す図である。It is a figure which shows an example of the HTML document by which the modification for coloring was performed about all the HTML elements of coloring object. 第一の実施の形態において割当色記憶部に記憶される値の一例を示す図である。It is a figure which shows an example of the value memorize | stored in the allocation color memory | storage part in 1st embodiment. 表示領域記憶部の構成例を示す図である。It is a figure which shows the structural example of a display area memory | storage part. 第一の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the specific process of the circumscribed rectangle of the pixel of a certain color in 1st embodiment. キャプチャ画像及びキャプチャ画像から抽出される画素の一例を示す図である。It is a figure which shows an example of the pixel extracted from a capture image and a capture image. div要素に対する背景色の指定例を示す図である。It is a figure which shows the example of designation | designated of the background color with respect to a div element. 他のブロックレベル要素を含むブロックレベル要素について特定される外接矩形の一例を示す図である。It is a figure which shows an example of the circumscribed rectangle specified about the block level element containing another block level element. Webブラウザごとの表示結果の相違点の検出処理の第一の変形例を説明するためのフローチャートである。It is a flowchart for demonstrating the 1st modification of the detection process of the difference of the display result for every Web browser. 一致しないと判定される位置関係の一例を示す図である。It is a figure which shows an example of the positional relationship determined not to correspond. 一致すると判定される位置関係の一例を示す図である。It is a figure which shows an example of the positional relationship determined to correspond. 二つのHTML要素の相対的な位置関係の一例を示す図である。It is a figure which shows an example of the relative positional relationship of two HTML elements. Webブラウザごとの表示結果の相違点の検出処理の第二の変形例を説明するためのフローチャートである。It is a flowchart for demonstrating the 2nd modification of the detection process of the difference of the display result for every Web browser. 本実施の形態における並列関係を説明するための図である。It is a figure for demonstrating the parallel relationship in this Embodiment. 第二の実施の形態における割当色の決定処理の処理手順の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the process sequence of the determination process of the allocation color in 2nd embodiment. 第二の実施の形態において割当色記憶部に記憶される値の一例を示す図である。It is a figure which shows an example of the value memorize | stored in the allocation color memory | storage part in 2nd embodiment. 第二の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the specific process of the circumscribed rectangle of the pixel of a certain color in 2nd embodiment. 第三の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the specific process of the circumscribed rectangle of the pixel of a certain color in 3rd embodiment. 第三の実施の形態において或る色の画素の外接矩形の特定処理を説明するための画像の一例である。It is an example of the image for demonstrating the specification process of the circumscribed rectangle of the pixel of a certain color in 3rd embodiment. 隣接8近傍を説明するための図である。It is a figure for demonstrating adjacent 8 vicinity.

以下、図面に基づいて第一の実施の形態を説明する。図1は、第一の実施の形態における比較装置のハードウェア構成例を示す図である。図1の比較装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、インタフェース装置105、表示装置106、及び入力装置107等を有する。   The first embodiment will be described below with reference to the drawings. FIG. 1 is a diagram illustrating a hardware configuration example of the comparison device according to the first embodiment. 1 includes a drive device 100, an auxiliary storage device 102, a memory device 103, a CPU 104, an interface device 105, a display device 106, an input device 107, and the like that are mutually connected by a bus B.

比較装置10での処理を実現するプログラムは、記録媒体101によって提供される。プログラムを記録した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。   A program that realizes processing in the comparison apparatus 10 is provided by the recording medium 101. When the recording medium 101 on which the program is recorded is set in the drive device 100, the program is installed from the recording medium 101 to the auxiliary storage device 102 via the drive device 100. However, the program need not be installed from the recording medium 101 and may be downloaded from another computer via a network. The auxiliary storage device 102 stores the installed program and also stores necessary files and data.

メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従って比較装置10に係る機能を実現する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。表示装置106はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置107はキーボード及びマウス等であり、様々な操作指示を入力させるために用いられる。   The memory device 103 reads the program from the auxiliary storage device 102 and stores it when there is an instruction to start the program. The CPU 104 realizes functions related to the comparison device 10 in accordance with a program stored in the memory device 103. The interface device 105 is used as an interface for connecting to a network. The display device 106 displays a GUI (Graphical User Interface) or the like by a program. The input device 107 is a keyboard, a mouse, or the like, and is used for inputting various operation instructions.

なお、記録媒体101の一例としては、CD−ROM、DVDディスク、又はUSBメモリ等の可搬型の記録媒体が挙げられる。また、補助記憶装置102の一例としては、HDD(Hard Disk Drive)又はフラッシュメモリ等が挙げられる。記録媒体101及び補助記憶装置102のいずれについても、コンピュータ読み取り可能な記録媒体に相当する。   An example of the recording medium 101 is a portable recording medium such as a CD-ROM, a DVD disk, or a USB memory. An example of the auxiliary storage device 102 is an HDD (Hard Disk Drive) or a flash memory. Both the recording medium 101 and the auxiliary storage device 102 correspond to computer-readable recording media.

図2は、第一の実施の形態における比較装置の機能構成例を示す図である。図2において、比較装置10は、複数のWebブラウザ11、割当色決定部12、HTML文書改変部13、ブラウザ表示部14、画面キャプチャ部15、表示領域特定部16、比較部17、及び出力部18等を有する。これら各部は、比較装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。比較装置10は、また、HTML文書記憶部121、割当色記憶部122、改変文書記憶部123、及び表示領域記憶部124等を利用する。これら各記憶部は、補助記憶装置102若しくはメモリ装置103、又は比較装置10にネットワークを介して接続される記憶装置等を用いて実現可能である。   FIG. 2 is a diagram illustrating a functional configuration example of the comparison device according to the first embodiment. 2, the comparison apparatus 10 includes a plurality of Web browsers 11, an assigned color determination unit 12, an HTML document modification unit 13, a browser display unit 14, a screen capture unit 15, a display area specifying unit 16, a comparison unit 17, and an output unit. 18 etc. Each of these units is realized by processing that one or more programs installed in the comparison apparatus 10 cause the CPU 104 to execute. The comparison apparatus 10 also uses an HTML document storage unit 121, an assigned color storage unit 122, a modified document storage unit 123, a display area storage unit 124, and the like. Each of these storage units can be realized by using a storage device connected to the auxiliary storage device 102 or the memory device 103 or the comparison device 10 via a network.

Webブラウザ11は、HTML文書の表示を制御する。各Webブラウザ11は、例えば、相互に異なる種類のWebブラウザである。HTML文書記憶部121は、各Webブラウザ11による表示結果について評価対象とされるHTML文書を記憶する。割当色決定部12は、HTML文書に含まれる各HTML要素に対し、相互に異なる色を割り当てる。割当色記憶部122は、各HTML要素について、割当色決定部12によって割り当てられた色を示す情報を記憶する。HTML文書改変部13は、各HTML要素が、割当色決定部12によって割り当てられた色によって表示されるように、HTML文書の定義内容を改変する(書き換える)。改変後のHTML文書は、改変文書記憶部123に記憶される。   The web browser 11 controls the display of the HTML document. Each Web browser 11 is, for example, a different type of Web browser. The HTML document storage unit 121 stores an HTML document that is an evaluation target for the display result of each Web browser 11. The assigned color determination unit 12 assigns a different color to each HTML element included in the HTML document. The assigned color storage unit 122 stores information indicating the color assigned by the assigned color determination unit 12 for each HTML element. The HTML document modification unit 13 modifies (rewrites) the definition content of the HTML document so that each HTML element is displayed with the color allocated by the allocation color determination unit 12. The modified HTML document is stored in the modified document storage unit 123.

ブラウザ表示部14は、改変後のHTML文書を、各Webブラウザ11に表示させる。画面キャプチャ部15は、改変後のHTML文書について、各Webブラウザ11による描画結果を示す画像を取得する。例えば、Webブラウザ11による描画結果が、液晶ディスプレイ等に表示される場合、画面キャプチャ部15は、液晶ディプレイについて画面キャプチャを行う。また、Webブラウザ11の描画シミュレータが使われている場合、画面キャプチャ部15は、当該描画シミュレータが出力する画像を取得する。   The browser display unit 14 displays the HTML document after modification on each Web browser 11. The screen capture unit 15 acquires an image indicating a rendering result by each Web browser 11 for the HTML document after modification. For example, when the drawing result by the Web browser 11 is displayed on a liquid crystal display or the like, the screen capture unit 15 performs screen capture for the liquid crystal display. When the drawing simulator of the web browser 11 is used, the screen capture unit 15 acquires an image output from the drawing simulator.

表示領域特定部16は、各表示要素に割り当てられた色に基づいて、各Webブラウザ11による表示結果における、各表示要素の表示領域を特定する。Webブラウザ11ごと、かつ、HTML要素ごとに特定された表示領域は、表示領域記憶部124に記憶される。   The display area specifying unit 16 specifies the display area of each display element in the display result by each Web browser 11 based on the color assigned to each display element. The display area specified for each Web browser 11 and for each HTML element is stored in the display area storage unit 124.

比較部17は、Webブラウザ11ごとの、各HTML要素の表示領域を比較して、HTML文書の表示結果について、Webブラウザ11間の相違点を検出する。出力部18は、比較部17によって検出された相違点を示す情報を出力する。   The comparison unit 17 compares the display areas of the HTML elements for each Web browser 11 and detects a difference between the Web browsers 11 regarding the display result of the HTML document. The output unit 18 outputs information indicating the difference detected by the comparison unit 17.

以下、比較装置10が実行する処理手順について説明する。図3は、第一の実施の形態の比較装置が実行する処理手順の一例を説明するためのフローチャートである。   Hereinafter, a processing procedure executed by the comparison apparatus 10 will be described. FIG. 3 is a flowchart for explaining an example of a processing procedure executed by the comparison device of the first embodiment.

ステップS101において、割当色決定部12は、評価対象のHTML文書をHTML文書記憶部121から読み込む。   In step S <b> 101, the assigned color determination unit 12 reads an HTML document to be evaluated from the HTML document storage unit 121.

図4は、評価対象のHTML文書の一例を示す図である。図4に示されるHTML文書d1は、「文字列1」を表示させるHTML要素te1、「文字列2」を表示させるHTML要素te2、及び「文字列3」を表示させるHTML要素te3等を含む。   FIG. 4 is a diagram illustrating an example of an HTML document to be evaluated. The HTML document d1 shown in FIG. 4 includes an HTML element te1 that displays “character string 1”, an HTML element te2 that displays “character string 2”, an HTML element te3 that displays “character string 3”, and the like.

続いて、割当色決定部12は、HTML文書d1に含まれるHTML要素の中から、着色対象の一つのHTML要素を選択する(S102)。選択されたHTML要素を、以下「対象要素」という。   Subsequently, the assigned color determination unit 12 selects one HTML element to be colored from the HTML elements included in the HTML document d1 (S102). The selected HTML element is hereinafter referred to as “target element”.

続いて、割当色決定部12は、既に他のHTML要素に割り当て済みの色とは重複しない色を、対象要素に割り当てる(S103)。第一の実施の形態において、HTML要素に割り当てられる色は、RGB形式によって表現され、R/G/Bのそれぞれの値は、0x00〜0xFFであるとする。例えば、HTML要素に割り当てる色を管理する変数をCとすると、変数Cの第0〜第7ビットはB値を示し、第8〜第15ビットはG値を示し、第16ビット〜第23ビットはR値を示すこととする。   Subsequently, the assigned color determination unit 12 assigns a color that does not overlap with a color already assigned to another HTML element to the target element (S103). In the first embodiment, the colors assigned to the HTML elements are expressed in RGB format, and the values of R / G / B are 0x00 to 0xFF. For example, if the variable for managing the color assigned to the HTML element is C, the 0th to 7th bits of the variable C indicate the B value, the 8th to 15th bits indicate the G value, and the 16th to 23rd bits. Indicates an R value.

ステップS102では、「C←C+α」の演算結果におけるCが、対象要素に割り当てる色とされてもよい。Cの初期値は、例えば、0x000000である。αは、例えば、1等の定数である。以下、対象要素に割り当てられた色を、「割当色」という。   In step S102, C in the calculation result “C ← C + α” may be a color assigned to the target element. The initial value of C is, for example, 0x000000. α is a constant such as 1, for example. Hereinafter, the color assigned to the target element is referred to as “assigned color”.

続いて、HTML文書改変部13は、対象要素が割当色で表示されるように、HTML文書d1の定義内容を改変する(S104)。   Subsequently, the HTML document modification unit 13 modifies the definition content of the HTML document d1 so that the target element is displayed in the assigned color (S104).

図5は、1つのHTML要素について着色のための改変が行われたHTML文書の一例を示す図である。図5において、HTML要素te1は、<font>タグで囲まれている。また、<font>タグのcolor属性の値として、「#0000FF」が設定されている。その結果、「文字列1」は、青色で表示されるようになる。このような改変が、ステップS104において行われる。なお、HTML要素を所望の色で表示させるためのHTML文書の改変方法として、他の方法が利用されてもよい。例えば、<font style="background−color:#00F">の様なstyle属性を含む<font>タグが、HTML要素に追加されることで、当該HTML要素の背景が着色されてもよい。   FIG. 5 is a diagram illustrating an example of an HTML document in which one HTML element is modified for coloring. In FIG. 5, the HTML element te1 is surrounded by <font> tags. Also, “# 0000FF” is set as the value of the color attribute of the <font> tag. As a result, “character string 1” is displayed in blue. Such modification is performed in step S104. It should be noted that other methods may be used as a method for modifying an HTML document for displaying HTML elements in a desired color. For example, a <font> tag including a style attribute such as <font style = “background-color: # 00F”> may be added to the HTML element, so that the background of the HTML element may be colored.

続いて、HTML文書改変部13は、対象要素と割当色とを対応付けて割当色記憶部122に記憶する(S105)。ステップS102〜S105は、着色対象の全てのHTML要素に関して実行される(S106)。なお、着色対象のHTML要素とは、Webブラウザ11による表示結果においてその表示位置及び表示領域を知りたいHTML要素である。例えば、Webブラウザ11間での文字の表示結果を比較したい場合は、テキスト要素が着色対象に含まれる。また、divブロックの配置関係を比較したい場合は、div要素が着色対象に含まれる。全てのHTML要素の表示領域を比較したい場合は、HTML文書内の全てのブロック要素及びインライン要素が着色対象に含まれる。   Subsequently, the HTML document modifying unit 13 associates the target element with the allocated color and stores them in the allocated color storage unit 122 (S105). Steps S102 to S105 are executed for all HTML elements to be colored (S106). The HTML element to be colored is an HTML element whose display position and display area are to be known in the display result by the Web browser 11. For example, when it is desired to compare the display results of characters between the Web browsers 11, the text element is included in the coloring target. Further, when it is desired to compare the arrangement relationship of the div blocks, the div element is included in the coloring target. When it is desired to compare display areas of all HTML elements, all block elements and inline elements in the HTML document are included in the coloring target.

着色対象の全てについて改変が行われた時点において(S106でYes)、HTML文書d1は、図6に示されるような状態となる。   When all the coloring objects are modified (Yes in S106), the HTML document d1 is in a state as shown in FIG.

図6は、着色対象の全てのHTML要素について着色のための改変が行われたHTML文書の一例を示す図である。図6に示されるHTML文書d1では、HTML要素te2及びe3についても、HTML要素te1と同様の改変が行われている。なお、改変後のHTML文書d1は、改変文書記憶部123に記憶される。   FIG. 6 is a diagram showing an example of an HTML document in which all the HTML elements to be colored have been modified for coloring. In the HTML document d1 shown in FIG. 6, the HTML element te2 and e3 are also modified similarly to the HTML element te1. The modified HTML document d1 is stored in the modified document storage unit 123.

また、着色対象の全てについて改変が行われた時点において(S106でYes)、割当色記憶部122には、図7に示されるような情報が記憶される。   Further, when all the coloring objects are modified (Yes in S106), the assigned color storage unit 122 stores information as shown in FIG.

図7は、第一の実施の形態において割当色記憶部に記憶される値の一例を示す図である。図7に示されるように、割当色記憶部122は、着色対象のHTML要素ごとに、XPath及び割当色のRGB値を記憶する。XPathは、HTML要素の識別情報の一例である。HTML文書d1内の行数及び桁数が、XPathの代わりに用いられてもよい。また、各HTML要素に、それぞれ異なる値を有するid属性が付加されて、id属性の値が、XPathの代わりに用いられてもよい。   FIG. 7 is a diagram illustrating an example of values stored in the assigned color storage unit in the first embodiment. As shown in FIG. 7, the assigned color storage unit 122 stores the XPath and the RGB value of the assigned color for each HTML element to be colored. XPath is an example of identification information of an HTML element. The number of lines and the number of digits in the HTML document d1 may be used instead of XPath. Further, id attributes having different values may be added to each HTML element, and the value of the id attribute may be used instead of XPath.

続いて、ブラウザ表示部14は、HTML文書d1の表示結果について比較対象とされるWebブラウザ11群のうちの1つのWebブラウザ11を選択し(S107)、改変文書記憶部123に記憶されているHTML文書d1を、当該Webブラウザ11(以下、「対象ブラウザ」という。)に表示させる(S108)。すなわち、改変後のHTML文書d1(図6)が表示される。したがって、この際、着色対象とされた各HTML要素は、当該HTML要素に対する割当色によって表示される。   Subsequently, the browser display unit 14 selects one Web browser 11 from the group of Web browsers 11 to be compared with respect to the display result of the HTML document d1 (S107), and is stored in the modified document storage unit 123. The HTML document d1 is displayed on the Web browser 11 (hereinafter referred to as “target browser”) (S108). That is, the modified HTML document d1 (FIG. 6) is displayed. Accordingly, at this time, each HTML element to be colored is displayed by an assigned color for the HTML element.

続いて、画面キャプチャ部15は、Webブラウザ11の描画領域(HTML文書が表示される領域)について画面キャプチャを行う(S109)。その結果、HTML文書d1の表示結果を示す画像データ(以下、「キャプチャ画像」という。)が取得される。なお、画面キャプチャでは、例えば、Webブラウザ11が動作しているOS(Operating System)のAPI(Application Programming Interface)が用いられて、描画領域を示す画像がビットマップ画像として取得されてもよい。又は、ディスプレイ端子に流れている映像信号が、画像データに変換されてもよい。   Subsequently, the screen capture unit 15 performs screen capture on the drawing area (area where the HTML document is displayed) of the Web browser 11 (S109). As a result, image data indicating the display result of the HTML document d1 (hereinafter referred to as “capture image”) is acquired. In the screen capture, for example, an API (Application Programming Interface) of an OS (Operating System) on which the Web browser 11 is operating may be used, and an image showing a drawing area may be acquired as a bitmap image. Alternatively, the video signal flowing through the display terminal may be converted into image data.

続いて、表示領域特定部16は、割当色記憶部122(図7)に記憶されているレコードのうちの一つのレコードを処理対象として選択する(S110)。すなわち、HTML要素(XPath)と割当色との組が一つ選択される。選択されたレコードのHTML要素を、以下「選択要素」といい、当該レコードの割当色を、以下「選択色」という。   Subsequently, the display area specifying unit 16 selects one of the records stored in the assigned color storage unit 122 (FIG. 7) as a processing target (S110). That is, one set of an HTML element (XPath) and an assigned color is selected. The HTML element of the selected record is hereinafter referred to as “selected element”, and the assigned color of the record is hereinafter referred to as “selected color”.

続いて、表示領域特定部16は、キャプチャ画像に基づいて、選択要素の表示領域を特定する(S111)。例えば、表示領域特定部16は、その画素のRGB値が選択色に一致する画素を全て抽出し、抽出された全ての画素を含む外接矩形(例えば、最小外接矩形)を特定する。   Subsequently, the display area specifying unit 16 specifies the display area of the selected element based on the captured image (S111). For example, the display area specifying unit 16 extracts all pixels whose RGB values match the selected color, and specifies a circumscribed rectangle (for example, a minimum circumscribed rectangle) including all the extracted pixels.

続いて、表示領域特定部16は、当該外接矩形の領域(すなわち、選択要素の表示領域)を特定可能な座標値(以下、「表示座標」という。)を、選択要素に対応付けて表示領域記憶部124に記憶する(S112)。すなわち、当該外接矩形の領域が、対象ブラウザによるHTML文書d1の表示結果における、選択要素の表示領域として特定される。   Subsequently, the display area specifying unit 16 associates a coordinate value (hereinafter referred to as “display coordinates”) that can specify the circumscribed rectangular area (that is, the display area of the selected element) with the selected element. It memorize | stores in the memory | storage part 124 (S112). That is, the circumscribed rectangular area is specified as the display area of the selected element in the display result of the HTML document d1 by the target browser.

図8は、表示領域記憶部の構成例を示す図である。図8において、表示領域記憶部124は、着色対象のHTML要素ごとに、XPath、割当色、及び表示座標を記憶する。表示座標は、当該XPathに係るHTML要素に関して特定された外接矩形の左上頂点及び右下頂点のそれぞれの座標値である。   FIG. 8 is a diagram illustrating a configuration example of the display area storage unit. In FIG. 8, the display area storage unit 124 stores the XPath, the assigned color, and the display coordinates for each coloring target HTML element. The display coordinates are the coordinate values of the upper left vertex and the lower right vertex of the circumscribed rectangle specified for the HTML element related to the XPath.

ステップS110〜S112は、割当色記憶部122に記憶されている全てのレコードについて実行される(S113)。また、ステップS107〜S113は、比較対象の全てのWebブラウザ11に関して実行される。したがって、表示領域記憶部124には、各HTML要素について、Webブラウザ11ごとに、表示座標が記憶される。   Steps S110 to S112 are executed for all records stored in the assigned color storage unit 122 (S113). Steps S107 to S113 are executed for all Web browsers 11 to be compared. Therefore, display coordinates are stored in the display area storage unit 124 for each Web browser 11 for each HTML element.

ステップS107〜S113が、比較対象の全てのWebブラウザ11に関して実行されると(S114でYes)、比較部17は、比較対象のWebブラウザ11ごとに表示領域記憶部124に記憶された情報に基づいて、各Webブラウザ11によるHTML文書d1の表示結果の相違点を検出する(S115)。   When steps S107 to S113 are executed for all the Web browsers 11 to be compared (Yes in S114), the comparison unit 17 is based on the information stored in the display area storage unit 124 for each Web browser 11 to be compared. Then, a difference in the display result of the HTML document d1 by each Web browser 11 is detected (S115).

例えば、単純に、HTML要素ごと(XPathごと)に、Webブラウザ11ごとの表示座標が比較され、比較された表示座標が一致しないHTML要素が、相違点として検出されてもよい。   For example, the display coordinates for each Web browser 11 may be simply compared for each HTML element (for each XPath), and an HTML element that does not match the compared display coordinates may be detected as a difference.

又は、表示座標の完全一致までは要求されない場合は、他の方法によって相違点の検出が行われてもよい。他の方法の一例(変形例)については後述される。   Alternatively, when the display coordinates are not required to be completely coincident, the difference may be detected by another method. An example (variation) of another method will be described later.

続いて、出力部18は、相違点として検出されたHTML要素に関する情報を出力する(S116)。例えば、当該HTML要素に関する情報が、表示装置106に表示される。この際、出力部18は、HTML文書d1中における、当該HTML要素に関する定義部分を特定し、当該定義部分が強調表示されるように、HTML文書(HTMLソースコード)を表示してもよい。   Subsequently, the output unit 18 outputs information on the HTML element detected as the difference (S116). For example, information regarding the HTML element is displayed on the display device 106. At this time, the output unit 18 may specify a definition part related to the HTML element in the HTML document d1 and display the HTML document (HTML source code) so that the definition part is highlighted.

続いて、ステップS111の詳細について説明する。図9は、第一の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。   Next, details of step S111 will be described. FIG. 9 is a flowchart for explaining an example of a circumscribed rectangle specifying process for a pixel of a certain color in the first embodiment.

ステップS201において、表示領域特定部16は、変数Dに選択色(を示すRGB値)を代入する。変数Dは、変数Cと同様に、第0〜第7ビットはB値を示し、第8〜第15ビットはG値を示し、第16ビット〜第23ビットはR値を示す。   In step S <b> 201, the display area specifying unit 16 substitutes the selected color (indicating RGB value) for the variable D. In the variable D, as in the variable C, the 0th to 7th bits indicate the B value, the 8th to 15th bits indicate the G value, and the 16th to 23rd bits indicate the R value.

続いて、表示領域特定部16は、キャプチャ画像からDの値に一致するRGB値を有する画素のみを抽出する(S202)。   Subsequently, the display area specifying unit 16 extracts only pixels having RGB values that match the value of D from the captured image (S202).

図10は、キャプチャ画像及びキャプチャ画像から抽出される画素の一例を示す図である。図10において、(1)が、キャプチャ画像であるとする。(1)に示される文字列のうち、「電子デバイス・半導体」という文字列を構成する画素のRGB値のみが、Dの値に一致するとする。この場合、ステップS202では、(2)に示される画素が抽出される。   FIG. 10 is a diagram illustrating an example of a captured image and pixels extracted from the captured image. In FIG. 10, it is assumed that (1) is a captured image. Of the character string shown in (1), it is assumed that only the RGB values of the pixels constituting the character string “electronic device / semiconductor” match the value of D. In this case, in step S202, the pixel shown in (2) is extracted.

続いて、表示領域特定部16は、抽出された画素の外接矩形(最小外接矩形)を特定し、当該外接矩形の左上頂点及び右下頂点の座標値を取得する(S203)。取得された座標値が、選択要素のXPathに対応付けられて表示領域記憶部124(図8)に記憶される。   Subsequently, the display area specifying unit 16 specifies the circumscribed rectangle (minimum circumscribed rectangle) of the extracted pixel, and acquires the coordinate values of the upper left vertex and the lower right vertex of the circumscribed rectangle (S203). The acquired coordinate values are stored in the display area storage unit 124 (FIG. 8) in association with the XPath of the selected element.

なお、図10では、文字列自体が着色される例が示されているが、文字列自体ではなく、文字列の背景が着色されてもよい。この場合であっても図9と同様の処理手順が実行されてよい。但し、背景が着色される場合、Webブラウザ11ごとに文字の行間が異なる可能性があり、文字列の表示領域の検出精度が劣化する可能性が有る。したがって、テキスト要素に関しては、上記したように、文字列自体を着色対象とするのが望ましい。   Although FIG. 10 shows an example in which the character string itself is colored, the background of the character string may be colored instead of the character string itself. Even in this case, the same processing procedure as in FIG. 9 may be executed. However, when the background is colored, there is a possibility that the line spacing of characters is different for each Web browser 11, and the detection accuracy of the display area of the character string may be deteriorated. Therefore, regarding the text element, as described above, it is desirable that the character string itself is a coloring target.

また、HTML文書d1には、テキスト要素のみが含まれている例を示したが、テキスト要素以外のHTML要素に係るタグに、style属性が追加されて、当該HTML要素の背景が着色されるようにHTML文書が改変されることで、テキスト要素以外のHTML要素についても、表示領域を特定することができる。   Moreover, although the example in which only the text element is included is shown in the HTML document d1, the style attribute is added to the tag related to the HTML element other than the text element so that the background of the HTML element is colored. By modifying the HTML document, it is possible to specify a display area for HTML elements other than text elements.

例えば、div要素等のブロックレベル要素のスタイル属性に、background−colorキーワードを使用して背景色が指定されてもよい。   For example, the background color may be specified using the background-color keyword in the style attribute of a block level element such as the div element.

図11は、div要素に対する背景色の指定例を示す図である。図11に示されるHTML文書d2は、div要素de1、de2、及びde3の3つのdiv要素を含む。各div要素の<div>タグには、「style="background−color:#XXX"」の形式のstyle属性が付加されている。ここで、「#XXX」の値は、div要素ごとに異なる。その結果、各div要素は、相互に異なる色で表示される。   FIG. 11 is a diagram illustrating a designation example of the background color for the div element. The HTML document d2 shown in FIG. 11 includes three div elements, div elements de1, de2, and de3. The <div> tag of each div element has a style attribute of the form “style =“ background-color: #XXX ””. Here, the value of “#XXX” is different for each div element. As a result, each div element is displayed in a different color.

更に、図11において、各div要素には、paddingが指定されることで、当該div要素内のHTML要素との間に余白が設けられている。これは、特に、他のHTML要素を含むブロックレベル要素の外接矩形を正確に特定するための工夫である。例えば、図11において、div要素de1は、div要素de2及びde3を含む。このような場合、div要素de1にpaddingが指定されることで、div要素de1の外接矩形が誤って特定される可能性を低減することができる。   Further, in FIG. 11, each div element is designated as padding, so that a blank space is provided between the div element and the HTML element in the div element. This is a contrivance for accurately specifying a circumscribed rectangle of a block level element including other HTML elements. For example, in FIG. 11, the div element de1 includes div elements de2 and de3. In such a case, by specifying padding for the div element de1, it is possible to reduce the possibility that the circumscribed rectangle of the div element de1 is erroneously specified.

図12は、他のブロックレベル要素を含むブロックレベル要素について特定される外接矩形の一例を示す図である。図12には、図11に示したdiv要素de1、div要素de2、及びdiv要素3の領域が示されている。   FIG. 12 is a diagram illustrating an example of a circumscribed rectangle specified for a block level element including another block level element. FIG. 12 shows areas of the div element de1, the div element de2, and the div element 3 shown in FIG.

(1)は、paddingが指定されない場合の表示例である。(1)では、div要素de1とdiv要素de2の左側の頂点は一致しているため、div要素de1の外接矩形の幅は、w1に示される範囲であるとして特定されてしまう。   (1) is a display example when padding is not specified. In (1), since the left vertices of the div element de1 and the div element de2 match, the width of the circumscribed rectangle of the div element de1 is specified as being in the range indicated by w1.

一方、(2)は、div要素de1の左右両側に関してpaddingが指定された例である。この場合、余白部分の画素によって、w2で示される範囲が、div要素de1の幅として特定される。   On the other hand, (2) is an example in which padding is specified for both the left and right sides of the div element de1. In this case, the range indicated by w2 is specified as the width of the div element de1 by the pixels of the margin part.

なお、評価対象のHTML文書がimg要素を含む場合、img要素によって埋め込まれる画像を着色するのは困難である。また、img要素をそのままにしておくと、img要素によって埋め込まれる画像の画素に基づいて、各HTML要素の外接矩形が誤検出されてしまう。そこで、HTML文書改変部13は、img要素によって埋め込まれる画像と同じサイズの透明の画像を生成し、img要素のsrc属性の値を、当該透明の画像が格納されたファイルのパス名に置換してもよい。   Note that when an HTML document to be evaluated includes an img element, it is difficult to color an image embedded by the img element. If the img element is left as it is, the circumscribed rectangle of each HTML element is erroneously detected based on the pixel of the image embedded by the img element. Therefore, the HTML document modification unit 13 generates a transparent image having the same size as the image embedded by the img element, and replaces the value of the src attribute of the img element with the path name of the file in which the transparent image is stored. May be.

又は、「style="visibility:hidden;"」が、<img>タグに追加されてもよい。斯かるstyle属性によれば、当該style属性が指定されたHTML要素の表示領域を確保したまま、当該HTML要素を非表示にすることができる。   Alternatively, “style =“ visibility: hidden; ”” may be added to the <img> tag. According to such a style attribute, the HTML element can be hidden while a display area of the HTML element in which the style attribute is specified is secured.

続いて、図3のステップS115の変形例について説明する。例えば、或るWebブラウザ11による表示結果における各HTML要素の相対的な位置関係と、他のWebブラウザ11による表示結果における各HTML要素の相対的な位置関係とが、所定の条件を満たすか否かを判定することで、相違点が検出されてもよい。   Subsequently, a modified example of step S115 in FIG. 3 will be described. For example, whether the relative positional relationship of each HTML element in the display result by a certain Web browser 11 and the relative positional relationship of each HTML element in the display result by another Web browser 11 satisfies a predetermined condition. By determining whether or not, a difference may be detected.

図13は、Webブラウザごとの表示結果の相違点の検出処理の第一の変形例を説明するためのフローチャートである。なお、図13の処理において、比較対象のWebブラウザ11は、便宜上、2種類であるとする。但し、3種類以上のWebブラウザ11に関して、図13の処理が実行されてもよい。   FIG. 13 is a flowchart for explaining a first modified example of the difference detection processing for display results for each Web browser. In the processing of FIG. 13, it is assumed that there are two types of Web browsers 11 to be compared for convenience. However, the processing of FIG. 13 may be executed for three or more types of Web browsers 11.

ステップS210において、比較部17は、着色対象とされたたHTML要素群(以下、「対象要素群」という。)における二つずつのHTML要素の組み合わせのうち、未処理の一つの組み合わせを処理対象として選択する。未処理の組み合わせとは、ステップS220以降に関して処理対象とされていない組み合わせをいう。   In step S210, the comparison unit 17 processes one unprocessed combination among two combinations of HTML elements in the HTML element group (hereinafter referred to as “target element group”) that is a coloring target. Choose as. An unprocessed combination refers to a combination that is not set as a processing target for step S220 and subsequent steps.

続いて、比較部17は、選択された組み合わせに含まれる二つのHTML要素について、2種類のWebブラウザ11のそれぞれの表示結果における相対的な位置関係を求める(S220)。   Subsequently, the comparison unit 17 obtains the relative positional relationship in the display results of the two types of Web browsers 11 for the two HTML elements included in the selected combination (S220).

通常、Webブラウザ11によってデフォルトの行間や文字間隔等が異なる。したがって、HTML要素間の距離の一致、若しくは、不一致の確認によって、2種類のWebブラウザ11における当該HTML要素間の位置関係を比較した場合、人の目には同様に見えても位置関係は異なると判定される場合が有る。すなわち、人から見ればほぼ同じと見える位置関係でも、コンピュータによっては異なると判定され、その結果、相違点が過剰に検出されてしまう。   Usually, the default line spacing, character spacing, and the like differ depending on the Web browser 11. Therefore, when the positional relationship between the HTML elements in the two types of Web browsers 11 is compared by confirming whether the distance between the HTML elements is the same or not, the positional relationship is different even if it looks similar to the human eye. May be determined. That is, even if the positional relationship looks almost the same from the viewpoint of a person, it is determined that the position is different depending on the computer. As a result, the difference is excessively detected.

そこで、第一の変形例において、比較部17は、二つのHTML要素の上下左右方向(水平・垂直方向)の整列関係(ずれの方向)が一致していれば、当該二つのHTML要素の相対的な位置関係は一致すると判定する。例えば、比較部17は、二つのHTML要素について、図14の(A)に示される位置関係と、(B)に示される位置関係とは異なると判定する。(A)では二つのHTML要素の左端及び右端が揃っているのに対し、(B)では二つのHTML要素の左端及び右端が揃っていないからである。すなわち、(A)と(B)とでは、左右方向(水平方向)におけるずれの方向が異なるからである。一方、比較部17は、図15の(A)に示される位置関係と、(B)に示される位置関係とは一致すると判定する。一方のHTML要素に対する他方のHTML要素の上下方向及び左右方向におけるずれの方向が、一致するからである。なお、例えば、二つのHTML要素間の間隔、すなわち、ずれの量が(A)と(B)とで異なっても、判定結果には影響しない。   Therefore, in the first modification, the comparison unit 17 determines that the relative relationship between the two HTML elements is the same if the alignment relations (shift directions) of the two HTML elements in the vertical and horizontal directions (horizontal and vertical directions) match. It is determined that the physical positional relationship matches. For example, the comparison unit 17 determines that the positional relationship shown in (A) of FIG. 14 is different from the positional relationship shown in (B) for two HTML elements. This is because the left end and right end of the two HTML elements are aligned in (A), whereas the left end and right end of the two HTML elements are not aligned in (B). That is, (A) and (B) differ in the direction of deviation in the left-right direction (horizontal direction). On the other hand, the comparison unit 17 determines that the positional relationship shown in FIG. 15A matches the positional relationship shown in FIG. This is because the vertical and horizontal shift directions of the other HTML element with respect to one HTML element match. For example, even if the interval between two HTML elements, that is, the amount of deviation differs between (A) and (B), the determination result is not affected.

上記のような判定結果を得るための比較部17による判定方法の一例を説明する。ここでは、少なくとも一方のWebブラウザ11の表示結果における、二つのHTML要素の相対的な位置関係が、図16に示される通りであるとする。   An example of a determination method by the comparison unit 17 for obtaining the above determination result will be described. Here, it is assumed that the relative positional relationship between the two HTML elements in the display result of at least one Web browser 11 is as shown in FIG.

図16は、二つのHTML要素の相対的な位置関係の一例を示す図である。図16において、HTML要素e1は、ステップS210において選択された二つのHTML要素のうちの一方のHTML要素であり、HTML要素e2は、他方のHTML要素である。HTML要素e1の左上頂点の座標値は、(left1,top1)として表記され、右下頂点の座標は、(right1,bottom1)として表記されている。また、HTML要素e2の左上頂点の座標値は、(left2,top2)として表記され、右下頂点の座標は、(right2,bottom2)として表記されている。left1、top1、right1、bottom1、left2、top2、right2、及びbottom2の値は、表示領域記憶部124に記憶された表示座標に基づいて特定可能である。   FIG. 16 is a diagram illustrating an example of the relative positional relationship between two HTML elements. In FIG. 16, the HTML element e1 is one of the two HTML elements selected in step S210, and the HTML element e2 is the other HTML element. The coordinate value of the upper left vertex of the HTML element e1 is represented as (left1, top1), and the coordinate value of the lower right vertex is represented as (right1, bottom1). The coordinate value of the upper left vertex of the HTML element e2 is expressed as (left2, top2), and the coordinate value of the lower right vertex is expressed as (right2, bottom2). The values of left 1, top 1, right 1, bottom 1, left 2, top 2, right 2, and bottom 2 can be specified based on the display coordinates stored in the display area storage unit 124.

比較部17は、上記座標値を、以下の関数f(x)に当てはめて、f0〜f7の値を求める。   The comparison unit 17 applies the coordinate value to the following function f (x) to obtain values of f0 to f7.

f0=f(left1−left2)
f1=f(left1−right2)
f2=f(right1−left2)
f3=f(right1−right2)
f4=f(top1−top2)
f5=f(top1−bottom2)
f6=f(bottom1−top2)
f7=f(bottom1−bottom2)
ここで、f(x)の値は、以下の通りである。
f0 = f (left1-left2)
f1 = f (left1-right2)
f2 = f (right1-left2)
f3 = f (right1-right2)
f4 = f (top1-top2)
f5 = f (top1-bottom2)
f6 = f (bottom1-top2)
f7 = f (bottom1-bottom2)
Here, the value of f (x) is as follows.

x>αの場合、f(x)=1
−α<=x<=αの場合、f(x)=0
x<−αの場合、f(x)=−1
なお、閾値αは、関数f(x)において比較される二つの値が同じであると判定する範囲を示す0以上の定数であり、予め決定される。すなわち、関数f(x)によって求められるf0〜f7は、比較された二つのHTML要素の左上頂点及び左下頂点に関して、上下左右方向の相対的なずれの方向を示すものである。換言すれば、f0〜f7は、図16に示されるベクトルv1〜v4に関して、上下左右方向の向きを示すものである。
If x> α, f (x) = 1
If -α <= x <= α, f (x) = 0
If x <−α, f (x) = − 1
The threshold value α is a constant equal to or greater than 0 that indicates a range in which it is determined that two values compared in the function f (x) are the same, and is determined in advance. That is, f0 to f7 obtained by the function f (x) indicate the direction of relative displacement in the vertical and horizontal directions with respect to the upper left vertex and the lower left vertex of the two HTML elements compared. In other words, f0 to f7 indicate the vertical and horizontal directions with respect to the vectors v1 to v4 shown in FIG.

図16の例によれば、f0〜f7の値は、以下の通りである。なお、図16において、原点は、左上であるとする。また、こでは、便宜上、α=0とであるとする。   According to the example of FIG. 16, the values of f0 to f7 are as follows. In FIG. 16, it is assumed that the origin is the upper left. Here, for convenience, it is assumed that α = 0.

f0=f(left1−left2)=−1
f1=f(left1−right2)=−1
f2=f(right1−left2)=1
f3=f(right1−right2)=−1
f4=f(top1−top2)=−1
f5=f(top1−bottom2)=−1
f6=f(bottom1−top2)=−1
f7=f(bottom1−bottom2)=−1
ステップS220において、比較部17は、ステップS210において選択された二つのHTML要素に関するf0〜f7の値を、2種類のWebブラウザ11のそれぞれの表示結果に関して求める。
f0 = f (left1-left2) =-1
f1 = f (left1-right2) = − 1
f2 = f (right1-left2) = 1
f3 = f (right1-right2) = − 1
f4 = f (top1-top2) =-1
f5 = f (top1-bottom2) =-1
f6 = f (bottom1-top2) =-1
f7 = f (bottom1-bottom2) = − 1
In step S <b> 220, the comparison unit 17 obtains the values of f <b> 0 to f <b> 7 related to the two HTML elements selected in step S <b> 210 regarding the display results of the two types of Web browsers 11.

続いて、比較部17は、2種類のWebブラウザ11のそれぞれの表示結果に関して求められたf0〜f7を比較する(S230)。ここで、fに対する添え字(0〜7)が同じもの同士が比較される。比較された全ての値が一致する場合(S230でYes)、比較部17は、対象要素群に含まれるHTML要素における二つずつのHTML要素の組み合わせの全てに関して実行されたか否かを判定する(S240)。未処理の組み合わせが残っている場合(S240でNo)、比較部17は、未処理の組み合わせに関してステップS210以降を繰り返す。   Subsequently, the comparison unit 17 compares f0 to f7 obtained for the display results of the two types of Web browsers 11 (S230). Here, the same subscripts (0 to 7) for f are compared. When all the compared values match (Yes in S230), the comparison unit 17 determines whether or not the processing has been performed for all combinations of two HTML elements in the HTML elements included in the target element group ( S240). When an unprocessed combination remains (No in S240), the comparison unit 17 repeats Step S210 and subsequent steps regarding the unprocessed combination.

全ての組み合わせに関して、f0〜f7の値が一致する場合(S240でYes)、比較部17は、対象要素群の相対的な位置関係が2種類のWebブラウザ11間において一致すると判定する(S250)。一方、f0〜f7の値のいずれかが一致しない組み合わせが検出された場合(S230でNo)、比較部17は、対象要素群の相対的な位置関係が2種類のWebブラウザ11間において異なると判定する(S260)。   When the values of f0 to f7 match for all combinations (Yes in S240), the comparison unit 17 determines that the relative positional relationship of the target element group matches between the two types of Web browsers 11 (S250). . On the other hand, when a combination in which any of the values of f0 to f7 does not match is detected (No in S230), the comparison unit 17 determines that the relative positional relationship of the target element group differs between the two types of Web browsers 11. Determination is made (S260).

なお、ステップS240において、少なくともf0、f4、f5、f6、及びf7が一致すれば、比較部17は、対象要素群の相対的な位置関係が2種類のブラウザ間において一致すると判定するよいにしてもよい。例えば、文字列同士の比較の場合、行頭だけの一致が確保されれば、相対的な位置関係は一致すると判定できる場合も有る。したがって、斯かる判定基準は、文字列同士の組み合わせに限定されて適用されてもよい。そうすることにより、例えば、2種類のブラウザ間において、文字間隔が異なる場合であっても、文字列同士の相対的な位置関係は一致すると判定することができる。   In step S240, if at least f0, f4, f5, f6, and f7 match, the comparison unit 17 may determine that the relative positional relationship of the target element group matches between the two types of browsers. Also good. For example, in the case of comparison between character strings, it may be determined that the relative positional relationship matches if only the beginning of the line is secured. Accordingly, such a determination criterion may be applied to a combination of character strings. By doing so, for example, it can be determined that the relative positional relationship between the character strings is the same even if the character spacing is different between the two types of browsers.

このように、第一の変形例では、HTML要素群に含まれる各HTML要素の外接矩形の各頂点のずれの方向が各Webブラウザ11に関して一致すれば、各Webブラウザ11によるHTML文書の表示結果は、一致すると判定される。   As described above, in the first modified example, if the direction of displacement of each vertex of the circumscribed rectangle of each HTML element included in the HTML element group is the same for each Web browser 11, the display result of the HTML document by each Web browser 11. Are determined to match.

なお、上記においては、αが定数である例を説明したが、相対的な位置関係が求められる二つのHTML要素の種類等に応じてαの値が変更されてもよい。   In the above, an example in which α is a constant has been described. However, the value of α may be changed according to the types of two HTML elements whose relative positional relationship is required.

続いて、第二の変形例について説明する。第二の変形例においては、いずれかのWebブラウザ11において水平方向に並列するHTML要素の組み合わせが、他のWebブラウザ11においても水平方向に並列するか否かに基づいて、各Webブラウザ11による表示結果の相違点が検出される。   Subsequently, a second modification will be described. In the second modification, each Web browser 11 uses a combination of HTML elements that are parallel in the horizontal direction in any Web browser 11 based on whether the other Web browsers 11 are also parallel in the horizontal direction. Differences in the display results are detected.

図17は、Webブラウザごとの表示結果の相違点の検出処理の第二の変形例を説明するためのフローチャートである。   FIG. 17 is a flowchart for explaining a second modification of the process for detecting a difference in display results for each Web browser.

ステップS301において、比較部17は、着色対象とされた複数のHTML要素のうちの任意の二つを並列関係の有無の判定対象として選択する(S301)。続いて、比較部17は、選択された二つのHTML要素について、Webブラウザ11ごとに表示領域記憶部124に記憶された表示座標に基づいて、Webブラウザ11ごとに並列関係(又は隣接関係)を有するか否かを判定する(S302)。   In step S <b> 301, the comparison unit 17 selects any two of the plurality of HTML elements that are to be colored as determination targets for the presence or absence of a parallel relationship (S <b> 301). Subsequently, the comparison unit 17 establishes a parallel relationship (or adjacency relationship) for each Web browser 11 based on the display coordinates stored in the display area storage unit 124 for each Web browser 11 for the two selected HTML elements. It is determined whether it has (S302).

図18は、本実施の形態における並列関係を説明するための図である。図18において(1)〜(3)は、HTML要素e0とHTML要素e1とが並列関係を有すると判定される例である。   FIG. 18 is a diagram for explaining the parallel relationship in the present embodiment. In FIG. 18, (1) to (3) are examples in which it is determined that the HTML element e0 and the HTML element e1 have a parallel relationship.

すなわち、本実施の形態では、二つのHTML要素が、水平方向の範囲において重複部分(又は干渉部分)を有さず、一方のHTML要素の垂直方向の範囲が、他方のHTML要素の垂直方向の範囲に含まれる場合、当該二つのHTML要素は並列関係を有すると判定される。   That is, in the present embodiment, two HTML elements do not have overlapping portions (or interference portions) in the horizontal range, and the vertical range of one HTML element is the vertical direction of the other HTML element. When included in the range, it is determined that the two HTML elements have a parallel relationship.

並列関係の有無の判定は、以下のように行われてもよい。   The determination of the presence or absence of the parallel relationship may be performed as follows.

二つのHTML要素のうちの一方のHTML要素の表示座標(左上頂点の座標値と右下頂点の座標値)が、(left0,top0)−(right0,bottom0)であり、他方のHTML要素の表示座標が、(left1,top1)−(right1,bottom1)である場合、以下の条件1及び条件2の双方が満たされれば、当該二つのHTML要素は、並列関係を有すると判定される。なお、HTML要素の表示座標の座標系は、図18の(1)に示される通りである。   The display coordinates (the coordinate value of the upper left vertex and the coordinate value of the lower right vertex) of one of the two HTML elements are (left0, top0) − (right0, bottom0), and the display of the other HTML element When the coordinates are (left1, top1) − (right1, bottom1), if both of the following condition 1 and condition 2 are satisfied, the two HTML elements are determined to have a parallel relationship. The coordinate system of the display coordinates of the HTML element is as shown in (1) of FIG.

条件1:(α1≦left1−right0≦α2)又は(α1≦left0−right1≦α2)
条件2:(β≦top1−top0 かつ β≦bottom0−bottom1)又は(β≦top0−top1 かつ β≦bottom1−bottom0)
なお、上記の条件1及び条件2では、一方のHTML要素と他方のHTML要素との左右関係は、限定されていない。

なお、上記の条件1及び条件2では、一方のHTML要素と他方のHTML要素との左右関係は、限定されていない。
Condition 1: (α1 ≦ left1−right0 ≦ α2) or (α1 ≦ left0−right1 ≦ α2)
Condition 2: (β ≦ top1−top0 and β ≦ bottom0−bottom1) or (β ≦ top0−top1 and β ≦ bottom1−bottom0)
In the above conditions 1 and 2, the left-right relationship between one HTML element and the other HTML element is not limited.

In the above conditions 1 and 2, the left-right relationship between one HTML element and the other HTML element is not limited.

条件1は、一方HTML要素の表示領域と他方のHTML要素の表示領域とが水平方向の範囲において重複部分を有さないことを示す条件である。すなわち、条件1は、一方のHTML要素の表示領域の左端又は右端と、他方のHTML要素の表示領域の右端又は左端とが、接するか、又は離れていることを示す条件である。
なお、条件1におけるα1及びα2は、条件の判定に用いられる座標の誤差を許容するための定数である。通常、α1は、小さな負数であり、α2は、小さな正数である。

条件2は、一方のHTML要素の垂直方向の範囲が、他方のHTML要素の垂直方向の範囲に含まれることを示す条件である。なお、条件2におけるβについても、条件の判定に用いられる座標の誤差を許容するため定数である。通常、βは、小さな負数である。
Condition 1 is a condition indicating that the display area of one HTML element and the display area of the other HTML element do not have overlapping portions in the horizontal range. That is, the condition 1 is a condition indicating that the left end or right end of the display area of one HTML element is in contact with or separated from the right end or left end of the display area of the other HTML element.
Note that α1 and α2 in the condition 1 are constants for allowing an error in coordinates used for condition determination. Usually, α1 is a small negative number and α2 is a small positive number.

Condition 2 is a condition indicating that the vertical range of one HTML element is included in the vertical range of the other HTML element. Note that β in condition 2 is also a constant to allow an error in coordinates used for condition determination. Usually, β is a small negative number.

なお、条件2については、緩和されてもよい。例えば、図18の(4)に示されるHTML要素e0とHTML要素e1とについて、垂直方向の範囲の重複部分が、少なくともいずれか一方のHTML要素の高さに対して所定の割合以上であるという条件が、条件2の代わりに用いられてもよい。なお、条件2において、当該所定の割合は100%である。   Note that Condition 2 may be relaxed. For example, with respect to the HTML element e0 and the HTML element e1 shown in (4) of FIG. 18, the overlapping portion in the vertical range is at least a predetermined ratio with respect to the height of at least one of the HTML elements. Conditions may be used instead of condition 2. In condition 2, the predetermined ratio is 100%.

なお、Webブラウザ11によるHTML文書の表示において、各HTML要素が相互に重複しないことが保証されるのであれば、条件1は、並列関係を満たすための条件から除去されてもよい。   In the display of the HTML document by the Web browser 11, if it is guaranteed that the HTML elements do not overlap each other, the condition 1 may be removed from the condition for satisfying the parallel relationship.

続いて、比較部17は、二つのHTML要素の並列関係の有無の判定結果が、Webブラウザ11ごとに異なるか否かを判定する(S303)。Webブラウザ11ごとの判定結果が異なる場合、すなわち、一方のWebブラウザ11に関しては並列関係を有すると判定され、他方のWebブラウザ11に関しては並列関係を有さないと判定された場合(S303でYes)、比較部17は、並列関係を有さないと判定されたWebブラウザ11の表示結果に係る、二つのHTML要素それぞれの表示座標について、以下の条件3が満たされるか否かを判定する(S304)。   Subsequently, the comparison unit 17 determines whether or not the determination result of the presence / absence of the parallel relationship between the two HTML elements is different for each Web browser 11 (S303). When the determination result for each Web browser 11 is different, that is, when it is determined that one Web browser 11 has a parallel relationship and the other Web browser 11 does not have a parallel relationship (Yes in S303). ), The comparison unit 17 determines whether or not the following condition 3 is satisfied for the display coordinates of each of the two HTML elements related to the display result of the Web browser 11 determined not to have a parallel relationship ( S304).

条件3:γ≦top1−bottom0 又は γ≦top0−bottom1
すなわち、下方のHTML要素の表示領域のY座標の最小値と、上方のHTML要素の表示領域の上辺のY座標の最大値と差が、下方のHTML要素の高さ以上であるか否かが判定される。
Condition 3: [gamma] <= top1-bottom0 or [gamma] <= top0-bottom1
That is, whether or not the difference between the minimum value of the Y coordinate of the display area of the lower HTML element and the maximum value of the Y coordinate of the upper side of the display area of the upper HTML element is equal to or higher than the height of the lower HTML element. Determined.

なお、条件3は、一方のHTML要素の上辺のY座標値が、他方のHTML要素の底辺のY座標値以下であることを示す条件であるともいえる。又は、条件3は、一方のHTML要素の垂直方向の範囲の全部が、他方のHTML要素の垂直方向の範囲よりも下であることを示す条件であるともいえる。すなわち、条件3は、一方のHTML要素が、他方のHTML要素の下に回り込んでいる否かを判定するための条件である。なお、条件3におけるγについても、条件の判定に用いられる座標の誤差を許容するため定数である。通常、γは、小さな負数である。   Condition 3 can be said to be a condition indicating that the Y coordinate value of the upper side of one HTML element is equal to or less than the Y coordinate value of the bottom side of the other HTML element. Alternatively, Condition 3 can be said to be a condition indicating that the entire vertical range of one HTML element is lower than the vertical range of the other HTML element. That is, the condition 3 is a condition for determining whether one HTML element wraps around below the other HTML element. Note that γ in condition 3 is also a constant to allow an error in coordinates used for condition determination. Usually, γ is a small negative number.

条件3が満たされる場合(S304でYes)、比較部17は、並列関係の判定対象の二つのHTML要素を、各Webブラウザ11の表示結果における相違点として検出する(S305)。すなわち、当該二つのHTML要素の表示に関して、二つのWebブラウザ11の間に非互換が有ることが検出される。   When the condition 3 is satisfied (Yes in S304), the comparison unit 17 detects two HTML elements to be determined as parallel relationships as differences in the display results of the Web browsers 11 (S305). That is, it is detected that there is an incompatibility between the two Web browsers 11 regarding the display of the two HTML elements.

なお、Webブラウザ11ごとの並列関係の判定結果が一致する場合(S303でNo)、又はWebブラウザ11ごとの並列関係の判定結果が相互に異なるが、条件3が満たされない場合(S304でNo)、ステップS305は実行されない。   In addition, when the determination result of the parallel relationship for every Web browser 11 corresponds (No in S303), or the determination result of the parallel relationship for each Web browser 11 is different from each other, but the condition 3 is not satisfied (No in S304). Step S305 is not executed.

続いて、比較部17は、表示座標が取得されたHTML要素群の中からの二つのHTML要素の全ての組み合わせについて並列関係の有無の判定が実行されたか否かを判定する(S306)。未判定の組み合わせが有る場合(S306でNo)、当該組み合わせについてステップS301以降が繰り返される。未判定の組み合わせが無い場合(S306でYes)、図17の処理は終了する。   Subsequently, the comparison unit 17 determines whether or not the determination of the presence or absence of the parallel relationship has been executed for all combinations of two HTML elements from the HTML element group from which the display coordinates have been acquired (S306). When there is an undetermined combination (No in S306), Step S301 and subsequent steps are repeated for the combination. If there is no undetermined combination (Yes in S306), the process in FIG. 17 ends.

上述したように、第一の実施の形態によれば、各HTML要素が相互に異なる色によって着色されてHTML文書が表示される。HTML文書の表示結果を示す画像を構成する画素のうち、HTML要素ごとに当該HTML要素に割り当てられた色の画素に基づいて、当該HTML要素の表示領域が特定される。したがって、Webブラウザ11ごとに1回の表示により、複数のHTML要素の表示領域を特定することができる。その結果、HTML文書内の各HTML要素の表示領域を効率的に特定することができる。   As described above, according to the first embodiment, each HTML element is colored with a different color, and an HTML document is displayed. Among the pixels constituting the image showing the display result of the HTML document, the display area of the HTML element is specified based on the pixel of the color assigned to the HTML element for each HTML element. Therefore, the display area of a plurality of HTML elements can be specified by one display for each Web browser 11. As a result, the display area of each HTML element in the HTML document can be efficiently specified.

次に、第二の実施の形態について説明する。第二の実施の形態では第一の実施の形態と異なる点について説明する。第二の実施の形態において、特に言及されない点については、第一の実施の形態と同様でもよい。   Next, a second embodiment will be described. In the second embodiment, differences from the first embodiment will be described. In the second embodiment, points not particularly mentioned may be the same as those in the first embodiment.

最近のPC(Personal Computer)では、低いディスプレイ解像度でも滑らかな文字が表示されるように、アンチエイリアシング処理が行われるようになっている。アンチエイリアシング処理とは、文字のエッジにグラデーションを持たせ、遠目から文字がきれいに見えるようにする処理である。   In recent PCs (Personal Computers), anti-aliasing processing is performed so that smooth characters are displayed even at a low display resolution. The anti-aliasing process is a process in which a gradation is given to the edge of a character so that the character can be seen clearly from a distance.

アンチエイリアシング処理が行われる場合、一つのテキスト要素に、<font color=#FF0000>等のタグが付加されて一色が割り当てられても、実際の表示時には、当該テキスト要素に係る文字列には多数の色が使用されてしまう。その為、キャプチャ画像から、当該テキスト要素の割当色を示すRGB値を有する画素が抽出したとしても、当該画素に基づいて、当該テキスト要素の外接矩形を正確に得るのは困難である。当該画素には、当該テキスト要素以外のHTML要素を構成する画素が含まれている可能性が有るからである。   When anti-aliasing processing is performed, even if a tag such as <font color = # FF0000> is added to one text element and one color is assigned, there are many character strings related to the text element in actual display. Colors will be used. Therefore, even if a pixel having an RGB value indicating the assigned color of the text element is extracted from the captured image, it is difficult to accurately obtain a circumscribed rectangle of the text element based on the pixel. This is because the pixel may include a pixel constituting an HTML element other than the text element.

そこで、第二の実施の形態では、テキスト要素に色が割り当てられるときには、色相が基準とされ、相互に異なる色相を有する色が、各テキスト要素に割り当てられるようにする。文字の背景が無彩色であれば、アンチエイリアシング処理でも当該文字を構成する画素の色相は不変であり、また、文字の背景が有彩色であっても、当該文字を構成する画素の色相は、大きく変化しないといった性質が利用される。   Therefore, in the second embodiment, when a color is assigned to a text element, the hue is used as a reference, and colors having different hues are assigned to each text element. If the character background is an achromatic color, the hue of the pixels constituting the character is unchanged even in the anti-aliasing process, and even if the character background is a chromatic color, the hue of the pixels constituting the character is The property of not changing greatly is used.

第二の実施の形態では、図3の処理に関して、HTML要素に割り当てる色を管理する変数として、変数Cの代わりに変数Hが利用される。なお、変数名が異なるのは、単に、第一の実施の形態との混同を避けるためである。   In the second embodiment, the variable H is used in place of the variable C as a variable for managing the color assigned to the HTML element in the processing of FIG. Note that the variable names are different only to avoid confusion with the first embodiment.

変数Hの初期値は、例えば、0である。また、図3のステップS103では、例えば、図19に示される処理が実行される。図19は、第二の実施の形態における割当色の決定処理の処理手順の一例を説明するためのフローチャートである。   The initial value of the variable H is 0, for example. Further, in step S103 of FIG. 3, for example, the processing shown in FIG. 19 is executed. FIG. 19 is a flowchart for explaining an example of a processing procedure of assigned color determination processing according to the second embodiment.

ステップS401において、割当色決定部12は、変数Hにβを加算した結果を、変数Hに代入する。そうすることにより、既に割り当て済みの色とは異なる色が割り当てられるようにする。βは、例えば、1等の定数である。文字の背景に有彩色が使用されていれば、βの値は、1より大きい方が望ましい。HTML文書において、背景色は、<body>タグにおけるbgcolor属性によって指定される。したがって、bgcolorの値に基づいて、背景色が有彩色であるか否かが判定されてもよい。   In step S <b> 401, the assigned color determination unit 12 assigns the result of adding β to the variable H to the variable H. By doing so, a color different from the already assigned color is assigned. β is, for example, a constant such as 1. If a chromatic color is used for the background of the character, the value of β is preferably larger than 1. In the HTML document, the background color is specified by the bgcolor attribute in the <body> tag. Therefore, whether or not the background color is a chromatic color may be determined based on the value of bgcolor.

続いて、割当色決定部12は、色相がH、彩度が1、及び明度が1によって特定される色を、RGB値に変換する(S402)。割当色決定部12は、変換結果を、対象要素の割当色とする。但し、彩度及び明度は、0以外の値であれば、必ずしも1でなくてもよい。また、彩度及び明度は、各HTML要素間で共通の値でなくてもよい。   Subsequently, the assigned color determination unit 12 converts the color specified by the hue H, the saturation 1 and the lightness 1 into an RGB value (S402). The assigned color determination unit 12 sets the conversion result as the assigned color of the target element. However, the saturation and lightness are not necessarily 1 as long as the values are other than 0. Further, the saturation and lightness do not have to be common values among the HTML elements.

図3のステップS105において、割当色決定部12は、変数Hの値(すなわち、色相の値)を対象要素に対応付けて割当色記憶部122に記憶する。   In step S <b> 105 of FIG. 3, the assigned color determination unit 12 stores the value of the variable H (that is, the hue value) in the assigned color storage unit 122 in association with the target element.

図20は、第二の実施の形態において割当色記憶部に記憶される値の一例を示す図である。図20に示されるように、第二の実施の形態において、割当色記憶部122には、HTML要素ごと(XPathごと)に、当該HTML要素に割り当てられた色相の値が記憶される。   FIG. 20 is a diagram illustrating an example of values stored in the allocated color storage unit in the second embodiment. As shown in FIG. 20, in the second embodiment, the assigned color storage unit 122 stores the hue value assigned to the HTML element for each HTML element (for each XPath).

したがって、ステップS110では、XPathと色相との組みが選択される。以下、ステップS110において選択された色相を、「選択色相」という。   Therefore, in step S110, a combination of XPath and hue is selected. Hereinafter, the hue selected in step S110 is referred to as “selected hue”.

続いて、図3のステップS111の詳細について説明する。図21は、第二の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。   Next, details of step S111 in FIG. 3 will be described. FIG. 21 is a flowchart for explaining an example of a process for specifying a circumscribed rectangle of a pixel of a certain color in the second embodiment.

ステップS501において、表示領域特定部16は、変数Iに選択色相の値を代入する。続いて、表示領域特定部16は、RGB値で表現されたビットマップ画像であるキャプチャ画像の各画素のRGB値を、HSV(色相、彩度、明度)値に変換する(S502)。変換は、公知の方法によって行われればよい。   In step S501, the display area specifying unit 16 substitutes the value of the selected hue into the variable I. Subsequently, the display area specifying unit 16 converts the RGB value of each pixel of the captured image, which is a bitmap image expressed by RGB values, into HSV (hue, saturation, brightness) values (S502). The conversion may be performed by a known method.

続いて、表示領域特定部16は、キャプチャ画像を構成する画素の中で、以下の式(1)を満たす全ての画素を抽出する(S503)。
I−β/2 ≦ 画素の色相H < I+β/2 ・・・(1)
式(1)では、アンチエイリアシングの影響で色相が僅かに変化することが考慮されて、±β/2の範囲の誤差が許容されている。すなわち、ステップS503では、選択色の色相から所定の範囲内の色相に係る色を有する画素が抽出される。
Subsequently, the display area specifying unit 16 extracts all the pixels satisfying the following expression (1) from the pixels constituting the capture image (S503).
I−β / 2 ≦ Hue of pixel H <I + β / 2 (1)
In equation (1), it is considered that the hue slightly changes due to the effect of anti-aliasing, and an error in the range of ± β / 2 is allowed. That is, in step S503, a pixel having a color related to a hue within a predetermined range is extracted from the hue of the selected color.

続いて、表示領域特定部16は、抽出された画素の外接矩形(最小外接矩形)を特定し、当該外接矩形の左上頂点及び右下頂点の座標値を取得する(S504)。取得された座標値が、選択要素のXPathに対応付けられて表示領域記憶部124(図8)に記憶される。   Subsequently, the display area specifying unit 16 specifies the circumscribed rectangle (minimum circumscribed rectangle) of the extracted pixel, and acquires the coordinate values of the upper left vertex and the lower right vertex of the circumscribed rectangle (S504). The acquired coordinate values are stored in the display area storage unit 124 (FIG. 8) in association with the XPath of the selected element.

上述したように、第二の実施の形態によれば、アンチエイリアシング処理が行われる場合であっても、各HTML要素の表示領域を特定することができる。   As described above, according to the second embodiment, the display area of each HTML element can be specified even when anti-aliasing processing is performed.

次に、第三の実施の形態について説明する。第三の実施の形態では第二の実施の形態と異なる点について説明する。第三の実施の形態において、特に言及されない点については、第二の実施の形態と同様でもよい。   Next, a third embodiment will be described. In the third embodiment, differences from the second embodiment will be described. In the third embodiment, points not particularly mentioned may be the same as those in the second embodiment.

第三の実施の形態では、文字の表示に関して、ClearType(登録商標)又はCoolType(登録商標)等、アンチエイリアシングを更に高度化した処理が実行される場合が考慮される。   In the third embodiment, a case is considered in which processing with higher anti-aliasing is performed, such as ClearType (registered trademark) or CoolType (registered trademark), for displaying characters.

ClearType(登録商標)又はCoolType(登録商標)が適用されて表示された文字は、当該文字を構成する画素の中に、当該文字に対して指定された色とは大きく異なる色を有する画素が存在する。したがって、ClearType(登録商標)又はCoolType(登録商標)が適用されて表示されたテキスト要素に関しては、第一の実施の形態又は第二の実施の形態のように、当該テキスト要素に指定された色の画素を単純に抽出したとしても、抽出された画素の外接矩形が、当該テキスト要素の表示領域と大きく異なる可能性が有る。何故なら、テキスト要素の文字に複数の色の画素が混在してしまうため、他のテキスト要素にも同じ色の画素が存在する可能性が高くなり、色情報に基づいて、テキスト要素を区別するのが困難になるからである。   For characters displayed with ClearType (registered trademark) or CoolType (registered trademark) applied, there are pixels that have a color that is significantly different from the color specified for the character in the pixels constituting the character To do. Therefore, for a text element displayed with ClearType (registered trademark) or CoolType (registered trademark) applied, the color specified for the text element as in the first embodiment or the second embodiment. Even if this pixel is simply extracted, the circumscribed rectangle of the extracted pixel may be significantly different from the display area of the text element. This is because the pixels of a text element are mixed with pixels of multiple colors, so there is a high possibility that pixels of the same color exist in other text elements, and the text elements are distinguished based on color information. This is because it becomes difficult.

そこで、第三の実施の形態では、図3のステップS111に関して、図22に示される処理が実行される。なお、各HTML要素に対する色(色相)の割り当て方法は、第二の実施の形態と同様でよい。   Therefore, in the third embodiment, the processing shown in FIG. 22 is executed with respect to step S111 in FIG. Note that the color (hue) assignment method for each HTML element may be the same as in the second embodiment.

図22は、第三の実施の形態において或る色の画素の外接矩形の特定処理の一例を説明するためのフローチャートである。   FIG. 22 is a flowchart for explaining an example of a process for specifying a circumscribed rectangle of a pixel of a certain color in the third embodiment.

ステップS601において、表示領域特定部16は、RGB値で表現されたビットマップ画像であるキャプチャ画像の各画素のRGB値を、HSV(色相、彩度、明度)値に変換する。   In step S601, the display area specifying unit 16 converts the RGB value of each pixel of the capture image, which is a bitmap image expressed by RGB values, into HSV (hue, saturation, brightness) values.

図23は、第三の実施の形態において或る色の画素の外接矩形の特定処理を説明するための画像の一例である。図23において、(1)が、キャプチャ画像であるとする。キャプチャ画像における色の違いは、図中において、濃淡によって表現されている。これは、「Press」の文字列に同じ色相を割当てたにも拘わらず、ClearType(登録商標)又はCoolType(登録商標)が適用された結果、異なる色の画素が混在することを示す。   FIG. 23 is an example of an image for explaining a circumscribed rectangle specifying process for a pixel of a certain color in the third embodiment. In FIG. 23, it is assumed that (1) is a captured image. The color difference in the captured image is expressed by shading in the drawing. This indicates that pixels of different colors are mixed as a result of applying ClearType (registered trademark) or CoolType (registered trademark) even though the same hue is assigned to the character string “Press”.

続いて、表示領域特定部16は、キャプチャ画像を二値化する(S602)。二値化は、公知の方法によって行われればよい。例えば、キャプチャ画像における各画素のV値が着目され、V値に関して大津の二値化のアルゴリズムが用いられて二値化が行われてもよい。又は、単純にV値の平均値を二値化の閾値とする等、他の方法によって二値化が行われてもよい。なお、図23の(2)は、二値化によって生成された画像を示す。以下、二値化によって生成された画像を、「二値画像」という。なお、以下において、キャプチャ画像というとき、当該画像は、二値化されていない元のキャプチャ画像(すなわち、図23の(1)の画像)である。   Subsequently, the display area specifying unit 16 binarizes the captured image (S602). The binarization may be performed by a known method. For example, attention may be paid to the V value of each pixel in the captured image, and binarization may be performed on the V value using Otsu's binarization algorithm. Alternatively, binarization may be performed by other methods such as simply using an average value of V values as a threshold for binarization. Note that (2) in FIG. 23 shows an image generated by binarization. Hereinafter, an image generated by binarization is referred to as a “binary image”. In the following, when the captured image is referred to, the image is an original captured image that is not binarized (that is, the image of (1) in FIG. 23).

続いて、表示領域特定部16は、二値画像において、各黒画素の隣接8近傍の黒画素を再帰的に連結することで、連結要素を抽出する(S603)。   Subsequently, the display area specifying unit 16 extracts connected elements by recursively connecting the black pixels adjacent to the adjacent 8 pixels in the binary image (S603).

図24は、隣接8近傍を説明するための図である。図24において、画素(1)を注目画素とした場合、画素(1)に辺が接する画素(2)と、画像(1)に頂点が接する画素(3)とが、画素(1)の隣接8近傍画素である。隣接8近傍で連結された連結要素とは、お互いに隣接8近傍の関係にある黒画素の集合が構成する要素をいう。   FIG. 24 is a diagram for explaining the vicinity of adjacent 8. In FIG. 24, when pixel (1) is the target pixel, pixel (2) whose side is in contact with pixel (1) and pixel (3) whose vertex is in contact with image (1) are adjacent to pixel (1). 8 neighboring pixels. A connected element connected in the vicinity of the adjacent 8 means an element formed by a set of black pixels in a relationship of adjacent 8 adjacent to each other.

図23の(3)には、連結要素ce1、ce2、及びce3の3つの連結要素が抽出された例が示されている。なお、各連結要素は、同じ色を有することが推定される画素の集合である。例えば、連結要素ce1を構成する画素群は、同じ色を有することが推定される。また、ステップS602における二値画像の生成は、評価対象のHTML文書の背景色が不明な場合や一様でない場合において、連結要素の抽出精度を向上させるために実行される。仮に、HTML文書の背景色が既知であり、当該背景色が一様である場合は、キャプチャ画像において、当該背景色以外の画像に関して連結要素が抽出されてもよい。この場合、二値画像は生成されなくてもよい。   FIG. 23 (3) shows an example in which three connection elements of connection elements ce1, ce2, and ce3 are extracted. Each connected element is a set of pixels estimated to have the same color. For example, it is presumed that the pixel groups constituting the connection element ce1 have the same color. Further, the generation of the binary image in step S602 is executed to improve the extraction accuracy of the connected elements when the background color of the HTML document to be evaluated is unknown or not uniform. If the background color of the HTML document is known and the background color is uniform, connected elements may be extracted for images other than the background color in the captured image. In this case, a binary image may not be generated.

続いて、表示領域特定部16は、各連結要素について、キャプチャ画像上において当該連結要素に対応する画素の色相のヒストグラム(度数分布表)を求める(S604)。すなわち、図23の(4)に示されるように、連結要素ce1、ce2、及びce3のそれぞれについて、キャプチャ画像において当該連結要素に対応する画素の色相のヒストグラムが求められる。なお、図23の(4)に示される画像は、(1)の画像と同じである。   Subsequently, the display area specifying unit 16 obtains a histogram (frequency distribution table) of hues of pixels corresponding to the connected elements on the captured image for each connected element (S604). That is, as shown in (4) of FIG. 23, for each of the connected elements ce1, ce2, and ce3, a histogram of the hue of the pixel corresponding to the connected element in the captured image is obtained. Note that the image shown in (4) of FIG. 23 is the same as the image of (1).

続いて、表示領域特定部16は、連結要素ごとに、当該連結要素について求められたヒストグラムに基づいて、色相の中央値を求め、当該中央値を、当該連結要素の代表色相値とする(S605)。なお、中央値の他、平均値又は最頻値等の代表値が、代表色相値とされてもよい。   Subsequently, for each connected element, the display area specifying unit 16 obtains the median value of the hue based on the histogram obtained for the connected element, and uses the median as the representative hue value of the connected element (S605). ). In addition to the median value, a representative value such as an average value or a mode value may be used as the representative hue value.

続いて、表示領域特定部16は、キャプチャ画像の各画素の色相の値が、当該画素が属する連結要素に関して求められた代表色相値によって置換された画像(以下、「色相置換画像」という。)を生成する(S606)。なお、図23の(5)には、色相置換画像の一例を示す。色相置換画像では、「Press」という文字列を構成する全ての画像の色相が同じ値(代表色相値)となる。   Subsequently, the display area specifying unit 16 replaces the hue value of each pixel of the captured image with the representative hue value obtained for the connected element to which the pixel belongs (hereinafter referred to as “hue replacement image”). Is generated (S606). FIG. 23 (5) shows an example of a hue replacement image. In the hue replacement image, the hues of all the images constituting the character string “Press” have the same value (representative hue value).

続いて、表示領域特定部16は、色相置換画像に関して、図21のステップS501、S503、及びS504と同様の処理を実行する。   Subsequently, the display area specifying unit 16 performs the same process as steps S501, S503, and S504 in FIG. 21 for the hue replacement image.

すなわち、表示領域特定部16は、変数Iに選択色相の値を代入する(S607)。続いて、表示領域特定部16は、色相置換画像を構成する画素の中で、上記の式(1)を満たす全ての画素を抽出する(S608)。なお、色相置換画像において、文字列に対応する各画素の色相の値は、共通の代表色相値に置き換えられているが、当該代表色相値に誤差が含まれる可能性があるため、±β/2の誤差が考慮される。   That is, the display area specifying unit 16 substitutes the value of the selected hue for the variable I (S607). Subsequently, the display area specifying unit 16 extracts all the pixels satisfying the above formula (1) among the pixels constituting the hue replacement image (S608). In the hue replacement image, the hue value of each pixel corresponding to the character string is replaced with a common representative hue value, but there is a possibility that the representative hue value includes an error, so that ± β / Two errors are taken into account.

続いて、表示領域特定部16は、抽出された画素の外接矩形(最小外接矩形)を特定し、当該外接矩形の左上頂点及び右下頂点の座標値を取得する(S609)。取得された座標値が、選択要素のXPathに対応付けられて表示領域記憶部124(図8)に記憶される。   Subsequently, the display area specifying unit 16 specifies the circumscribed rectangle (minimum circumscribed rectangle) of the extracted pixel, and acquires the coordinate values of the upper left vertex and the lower right vertex of the circumscribed rectangle (S609). The acquired coordinate values are stored in the display area storage unit 124 (FIG. 8) in association with the XPath of the selected element.

上述したように、第三の実施の形態によれば、ClearType(登録商標)又はCoolType(登録商標)等、アンチエイリアシングを更に高度化した処理が実行される場合であっても、各HTML要素の表示領域を特定することができる。   As described above, according to the third embodiment, even when processing that further enhances anti-aliasing, such as ClearType (registered trademark) or CoolType (registered trademark), is executed. The display area can be specified.

なお、上記各実施の形態において、比較装置10は、表示領域特定装置の一例である。割当色決定部12は、割当部の一例である。HTML文書改変部13は、変更部の一例である。ブラウザ表示部14は、表示部の一例である。表示領域特定部16は、特定部の一例である。比較部17は、検出部の一例である。HTML要素は、表示要素の一例である。すなわち、HTML文書以外の表示データであって、複数の表示要素を含む表示データに関して、本実施の形態が適用されてもよい。この場合、Webブラウザ11の代わりに、当該表示データに適したブラウザが用いられてもよい。キャプチャ画像は、表示画像の一例である。   In each of the above embodiments, the comparison device 10 is an example of a display area specifying device. The allocation color determination unit 12 is an example of an allocation unit. The HTML document modification unit 13 is an example of a change unit. The browser display unit 14 is an example of a display unit. The display area specifying unit 16 is an example of a specifying unit. The comparison unit 17 is an example of a detection unit. The HTML element is an example of a display element. In other words, the present embodiment may be applied to display data other than an HTML document and display data including a plurality of display elements. In this case, a browser suitable for the display data may be used instead of the Web browser 11. A capture image is an example of a display image.

以上、本発明の実施例について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   As mentioned above, although the Example of this invention was explained in full detail, this invention is not limited to such specific embodiment, In the range of the summary of this invention described in the claim, various deformation | transformation・ Change is possible.

以上の説明に関し、更に以下の項を開示する。
(付記1)
表示データに含まれる各表示要素に相互に異なる色を割り当てる割当部と、
各表示要素又は各表示要素の背景が、前記割当部によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更する変更部と、
前記変更部による変更後の表示データをブラウザに表示させる表示部と、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する特定部と、
を有することを特徴とする表示領域特定装置。
(付記2)
前記表示部は、前記変更部による変更後の表示データを複数のブラウザに表示させ、
前記特定部は、前記ブラウザごとに、当該ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定し、
前記ブラウザごとに特定された前記各表示要素の表示領域を比較して、前記複数のブラウザによる表示結果における相違点を検出する検出部を有することを特徴とする付記1記載の表示領域特定装置。
(付記3)
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記1又は2記載の表示領域特定装置。
(付記4)
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示データの背景色とは異なる色の各画素について、当該画素に隣接する画素の集合を求め、前記集合ごとに、当該集合に含まれる画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記1又は2記載の表示領域特定装置。
(付記5)
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示画像が二値化された二値画像を生成し、前記二値画像における各黒画素について、当該黒画素に隣接する黒画素の集合を求め、前記表示画像について、前記集合ごとに、当該集合に含まれる黒画素に対応する画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記1又は2記載の表示領域特定装置。
(付記6)
コンピュータが、
表示データに含まれる各表示要素に相互に異なる色を割り当て、
各表示要素又は各表示要素の背景が、前記割り当てる処理によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更し、
前記変更する処理による変更後の表示データをブラウザに表示させ、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する、
処理を実行することを特徴とする表示領域特定方法。
(付記7)
前記表示させる処理は、前記変更する処理による変更後の表示データを複数のブラウザに表示させ、
前記特定する処理は、前記ブラウザごとに、当該ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定し、
前記ブラウザごとに特定された前記各表示要素の表示領域を比較して、前記複数のブラウザによる表示結果における相違点を検出する処理を前記コンピュータが実行することを特徴とする付記6記載の表示領域特定方法。
(付記8)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記6又は7記載の表示領域特定方法。
(付記9)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示データの背景色とは異なる色の各画素について、当該画素に隣接する画素の集合を求め、前記集合ごとに、当該集合に含まれる画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記6又は7記載の表示領域特定方法。
(付記10)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示画像が二値化された二値画像を生成し、前記二値画像における各黒画素について、当該黒画素に隣接する黒画素の集合を求め、前記表示画像について、前記集合ごとに、当該集合に含まれる黒画素に対応する画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記6又は7記載の表示領域特定方法。
(付記11)
コンピュータに、
表示データに含まれる各表示要素に相互に異なる色を割り当て、
各表示要素又は各表示要素の背景が、前記割り当てる処理によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更し、
前記変更する処理による変更後の表示データをブラウザに表示させ、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する、
処理を実行させるプログラム。
(付記12)
前記表示させる処理は、前記変更する処理による変更後の表示データを複数のブラウザに表示させ、
前記特定する処理は、前記ブラウザごとに、当該ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定し、
前記ブラウザごとに特定された前記各表示要素の表示領域を比較して、前記複数のブラウザによる表示結果における相違点を検出する処理を前記コンピュータに実行させる付記11記載のプログラム。
(付記13)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記11又は12記載のプログラム。
(付記14)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示データの背景色とは異なる色の各画素について、当該画素に隣接する画素の集合を求め、前記集合ごとに、当該集合に含まれる画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記11又は12記載のプログラム。
(付記15)
前記変更する処理は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定する処理は、前記表示画像が二値化された二値画像を生成し、前記二値画像における各黒画素について、当該黒画素に隣接する黒画素の集合を求め、前記表示画像について、前記集合ごとに、当該集合に含まれる黒画素に対応する画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする付記11又は12記載のプログラム。
Regarding the above description, the following items are further disclosed.
(Appendix 1)
An assigning unit that assigns a different color to each display element included in the display data;
A changing unit that changes the definition content of the display data so that each display element or a background of each display element is displayed in a color assigned to the display element by the assigning unit;
A display unit for displaying the display data after the change by the change unit in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. A specific part to identify as,
A display area specifying device comprising:
(Appendix 2)
The display unit displays the display data after the change by the change unit in a plurality of browsers,
The specifying unit, for each browser, in a display image showing a display result of the display data by the browser, for each color assigned to the display element, an area specified based on a pixel of the color, Identify the display area of the display element assigned the color,
The display area specifying apparatus according to claim 1, further comprising a detection unit that detects a difference in display results of the plurality of browsers by comparing display areas of the display elements specified for the browsers.
(Appendix 3)
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
In the display image, for each hue assigned to the display element, the specifying unit assigns the hue to an area specified based on a pixel of a color related to a hue within a predetermined range from the hue. Specify as the display area of the display element,
The display area specifying device according to appendix 1 or 2, characterized in that:
(Appendix 4)
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
For each pixel of a color different from the background color of the display data, the specifying unit obtains a set of pixels adjacent to the pixel, and for each set, the hue of each pixel included in the set is An image replaced with a representative value related to the hue distribution of the image is generated, and in the image, each hue assigned to the display element is specified based on pixels of a color related to a hue within a predetermined range from the hue. The display area of the display element to which the hue is assigned,
The display area specifying device according to appendix 1 or 2, characterized in that:
(Appendix 5)
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
The specifying unit generates a binary image in which the display image is binarized, obtains a set of black pixels adjacent to the black pixel for each black pixel in the binary image, and For each set, an image is generated in which the hues of the pixels corresponding to the black pixels included in the set are replaced by representative values related to the distribution of the respective hues, and the image is assigned to the display element in the image. For each hue, an area identified based on pixels of a color within a predetermined range from the hue is identified as a display area of a display element to which the hue is assigned.
The display area specifying device according to appendix 1 or 2, characterized in that:
(Appendix 6)
Computer
Assign different colors to each display element included in the display data,
Change the definition content of the display data so that each display element or the background of each display element is displayed in the color assigned to the display element by the assigning process,
Display the display data after the change by the processing to be changed in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. As specified,
A display area specifying method characterized by executing processing.
(Appendix 7)
In the process of displaying, the display data after the change by the process of changing is displayed on a plurality of browsers,
In the display image showing the display result of the display data by the browser for each of the browsers, the specifying process specifies an area specified based on the pixel of the color for each color assigned to the display element. Specify the display area of the display element to which the color is assigned,
The display area according to claim 6, wherein the computer executes a process of comparing the display areas of the respective display elements specified for each of the browsers and detecting differences in display results of the plurality of browsers. Identification method.
(Appendix 8)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
In the display process, for each hue assigned to the display element in the display image, the hue is assigned to an area specified based on a pixel having a color within a predetermined range from the hue. Specified as the display area of the displayed element,
The display area specifying method according to appendix 6 or 7, characterized in that:
(Appendix 9)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
In the specifying process, for each pixel of a color different from the background color of the display data, a set of pixels adjacent to the pixel is obtained, and for each set, each hue of the pixels included in the set is Generate an image replaced with a representative value for each hue distribution, and specify for each hue assigned to the display element in the image based on pixels of a color related to a hue within a predetermined range from the hue Identify the area to be displayed as the display area of the display element to which the hue is assigned.
The display area specifying method according to appendix 6 or 7, characterized in that:
(Appendix 10)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
The specifying process generates a binary image in which the display image is binarized, obtains a set of black pixels adjacent to the black pixel for each black pixel in the binary image, and for the display image, For each set, an image is generated in which the hues of the pixels corresponding to the black pixels included in the set are replaced by representative values related to the distribution of the respective hues, and the image is assigned to the display element in the image. For each hue, an area specified based on pixels of a color within a predetermined range from the hue is specified as a display area of a display element to which the hue is assigned.
The display area specifying method according to appendix 6 or 7, characterized in that:
(Appendix 11)
On the computer,
Assign different colors to each display element included in the display data,
Change the definition content of the display data so that each display element or the background of each display element is displayed in the color assigned to the display element by the assigning process,
Display the display data after the change by the processing to be changed in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. As specified,
A program that executes processing.
(Appendix 12)
In the process of displaying, the display data after the change by the process of changing is displayed on a plurality of browsers,
In the display image showing the display result of the display data by the browser for each of the browsers, the specifying process specifies an area specified based on the pixel of the color for each color assigned to the display element. Specify the display area of the display element to which the color is assigned,
The program according to appendix 11, wherein the computer executes a process of comparing the display areas of the display elements specified for each browser and detecting differences in the display results of the plurality of browsers.
(Appendix 13)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
In the display process, for each hue assigned to the display element in the display image, the hue is assigned to an area specified based on a pixel having a color within a predetermined range from the hue. Specified as the display area of the displayed element,
The program according to appendix 11 or 12, characterized by the above.
(Appendix 14)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
In the specifying process, for each pixel of a color different from the background color of the display data, a set of pixels adjacent to the pixel is obtained, and for each set, each hue of the pixels included in the set is Generate an image replaced with a representative value for each hue distribution, and specify for each hue assigned to the display element in the image based on pixels of a color related to a hue within a predetermined range from the hue Identify the area to be displayed as the display area of the display element to which the hue is assigned.
The program according to appendix 11 or 12, characterized by the above.
(Appendix 15)
The process of changing assigns a different hue to each display element, and displays each display element or the background of each display element in a color related to the hue assigned to the display element. Change the definition,
The specifying process generates a binary image in which the display image is binarized, obtains a set of black pixels adjacent to the black pixel for each black pixel in the binary image, and for the display image, For each set, an image is generated in which the hues of the pixels corresponding to the black pixels included in the set are replaced by representative values related to the distribution of the respective hues, and the image is assigned to the display element in the image. For each hue, an area specified based on pixels of a color within a predetermined range from the hue is specified as a display area of a display element to which the hue is assigned.
The program according to appendix 11 or 12, characterized by the above.

10 比較装置
11 Webブラウザ
12 割当色決定部
13 HTML文書改変部
14 ブラウザ表示部
15 画面キャプチャ部
16 表示領域特定部
17 比較部
18 出力部
100 ドライブ装置
101 記録媒体
102 補助記憶装置
103 メモリ装置
104 CPU
105 インタフェース装置
106 表示装置
107 入力装置
121 HTML文書記憶部
122 割当色記憶部
123 改変文書記憶部
124 表示領域記憶部
B バス
DESCRIPTION OF SYMBOLS 10 Comparison apparatus 11 Web browser 12 Allocation color determination part 13 HTML document modification part 14 Browser display part 15 Screen capture part 16 Display area specification part 17 Comparison part 18 Output part 100 Drive apparatus 101 Recording medium 102 Auxiliary storage apparatus 103 Memory apparatus 104 CPU
105 interface device 106 display device 107 input device 121 HTML document storage unit 122 assigned color storage unit 123 modified document storage unit 124 display area storage unit B bus

Claims (7)

表示データに含まれる各表示要素に相互に異なる色を割り当てる割当部と、
各表示要素又は各表示要素の背景が、前記割当部によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更する変更部と、
前記変更部による変更後の表示データをブラウザに表示させる表示部と、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する特定部と、
を有することを特徴とする表示領域特定装置。
An assigning unit that assigns a different color to each display element included in the display data;
A changing unit that changes the definition content of the display data so that each display element or a background of each display element is displayed in a color assigned to the display element by the assigning unit;
A display unit for displaying the display data after the change by the change unit in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. A specific part to identify as,
A display area specifying device comprising:
前記表示部は、前記変更部による変更後の表示データを複数のブラウザに表示させ、
前記特定部は、前記ブラウザごとに、当該ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定し、
前記ブラウザごとに特定された前記各表示要素の表示領域を比較して、前記複数のブラウザによる表示結果における相違点を検出する検出部を有することを特徴とする請求項1記載の表示領域特定装置。
The display unit displays the display data after the change by the change unit in a plurality of browsers,
The specifying unit, for each browser, in a display image showing a display result of the display data by the browser, for each color assigned to the display element, an area specified based on a pixel of the color, Identify the display area of the display element assigned the color,
The display area specifying device according to claim 1, further comprising: a detection unit that detects a difference in display results of the plurality of browsers by comparing display areas of the display elements specified for the browsers. .
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする請求項1又は2記載の表示領域特定装置。
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
In the display image, for each hue assigned to the display element, the specifying unit assigns the hue to an area specified based on a pixel of a color related to a hue within a predetermined range from the hue. Specify as the display area of the display element,
The display area specifying device according to claim 1, wherein the display area specifying device is a display area specifying device.
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示データの背景色とは異なる色の各画素について、当該画素に隣接する画素の集合を求め、前記集合ごとに、当該集合に含まれる画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内の色相に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする請求項1又は2記載の表示領域特定装置。
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
For each pixel of a color different from the background color of the display data, the specifying unit obtains a set of pixels adjacent to the pixel, and for each set, the hue of each pixel included in the set is An image replaced with a representative value related to the hue distribution of the image is generated, and in the image, each hue assigned to the display element is specified based on pixels of a color related to a hue within a predetermined range from the hue. The display area of the display element to which the hue is assigned,
The display area specifying device according to claim 1, wherein the display area specifying device is a display area specifying device.
前記変更部は、前記各表示要素に相互に異なる色相を割り当て、各表示要素又は各表示要素の背景が当該表示要素に割り当てられた色相に係る色で表示されるように、前記表示データの定義内容を変更し、
前記特定部は、前記表示画像が二値化された二値画像を生成し、前記二値画像における各黒画素について、当該黒画素に隣接する黒画素の集合を求め、前記表示画像について、前記集合ごとに、当該集合に含まれる黒画素に対応する画素のそれぞれの色相が、当該それぞれの色相の分布に関する代表値によって置換された画像を生成し、当該画像において、前記表示要素に割り当てられた色相ごとに、当該色相から所定の範囲内に係る色の画素に基づいて特定される領域を、当該色相が割り当てられた表示要素の表示領域として特定する、
ことを特徴とする請求項1又は2記載の表示領域特定装置。
The changing unit assigns a different hue to each display element, and defines the display data so that each display element or the background of each display element is displayed in a color related to the hue assigned to the display element. Change the content,
The specifying unit generates a binary image in which the display image is binarized, obtains a set of black pixels adjacent to the black pixel for each black pixel in the binary image, and For each set, an image is generated in which the hues of the pixels corresponding to the black pixels included in the set are replaced by representative values related to the distribution of the respective hues, and the image is assigned to the display element in the image. For each hue, an area identified based on pixels of a color within a predetermined range from the hue is identified as a display area of a display element to which the hue is assigned.
The display area specifying device according to claim 1, wherein the display area specifying device is a display area specifying device.
コンピュータが、
表示データに含まれる各表示要素に相互に異なる色を割り当て、
各表示要素又は各表示要素の背景が、前記割り当てる処理によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更し、
前記変更する処理による変更後の表示データをブラウザに表示させ、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する、
処理を実行することを特徴とする表示領域特定方法。
Computer
Assign different colors to each display element included in the display data,
Change the definition content of the display data so that each display element or the background of each display element is displayed in the color assigned to the display element by the assigning process,
Display the display data after the change by the processing to be changed in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. As specified,
A display area specifying method characterized by executing processing.
コンピュータに、
表示データに含まれる各表示要素に相互に異なる色を割り当て、
各表示要素又は各表示要素の背景が、前記割り当てる処理によって当該表示要素に割り当てられた色で表示されるように、前記表示データの定義内容を変更し、
前記変更する処理による変更後の表示データをブラウザに表示させ、
前記ブラウザによる前記表示データの表示結果を示す表示画像において、前記表示要素に割り当てられた色ごとに、当該色の画素に基づいて特定される領域を、当該色が割り当てられた表示要素の表示領域として特定する、
処理を実行させるプログラム。
On the computer,
Assign different colors to each display element included in the display data,
Change the definition content of the display data so that each display element or the background of each display element is displayed in the color assigned to the display element by the assigning process,
Display the display data after the change by the processing to be changed in a browser;
In the display image showing the display result of the display data by the browser, for each color assigned to the display element, an area specified based on the pixel of the color is designated as a display area of the display element to which the color is assigned. As specified,
A program that executes processing.
JP2014196832A 2014-09-26 2014-09-26 Display area specifying device, display area specifying method, and program Active JP6354497B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014196832A JP6354497B2 (en) 2014-09-26 2014-09-26 Display area specifying device, display area specifying method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014196832A JP6354497B2 (en) 2014-09-26 2014-09-26 Display area specifying device, display area specifying method, and program

Publications (2)

Publication Number Publication Date
JP2016071418A JP2016071418A (en) 2016-05-09
JP6354497B2 true JP6354497B2 (en) 2018-07-11

Family

ID=55864650

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014196832A Active JP6354497B2 (en) 2014-09-26 2014-09-26 Display area specifying device, display area specifying method, and program

Country Status (1)

Country Link
JP (1) JP6354497B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7215176B2 (en) * 2019-01-10 2023-01-31 富士通株式会社 Display comparison program, apparatus and method
KR102587797B1 (en) * 2023-05-18 2023-10-11 정윤태 Method for providing art work search service and apparatus therefor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006092277A (en) * 2004-09-24 2006-04-06 Fuji Xerox Co Ltd Device, method and program for supporting creation of web page
JP2010039815A (en) * 2008-08-06 2010-02-18 Nec Engineering Ltd Web page layout correction system
US8996988B2 (en) * 2009-10-19 2015-03-31 Browsera, LLC Automated application compatibility testing
WO2014010576A1 (en) * 2012-07-13 2014-01-16 日本電気株式会社 Coloration support device, coloration support method, and program

Also Published As

Publication number Publication date
JP2016071418A (en) 2016-05-09

Similar Documents

Publication Publication Date Title
US10049291B2 (en) Image-processing apparatus, image-processing method, and computer program product
AU2011250829B2 (en) Image processing apparatus, image processing method, and program
AU2019201268A1 (en) Segmentation of an image based on color and color differences
US9697583B2 (en) Image processing apparatus, image processing method, and computer-readable recording medium
JP6098298B2 (en) Image processing apparatus and computer program
CN106663329B (en) Graphics primitives and color channels
JP6808330B2 (en) Information processing equipment, information processing methods, and programs
AU2011250827A1 (en) Image processing apparatus, image processing method, and program
CN105426810A (en) Information Processing Device, Image Modification Method, And Computer Program Product
US20040247179A1 (en) Image processing apparatus, image processing method, and image processing program
US20150149883A1 (en) Image processing device, image processing device control method, program, and information storage medium
CN113822817A (en) Document image enhancement method and device and electronic equipment
US8824778B2 (en) Systems and methods for depth map generation
JP5539488B2 (en) Judgment of transparent fill based on reference background color
JP6354497B2 (en) Display area specifying device, display area specifying method, and program
JP6318513B2 (en) Representative color extraction apparatus, representative color extraction method, program, and recording medium
JP6791593B2 (en) Recognition device, recognition program, and recognition method
JP2013025031A (en) Display device and control method thereof
JP6546385B2 (en) IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND PROGRAM
JP2021196451A (en) Image converter, image conversion method, and computer program for image conversion
JP2018055256A (en) Information processing apparatus, information processing method, and program
US20100238470A1 (en) Document image processing system and document image processing method
JP6091400B2 (en) Image processing device
JP6711031B2 (en) Image processing apparatus, image processing method, image processing system and program
WO2021129213A1 (en) Theme icon generation method and apparatus therefor, and computer device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170605

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180313

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180528

R150 Certificate of patent or registration of utility model

Ref document number: 6354497

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150