JP5853848B2 - Image processing apparatus, image processing program, and image processing method - Google Patents

Image processing apparatus, image processing program, and image processing method Download PDF

Info

Publication number
JP5853848B2
JP5853848B2 JP2012104041A JP2012104041A JP5853848B2 JP 5853848 B2 JP5853848 B2 JP 5853848B2 JP 2012104041 A JP2012104041 A JP 2012104041A JP 2012104041 A JP2012104041 A JP 2012104041A JP 5853848 B2 JP5853848 B2 JP 5853848B2
Authority
JP
Japan
Prior art keywords
contour
area
region
partial
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012104041A
Other languages
Japanese (ja)
Other versions
JP2013232115A (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 JP2012104041A priority Critical patent/JP5853848B2/en
Publication of JP2013232115A publication Critical patent/JP2013232115A/en
Application granted granted Critical
Publication of JP5853848B2 publication Critical patent/JP5853848B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Description

本発明は、画像処理装置、画像処理プログラム及び画像処理方法に関する。   The present invention relates to an image processing apparatus, an image processing program, and an image processing method.

肌の診断やデザイン等を目的として、色を計測する技術が知られている。かかる色の計測を行う場合には、光電色度計や分光光度計などの専用の測色計を用いることもできるが、専用の測色計は高価な機器であるので、エンドユーザが手軽に使用するのは困難である。   Techniques for measuring colors are known for the purpose of skin diagnosis and design. When performing such color measurement, a dedicated colorimeter such as a photoelectric colorimeter or a spectrophotometer can be used. However, since the dedicated colorimeter is an expensive device, it is easy for the end user. It is difficult to use.

このため、携帯端末に搭載されたカメラやデジタルカメラが専用の測色計の代わりに使用される場合がある。このように、カメラを用いて撮影を行う場合には、色の計測対象とする対象物の計測部位が日光や照明等の光源による影響を受けるので、計測部位が持つ色と撮影された画像に写る計測部位の色との間に明暗差が生じる。   For this reason, a camera or a digital camera mounted on a portable terminal may be used instead of a dedicated colorimeter. In this way, when taking a picture using a camera, the measurement part of the object to be measured for color is affected by the light source such as sunlight or illumination. There is a light / dark difference between the color of the measurement site.

このことから、中央に計測部位である肌を露出させるための貫通孔を肌の計測領域とし、その周りを複数の色の標示領域が取り囲むように配列されたカラーパッチを用いて、カメラによって撮影された画像に写る計測部位の色を補正する手法が考えられる。かかる手法では、カラーパッチが計測部位の近傍に貼付された状態で撮影を行うことによって計測部位と同様に光源の影響を受けたカラーパッチが画像に写り込むことを利用する。すなわち、上記の手法では、予め保存しておいたカラーパッチの色と画像に写ったカラーパッチの色との変化量をもとに、画像に写る計測部位の色を計測部位が本来有する色へ補正するための補正量を算出する。   For this reason, a through-hole for exposing the skin that is the measurement site in the center is used as the skin measurement area, and the image is photographed with a camera using a color patch that is arranged so that multiple color marking areas surround it. A method of correcting the color of the measurement site shown in the captured image is conceivable. Such a technique utilizes the fact that the color patch affected by the light source is reflected in the image in the same manner as the measurement part by performing imaging while the color patch is attached in the vicinity of the measurement part. That is, in the above method, based on the amount of change between the color patch color stored in advance and the color patch color that appears in the image, the color of the measurement site that appears in the image is changed to the color that the measurement site originally has. A correction amount for correction is calculated.

上記の補正において変化量を得る前段階には、画像に写ったカラーパッチの標示領域の並び順を取り出すために、画像内に写るカラーパッチの貫通孔、すなわち計測領域を先だって検出するのが合理的である。   Before obtaining the amount of change in the above correction, it is reasonable to detect the color patch through-holes in the image, that is, the measurement area first, in order to extract the order of the color patch marking areas in the image. Is.

このとき、画像に含まれるカラーパッチ以外の背景となる領域のエッジが少ない場合には、エッジが集まっている部分を包含する範囲をカラーパッチが写った範囲とみなし、その範囲の中心にある領域を計測領域として検出することも考えられる。ところが、カラーパッチ以外の背景となる領域にエッジが少ないとは限らず、また、カラーパッチの周りには、ロゴや装飾などの模様などがデザインされている場合もある。このような場合には、模様がデザインされている箇所にもエッジが集中するので、エッジの集まり具合から計測領域を検出するのは困難である。   At this time, if there are few edges in the background area other than the color patches included in the image, the range including the part where the edges are gathered is regarded as the range where the color patches are reflected, and the area at the center of the range May be detected as a measurement region. However, the background area other than the color patch does not always have few edges, and a pattern such as a logo or decoration may be designed around the color patch. In such a case, since the edges are concentrated on the place where the pattern is designed, it is difficult to detect the measurement region from the degree of gathering of the edges.

特開2011−186916号公報JP 2011-186916 A 特開平07−139918号公報Japanese Patent Application Laid-Open No. 07-139918

ところで、画像から特定の形状を持つ領域を抽出するのに有用なハフ変換を上記の計測領域の検出に用いることも考えられる。   By the way, it is conceivable to use a Hough transform useful for extracting a region having a specific shape from an image for detecting the measurement region.

しかしながら、上記の計測領域の検出にハフ変換を用いる場合には、演算処理量が増大するという問題がある。例えば、画像から楕円状の計測領域を検出する場合には、画像上の2次元座標と、楕円の長辺および短辺との4つのパラメータを用いて変換することになる。このように、変換で扱うパラメータ数が多くなるのに伴って演算処理量も増大してしまう。特に、携帯端末の場合には、携帯端末のハードウェア性能の限界が据え置き機に比べて低いことも相まって携帯端末にとって処理負荷が過大となる結果、既存機能の動作に支障をきたすおそれもある。   However, when the Hough transform is used for the detection of the measurement area, there is a problem that the amount of calculation processing increases. For example, when an elliptical measurement region is detected from an image, conversion is performed using four parameters of the two-dimensional coordinates on the image and the long and short sides of the ellipse. Thus, as the number of parameters handled in the conversion increases, the calculation processing amount also increases. In particular, in the case of a mobile terminal, the limit of hardware performance of the mobile terminal is lower than that of a stationary machine, and as a result, the processing load on the mobile terminal is excessive, which may hinder the operation of existing functions.

開示の技術は、上記に鑑みてなされたものであって、計測領域の検出時に実行される演算処理量を低減できる画像処理装置、画像処理プログラム及び画像処理方法を提供することを目的とする。   The disclosed technique has been made in view of the above, and an object thereof is to provide an image processing apparatus, an image processing program, and an image processing method capable of reducing the amount of calculation processing executed when a measurement region is detected.

本願の開示する画像処理装置は、画像を取得する取得部を有する。さらに、前記画像処理装置は、前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングして分けるグルーピング部を有する。さらに、前記画像処理装置は、グルーピングされた領域の輪郭を形成する輪郭画素ごとに当該輪郭画素が領域の輪郭上にある他の輪郭画素と連接する連接角度を算出する算出部を有する。さらに、前記画像処理装置は、前記領域を形成する輪郭線を前記輪郭画素の連接角度の変化が所定の閾値以内である区間で分割することによって前記輪郭線から部分輪郭線を抽出する抽出部を有する。さらに、前記画像処理装置は、グルーピングして分けた領域から前記部分輪郭線の垂線同士の交点が最も多い領域を検出する検出部を有する。   An image processing apparatus disclosed in the present application includes an acquisition unit that acquires an image. Furthermore, the image processing apparatus includes a grouping unit that groups and separates pixels having similar pixel values between adjacent pixels among the pixels included in the image. Furthermore, the image processing apparatus includes a calculation unit that calculates a connection angle at which each of the contour pixels forming the contour of the grouped region is connected to another contour pixel on the contour of the region. Furthermore, the image processing apparatus includes an extraction unit that extracts a partial contour line from the contour line by dividing the contour line forming the region in a section in which a change in the connection angle of the contour pixels is within a predetermined threshold. Have. Furthermore, the image processing apparatus includes a detection unit that detects a region having the largest number of intersections between the perpendicular lines of the partial contour lines from the grouped regions.

本願の開示する画像処理装置の一つの態様によれば、計測領域の検出時に実行される演算処理量を低減できるという効果を奏する。   According to one aspect of the image processing apparatus disclosed in the present application, there is an effect that it is possible to reduce the amount of calculation processing executed when the measurement region is detected.

図1は、実施例1に係るカラーパッチの上面図である。FIG. 1 is a top view of the color patch according to the first embodiment. 図2は、実施例1に係る画像処理装置の機能的構成を示すブロック図である。FIG. 2 is a block diagram illustrating a functional configuration of the image processing apparatus according to the first embodiment. 図3は、カラーパッチが写る画像の一例を示す図である。FIG. 3 is a diagram illustrating an example of an image in which a color patch is captured. 図4は、グルーピング結果の一例を示す図である。FIG. 4 is a diagram illustrating an example of the grouping result. 図5は、X方向フィルタの一例を示す図である。FIG. 5 is a diagram illustrating an example of the X-direction filter. 図6は、Y方向フィルタの一例を示す図である。FIG. 6 is a diagram illustrating an example of the Y-direction filter. 図7は、輝度勾配の角度を示す図である。FIG. 7 is a diagram showing the angle of the luminance gradient. 図8は、連接角度データの構成例を示す図である。FIG. 8 is a diagram illustrating a configuration example of connection angle data. 図9は、部分輪郭線の抽出例を示す図である。FIG. 9 is a diagram illustrating an example of extracting a partial outline. 図10は、部分輪郭線の抽出結果のイメージ例を示す図である。FIG. 10 is a diagram illustrating an example of an image of a partial outline extraction result. 図11は、部分輪郭線データの構成例を示す図である。FIG. 11 is a diagram illustrating a configuration example of the partial outline data. 図12は、部分輪郭線の垂線同士の交点の一例を示す図である。FIG. 12 is a diagram illustrating an example of an intersection of perpendicular lines of partial contour lines. 図13は、交点の投票結果のイメージ例を示す図である。FIG. 13 is a diagram illustrating an image example of the voting result of the intersection. 図14は、交点の投票結果の一例を示す図である。FIG. 14 is a diagram illustrating an example of the voting result of the intersection. 図15は、マッピングの一例を示す図である。FIG. 15 is a diagram illustrating an example of mapping. 図16は、マッピング出力の一例を示す図である。FIG. 16 is a diagram illustrating an example of the mapping output. 図17は、実施例1に係る画像処理装置の全体処理の手順を示すフローチャートである。FIG. 17 is a flowchart of an overall process procedure of the image processing apparatus according to the first embodiment. 図18は、実施例1に係る連接角度の算出処理の手順を示すフローチャートである。FIG. 18 is a flowchart illustrating a procedure of a connection angle calculation process according to the first embodiment. 図19は、実施例1に係る部分輪郭線の抽出処理の手順を示すフローチャートである。FIG. 19 is a flowchart illustrating the procedure of the partial outline extraction process according to the first embodiment. 図20は、実施例1に係る計測領域の検出処理の手順を示すフローチャート(1)である。FIG. 20 is a flowchart (1) illustrating the procedure of the measurement region detection process according to the first embodiment. 図21は、実施例1に係る計測領域の検出処理の手順を示すフローチャート(2)である。FIG. 21 is a flowchart (2) illustrating the procedure of the measurement region detection process according to the first embodiment. 図22は、応用例を説明するための図である。FIG. 22 is a diagram for explaining an application example. 図23は、実施例1及び実施例2に係る画像処理プログラムを実行するコンピュータの一例について説明するための図である。FIG. 23 is a schematic diagram illustrating an example of a computer that executes an image processing program according to the first and second embodiments.

以下に、本願の開示する画像処理装置、画像処理プログラム及び画像処理方法の実施例を図面に基づいて詳細に説明する。なお、この実施例は開示の技術を限定するものではない。そして、各実施例は、処理内容を矛盾させない範囲で適宜組み合わせることが可能である。   Embodiments of an image processing apparatus, an image processing program, and an image processing method disclosed in the present application will be described below in detail with reference to the drawings. Note that this embodiment does not limit the disclosed technology. Each embodiment can be appropriately combined within a range in which processing contents are not contradictory.

[カラーパッチ1の構造]
まず、本実施例に係るカラーパッチの構造について説明する。図1は、実施例1に係るカラーパッチ1の上面図である。図1の例では、色の標示領域が形成された表示面を上とし、色を計測する対象物に接する表示面の裏面を下としてカラーパッチ1の表示面を上から見た場合の上面図を示す。なお、以下では、肌の診断サービスを提供するために、人の肌の色をカラーパッチ1を用いて計測する場合を想定する。
[Structure of color patch 1]
First, the structure of the color patch according to the present embodiment will be described. FIG. 1 is a top view of the color patch 1 according to the first embodiment. In the example of FIG. 1, a top view when the display surface of the color patch 1 is viewed from the top with the display surface on which the color marking area is formed as the top and the back surface of the display surface in contact with the object whose color is to be measured as the bottom Indicates. In the following, it is assumed that the color of a person's skin is measured using the color patch 1 in order to provide a skin diagnosis service.

図1に示すように、カラーパッチ1は、色を計測する対象者に貼付または載置された上で計測部位とともに撮像されることによって、撮影が行われた画像に計測部位と同様に光源の影響を受けたカラーパッチ1を写り込ませるためのものである。   As shown in FIG. 1, the color patch 1 is attached to or placed on a subject whose color is to be measured, and then is imaged together with the measurement region. This is for reflecting the affected color patch 1.

ここで、本実施例に係るカラーパッチ1は、カラーパッチ1の表示面及び裏面を貫通する貫通孔3が形成される。このように、カラーパッチ1の中央部に貫通孔3を形成するのは、色を計測する対象者にカラーパッチ1が貼付された場合に、貫通孔3から計測部位である対象者の肌を計測領域として露出させるためである。そして、貫通孔3から対象者の肌が露出すると、カラーパッチ1の表示面に形成された標示領域C1〜C16は、対象者の肌を取り囲むように配置されることになる。   Here, in the color patch 1 according to the present embodiment, a through hole 3 penetrating the display surface and the back surface of the color patch 1 is formed. Thus, the through-hole 3 is formed in the central portion of the color patch 1 when the color patch 1 is affixed to the subject whose color is to be measured. This is for exposing as a measurement region. And if a subject's skin is exposed from the through-hole 3, the marking area | regions C1-C16 formed in the display surface of the color patch 1 will be arrange | positioned so that a subject's skin may be surrounded.

このため、本実施例に係るカラーパッチ1では、互いに貫通孔3を中心に円環状に配置された各々の標示領域を、漏れなく計測部位に近接させることが可能になる。それゆえ、本実施例に係るカラーパッチ1は、色の標示をマトリクス状に二次元配列された従来のカラーパッチよりも、計測部位に近接する部分を大きくすることができる。   For this reason, in the color patch 1 according to the present embodiment, it is possible to bring the respective marking areas arranged in an annular shape around the through hole 3 to be close to the measurement site without omission. Therefore, the color patch 1 according to the present embodiment can make the portion closer to the measurement site larger than the conventional color patch in which the color markings are two-dimensionally arranged in a matrix.

さらに、本実施例に係るカラーパッチ1では、同一色の標示領域C1、C6、C9及びC14が貫通孔3を挟んで表示面の両側に夫々形成される。さらに、同一の標示領域C2、C5、C10及びC13についても貫通孔3を挟んで表示面の両側に夫々形成される。また、同一の標示領域C3、C8、C11及びC16についても貫通孔3を挟んで表示面の両側に夫々形成される。さらに、同一の標示領域C4、C7、C12及びC15についても貫通孔3を挟んで表示面の両側に夫々形成される。   Furthermore, in the color patch 1 according to the present embodiment, the marking areas C1, C6, C9, and C14 of the same color are formed on both sides of the display surface with the through hole 3 interposed therebetween. Furthermore, the same marking areas C2, C5, C10, and C13 are also formed on both sides of the display surface with the through hole 3 interposed therebetween. Further, the same marking areas C3, C8, C11, and C16 are also formed on both sides of the display surface with the through hole 3 interposed therebetween. Furthermore, the same marking areas C4, C7, C12 and C15 are also formed on both sides of the display surface with the through hole 3 interposed therebetween.

図1に示す標示領域C1、C6、C9及びC14と、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とは、各々が同一色の標示がなされた表示面上の領域である。このうち、標示領域C1と標示領域C9は、互いに向かい合わせのペアで配置される。さらに、標示領域C6と標示領域C14も、互いに向かい合わせのペアで配置される。また、標示領域C2、C5、C10及びC13、標示領域C3、C8、C11及びC16及び標示領域C4、C7、C12及びC15についても、標示領域C1、C6、C9及びC14と比べて、色の種類が異なるものの、互いの位置関係は同様である。   The marking areas C1, C6, C9 and C14, the marking areas C2, C5, C10 and C13, the marking areas C3, C8, C11 and C16, and the marking areas C4, C7, C12 and C15 shown in FIG. Is an area on the display surface on which the same color is marked. Among these, the marking area C1 and the marking area C9 are arranged in pairs facing each other. Furthermore, the marking area C6 and the marking area C14 are also arranged in pairs facing each other. In addition, the marking areas C2, C5, C10 and C13, the marking areas C3, C8, C11 and C16 and the marking areas C4, C7, C12 and C15 are also different from the marking areas C1, C6, C9 and C14. Are different, but the mutual positional relationship is the same.

このように、同一色の標示領域を互いに向かわせの状態で配置するのは、カラーパッチ1の標示領域が本来有する色と、計測部位とともに画像に写るカラーパッチ1の標示領域の色との変化量を用いて画像に写る対象者の肌の色を後述の画像処理装置10に補正させる場合に正確な変化量を算出させるためである。   As described above, the marking areas of the same color are arranged so as to face each other because the color of the marking area of the color patch 1 originally changes and the color of the marking area of the color patch 1 that appears in the image together with the measurement site. This is because an accurate change amount is calculated when the image processing apparatus 10 described later corrects the skin color of the subject appearing in the image using the amount.

すなわち、一箇所の標示領域における変化量を観測しただけでは、補正によって対象者の肌の色を再現するには不十分な場合がある。なぜなら、対象者の肌が光源によって受ける影響は、必ずしも計測領域全体にわたって一様ではないからである。このことから、本実施例に係るカラーパッチ1では、一様でない変化を変化量へ反映させるために、計測領域を象る輪郭の両端に近接するペアの位置もしくはそれに準ずるペアの位置に同一色の標示領域をペアで配置することとした。これによって、同一色の標示領域のうちペアとされた標示領域は、互いに計測領域を象る輪郭の両端に近接する位置もしくはそれに準ずる位置において光源による影響を受けることとなる。それゆえ、同一色の標示領域のうちペアとされた標示領域に挟み込まれた部分の色の変化量を正確に算出させることができる。さらに、本実施例に係るカラーパッチ1では、4種類の色、加えて、同一色につき2組にわたるペアの標示領域を画像に写り込ませることができる。よって、計測領域全体にわたって光源による影響が反映された変化量を後述の画像処理装置10に算出させることができる。   That is, it may be insufficient to reproduce the color of the subject's skin simply by observing the amount of change in one marking area. This is because the influence on the subject's skin by the light source is not necessarily uniform over the entire measurement region. Therefore, in the color patch 1 according to the present embodiment, in order to reflect a non-uniform change in the amount of change, the same color is used at the position of the pair close to both ends of the contour representing the measurement region or the position of the pair equivalent thereto. The marking areas were arranged in pairs. As a result, the paired marking areas among the marking areas of the same color are affected by the light source at positions close to or opposite to both ends of the contour that represents the measurement area. Therefore, it is possible to accurately calculate the amount of change in the color of the portion sandwiched between the paired marking areas among the marking areas of the same color. Furthermore, in the color patch 1 according to the present embodiment, four types of colors and two pairs of marking areas for the same color can be reflected in the image. Therefore, it is possible to cause the image processing apparatus 10 described later to calculate the amount of change reflecting the influence of the light source over the entire measurement region.

さらに、同一色の標示領域をペアにして配置する場合には、貫通孔3の中心を基準に点対称に配置されるのが好ましい。例えば、図1に示すように、標示領域C1と標示領域C9のペア、さらには、標示領域C6と標示領域C14のペアのごとく、互いに同じ大きさ、かつ同じ形状の標示領域を正対して配置する。さらに、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とについても、C1、C6、C9及びC14と同様に、2組のペアが点対称に配置される。これによって、計測領域に近接する標示領域の変化量を計測領域の対角線上で算出させるとともに、同じ大きさ及び同じ形状の標示領域が光源によって受けた影響を等分に反映した変化量を算出させることが可能となる。   Furthermore, when arranging the marking area | region of the same color as a pair, it is preferable to arrange | position symmetrically about the center of the through-hole 3 as a reference | standard. For example, as shown in FIG. 1, a pair of a marking area C1 and a marking area C9, or a pair of a marking area C6 and a marking area C14 are arranged facing each other with the same size and the same shape. To do. Further, the marking areas C2, C5, C10 and C13, the marking areas C3, C8, C11 and C16, and the marking areas C4, C7, C12 and C15, as well as C1, C6, C9 and C14, are two sets. Are arranged symmetrically. As a result, the amount of change in the marking area adjacent to the measurement area is calculated on the diagonal line of the measurement area, and the amount of change that equally reflects the influence of the label area of the same size and shape on the light source is calculated. It becomes possible.

このように、本実施例に係るカラーパッチ1では、互いに貫通孔3を中心に円環状に配置された各々の標示領域を、漏れなく計測部位に近接させることが可能になる。さらに、本実施例に係るカラーパッチ1が計測部位とともに撮影された場合には、当該撮影された画像から同一色の標示領域のうちペアとされた標示領域に挟み込まれた部分の色の変化量を正確に算出させることができる。それゆえ、カラーパッチ1に配置された標示領域の色の変化量を用いて画像に写った計測部位の色を補正させる場合に、計測部位が本来有する色もしくはそれに近い色を再現する確率を高めることができる。したがって、本実施例に係るカラーパッチ1によれば、色の計測精度を向上させることができる。   As described above, in the color patch 1 according to the present embodiment, it is possible to bring the respective marking areas arranged in an annular shape around the through hole 3 to be close to the measurement site without omission. Further, when the color patch 1 according to the present embodiment is photographed together with the measurement site, the amount of change in the color of the portion sandwiched between the paired labeling areas among the labeling areas of the same color from the photographed image. Can be calculated accurately. Therefore, when correcting the color of the measurement region shown in the image using the amount of change in the color of the marking area arranged in the color patch 1, the probability of reproducing the original color of the measurement region or a color close thereto is increased. be able to. Therefore, according to the color patch 1 according to the present embodiment, the color measurement accuracy can be improved.

また、本実施例に係るカラーパッチ1には、白色の標示領域W1〜W4が所定の間隔、例えば90度間隔で配置される。このため、計測領域に近接する4つの白色の標示領域W1〜W4が画像に写った際の画素値を用いてホワイトバランスを補正させることができる。   Further, in the color patch 1 according to the present embodiment, white marking areas W1 to W4 are arranged at a predetermined interval, for example, an interval of 90 degrees. For this reason, it is possible to correct the white balance by using the pixel values when the four white marking areas W1 to W4 adjacent to the measurement area appear in the image.

さらに、本実施例に係るカラーパッチ1は、表示面の外周および表示面の内周を形成する貫通孔3の形状を円形に形成することによってカラーパッチ1の外形を円環状に形成する。これによって、後述のカメラ11によって計測部位とともに撮影される計測領域を円形にするとともに、カラーパッチ1の外形を円環状にすることができる。このため、カラーパッチ1の表示面が正面から撮影されずに正面以外の多角的な向きから撮影されたとしても、撮影された画像には、対象者の肌における計測領域やカラーパッチ1の表示面の変形を楕円形に抑えることができる。よって、撮影された画像から計測領域や表示面を検出させやすくできる。また、本実施例に係るカラーパッチ1では、カラーパッチ1の外周または内周を円形または楕円形に形成するので、カラーパッチ1と計測部位を撮影する時にカメラのファインダ画面にガイドを表示する場合に、カラーパッチ1がカメラのレンズに収まる向きに依らず、ガイドの向きを定常的に表示させることができるので、デザイン性とユーザビリティを向上させることもできる。   Furthermore, in the color patch 1 according to the present embodiment, the outer shape of the color patch 1 is formed in an annular shape by forming the shape of the through hole 3 forming the outer periphery of the display surface and the inner periphery of the display surface in a circular shape. As a result, the measurement area photographed together with the measurement site by the camera 11 to be described later can be circular, and the outer shape of the color patch 1 can be circular. For this reason, even if the display surface of the color patch 1 is not photographed from the front but photographed from various directions other than the front, the photographed image displays the measurement area and the color patch 1 on the subject's skin. Surface deformation can be suppressed to an elliptical shape. Therefore, it is possible to easily detect the measurement region and the display surface from the captured image. Further, in the color patch 1 according to the present embodiment, the outer periphery or inner periphery of the color patch 1 is formed in a circle or an ellipse, so that a guide is displayed on the camera finder screen when photographing the color patch 1 and the measurement site. In addition, since the direction of the guide can be displayed constantly regardless of the direction in which the color patch 1 fits in the lens of the camera, the design and usability can be improved.

加えて、本実施例に係るカラーパッチ1では、表示面を外周側の円環と内周側の円環の二層に分けて、標示領域C1、C6、C9及びC14と、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とを配置する。このため、外周側の円環と内周側の円環に分けずに標示領域を配置する場合に比べて、より多くの標示領域を効率的に配置することができる。   In addition, in the color patch 1 according to the present embodiment, the display surface is divided into two layers of an outer ring and an inner ring, and the marking areas C1, C6, C9, and C14, the marking area C2, C5, C10, and C13, marking areas C3, C8, C11, and C16, and marking areas C4, C7, C12, and C15 are arranged. For this reason, it is possible to efficiently arrange a larger number of marking areas as compared with the case where the marking areas are arranged without being divided into an outer ring and an inner ring.

なお、図1に示した標示領域C1、C6、C9及びC14と、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とに標示させる色には、任意の色を採用することができる。好ましくは、肌色に類する色を採用するのがよい。例えば、4色の標示領域を配置する場合には、RGB(Red-Green-Blue color model)空間上で一般に人の肌色が分布すると想定される領域の外縁を囲む位置に分布する色、例えば肌色よりも赤みがかった色や黄みがかった色などを採用することができる。なお、カラーパッチ1の表示面上で表示される標示領域の色は、印刷によって着色されたものあってもよいし、その他の方法によって着色されたものであってもよい。   In addition, the marking areas C1, C6, C9, and C14, the marking areas C2, C5, C10, and C13, the marking areas C3, C8, C11, and C16, and the marking areas C4, C7, C12, and C15 illustrated in FIG. Any color can be adopted as the color to be displayed. Preferably, a color similar to skin color is employed. For example, when a four-color marking area is arranged, a color distributed in a position surrounding an outer edge of an area in which human skin color is generally distributed in RGB (Red-Green-Blue color model) space, for example, skin color A reddish or yellowish color can be used. In addition, the color of the marking area displayed on the display surface of the color patch 1 may be colored by printing, or may be colored by other methods.

また、図1の例では、カラーパッチ1が色の計測に関係のある標示領域だけを有する場合を例示したが、カラーパッチ1の表示面またはカラーパッチ1の外周の外側にロゴ、装飾やコードなどが図案化されることとしてもかまわない。   Further, in the example of FIG. 1, the case where the color patch 1 has only a marking area related to color measurement is illustrated, but a logo, a decoration, or a code is displayed outside the display surface of the color patch 1 or the outer periphery of the color patch 1. Etc. may be designed as a design.

なお、カラーパッチ1の貫通孔3の形状を円や楕円に代えて、多角形や矩形などの他の形状としても良い。   The shape of the through hole 3 of the color patch 1 may be other shapes such as a polygon or a rectangle instead of a circle or an ellipse.

[画像処理装置の構成]
続いて、本実施例に係る画像処理装置の機能的構成について説明する。図2は、実施例1に係る画像処理装置の機能的構成を示すブロック図である。図2に示す画像処理装置10は、カメラ11等によって撮影された画像の中からカラーパッチ1の貫通孔3によって形成された計測領域を検出する画像処理を実行するものである。
[Configuration of image processing apparatus]
Subsequently, a functional configuration of the image processing apparatus according to the present embodiment will be described. FIG. 2 is a block diagram illustrating a functional configuration of the image processing apparatus according to the first embodiment. An image processing apparatus 10 shown in FIG. 2 performs image processing for detecting a measurement region formed by the through holes 3 of the color patch 1 from images taken by the camera 11 or the like.

かかる画像処理装置10の一態様としては、デジタルカメラが接続されたパーソナルコンピュータやカメラ機能を搭載するスマートフォン等の携帯端末に上記の画像処理サービスを提供する画像処理プログラムをインストールさせることにより実装できる。他の一態様としては、上記の画像処理プログラムを実行するWebサーバとして実装することとしてもよいし、また、画像処理サービスをアウトソーシングにより提供するクラウドとして実装することもできる。   As an aspect of the image processing apparatus 10, the image processing apparatus 10 can be implemented by installing an image processing program for providing the image processing service on a personal computer connected with a digital camera or a mobile terminal such as a smartphone equipped with a camera function. As another aspect, it may be implemented as a Web server that executes the above-described image processing program, or may be implemented as a cloud that provides image processing services through outsourcing.

図2に示すように、画像処理装置10は、カメラ11と、記憶部13と、制御部15とを有する。なお、画像処理装置10は、図2に示した機能部以外にも既知のコンピュータが有する各種の機能部、例えば各種の入力デバイス、音声出力デバイスや外部の装置と通信を行うための通信インタフェースなどの機能部を有することとしてもかまわない。   As illustrated in FIG. 2, the image processing apparatus 10 includes a camera 11, a storage unit 13, and a control unit 15. Note that the image processing apparatus 10 includes various functional units included in known computers other than the functional units illustrated in FIG. 2, such as various input devices, audio output devices, and communication interfaces for communicating with external devices. It does not matter as having the functional part.

カメラ11は、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)などを用いた撮像装置である。かかるカメラ11の実装例としては、デジタルカメラを接続することとしてもよいし、携帯端末のように、カメラが予め搭載されている場合にはそのカメラを使用することができる。なお、ここでは、画像処理装置10がカメラ11を有する場合を例示したが、ネットワーク経由または記憶デバイス経由で画像を取得できる場合には、必ずしもカメラ11を有する必要はない。   The camera 11 is an imaging device using a CCD (Charge Coupled Device), a CMOS (Complementary Metal Oxide Semiconductor), or the like. As an implementation example of the camera 11, a digital camera may be connected, or the camera can be used when the camera is mounted in advance, such as a mobile terminal. Although the case where the image processing apparatus 10 includes the camera 11 is illustrated here, the image does not necessarily need to include the camera 11 when an image can be acquired via a network or a storage device.

記憶部13は、制御部15で実行されるOS(Operating System)や画像処理プログラムなどの各種プログラムを記憶する記憶デバイスである。記憶部13の一態様としては、フラッシュメモリなどの半導体メモリ素子、ハードディスク、光ディスクなどの記憶装置が挙げられる。また、記憶部13は、上記の種類の記憶装置に限定されるものではなく、RAM(Random Access Memory)、ROM(Read Only Memory)であってもよい。記憶部13は、制御部15で実行されるプログラムに用いられるデータの一例として、後述する連接角度データ13a、部分輪郭線データ13bや投票データ13cなどを記憶する。   The storage unit 13 is a storage device that stores various programs such as an OS (Operating System) executed by the control unit 15 and an image processing program. As one aspect of the storage unit 13, a storage device such as a semiconductor memory element such as a flash memory, a hard disk, or an optical disk can be cited. The storage unit 13 is not limited to the above-mentioned types of storage devices, and may be a RAM (Random Access Memory) or a ROM (Read Only Memory). The storage unit 13 stores connection angle data 13a, partial outline data 13b, voting data 13c, and the like, which will be described later, as an example of data used in a program executed by the control unit 15.

制御部15は、各種の処理手順を規定したプログラムや制御データを格納するための内部メモリを有し、これらによって種々の処理を実行する。制御部15は、図2に示すように、取得部15aと、グルーピング部15bと、算出部15cと、抽出部15dと、検出部15eと、対応付け部15fと、出力部15gとを有する。   The control unit 15 has an internal memory for storing programs defining various processing procedures and control data, and executes various processes using these. As shown in FIG. 2, the control unit 15 includes an acquisition unit 15a, a grouping unit 15b, a calculation unit 15c, an extraction unit 15d, a detection unit 15e, an association unit 15f, and an output unit 15g.

取得部15aは、画像を取得する処理部である。一態様としては、取得部15aは、カメラ11によって撮影される画像を取得する。他の一様としては、取得部15aは、インターネットやLAN(Local Area Network)などのネットワークを介して画像を取得することもできる。更なる一態様としては、取得部15aは、メモリやハードディスクのみならず、メモリカードやUSB(Universal Serial Bus)メモリなどの補助記憶装置から画像を取得することもできる。   The acquisition unit 15a is a processing unit that acquires an image. As one aspect, the acquisition unit 15a acquires an image photographed by the camera 11. As another uniformity, the acquisition unit 15a can also acquire an image via a network such as the Internet or a LAN (Local Area Network). As a further aspect, the acquisition unit 15a can acquire an image from an auxiliary storage device such as a memory card or a USB (Universal Serial Bus) memory as well as a memory and a hard disk.

グルーピング部15bは、画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングする処理部である。一態様としては、グルーピング部15bは、取得部15aによって取得された画像に含まれる画素のうち輝度が所定の閾値、例えば100以上である画素を対象に、隣接する画素間でR成分、G成分及びB成分が類似する画素同士をグルーピングする。このように、閾値以上の画素に絞ってグルーピングするのは、カラーパッチ1の標示領域および計測領域に露出すると想定される肌に対応する画素以外の画素をグルーピングの対象から除外することによって処理の精度および効率を向上させるためである。その後、グルーピング部15bは、グルーピングの結果として得られた領域に当該領域を識別する領域番号を付与する。   The grouping unit 15b is a processing unit that groups pixels having similar pixel values between adjacent pixels among the pixels included in the image. As one aspect, the grouping unit 15b is configured such that, among pixels included in the image acquired by the acquisition unit 15a, a pixel whose luminance is a predetermined threshold, for example, 100 or more, is an R component and a G component between adjacent pixels. And pixels having similar B components are grouped. As described above, the grouping is performed by narrowing down to pixels that are equal to or greater than the threshold value by excluding the pixels other than the pixels corresponding to the skin that are assumed to be exposed in the indication area and the measurement area of the color patch 1 from the grouping target. This is to improve accuracy and efficiency. Thereafter, the grouping unit 15b assigns an area number for identifying the area to the area obtained as a result of the grouping.

ここで、図3及び図4を用いて、グルーピングの具体例について説明する。図3は、カラーパッチ1が写る画像の一例を示す図である。図4は、グルーピング結果の一例を示す図である。図3に示す画像にグルーピングが実行された場合には、図4に示す領域番号1〜23の23個の領域が抽出される。図3に示すように、対象者の肌にカラーパッチ1が貼付された上で画像が撮像される場合には、図4に示すように、色の計測に有用な領域と色の計測には無関係な領域とが混在した状態でグルーピング結果が得られる。図4の例で言えば、貫通孔3から露出する肌の計測領域やカラーパッチ1の標示領域などの色の計測に有用な領域が領域番号2〜23(領域番号12を除く)として抽出される。これとともに、カラーパッチ1とは無関係な背景等の領域が領域番号1や領域番号12として抽出される。   Here, a specific example of grouping will be described with reference to FIGS. 3 and 4. FIG. 3 is a diagram illustrating an example of an image in which the color patch 1 is captured. FIG. 4 is a diagram illustrating an example of the grouping result. When grouping is performed on the image shown in FIG. 3, 23 areas of area numbers 1 to 23 shown in FIG. 4 are extracted. As shown in FIG. 3, when an image is picked up after the color patch 1 is applied to the skin of the subject person, as shown in FIG. The grouping result can be obtained in a state where irrelevant areas are mixed. In the example of FIG. 4, regions useful for color measurement such as the skin measurement region exposed from the through hole 3 and the marking region of the color patch 1 are extracted as region numbers 2 to 23 (excluding region number 12). The At the same time, an area such as a background that is not related to the color patch 1 is extracted as area number 1 or area number 12.

算出部15cは、領域の輪郭を形成する画素ごとに当該画素が領域の輪郭上にある他の画素と連接する連接角度を算出する処理部である。以下では、領域の輪郭を形成する線のことを「輪郭線」と記載するとともに、領域の輪郭を形成する画素、言い換えれば輪郭線を形成する画素のことを「輪郭点」と記載し、当該輪郭点に採番される番号のことを「輪郭点番号」と記載する場合がある。   The calculation unit 15c is a processing unit that calculates, for each pixel forming the outline of the area, a connection angle at which the pixel is connected to other pixels on the outline of the area. In the following, the line that forms the contour of the region is referred to as “contour line”, and the pixel that forms the contour of the region, in other words, the pixel that forms the contour line is referred to as “contour point”. The number assigned to the contour point may be described as “contour point number”.

一態様としては、算出部15cは、グルーピング部15bによってグルーピングされた領域に含まれる各輪郭点に輪郭点番号を採番する。このとき、算出部15cは、任意の輪郭点を起点とし、起点から各輪郭点が連接する順に輪郭点番号を採番できる。例えば、画像を含む平面において画像の幅方向をX軸とし、画像の高さ方向をY軸としたとき、輪郭点のうちXまたはYの最小値を持つ輪郭点を起点とすることもできるし、任意の点、例えば原点から最短距離にある輪郭点を起点として輪郭点番号を採番できる。その上で、算出部15cは、輪郭点を1つ選択し、選択した輪郭点および輪郭点を中心とする周辺画素にX方向フィルタ及びY方向フィルタを適用する。   As one aspect, the calculation unit 15c assigns a contour point number to each contour point included in the region grouped by the grouping unit 15b. At this time, the calculation unit 15c can start with an arbitrary contour point and assign contour point numbers in the order in which the contour points are connected to the starting point. For example, in the plane including the image, when the width direction of the image is the X axis and the height direction of the image is the Y axis, the contour point having the minimum value of X or Y can be set as the starting point. A contour point number can be assigned starting from an arbitrary point, for example, a contour point at the shortest distance from the origin. In addition, the calculation unit 15c selects one contour point, and applies the X-direction filter and the Y-direction filter to the selected contour point and peripheral pixels centered on the contour point.

図5は、X方向フィルタの一例を示す図である。図6は、Y方向フィルタの一例を示す図である。図5に示すように、X方向フィルタは、3×3の要素が配列されたフィルタであり、中央の要素を含む列にはゼロ、左側の列には負の値、右側の列には正の値がフィルタ係数として設定されている。また、図6に示すように、Y方向フィルタは、3×3の要素が配列されたフィルタであり、中央の要素を含む行にはゼロ、上側の行には負の値、下側の行には正の値がフィルタ係数として設定されている。なお、図5及び図6の例では、3×3の要素が配列されたフィルタを例示したが、任意の数、例えば9×9や16×16などの要素が配列されたフィルタを用いることができる。   FIG. 5 is a diagram illustrating an example of the X-direction filter. FIG. 6 is a diagram illustrating an example of the Y-direction filter. As shown in FIG. 5, the X-direction filter is a filter in which 3 × 3 elements are arranged. Zero is applied to the column including the central element, negative value is applied to the left column, and positive is applied to the right column. Is set as a filter coefficient. In addition, as shown in FIG. 6, the Y-direction filter is a filter in which 3 × 3 elements are arranged. Zero is applied to the row including the central element, negative value is applied to the upper row, and lower row is processed. A positive value is set as a filter coefficient. 5 and 6 exemplifies a filter in which 3 × 3 elements are arranged, but an arbitrary number of filters, for example, elements in which 9 × 9, 16 × 16, and the like are arranged may be used. it can.

図5に示すX方向フィルタを適用する場合には、注目画素である輪郭点の輝度値にX方向フィルタのうち中央の要素のフィルタ係数「0」が掛け算される。これとともに、輪郭点の周辺画素の輝度値にX方向フィルタに含まれる中央の要素以外の他の要素のフィルタ係数が掛け算される。例えば、輪郭点の上、右上、右、右下、下、左下、左、左上の各画素の輝度値に、X方向フィルタの一行二列目、一行三列目、二行三列目、三行三列目、三行二列目、三行一列目、二行一列目、一行一列目のフィルタ係数「0」、「1」、「2」、「1」、「0」、「-1」、「-2」、「-1」がそれぞれ掛け算される。その後、算出部15cは、輪郭点およびその周辺画素にフィルタ係数が掛け算された各々の値の和を計算することによって注目画素である輪郭点と周辺画素との間における輝度勾配のX成分を算出する。   When the X-direction filter shown in FIG. 5 is applied, the luminance value of the contour point that is the target pixel is multiplied by the filter coefficient “0” of the center element of the X-direction filter. At the same time, the luminance value of the peripheral pixels around the contour point is multiplied by the filter coefficient of other elements than the central element included in the X-direction filter. For example, the luminance value of each pixel above, upper right, right, lower right, lower, lower left, left, upper left of the contour point is set to the first row, second column, first row, third column, second row, third column, third of the X direction filter. Filter coefficients "0", "1", "2", "1", "0", "-1" for the third row, third row, second row, third row, first column, second row, first column, first row, first column ”,“ −2 ”,“ −1 ”, respectively. Thereafter, the calculation unit 15c calculates the X component of the luminance gradient between the contour point that is the target pixel and the peripheral pixel by calculating the sum of the values obtained by multiplying the contour point and the peripheral pixel by the filter coefficient. To do.

また、図6に示すY方向フィルタを適用する場合には、注目画素である輪郭点の輝度値にY方向フィルタのうち中央の要素のフィルタ係数「0」が掛け算される。これとともに、輪郭点の周辺画素の輝度値にY方向フィルタに含まれる中央の要素以外の他の要素のフィルタ係数が掛け算される。例えば、輪郭点の上、右上、右、右下、下、左下、左、左上の各画素の輝度値に、Y方向フィルタの一行二列目、一行三列目、二行三列目、三行三列目、三行二列目、三行一列目、二行一列目、一行一列目のフィルタ係数「-2」、「-1」、「0」、「1」、「2」、「1」、「0」、「-1」がそれぞれ掛け算される。その後、算出部15cは、輪郭点およびその周辺画素にフィルタ係数が掛け算された各々の値の和を計算することによって注目画素である輪郭点と周辺画素との間における輝度勾配のY成分を算出する。   When the Y-direction filter shown in FIG. 6 is applied, the luminance value of the contour point that is the target pixel is multiplied by the filter coefficient “0” of the center element of the Y-direction filter. At the same time, the luminance values of the peripheral pixels around the contour point are multiplied by the filter coefficients of elements other than the central element included in the Y-direction filter. For example, the luminance value of each pixel above, upper right, right, lower right, lower, lower left, left, upper left of the contour point is set to the first row, second column, first row, third column, second row, third column, third of the Y direction filter. Filter coefficients `` -2 '', `` -1 '', `` 0 '', `` 1 '', `` 2 '', `` 2 '', `` 2 '', `` 2 '', `` 2 '', `` 1 '', `` 2 '', `` 0 '' “1”, “0”, and “−1” are respectively multiplied. Thereafter, the calculation unit 15c calculates the Y component of the luminance gradient between the contour point that is the target pixel and the peripheral pixel by calculating the sum of the values obtained by multiplying the contour point and the peripheral pixel by the filter coefficient. To do.

これら輝度勾配のX成分及びY成分の算出後、算出部15cは、輝度勾配のX成分及びY成分を用いて、輪郭点の連接角度を算出する。図7は、輝度勾配の角度を示す図である。例えば、図7に示すように、算出部15cは、逆正接の関数「atan(X成分/Y成分)*180/3.14」に輝度勾配のX成分及びY成分の値を代入する計算、いわゆる逆正接を取ることによって輝度勾配の角度を算出する。ここでは、角度が画像の上方向を0度とし、そこから時計回りを正として表される場合を想定して以下の説明を行う。   After calculating the X and Y components of the brightness gradient, the calculation unit 15c calculates the connection angle of the contour points using the X and Y components of the brightness gradient. FIG. 7 is a diagram showing the angle of the luminance gradient. For example, as illustrated in FIG. 7, the calculation unit 15 c performs a calculation of substituting the values of the X component and the Y component of the luminance gradient into the arctangent function “atan (X component / Y component) * 180 / 3.14”, so-called inverse The angle of the luminance gradient is calculated by taking the tangent. Here, the following description will be made assuming that the angle is represented as 0 degree in the upward direction of the image and clockwise from there.

かかる輝度勾配の角度の直角方向が輪郭線の連接方向であることから、輝度勾配のX成分が正の値である場合には輝度勾配の角度に90度を加算する一方で、輝度勾配のX成分が負の値である場合には輝度勾配の角度に270度を加算する。これによって、輪郭点の連接角度が算出される。このとき、輝度勾配のX成分がゼロである場合には、輝度勾配の角度が発散する。よって、この場合には、逆正接を取らずに、輝度勾配のY成分がゼロよりも大きい場合には輪郭点の連接角度を180度とする一方で、輝度勾配のY成分がゼロ以下である場合には輪郭点の連接角度を0度とする。   Since the direction perpendicular to the angle of the luminance gradient is the connecting direction of the contour line, when the X component of the luminance gradient is a positive value, 90 degrees is added to the angle of the luminance gradient, while the luminance gradient X When the component is a negative value, 270 degrees is added to the angle of the luminance gradient. Thereby, the connecting angle of the contour points is calculated. At this time, when the X component of the luminance gradient is zero, the luminance gradient angle diverges. Therefore, in this case, when the Y component of the luminance gradient is larger than zero without taking the arctangent, the concatenated angle of the contour points is set to 180 degrees, while the Y component of the luminance gradient is less than zero. In this case, the connecting angle of the contour points is set to 0 degree.

なお、ここでは、輝度勾配の角度を輪郭点の連接角度へ換算する場合を例示したが、必ずしも換算を行う必要はなく、後段の処理において角度の変化として差が用いられるので、輝度勾配の角度を輪郭点の連接角度として用いることもできる。また、ここでは、逆正接を取る際に連接角度の単位を変換する例を説明したが、必ずしもラジアンからディグリーへ変換する必要はない。   Here, the case where the angle of the luminance gradient is converted into the concatenated angle of the contour point is illustrated, but it is not always necessary to perform conversion, and the difference is used as the change in angle in the subsequent processing, so the angle of the luminance gradient Can also be used as the connecting angle of contour points. In addition, here, an example in which the unit of the connection angle is converted when taking the arc tangent has been described, but it is not always necessary to convert from radians to degrees.

その後、算出部15cは、上述のようにして各領域に含まれる輪郭点ごとに連接角度を算出した上で各領域に含まれる輪郭点と連接角度とが対応付けられた連接角度データ13aを記憶部13へ登録する。図8は、連接角度データ13aの構成例を示す図である。図8に示す連接角度データ13aの例では、領域番号ごとに当該領域番号を持つ領域に含まれる輪郭点の輪郭点番号が対応付けられている。さらに、連接角度データ13aは、輪郭点番号ごとに当該輪郭点番号を持つ輪郭点が画像上で位置する座標(X,Y)および連接角度が対応付けられている。例えば、領域番号1の例で言えば、輪郭点番号1から輪郭点番号Nまでの座標および連接角度が領域番号1に対応付けられている。   Thereafter, the calculation unit 15c calculates the connection angle for each contour point included in each region as described above, and stores the connection angle data 13a in which the contour point included in each region is associated with the connection angle. Register to the unit 13. FIG. 8 is a diagram illustrating a configuration example of the connection angle data 13a. In the example of the connection angle data 13a shown in FIG. 8, the contour point numbers of the contour points included in the region having the region number are associated with each region number. Further, in the connection angle data 13a, the coordinates (X, Y) and the connection angle at which the contour point having the contour point number is located on the image are associated with each contour point number. For example, in the case of the region number 1, the coordinates from the contour point number 1 to the contour point number N and the connection angle are associated with the region number 1.

なお、上記の図8の例では、領域番号、輪郭点番号、座標および連接角度が対応付けられたデータを採用する場合を例示したが、連接角度データのスキームはこれに限定されない。例えば、開示の装置は、領域番号と輪郭点番号の対応付け、輪郭点番号と座標の対応付け、さらには、輪郭点番号と連接角度の対応付けを別のデータとして管理することもできる。   In the example of FIG. 8 described above, the case where the data in which the region number, the contour point number, the coordinates, and the connection angle are associated is illustrated, but the connection angle data scheme is not limited thereto. For example, the disclosed apparatus can manage the association between the region number and the contour point number, the association between the contour point number and the coordinate, and further the association between the contour point number and the connection angle as separate data.

図2の説明に戻り、抽出部15dは、領域を形成する輪郭線が分割された部分輪郭線を抽出する処理部である。一態様としては、抽出部15dは、連接角度の変化が所定の閾値を超える輪郭点で輪郭線を分割する。換言すれば、抽出部15dは、領域を形成する輪郭線を連接角度が大きく変化せずに輪郭点が連接する区間で分離する。   Returning to the description of FIG. 2, the extraction unit 15 d is a processing unit that extracts a partial contour line obtained by dividing a contour line that forms a region. As an aspect, the extraction unit 15d divides the contour line at contour points where the change in the connection angle exceeds a predetermined threshold. In other words, the extraction unit 15d separates the contour lines that form the region in a section where the contour points are connected without greatly changing the connection angle.

これを説明すると、抽出部15dは、記憶部13に記憶された連接角度データ13aを参照する。そして、抽出部15dは、連接角度データ13aに含まれる領域番号を1つ選択する。続いて、抽出部15dは、領域番号に対応付けられた輪郭点番号のうち1つを選択し、選択した輪郭点番号および連接角度を図示しない内部メモリに登録する。これによって、部分輪郭線の始点の候補となる輪郭点の連接角度が以降の処理で探索が実行される輪郭点の連接角度と比較するために一時記憶されることになる。   Explaining this, the extraction unit 15 d refers to the connection angle data 13 a stored in the storage unit 13. Then, the extracting unit 15d selects one area number included in the connection angle data 13a. Subsequently, the extraction unit 15d selects one of the contour point numbers associated with the region number, and registers the selected contour point number and the connection angle in an internal memory (not shown). As a result, the articulation angle of the contour point that is a candidate for the starting point of the partial contour line is temporarily stored for comparison with the articulation angle of the contour point that is searched in the subsequent processing.

その上で、抽出部15dは、領域の輪郭線上にある輪郭点番号を探索し、当該輪郭点番号を持つ輪郭点の連接角度と、内部メモリに部分輪郭線の始点の候補として一時記憶された輪郭点の連接角度との差分が所定の分割閾値を超えるか否かを判定する。ここで、上記の分割閾値には、カラーパッチ1の標示領域の輪郭のうち貫通孔3の同心円の円弧と貫通孔3へ向かう方向の線分との接続部分で判定の分岐が可能な程度の値を設定するのが好ましい。なお、カラーパッチ1の外周や内周の形状が楕円や多角形である場合には、その形状に応じて分割閾値を適宜変更することができる。   After that, the extraction unit 15d searches for the contour point number on the contour line of the region, and is temporarily stored as a candidate for the start point of the partial contour line in the internal memory and the connection angle of the contour point having the contour point number. It is determined whether or not the difference between the contour points and the connection angle exceeds a predetermined division threshold. Here, the division threshold value is such that determination can be branched at a connection portion between the concentric circular arc of the through hole 3 and the line segment in the direction toward the through hole 3 in the outline of the marking region of the color patch 1. It is preferable to set a value. In addition, when the shape of the outer periphery or inner periphery of the color patch 1 is an ellipse or a polygon, the division threshold can be appropriately changed according to the shape.

このとき、連接角度の差分が分割閾値を超える場合には、領域の輪郭を形成する輪郭線のうち始点の候補となる輪郭点から探索中の輪郭点までの区間で輪郭線の連接方向が大きく変化したと判別することができる。この場合には、抽出部15dは、探索中の輪郭点よりも以前に探索した輪郭点、例えば直前の輪郭点の分割フラグを有効化するとともに、当該探索中の輪郭点を部分輪郭線の始点の候補として輪郭点番号および連接角度を内部メモリに上書き登録する。例えば、抽出部15dは、内部メモリ上で輪郭線を分割する分割点とする分割フラグを「0」に初期化した上で領域に含まれる輪郭点ごとに配列しておき、分割閾値を超えた輪郭点の分割フラグを「1」へ更新する。これによって、領域の輪郭線を分割される結果、部分輪郭線を抽出することができる。   At this time, when the difference in the connecting angle exceeds the division threshold, the connecting direction of the contour line is large in the section from the contour point that is the candidate for the starting point to the contour point being searched among the contour lines that form the contour of the region. It can be determined that it has changed. In this case, the extraction unit 15d activates the division flag of the contour point searched before the contour point being searched, for example, the immediately preceding contour point, and sets the contour point being searched as the starting point of the partial contour line. The contour point number and the connection angle are overwritten and registered in the internal memory as candidates. For example, the extraction unit 15d initializes a division flag, which is a division point for dividing the contour line on the internal memory, and arranges it for each contour point included in the region, and exceeds the division threshold. Update the contour point division flag to "1". As a result, the partial outline can be extracted as a result of dividing the outline of the region.

一方、連接角度の差分が分割閾値以下である場合には、領域の輪郭を形成する輪郭線のうち始点の候補となる輪郭点から探索中の輪郭点までの区間で輪郭線の連接方向が大きくは変化していないと判別することができる。この場合には、抽出部15dは、未探索の輪郭点のうち今回に探索を行った輪郭点と連接する輪郭点の輪郭点番号を探索の対象とし、未探索の輪郭点がなくなるまで、上記の分割判定を繰り返し実行する。そして、抽出部15dは、未探索の輪郭点がなくなると、上記の分割判定を行っていない領域を探索の対象とし、未探索の領域がなくなるまで、上記の分割判定を繰り返し実行する。   On the other hand, when the difference in the connecting angle is equal to or smaller than the division threshold, the connecting direction of the contour line is large in the section from the contour point that is the candidate for the starting point to the contour point being searched among the contour lines that form the contour of the region. Can be determined as not changing. In this case, the extraction unit 15d searches for the contour point number of the contour point connected to the contour point searched this time among the unsearched contour points until the unsearched contour point disappears. The division determination is repeatedly executed. Then, when there is no unsearched contour point, the extraction unit 15d repeats the above-described division determination until there is no unsearched area, with an area that has not been subjected to the above-described division determination as a search target.

その後、抽出部15dは、全ての領域について上記の分割判定が終了すると、分割フラグが有効化された輪郭点とその次に探索された輪郭点との間で輪郭線を分割する。すなわち、抽出部15dは、領域の輪郭線を形成する全輪郭点の輪郭点番号の集合のうち、部分輪郭線の始点の候補となる輪郭点番号から分割フラグが有効化された輪郭点番号までの部分集合を部分輪郭線の輪郭点番号の集合として分離する。その上で、抽出部15dは、部分輪郭線を形成する輪郭点の輪郭点番号、座標および連接角度の集合を部分輪郭線データ13bとして記憶部13へ登録する。   After that, the extraction unit 15d divides the contour line between the contour point for which the division flag is validated and the contour point searched next after the above-described division determination is completed for all the regions. In other words, the extraction unit 15d includes, from the set of contour point numbers of all the contour points that form the contour line of the region, from the contour point number that is a candidate for the start point of the partial contour line to the contour point number for which the division flag is activated. Are separated as a set of contour point numbers of partial contour lines. After that, the extraction unit 15d registers the set of contour point numbers, coordinates, and connection angles of the contour points forming the partial contour line in the storage unit 13 as the partial contour line data 13b.

図9は、部分輪郭線の抽出例を示す図である。図9の例では、輪郭点Sを始点とし、輪郭点Eを終点として領域の輪郭を形成する輪郭線200を探索する場合を想定する。図9に示すように、輪郭点Sから探索が開始されると、探索が輪郭点Aに至るまでは貫通孔3の同心円の円弧が探索されることになる。よって、輪郭点Sと探索中の輪郭点との間における連接角度の差は微差に留まる。このため、探索が輪郭点Aに至るまでは、上記の分割判定において分割閾値を超えることはなく、分割フラグは有効化されない。その後、探索が輪郭点Aに至ると、貫通孔3の同心円の円弧の探索が終了して貫通孔3へ向かう方向の線分の探索が開始される段階に至る。すると、輪郭点Sと輪郭点Aとの間における連接角度の差が直角に至るほどまで逸脱する。このため、輪郭点Aを探索した段階で上記の分割判定において分割閾値を超え、輪郭点Aの直前に探索された輪郭点の分割フラグが有効化されるとともに、輪郭点Aが新たな部分輪郭線の始点の候補とされる。かかる分割フラグよって、輪郭線200が部分輪郭線210と未探索の輪郭線220とに分割されることになる。   FIG. 9 is a diagram illustrating an example of extracting a partial outline. In the example of FIG. 9, it is assumed that the contour line S that starts the contour point S and searches for the contour line 200 that forms the contour of the region with the contour point E as the end point is assumed. As shown in FIG. 9, when the search is started from the contour point S, a concentric circular arc of the through hole 3 is searched until the search reaches the contour point A. Therefore, the difference in the articulation angle between the contour point S and the contour point being searched remains a slight difference. For this reason, until the search reaches the contour point A, the division threshold is not exceeded in the above-described division determination, and the division flag is not validated. Thereafter, when the search reaches the contour point A, the search for the concentric circular arc of the through hole 3 is completed, and the search for the line segment in the direction toward the through hole 3 is started. Then, the connection angle difference between the contour point S and the contour point A deviates to a right angle. For this reason, when the contour point A is searched, the division threshold is exceeded in the above-described division determination, the contour point division flag searched immediately before the contour point A is validated, and the contour point A becomes a new partial contour. Candidate for the starting point of the line. With this division flag, the contour line 200 is divided into a partial contour line 210 and an unsearched contour line 220.

その後、探索が輪郭点Bに至るまでは、貫通孔3へ向かう方向の線分が探索されることになる。よって、輪郭点Aと探索中の輪郭点との間における連接角度の差は微差に留まる。このため、探索が輪郭点Bに至るまでは、上記の分割判定において分割閾値を超えることはなく、分割フラグは有効化されない。その後、探索が輪郭点Bに至ると、貫通孔3へ向かう方向の線分の探索が終了して貫通孔3の同心円の円弧の探索が開始される段階に至る。すると、輪郭点Aと輪郭点Bとの間における連接角度の差が直角に至るほどまで逸脱する。このため、輪郭点Bを探索した段階で上記の分割判定において分割閾値を超え、輪郭点Bの直前に探索された輪郭点の分割フラグが有効化されるとともに、輪郭点Bが新たな部分輪郭線の始点の候補とされる。かかる分割フラグによって、輪郭線200が部分輪郭線230と未探索の輪郭線240とにさらに分離されることになる。   Thereafter, until the search reaches the contour point B, a line segment in the direction toward the through hole 3 is searched. Therefore, the difference in the articulation angle between the contour point A and the contour point being searched remains a slight difference. For this reason, until the search reaches the contour point B, the division threshold is not exceeded in the above-described division determination, and the division flag is not validated. Thereafter, when the search reaches the contour point B, the search for the line segment in the direction toward the through hole 3 is completed, and the search for the concentric arc of the through hole 3 is started. Then, the connection angle difference between the contour point A and the contour point B deviates to a right angle. For this reason, when the contour point B is searched, the division threshold is exceeded in the above-mentioned division determination, the contour point division flag searched immediately before the contour point B is validated, and the contour point B becomes a new partial contour. Candidate for the starting point of the line. With this division flag, the contour line 200 is further separated into a partial contour line 230 and an unsearched contour line 240.

そして、輪郭点Bから終点である輪郭点Eまでの区間は、貫通孔3の同心円の円弧が探索されるので、輪郭点Aと探索中の輪郭点との間における連接角度の差は微差に留まる。よって、終点まで上記の分割判定において分割閾値を超えることはなく、分割フラグは有効化されない。よって、輪郭点Bを探索した時点では未探索であった輪郭線240がそのまま部分輪郭線として抽出されることになる。このようにして輪郭線200から部分輪郭線210、部分輪郭線230及び部分輪郭線240が抽出される。   In the section from the contour point B to the contour point E which is the end point, a concentric circular arc of the through hole 3 is searched, so that the difference in the connecting angle between the contour point A and the contour point being searched is slightly different. Stay on. Therefore, the division threshold is not exceeded in the above-described division determination until the end point, and the division flag is not validated. Therefore, the contour line 240 that has not been searched when the contour point B is searched is extracted as a partial contour line as it is. In this way, the partial outline 210, the partial outline 230, and the partial outline 240 are extracted from the outline 200.

図10は、部分輪郭線の抽出結果のイメージ例を示す図である。例えば、全ての領域の輪郭線について図9を用いて説明した分割判定および分割フラグの有効化が実行されると、図10に示す部分輪郭線が抽出される。図10に示すように、カラーパッチ1の標示領域の輪郭線のうち貫通孔3の同心円の円弧や貫通孔3へ向かう方向の線分が部分輪郭線として抽出される。この他にも、カラーパッチ1の貫通孔3の輪郭線、すなわち画像上で略円状の輪郭線が上記の分割閾値を超える前の輪郭点と上記の分割閾値を超えた後の輪郭点との間で順次分割される結果、貫通孔3の円弧が部分輪郭線として抽出される。   FIG. 10 is a diagram illustrating an example of an image of a partial outline extraction result. For example, when the division determination and the validation of the division flag described with reference to FIG. 9 are executed for the outlines of all regions, the partial outline shown in FIG. 10 is extracted. As shown in FIG. 10, a concentric circular arc of the through hole 3 or a line segment in the direction toward the through hole 3 is extracted as a partial outline from the outline of the marking region of the color patch 1. In addition to this, the contour line of the through hole 3 of the color patch 1, that is, the contour point before the substantially circular contour line on the image exceeds the division threshold, and the contour point after the division threshold is exceeded. As a result, the circular arc of the through hole 3 is extracted as a partial contour line.

図11は、部分輪郭線データ13bの構成例を示す図である。図11に示す部分輪郭線データ13bの例では、領域番号ごとに当該領域番号を持つ領域に含まれる部分輪郭線の部分輪郭線番号が対応付けられている。さらに、部分輪郭線データ13bは、部分輪郭線番号ごとに当該部分輪郭線番号を持つ部分輪郭線を形成する輪郭点の輪郭点番号、座標および連接角度の集合が対応付けられている。例えば、領域番号1の例で言えば、部分輪郭線番号1から部分輪郭線番号MまでのM個の部分輪郭線が領域番号1に対応付けられる。さらに、部分輪郭線番号1の部分輪郭線を形成する輪郭点番号1から輪郭点番号N1までの各輪郭点の座標および連接角度が領域番号1に対応付けられている。さらに、部分輪郭線番号2の部分輪郭線を形成する輪郭点番号1から輪郭点番号N2までの各輪郭点の座標および連接角度が領域番号1に対応付けられている。さらに、部分輪郭線番号Mの部分輪郭線を形成する輪郭点番号1から輪郭点番号NMまでの各輪郭点の座標および連接角度が領域番号1に対応付けられている。なお、部分輪郭線番号1から部分輪郭線番号MまでのM個の部分輪郭線に含まれるN1個の輪郭点、N2個の輪郭点、・・・、NM個の輪郭点の総和は、領域番号1の領域に含まれる全輪郭点の数と等しい。   FIG. 11 is a diagram illustrating a configuration example of the partial outline data 13b. In the example of the partial outline data 13b shown in FIG. 11, the partial outline number of the partial outline included in the area having the area number is associated with each area number. Furthermore, in the partial outline data 13b, for each partial outline number, a set of outline point numbers, coordinates, and connection angles of outline points forming a partial outline having the partial outline number is associated. For example, in the case of region number 1, M partial contour lines from partial contour number 1 to partial contour number M are associated with region number 1. Further, the coordinates of the contour points from the contour point number 1 to the contour point number N1 that form the partial contour line of the partial contour number 1 and the connection angle are associated with the region number 1. Further, the coordinates of the contour points from the contour point number 1 to the contour point number N2 that form the partial contour line of the partial contour number 2 and the connection angle are associated with the region number 1. Further, the coordinates of the contour points from the contour point number 1 to the contour point number NM that form the partial contour line of the partial contour number M and the connection angle are associated with the region number 1. The sum of N1 contour points, N2 contour points,..., NM contour points included in M partial contour lines from partial contour number 1 to partial contour number M is a region It is equal to the number of all contour points included in the area of number 1.

図2の説明に戻り、検出部15eは、部分輪郭線の垂線同士の交点が最も多い領域をカラーパッチ1の計測領域として検出する処理部である。このように、部分輪郭線の垂線同士の交点が最も多い領域を計測領域とみなすのは、部分輪郭線の垂線同士の交点が存在する領域に投票を行った場合に計測領域への投票が最多となる蓋然性が高いからである。   Returning to the description of FIG. 2, the detection unit 15 e is a processing unit that detects an area where the intersections of the perpendicular lines of the partial contour lines are the largest as the measurement area of the color patch 1. In this way, the area having the largest number of intersections between the perpendicular lines of the partial contour lines is regarded as the measurement area. When voting is performed on the area where the intersection points between the perpendicular lines of the partial contour lines exist, the number of votes in the measurement area is the largest. This is because the probability of becoming is high.

なぜなら、カラーパッチ1の貫通孔3の円弧や貫通孔3の同心円の円弧などの部分輪郭線の間で垂線の交点が存在する領域に投票した場合には、その投票数がカラーパッチ1の計測領域である貫通孔3に集中するからである。一方、他の部分輪郭線、例えば貫通孔3へ向かう方向の線分を始め、カラーパッチ1に設けられたロゴや装飾を形成する部分輪郭線の間で垂線の交点が存在する領域に投票した場合には、その投票数が特定の領域には集中せずに分散する。したがって、各部分輪郭線間で部分輪郭線の垂線同士の交点が存在する領域に投票を行った場合には、計測領域への投票が最多となる蓋然性が高い。このことから、検出部15eは、部分輪郭線の垂線同士の交点が最も多い領域をカラーパッチ1の計測領域として検出する。   This is because, when voting is performed for an area where there is an intersection of perpendicular lines between partial contour lines such as an arc of the through hole 3 of the color patch 1 or an arc of a concentric circle of the through hole 3, the number of votes is the measurement of the color patch 1. It is because it concentrates on the through-hole 3 which is a region. On the other hand, voting was started for other partial contour lines, for example, a line segment in the direction toward the through-hole 3, and an area where a perpendicular intersection exists between the partial contour lines forming the logo or decoration provided on the color patch 1. In some cases, the number of votes is not concentrated in a specific area but dispersed. Therefore, when voting is performed on a region where the intersections of the perpendiculars of the partial contour lines exist between the partial contour lines, there is a high probability that the voting for the measurement region is the most. From this, the detection unit 15 e detects the area where the intersections of the perpendicular lines of the partial contour lines are the largest as the measurement area of the color patch 1.

図12は、部分輪郭線の垂線同士の交点の一例を示す図である。図12に示すように、検出部15eは、部分輪郭線310に含まれる輪郭点のうち両端の輪郭点を結ぶ線分と垂直な直線を計算することによって部分輪郭線310の垂線315を算出する。また、検出部15eは、部分輪郭線320の垂線325についても、部分輪郭線320に含まれる輪郭点のうち両端の輪郭点を結ぶ線分と垂直な直線を計算することによって算出する。その後、検出部15eは、部分輪郭線310の垂線315と部分輪郭線320の垂線325との交点Pが存在する領域を判別した上で、交点Pが存在する領域の交点数をカウントアップする。例えば、検出部15eは、記憶部13に記憶された投票データ13c、すなわち領域ごとに当該領域の交点数が対応付けられたデータのうち先に算出した交点が存在する領域に対応する交点数を加算する更新を行う。そして、検出部15eは、各部分輪郭線の全組合せについて交点の算出および交点数の計数を実行する。なお、ここでは、部分輪郭線の両端の輪郭点を用いて部分輪郭線の垂線を算出する場合を例示したが、部分輪郭線を形成する曲線の中点を通る法線を部分輪郭線の垂線として算出することもできる。   FIG. 12 is a diagram illustrating an example of an intersection of perpendicular lines of partial contour lines. As illustrated in FIG. 12, the detection unit 15 e calculates a perpendicular 315 of the partial contour 310 by calculating a straight line perpendicular to a line segment connecting the contour points at both ends among the contour points included in the partial contour 310. . The detection unit 15 e also calculates the perpendicular 325 of the partial contour 320 by calculating a straight line that is perpendicular to the line connecting the contour points at both ends among the contour points included in the partial contour 320. Thereafter, the detection unit 15e discriminates an area where the intersection point P between the perpendicular line 315 of the partial outline 310 and the perpendicular line 325 of the partial outline 320 exists, and then counts up the number of intersections in the area where the intersection point P exists. For example, the detection unit 15e calculates the number of intersections corresponding to the area where the intersection calculated earlier is included in the voting data 13c stored in the storage unit 13, that is, the data in which the number of intersections of the area is associated with each area. Update to add. And the detection part 15e performs the calculation of an intersection, and the count of the number of intersections about all the combinations of each partial outline. In addition, although the case where the perpendicular line of the partial contour line is calculated using the contour points at both ends of the partial contour line is illustrated here, the normal line passing through the midpoint of the curve forming the partial contour line is defined as the perpendicular line of the partial contour line. Can also be calculated as

図13は、交点の投票結果のイメージ例を示す図である。例えば、全ての部分輪郭線の組合せについて交点が存在する領域に投票を行った場合には、図13に示す投票結果を得ることができる。このとき、部分輪郭線には、カラーパッチ1の貫通孔3の円弧や貫通孔3の同心円の円弧だけでなく、貫通孔3へ向かう方向の線分やカラーパッチ1に設けられたロゴや装飾のエッジなども含まれる。このため、図13に示すように、カラーパッチ1の計測領域以外の領域にも若干の投票がなされるが、投票の大半はカラーパッチ1の計測領域になされる。   FIG. 13 is a diagram illustrating an image example of the voting result of the intersection. For example, when voting is performed on an area where intersections exist for all combinations of partial contour lines, the voting result shown in FIG. 13 can be obtained. At this time, the partial contour line includes not only the arc of the through-hole 3 of the color patch 1 and the concentric arc of the through-hole 3, but also a line segment in the direction toward the through-hole 3 and a logo or decoration provided on the color patch 1. This includes the edges. For this reason, as shown in FIG. 13, some voting is also performed in an area other than the measurement area of the color patch 1, but most of the voting is performed in the measurement area of the color patch 1.

その上で、検出部15eは、部分輪郭線の垂線同士の交点が最も多い領域をカラーパッチ1の計測領域として検出する。図14は、交点の投票結果の一例を示す図である。例えば、図14に示す投票結果が得られた場合には、図4に示したグルーピング結果として得られた領域番号1〜領域番号23のうち領域番号11に投票された交点数が「1489」となり、最多となる。したがって、検出部15eは、交点数が最多である領域番号11をカラーパッチ1の計測領域と検出する。   In addition, the detection unit 15 e detects the region where the intersections of the perpendicular lines of the partial contour lines are the largest as the measurement region of the color patch 1. FIG. 14 is a diagram illustrating an example of the voting result of the intersection. For example, when the voting result shown in FIG. 14 is obtained, the number of intersections voted for the region number 11 out of the region numbers 1 to 23 obtained as the grouping result shown in FIG. 4 is “1489”. , Will be the most. Therefore, the detection unit 15 e detects the area number 11 having the largest number of intersections as the measurement area of the color patch 1.

図2の説明に戻り、対応付け部15fは、カラーパッチ1の計測領域の検出結果を用いて、計測領域を取り囲む標示領域の領域番号と、計測領域の輪郭を時計回りに周回する場合の並び順とを対応付ける処理部である。   Returning to the description of FIG. 2, the association unit 15 f uses the detection result of the measurement area of the color patch 1 to arrange the area number of the marking area surrounding the measurement area and the outline of the measurement area when it circulates clockwise. A processing unit that associates the order.

一態様としては、対応付け部15fは、画像上で計測領域の輪郭を形成する各輪郭点の輪郭点ごとに、各領域の輪郭点のうち当該計測領域の輪郭点と最も距離が近い対応輪郭点を抽出し、対応輪郭点に計測領域の輪郭点の輪郭点番号を付与する。そして、対応付け部15fは、対応輪郭点を抽出する度に、対応輪郭点が抽出された領域を対象に、当該領域が持つ対応輪郭点の個数をインクリメントするとともに、当該領域が持つ対応輪郭点に付与された輪郭点番号の合計値に今回抽出された対応輪郭点へ付与された輪郭点番号を加算する更新を実行する。続いて、対応付け部15fは、計測領域の全ての輪郭点にわたって対応輪郭点が抽出されると、対応輪郭点へ付与された輪郭点番号の合計値を対応輪郭点の個数で除算する計算を実行することによって領域番号別の輪郭点番号の平均値を各領域の代表値として算出する。その上で、対応付け部15fは、代表値が小さい領域の領域番号から順番に領域番号を並び順に対応付ける。これによって、計測領域に近接する近接領域の領域番号の並び順が得られる。   As one aspect, for each contour point of each contour point that forms the contour of the measurement region on the image, the associating unit 15f has a corresponding contour that is the closest to the contour point of the measurement region among the contour points of each region. A point is extracted, and the contour point number of the contour point of the measurement region is assigned to the corresponding contour point. Then, each time the corresponding contour point is extracted, the associating unit 15f increments the number of corresponding contour points of the region for the region from which the corresponding contour point is extracted, and the corresponding contour point of the region. Update is performed in which the contour point number assigned to the corresponding contour point extracted this time is added to the total value of the contour point numbers assigned to. Subsequently, when the corresponding contour points are extracted over all the contour points in the measurement region, the associating unit 15f performs a calculation of dividing the total value of the contour point numbers assigned to the corresponding contour points by the number of corresponding contour points. By executing this, an average value of contour point numbers for each region number is calculated as a representative value for each region. After that, the associating unit 15f associates the region numbers in order from the region number of the region with the small representative value. Thereby, the arrangement order of the area numbers of the proximity areas close to the measurement area is obtained.

その後、対応付け部15fは、近接領域の領域番号の並び順にしたがって、近接領域よりも外側に存在する外側領域の並び順と、領域の領域番号とを対応付ける。これによって、外側領域の領域番号の並び順が得られる。そして、対応付け部15fは、計測領域の中心座標から近接領域の外縁部までの距離が最長である並び順が貫通領域、すなわち白色の標示領域であると判別する。ここで、カラーパッチ1の例で言えば、貫通領域である白色の標示領域は、2つの並び順を跳ばして配置されるという規則性がある。したがって、対応付け部15fは、先に貫通領域であると判別した並び順Lに加え、並び順L+3、並び順L+6及び並び順L+9をさらに貫通領域であると判別する。   Thereafter, the associating unit 15f associates the arrangement order of the outer areas existing outside the proximity area with the area numbers of the areas in accordance with the arrangement order of the area numbers of the proximity areas. Thereby, the arrangement order of the area numbers of the outer area is obtained. Then, the associating unit 15f determines that the arrangement order in which the distance from the center coordinate of the measurement region to the outer edge of the proximity region is the longest is a penetration region, that is, a white marking region. Here, in the example of the color patch 1, there is a regularity that the white marking area that is the penetrating area is arranged so as to skip two arrangement orders. Accordingly, the association unit 15f further determines that the arrangement order L + 3, the arrangement order L + 6, and the arrangement order L + 9 are further through areas in addition to the arrangement order L that has been previously determined as the through area.

出力部15gは、近接領域と外側領域の領域番号の並び順及び貫通領域の判別結果を用いて、カラーパッチ1の各標示領域のRGB値を所定の出力先へ出力する処理部である。ここで、以下では、出力先へのデータの出力形式が白色の標示領域W1〜W4のRGB値および白色以外の色の標示領域C1〜C16のRGB値を出力する形式である場合を想定する。さらに、標示領域C1の輝度が標示領域C2の輝度よりも高い場合を想定する。なお、上記のRGB値は、各々の標示領域を構成する画素のRGB値の平均値であるものとする。   The output unit 15g is a processing unit that outputs the RGB value of each marking region of the color patch 1 to a predetermined output destination using the arrangement order of the region numbers of the proximity region and the outer region and the discrimination result of the penetration region. Here, in the following, it is assumed that the output format of the data to the output destination is a format that outputs the RGB values of the white marking areas W1 to W4 and the RGB values of the marking areas C1 to C16 of colors other than white. Furthermore, it is assumed that the luminance of the marking area C1 is higher than the luminance of the marking area C2. Note that the above RGB values are average values of the RGB values of the pixels constituting each marking area.

かかる出力部15gは、並び順と対応付けられた領域番号と、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16との間でマッピングを行うために、並び順のうちマッピング出力の起点とする並び順を特定する。   Since the output unit 15g performs mapping between the area numbers associated with the arrangement order, the white marking areas W1 to W4, and the marking areas C1 to C16 of colors other than white, the mapping is performed in the mapping order. Specify the order of output.

これを説明すると、カラーパッチ1には、カラーパッチ1の貫通領域とその90度隣の貫通領域との間に挟まれる内側および外側の標示領域は、90度ごとに内側の標示領域の色と外側の標示領域の色が入れ替わるように配置されると規則性がある。これを利用して、出力部15gは、近接領域及び外側領域の並び順のうち貫通領域と判別された並び順Lよりも1つ並び順が大きい近接領域、すなわち貫通領域よりも1つ右側にある近接領域の輝度がその外側領域の輝度よりも大きいか否かを判定する。このように、互いに隣接する近接領域及び外側領域を比較するのは、局所的に見れば、光源による影響が少ないからである。さらに、輝度を比較するのは、RGB値よりも輝度の方が光源によって受ける影響が小さく、撮影によって近接領域と外側領域の輝度の大小関係が逆転するケースは想定しなくてよいからである。   Explaining this, the color patch 1 includes the inner and outer marking areas sandwiched between the penetrating area of the color patch 1 and the penetrating area adjacent to the 90-degree area with the color of the inner marking area every 90 degrees. If it is arranged so that the colors of the outer marking areas are switched, there is regularity. By utilizing this, the output unit 15g has one adjacent order region that is larger in the order of arrangement than the arrangement order L determined as the through region in the order of arrangement of the adjacent region and the outer region, that is, one right side of the through region. It is determined whether or not the luminance of a certain adjacent region is larger than the luminance of the outer region. The reason why the adjacent area and the outer area adjacent to each other are compared in this manner is that the influence of the light source is small when viewed locally. Further, the luminance is compared because the luminance is less affected by the light source than the RGB value, and it is not necessary to assume a case where the magnitude relationship between the luminance of the adjacent area and the outer area is reversed by shooting.

そして、近接領域の輝度がその外側領域の輝度よりも高い場合には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順と対応すると判別できる。この場合には、出力部15gは、並び順をシフトさせずに、当該貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする。一方、近接領域の輝度がその外側領域の輝度以下である場合には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順とズレていると判別できる。この場合には、出力部15gは、貫通領域の並び順Lよりも1つの先の貫通領域の並び順L+3が並び順Lとなるように並び順をシフトする。これによって、出力部15gは、元の並び順L+3を並び順Lへシフトさせ、元の並び順L+6を並び順L+3へシフトさせ、元の並び順L+9を並び順L+6へシフトさせ、元の並び順Lを並び順L+9へシフトさせる。このようにして、画像に写るカラーパッチ1を90度回転させた場合の並び順にシフトさせる。その後、出力部15gは、シフト後の貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする。   When the brightness of the proximity area is higher than the brightness of the outside area, it can be determined that the order of arrangement of the proximity area and the outside area corresponds to the order of arrangement of the marking areas defined in the data output format. In this case, the output unit 15g starts the arrangement order L of the penetrating areas as a starting point without shifting the arrangement order, and assigns the area numbers associated with each arrangement order to the white marking areas W1 to W4 and the white color. It maps with the marking area | regions C1-C16 of colors other than. On the other hand, when the brightness of the proximity area is less than or equal to the brightness of the outside area, it can be determined that the order of arrangement of the proximity area and the outside area deviates from the order of alignment of the marking areas defined in the data output format. In this case, the output unit 15g shifts the arrangement order so that the arrangement order L + 3 of the through area one preceding the arrangement order L of the through areas becomes the arrangement order L. Thereby, the output unit 15g shifts the original arrangement order L + 3 to the arrangement order L, shifts the original arrangement order L + 6 to the arrangement order L + 3, shifts the original arrangement order L + 9 to the arrangement order L + 6, and restores the original arrangement order. The order L is shifted to the order L + 9. In this way, the color patches 1 appearing in the image are shifted in the arrangement order when they are rotated 90 degrees. Thereafter, the output unit 15g starts from the arrangement order L of the through areas after the shift, and uses the area numbers associated with each arrangement order as the white indication areas W1 to W4 and the indication areas C1 to C16 of colors other than white. And mapping.

例えば、標示領域W1には、貫通領域の第1要素である並び順Lの領域番号がマッピングされる。また、標示領域W2には、貫通領域の第2要素である並び順L+3の領域番号がマッピングされる。また、標示領域W3には、貫通領域の第3要素である並び順L+6の領域番号がマッピングされる。また、標示領域W4には、貫通領域の第4要素である並び順L+9の領域番号がマッピングされる。これら標示領域W1〜W4は、貫通領域である白色の標示領域である。このため、標示領域W1〜W4には、外側領域は存在しないので、並び順L、並び順L+3、並び順L+6、並び順L+9の近接領域の領域番号がマッピングされる。   For example, an area number in the arrangement order L that is the first element of the penetrating area is mapped to the marking area W1. In addition, the area number of the arrangement order L + 3 which is the second element of the penetrating area is mapped to the marking area W2. In addition, the area number of the arrangement order L + 6 that is the third element of the penetrating area is mapped to the marking area W3. Further, the area number of the arrangement order L + 9, which is the fourth element of the penetrating area, is mapped to the marking area W4. These marking areas W1 to W4 are white marking areas that are penetration areas. For this reason, since there are no outer areas in the marking areas W1 to W4, the area numbers of the adjacent areas of the arrangement order L, the arrangement order L + 3, the arrangement order L + 6, and the arrangement order L + 9 are mapped.

さらに、標示領域C1には、貫通領域の第1要素である並び順Lよりも1つ先の並び順L+1の近接領域の領域番号がマッピングされる。また、標示領域C2には、標示領域C1の外側領域の領域番号がマッピングされる。また、標示領域C3には、標示領域C1の並び順よりも1つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C4には、標示領域C3の外側領域の領域番号がマッピングされる。ここで、標示領域C5には、標示領域C3との間に標示領域W2が挟まれるので、標示領域C3の並び順よりも2つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C6には、標示領域C5の外側領域の領域番号がマッピングされる。また、標示領域C7には、標示領域C6の並び順よりも1つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C8には、標示領域C7の外側領域の領域番号がマッピングされる。ここで、標示領域C9には、標示領域C7との間に標示領域W3が挟まれるので、標示領域C7の並び順よりも2つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C10には、標示領域C9の外側領域の領域番号がマッピングされる。また、標示領域C11には、標示領域C9の並び順よりも1つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C12には、標示領域C11の外側領域の領域番号がマッピングされる。ここで、標示領域C13には、標示領域C11との間に標示領域W4が挟まれるので、標示領域C11の並び順よりも2つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C14には、標示領域C13の外側領域の領域番号がマッピングされる。また、標示領域C15には、標示領域C13の並び順よりも1つ先の並び順の近接領域の領域番号がマッピングされる。また、標示領域C16には、標示領域C15の外側領域の領域番号がマッピングされる。   Furthermore, the area number of the adjacent area of the arrangement order L + 1 that is one order ahead of the arrangement order L that is the first element of the penetrating area is mapped to the marking area C1. Further, the area number of the outer area of the marking area C1 is mapped to the marking area C2. In addition, the area number of the adjacent area in the arrangement order that is one order ahead of the arrangement order of the indication area C1 is mapped to the indication area C3. Further, the area number of the outer area of the marking area C3 is mapped to the marking area C4. Here, since the labeling area W2 is sandwiched between the labeling area C5 and the labeling area C3, the area numbers of the adjacent areas that are two orders ahead of the ordering order of the labeling area C3 are mapped. Further, the area number of the outer area of the marking area C5 is mapped to the marking area C6. In addition, the area number of the adjacent area in the arrangement order that is one order ahead of the arrangement order of the indication area C6 is mapped to the indication area C7. Further, the area number of the outer area of the marking area C7 is mapped to the marking area C8. Here, since the labeling area W3 is sandwiched between the labeling area C9 and the labeling area C7, the area numbers of the adjacent areas that are two orders ahead of the ordering order of the labeling area C7 are mapped. Further, the area number of the outer area of the marking area C9 is mapped to the marking area C10. In addition, the area number of the adjacent area in the arrangement order one order ahead of the arrangement order of the indication area C9 is mapped to the indication area C11. Further, the area number of the outer area of the marking area C11 is mapped to the marking area C12. Here, since the marking area W4 is sandwiched between the marking area C13 and the marking area C11, the area numbers of the adjacent areas in the order of arrangement two orders ahead of the order of the marking area C11 are mapped. Further, the area number of the outer area of the marking area C13 is mapped to the marking area C14. In addition, the area number of the adjacent area in the arrangement order that is one order ahead of the arrangement order of the indication area C13 is mapped to the indication area C15. Further, the area number of the outer area of the marking area C15 is mapped to the marking area C16.

ここで、図15を用いて、マッピングの具体例を説明する。図15は、マッピングの一例を示す図である。図15に示すように、図4に示した領域番号2の領域がカラーマップ1の白色の標示領域W1にマッピングされる。さらに、図4に示した領域番号14の領域がカラーマップ1の白色の標示領域W2にマッピングされる。さらに、図4に示した領域番号21の領域がカラーマップ1の白色の標示領域W3にマッピングされる。さらに、図4に示した領域番号13の領域がカラーマップ1の白色の標示領域W4にマッピングされる。また、図4に示した領域番号6の領域がカラーマップ1の色の標示領域C1にマッピングされる。さらに、図4に示した領域番号4の領域がカラーマップ1の色の標示領域C2にマッピングされる。さらに、図4に示した領域番号10の領域がカラーマップ1の色の標示領域C3にマッピングされる。さらに、図4に示した領域番号8の領域がカラーマップ1の色の標示領域C4にマッピングされる。さらに、図4に示した領域番号17の領域がカラーマップ1の色の標示領域C5にマッピングされる。さらに、図4に示した領域番号18の領域がカラーマップ1の色の標示領域C6にマッピングされる。さらに、図4に示した領域番号20の領域がカラーマップ1の色の標示領域C7にマッピングされる。さらに、図4に示した領域番号23の領域がカラーマップ1の色の標示領域C8にマッピングされる。さらに、図4に示した領域番号19の領域がカラーマップ1の色の標示領域C9にマッピングされる。さらに、図4に示した領域番号22の領域がカラーマップ1の色の標示領域C10にマッピングされる。さらに、図4に示した領域番号15の領域がカラーマップ1の色の標示領域C11にマッピングされる。さらに、図4に示した領域番号16の領域がカラーマップ1の色の標示領域C12にマッピングされる。さらに、図4に示した領域番号9の領域がカラーマップ1の色の標示領域C13にマッピングされる。さらに、図4に示した領域番号7の領域がカラーマップ1の色の標示領域C14にマッピングされる。さらに、図4に示した領域番号5の領域がカラーマップ1の色の標示領域C15にマッピングされる。さらに、図4に示した領域番号3の領域がカラーマップ1の色の標示領域C16にマッピングされる。   Here, a specific example of mapping will be described with reference to FIG. FIG. 15 is a diagram illustrating an example of mapping. As shown in FIG. 15, the area of area number 2 shown in FIG. 4 is mapped to the white marking area W <b> 1 of the color map 1. Further, the area of area number 14 shown in FIG. 4 is mapped to the white marking area W2 of the color map 1. Further, the area of area number 21 shown in FIG. 4 is mapped to the white marking area W3 of the color map 1. Further, the area of area number 13 shown in FIG. 4 is mapped to the white marking area W4 of the color map 1. 4 is mapped to the color marking area C1 of the color map 1. Furthermore, the area of area number 4 shown in FIG. 4 is mapped to the color marking area C2 of the color map 1. Further, the area of area number 10 shown in FIG. 4 is mapped to the color marking area C3 of the color map 1. Further, the area number 8 shown in FIG. 4 is mapped to the color marking area C4 of the color map 1. Further, the area of area number 17 shown in FIG. 4 is mapped to the color marking area C5 of the color map 1. Further, the area of area number 18 shown in FIG. 4 is mapped to the color marking area C6 of the color map 1. Further, the area of area number 20 shown in FIG. 4 is mapped to the color marking area C7 of the color map 1. Further, the area of area number 23 shown in FIG. 4 is mapped to the color marking area C8 of the color map 1. Furthermore, the area of area number 19 shown in FIG. 4 is mapped to the color marking area C9 of the color map 1. Further, the area of area number 22 shown in FIG. 4 is mapped to the color marking area C10 of the color map 1. Further, the area of area number 15 shown in FIG. 4 is mapped to the color marking area C11 of the color map 1. Further, the area of area number 16 shown in FIG. 4 is mapped to the color marking area C12 of the color map 1. Furthermore, the area of area number 9 shown in FIG. 4 is mapped to the color marking area C13 of the color map 1. Further, the area of area number 7 shown in FIG. 4 is mapped to the color marking area C14 of the color map 1. Further, the area of area number 5 shown in FIG. 4 is mapped to the color marking area C15 of the color map 1. Further, the area of area number 3 shown in FIG. 4 is mapped to the color marking area C16 of the color map 1.

その後、出力部15gは、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域ごとに当該標示領域に含まれる画素のRGB値の平均値を算出する。その上で、出力部15gは、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域別に算出されたRGB値を所定の出力先へ出力する。このとき、出力部15gは、各々の標示領域のRGB値とともに、各々の標示領域の色が本来有するRGB値を併せて出力することもできる。   Thereafter, the output unit 15g calculates the average value of the RGB values of the pixels included in the marking area for each of the white marking areas W1 to W4 and the marking areas C1 to C16 of colors other than white. In addition, the output unit 15g outputs the RGB values calculated for each of the white marking areas W1 to W4 and the marking areas C1 to C16 of colors other than white to a predetermined output destination. At this time, the output unit 15g can also output the RGB values inherent in the color of each marking area together with the RGB values of each marking area.

図16は、マッピング出力の一例を示す図である。図16に示すように、図15に示したマッピングされた白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域ごとに当該標示領域に含まれる画素のRGB値の平均値が算出される。その上で、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域別に算出されたRGB値の平均値とともに、各々の標示領域の色が本来有するRGB値が出力される。   FIG. 16 is a diagram illustrating an example of the mapping output. As shown in FIG. 16, the RGB values of the pixels included in the marking area for each of the mapped white marking areas W1 to W4 and the marking areas C1 to C16 of colors other than white shown in FIG. The average value of is calculated. In addition, together with the average value of the RGB values calculated for each of the white marking areas W1 to W4 and the marking areas C1 to C16 of colors other than white, the RGB values inherent in the colors of each marking area are Is output.

上記の出力先の一例としては、カラーパッチ1の標示領域の色が本来有するRGB値と画像に写った標示領域の色のRGB値の変化量とを用いて画像に写る計測領域のRGB値を補正する色計測プログラムが挙げられる。かかる色計測プログラムは、必ずしも画像処理装置10内で実行される必要はなく、色計測プログラムが実行される外部装置へ出力することとしてもかまわない。   As an example of the output destination, the RGB value of the measurement region that appears in the image using the RGB value inherent in the color of the indication region of the color patch 1 and the amount of change in the RGB value of the color of the indication region that appears in the image is used. There is a color measurement program to be corrected. Such a color measurement program does not necessarily need to be executed in the image processing apparatus 10, and may be output to an external device in which the color measurement program is executed.

なお、制御部15には、各種の集積回路や電子回路を採用できる。また、制御部15が有する機能部の一部を別の集積回路や電子回路とすることもできる。例えば、集積回路としては、ASIC(Application Specific Integrated Circuit)が挙げられる。また、電子回路としては、CPU(Central Processing Unit)やMPU(Micro Processing Unit)などが挙げられる。   Note that various integrated circuits and electronic circuits can be employed for the control unit 15. In addition, a part of the functional unit included in the control unit 15 may be another integrated circuit or an electronic circuit. For example, an ASIC (Application Specific Integrated Circuit) is an example of the integrated circuit. Examples of the electronic circuit include a central processing unit (CPU) and a micro processing unit (MPU).

[処理の流れ]
次に、本実施例に係る画像処理装置10の処理の流れについて説明する。なお、ここでは、画像処理装置10によって実行される(1)全体処理を説明した後に、全体処理のサブフローとして実行される(2)連接角度の算出処理、(3)部分輪郭線の抽出処理、(4)計測領域の検出処理の順に説明する。
[Process flow]
Next, a processing flow of the image processing apparatus 10 according to the present embodiment will be described. Here, after (1) the entire process executed by the image processing apparatus 10 is described, (2) a connection angle calculation process, (3) a partial contour extraction process, which is executed as a sub-flow of the entire process, (4) The measurement area detection processing will be described in this order.

(1)全体処理
図17は、実施例1に係る画像処理装置10の全体処理の手順を示すフローチャートである。この全体処理は、取得部15aによって画像が取得された場合に処理が起動される。図17に示すように、画像が取得されると(ステップS101)、画像処理装置10は、画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングする(ステップS102)。
(1) Overall Processing FIG. 17 is a flowchart illustrating a procedure of overall processing of the image processing apparatus 10 according to the first embodiment. The entire process is started when an image is acquired by the acquisition unit 15a. As shown in FIG. 17, when an image is acquired (step S101), the image processing apparatus 10 groups pixels having similar pixel values between adjacent pixels among the pixels included in the image (step S102). .

続いて、画像処理装置10は、領域に含まれる輪郭点に当該輪郭点が領域の輪郭上にある他の輪郭点と連接する連接角度を算出する「連接角度の算出処理」を実行する(ステップS103)。   Subsequently, the image processing apparatus 10 performs a “joint angle calculation process” for calculating a joint angle at which the contour point is connected to another contour point on the contour of the region (step S110). S103).

そして、画像処理装置10は、ステップS103で算出された各輪郭点の連接角度を用いて、領域を形成する輪郭線が分割された部分輪郭線を抽出する「部分輪郭線の抽出処理」を実行する(ステップS104)。   Then, the image processing apparatus 10 executes “partial contour line extraction processing” for extracting a partial contour line obtained by dividing the contour line forming the region, using the connection angle of each contour point calculated in step S103. (Step S104).

続いて、画像処理装置10は、ステップS104で抽出された部分輪郭線の垂線同士の交点が最も多い領域をカラーパッチ1の計測領域として検出する「計測領域の検出処理」を実行する(ステップS105)。   Subsequently, the image processing apparatus 10 executes “measurement region detection processing” in which the region having the largest number of intersections between the perpendiculars of the partial contour lines extracted in step S104 is detected as the measurement region of the color patch 1 (step S105). ).

その後、画像処理装置10は、カラーパッチ1の計測領域の検出結果を用いて、計測領域を取り囲む近接領域及び外側領域の領域番号と、計測領域の輪郭を時計回りに周回する場合の並び順とを対応付ける(ステップS106)。   After that, the image processing apparatus 10 uses the detection result of the measurement area of the color patch 1, the area numbers of the adjacent area and the outer area surrounding the measurement area, and the arrangement order when the outline of the measurement area is rotated clockwise. Are associated with each other (step S106).

そして、画像処理装置10は、計測領域の中心座標(CX,CY)から近接領域の外縁部までの距離が最長である並び順Lと、その並び順と一定の規則にある並び順L+3、L+6及びL+9とを貫通領域であると判別する(ステップS107)。   The image processing apparatus 10 then arranges the arrangement order L having the longest distance from the center coordinates (CX, CY) of the measurement area to the outer edge of the proximity area, and the arrangement orders L + 3 and L + 6 in the arrangement order and a certain rule. And L + 9 are determined to be through regions (step S107).

続いて、画像処理装置10は、近接領域及び外側領域の並び順のうち貫通領域と判別された並び順Lよりも1つ並び順が大きい近接領域の輝度がその外側領域の輝度よりも大きいか否かを判定する(ステップS108)。   Subsequently, the image processing apparatus 10 determines whether the luminance of the adjacent region having a larger arrangement order than the arrangement order L determined as the through region in the arrangement order of the adjacent region and the outer region is larger than the luminance of the outer region. It is determined whether or not (step S108).

このとき、近接領域の輝度がその外側領域の輝度以下である場合(ステップS108,No)には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順とズレていると判別できる。この場合には、画像処理装置10は、貫通領域の並び順Lよりも1つの先の貫通領域の並び順L+3が並び順Lとなるように並び順をシフトする(ステップS109)。その上で、画像処理装置10は、シフト後の貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする(ステップS110)。   At this time, when the brightness of the proximity area is equal to or lower than the brightness of the outside area (No in step S108), the arrangement order of the proximity area and the outside area is the alignment order of the marking areas defined in the data output format. It can be determined that there is a gap. In this case, the image processing apparatus 10 shifts the arrangement order so that the arrangement order L + 3 of the penetrating area one prior to the arrangement order L of the penetration areas becomes the arrangement order L (step S109). In addition, the image processing apparatus 10 starts from the arrangement order L of the through areas after the shift, and uses the area numbers associated with each arrangement order as the white indication areas W1 to W4 and the indication areas of colors other than white. Mapping is performed with C1 to C16 (step S110).

一方、近接領域の輝度がその外側領域の輝度よりも高い場合(ステップS108,Yes)には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順と対応すると判別できる。この場合には、画像処理装置10は、並び順をシフトさせずに、当該貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする(ステップS110)。   On the other hand, when the brightness of the adjacent area is higher than the brightness of the outer area (Yes in step S108), the arrangement order of the adjacent area and the outer area corresponds to the alignment order of the marking areas defined in the data output format. Then it can be determined. In this case, the image processing apparatus 10 does not shift the arrangement order, but uses the arrangement order L of the penetrating areas as a starting point, and assigns the area numbers associated with each arrangement order to the white marking areas W1 to W4 and Mapping is performed with the marking areas C1 to C16 of colors other than white (step S110).

その後、画像処理装置10は、各々の標示領域W1〜W4およびC1〜C16のRGB値とともに、各々の標示領域W1〜W4およびC1〜C16のRGBの色が本来有するRGB値を併せて所定の出力先へ出力し(ステップS111)、処理を終了する。   Thereafter, the image processing apparatus 10 outputs a predetermined output together with the RGB values of the respective marking areas W1 to W4 and C1 to C16 together with the RGB values of the respective marking areas W1 to W4 and C1 to C16. The data is output first (step S111), and the process is terminated.

(2)連接角度の算出処理
図18は、実施例1に係る連接角度の算出処理の手順を示すフローチャートである。この算出処理は、図17に示したステップS103に対応する処理であり、色の近さでグルーピングが実行されることによって領域が得られた後に処理が起動される。
(2) Connection Angle Calculation Processing FIG. 18 is a flowchart illustrating the procedure of the connection angle calculation processing according to the first embodiment. This calculation process is a process corresponding to step S103 shown in FIG. 17, and is started after an area is obtained by performing grouping based on closeness of colors.

図18に示すように、画像処理装置10は、領域番号をカウントするカウンタAに初期値、例えば領域番号が開始する番号を設定する初期化を実行する(ステップS201)。そして、画像処理装置10は、領域番号のカウンタAの値が全領域の数、すなわち最後の領域番号を超えるまで(ステップS202,Yes)、下記に説明するステップS203〜ステップS217までの処理を繰り返し実行する。   As shown in FIG. 18, the image processing apparatus 10 performs initialization for setting an initial value, for example, a number starting with the region number, to the counter A that counts the region numbers (step S <b> 201). Then, the image processing apparatus 10 repeats the processing from step S203 to step S217 described below until the value of the region number counter A exceeds the number of all regions, that is, the last region number (step S202, Yes). Run.

すなわち、画像処理装置10は、カウンタAの領域番号の値を持つ領域に含まれる各輪郭点に輪郭点番号を採番する(ステップS203)。そして、画像処理装置10は、輪郭点番号をカウントするカウンタBに初期値、例えば輪郭点番号が開始する番号を設定する初期化を実行する(ステップS204)。   In other words, the image processing apparatus 10 assigns a contour point number to each contour point included in the region having the value of the region number of the counter A (step S203). Then, the image processing apparatus 10 executes initialization for setting an initial value, for example, a number at which the contour point number starts, to the counter B that counts the contour point number (step S204).

その後、画像処理装置10は、カウンタBの輪郭点番号の値が領域Aに含まれる全輪郭点の数、すなわち最後の輪郭点番号を超えるまで(ステップS205,Yes)、下記に説明するステップS206〜ステップS216までの処理を繰り返し実行する。   Thereafter, the image processing apparatus 10 continues to step S206 described below until the value of the contour point number of the counter B exceeds the number of all contour points included in the region A, that is, the last contour point number (Yes in step S205). The processes up to step S216 are repeatedly executed.

これを説明すると、画像処理装置10は、カウンタBの輪郭点番号を持つ輪郭点およびその輪郭点を中心とする周辺画素にX方向フィルタ及びY方向フィルタを適用する(ステップS206)。これによって、輝度勾配のX成分およびY成分が得られる。そして、画像処理装置10は、ステップS206で得られた輝度勾配のX成分がゼロであるか否かを判定する(ステップS207)。   Explaining this, the image processing apparatus 10 applies the X direction filter and the Y direction filter to the contour point having the contour point number of the counter B and the peripheral pixels centered on the contour point (step S206). Thereby, the X component and the Y component of the luminance gradient are obtained. Then, the image processing apparatus 10 determines whether or not the X component of the luminance gradient obtained in step S206 is zero (step S207).

このとき、輝度勾配のX成分がゼロでない場合(ステップS207,No)には、画像処理装置10は、輝度勾配のX成分及びY成分の値の逆正接を計算することによって輝度勾配の角度を算出する(ステップS208)。   At this time, when the X component of the luminance gradient is not zero (No in step S207), the image processing apparatus 10 calculates the angle of the luminance gradient by calculating the arc tangent of the values of the X component and the Y component of the luminance gradient. Calculate (step S208).

そして、輝度勾配のX成分が正の値を取る場合(ステップS209,Yes)には、画像処理装置10は、輝度勾配の角度に90度を加算することによって輪郭点の連接角度を算出する(ステップS210)。一方、輝度勾配のX成分が負の値を取る場合(ステップS209,No)には、画像処理装置10は、輝度勾配の角度に270度を加算することによって輪郭点の連接角度を算出する(ステップS211)。   When the X component of the luminance gradient takes a positive value (step S209, Yes), the image processing apparatus 10 calculates the concatenated angle of the contour points by adding 90 degrees to the angle of the luminance gradient ( Step S210). On the other hand, when the X component of the luminance gradient takes a negative value (No in step S209), the image processing apparatus 10 calculates the joint angle of the contour points by adding 270 degrees to the luminance gradient angle ( Step S211).

また、輝度勾配のX成分がゼロである場合(ステップS207,Yes)には、逆正接を取ると輝度勾配の角度が発散する。したがって、この場合には、画像処理装置10は、逆正接を取らない。すなわち、輝度勾配のY成分がゼロよりも大きい場合(ステップS212,Yes)には、画像処理装置10は、輪郭点の連接角度を180度と決定する(ステップS213)。一方、輝度勾配のY成分がゼロ以下である場合(ステップS212,No)には、画像処理装置10は、輪郭点の連接角度を0度と決定する(ステップS214)。   When the X component of the luminance gradient is zero (step S207, Yes), the angle of the luminance gradient diverges when the arc tangent is taken. Therefore, in this case, the image processing apparatus 10 does not take an arc tangent. That is, when the Y component of the luminance gradient is greater than zero (step S212, Yes), the image processing apparatus 10 determines the connection angle of the contour points as 180 degrees (step S213). On the other hand, when the Y component of the luminance gradient is equal to or less than zero (step S212, No), the image processing apparatus 10 determines the articulation angle of the contour points as 0 degrees (step S214).

そして、画像処理装置10は、ステップS210、S211、S213またはS214で算出された輪郭点の連接角度を、カウンタAの領域番号、カウンタBの輪郭点番号及び輪郭点の座標と対応付けて記憶部13へ登録する(ステップS215)。   The image processing apparatus 10 stores the concatenated angle of the contour points calculated in step S210, S211, S213, or S214 in association with the area number of the counter A, the contour point number of the counter B, and the coordinates of the contour point. 13 is registered (step S215).

その後、画像処理装置10は、カウンタBの輪郭点番号の値を1つインクリメントする(ステップS216)。そして、カウンタBの輪郭点番号の値が領域Aに含まれる全輪郭点の数を超えると(ステップS205,No)、画像処理装置10は、カウンタAの領域番号の値を1つインクリメントする(ステップS217)。その後、カウンタAの領域番号の値が全領域の数を超えると(ステップS202,No)、処理を終了する。   Thereafter, the image processing apparatus 10 increments the value of the contour point number of the counter B by one (step S216). When the contour point number value of the counter B exceeds the number of all contour points included in the region A (No in step S205), the image processing apparatus 10 increments the value of the region number of the counter A by one ( Step S217). Thereafter, when the value of the area number of the counter A exceeds the number of all areas (No in step S202), the process is terminated.

(3)部分輪郭線の抽出処理
図19は、実施例1に係る部分輪郭線の抽出処理の手順を示すフローチャートである。この抽出処理は、図17に示したステップS104に対応する処理であり、各領域に含まれる輪郭点の連接角度が算出された後に処理が起動される。
(3) Partial Contour Line Extraction Processing FIG. 19 is a flowchart illustrating a procedure of partial contour line extraction processing according to the first embodiment. This extraction process is a process corresponding to step S104 shown in FIG. 17, and the process is started after the connection angles of the contour points included in each region are calculated.

図19に示すように、画像処理装置10は、領域番号をカウントするカウンタAに初期値、例えば領域番号が開始する番号を設定する初期化を実行する(ステップS301)。そして、画像処理装置10は、領域番号のカウンタAの値が全領域の数、すなわち最後の領域番号を超えるまで(ステップS302,Yes)、下記に説明するステップS303〜ステップS310までの処理を繰り返し実行する。   As shown in FIG. 19, the image processing apparatus 10 performs initialization for setting an initial value, for example, a number at which the region number starts, to the counter A that counts the region number (step S <b> 301). Then, the image processing apparatus 10 repeats the processing from step S303 to step S310 described below until the value of the area number counter A exceeds the number of all areas, that is, the last area number (step S302, Yes). Run.

すなわち、画像処理装置10は、カウンタAに保持された領域番号を持つ領域に含まれる各輪郭点に対応して配列された分割フラグと、部分輪郭線の始点の候補とする輪郭点の連接角度とを保持するレジスタを初期化する(ステップS303)。例えば、領域番号Aの領域に含まれる各輪郭点の分割フラグが初期値、例えば「0」に設定されるとともに、部分輪郭線の始点の候補とする輪郭点の連接角度に最初の輪郭点番号の連接角度を設定する初期化が実行される。   In other words, the image processing apparatus 10 includes a division flag arranged corresponding to each contour point included in the region having the region number held in the counter A, and a joint angle between contour points that are candidates for the starting point of the partial contour line. Is initialized (step S303). For example, the division flag of each contour point included in the region of region number A is set to an initial value, for example, “0”, and the first contour point number is set to the concatenated angle of the contour points that are candidates for the starting point of the partial contour line. Initialization is performed to set the articulation angle.

続いて、画像処理装置10は、輪郭点番号をカウントするカウンタBに初期値、例えば最初の輪郭点番号に続く次の輪郭点番号を設定する初期化を実行する(ステップS304)。その後、画像処理装置10は、カウンタBの輪郭点番号の値が領域Aに含まれる全輪郭点の数、すなわち最後の輪郭点番号を超えるまで(ステップS305,Yes)、下記に説明するステップS306〜ステップS309までの処理を繰り返し実行する。   Subsequently, the image processing apparatus 10 executes initialization for setting an initial value, for example, the next contour point number following the first contour point number, to the counter B that counts the contour point numbers (step S304). Thereafter, the image processing apparatus 10 continues to step S306 described below until the value of the contour point number of the counter B exceeds the number of all contour points included in the region A, that is, the last contour point number (Yes in step S305). The processes up to step S309 are repeatedly executed.

これを説明すると、画像処理装置10は、カウンタBの輪郭点番号を持つ輪郭点の連接角度と、レジスタに部分輪郭線の始点の候補として保持された輪郭点の連接角度との差分が所定の分割閾値を超えるか否かを判定する(ステップS306)。   Explaining this, the image processing apparatus 10 has a predetermined difference between the connection angle of the contour point having the contour point number of the counter B and the connection angle of the contour point held as a candidate for the start point of the partial contour line in the register. It is determined whether or not the division threshold is exceeded (step S306).

このとき、連接角度の差分が分割閾値を超える場合(ステップS306,Yes)には、領域の輪郭を形成する輪郭線のうち始点の候補となる輪郭点から探索中の輪郭点までの区間で輪郭線の連接方向が大きく変化したと判別することができる。   At this time, when the difference in the connection angle exceeds the division threshold (step S306, Yes), the contour is contoured in a section from the contour point that is a candidate for the starting point to the contour point being searched among the contour lines forming the contour of the region. It can be determined that the connecting direction of the lines has changed greatly.

この場合には、画像処理装置10は、レジスタに保持された分割フラグのうち輪郭点番号Bの1つ前の輪郭点番号B−1の輪郭点の分割フラグを有効化する(ステップS307)。さらに、画像処理装置10は、レジスタに保持された部分輪郭線の始点の候補とする輪郭点の連接角度を、カウンタBの輪郭点番号を持つ輪郭点の連接角度に上書きする(ステップS308)。   In this case, the image processing apparatus 10 validates the division flag of the contour point with the contour point number B-1 immediately before the contour point number B among the division flags held in the register (step S307). Further, the image processing apparatus 10 overwrites the connection angle of the contour points, which are candidates for the start points of the partial contour lines, held in the register with the connection angle of the contour points having the contour point number of the counter B (step S308).

一方、連接角度の差分が分割閾値以下である場合(ステップS306,No)には、領域の輪郭を形成する輪郭線のうち始点の候補となる輪郭点から探索中の輪郭点までの区間で輪郭線の連接方向が大きくは変化していないと判別することができる。この場合には、レジスタ内の分割フラグおよび連接角度を更新せずに、ステップS309へ移行する。   On the other hand, when the difference in the connection angle is equal to or smaller than the division threshold (No in step S306), the contour is defined in a section from the contour point that is a candidate for the starting point to the contour point being searched out of the contour lines forming the contour of the region. It can be determined that the connecting direction of the lines has not changed significantly. In this case, the process proceeds to step S309 without updating the division flag and the connection angle in the register.

その後、画像処理装置10は、カウンタBの輪郭点番号の値を1つインクリメントする(ステップS309)。そして、カウンタBの輪郭点番号の値が領域Aに含まれる全輪郭点の数を超えると(ステップS305,No)、画像処理装置10は、カウンタAの領域番号の値を1つインクリメントする(ステップS310)。   Thereafter, the image processing apparatus 10 increments the value of the contour point number of the counter B by one (step S309). When the value of the contour point number of the counter B exceeds the number of all contour points included in the region A (No in step S305), the image processing apparatus 10 increments the value of the region number of the counter A by one ( Step S310).

そして、カウンタAの領域番号の値が全領域の数を超えると(ステップS302,No)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、領域の輪郭線を形成する全輪郭点の輪郭点番号の集合のうち部分輪郭線の始点の候補となる輪郭点番号から分割フラグが有効化された輪郭点番号までの部分集合を部分輪郭線の輪郭点番号の集合として抽出する(ステップS311)。   When the value of the area number of the counter A exceeds the number of all areas (step S302, No), the image processing apparatus 10 executes the following process. In other words, the image processing apparatus 10 performs the process from the contour point number that is a candidate for the start point of the partial contour line to the contour point number for which the division flag is activated in the set of contour point numbers of all contour points that form the contour line of the region. Are extracted as a set of contour point numbers of partial contour lines (step S311).

その上で、画像処理装置10は、部分輪郭線を形成する輪郭点の輪郭点番号、座標および連接角度の集合を部分輪郭線データ13bとして記憶部13へ登録し(ステップS312)、処理を終了する。   After that, the image processing apparatus 10 registers the set of contour point numbers, coordinates, and connection angles of the contour points forming the partial contour line in the storage unit 13 as the partial contour line data 13b (step S312), and ends the processing. To do.

(4)計測領域の検出処理
図20及び図21は、実施例1に係る計測領域の検出処理の手順を示すフローチャートである。この検出処理は、図17に示したステップS105に対応する処理であり、部分輪郭線が抽出された後に処理が起動される。
(4) Measurement Area Detection Process FIGS. 20 and 21 are flowcharts illustrating the procedure of the measurement area detection process according to the first embodiment. This detection process is a process corresponding to step S105 shown in FIG. 17, and is started after the partial outline is extracted.

図20に示すように、画像処理装置10は、領域別に交点数を保持するレジスタに初期値、例えば未投票の値であるゼロを設定する初期化を実行する(ステップS401)。続いて、画像処理装置10は、交点を定める2つの部分輪郭線のうち第1の部分輪郭線が属する第1の領域の領域番号をカウントするカウンタA1に初期値、例えば領域番号が開始する番号を設定する初期化を実行する(ステップS402)。   As shown in FIG. 20, the image processing apparatus 10 executes initialization to set an initial value, for example, zero which is an unvoted value, in a register that holds the number of intersections for each region (step S401). Subsequently, the image processing apparatus 10 sets an initial value, for example, a number at which the region number starts, to the counter A1 that counts the region number of the first region to which the first partial contour line belongs, out of the two partial contour lines that define the intersection. The initialization for setting is executed (step S402).

そして、画像処理装置10は、カウンタA1に保持された第1の領域の領域番号の値が全領域の数、すなわち最後の領域番号を超えるまで(ステップS403,Yes)、下記に説明するステップS404〜ステップS419までの処理を繰り返し実行する。   The image processing apparatus 10 then performs step S404 described below until the value of the area number of the first area held in the counter A1 exceeds the number of all areas, that is, the last area number (Yes in step S403). The processes up to step S419 are repeatedly executed.

このうち、ステップS404において、画像処理装置10は、第1の部分輪郭線の部分輪郭線番号をカウントするカウンタB1に初期値、例えば最初の部分輪郭線番号を設定する初期化を実行する。   Among these, in step S404, the image processing apparatus 10 executes initialization for setting an initial value, for example, the first partial contour line number, to the counter B1 that counts the partial contour line number of the first partial contour line.

その後、画像処理装置10は、カウンタB1に保持された第1の部分輪郭線の部分輪郭線番号の値がカウンタA1に保持された第1の領域に含まれる全部分輪郭線の数を超えるまで(ステップS405,Yes)、下記に説明するステップS406〜ステップS418までの処理を繰り返し実行する。   Thereafter, the image processing apparatus 10 until the value of the partial outline number of the first partial outline held in the counter B1 exceeds the number of all partial outlines included in the first area held in the counter A1. (Step S405, Yes), Steps S406 to S418 described below are repeatedly executed.

このうち、ステップS406において、交点を定める2つの部分輪郭線のうち第2の部分輪郭線が属する第2の領域の領域番号をカウントするカウンタA2に初期値、例えば領域番号が開始する番号を設定する初期化を実行する。   Among these, in step S406, an initial value, for example, a number at which the region number starts, is set in the counter A2 that counts the region number of the second region to which the second partial contour line belongs among the two partial contour lines that define the intersection. Perform initialization to

その後、画像処理装置10は、カウンタA2に保持された第2の領域の領域番号の値が全領域の数を超えるまで(ステップS407,Yes)、下記に説明するステップS408〜ステップS417までの処理を繰り返し実行する。   Thereafter, the image processing apparatus 10 performs processing from step S408 to step S417 described below until the value of the area number of the second area held in the counter A2 exceeds the number of all areas (step S407, Yes). Repeatedly.

このうち、ステップS408において、画像処理装置10は、第2の部分輪郭線の部分輪郭線番号をカウントするカウンタB2に初期値、例えば最初の部分輪郭線番号を設定する初期化を実行する。   Among these, in step S408, the image processing apparatus 10 executes initialization for setting an initial value, for example, the first partial contour line number, to the counter B2 that counts the partial contour line number of the second partial contour line.

その後、画像処理装置10は、カウンタB2に保持された第2の部分輪郭線の部分輪郭線番号の値がカウンタA2に保持された第2の領域に含まれる全部分輪郭線の数を超えるまで(ステップS409,Yes)、下記に説明するステップS410〜ステップS415までの処理を繰り返し実行する。   Thereafter, the image processing apparatus 10 until the value of the partial contour number of the second partial contour line held in the counter B2 exceeds the number of all partial contour lines included in the second region held in the counter A2. (Step S409, Yes), the processes from Step S410 to Step S415 described below are repeatedly executed.

これを説明すると、画像処理装置10は、図21に示すように、カウンタA1及びカウンタA2に保持された領域番号が同一であり、かつカウンタB1及びカウンタB2に保持された部分輪郭線番号が同一であるか否かを判定する(ステップS410)。つまり、交点を求めようとする部分輪郭線が同一の部分輪郭線であるか否かを判定する。   Explaining this, as shown in FIG. 21, the image processing apparatus 10 has the same area number held in the counter A1 and the counter A2, and the same partial outline number held in the counter B1 and the counter B2. It is determined whether or not (step S410). That is, it is determined whether or not the partial contour lines for which the intersection is to be obtained are the same partial contour lines.

このとき、交点を求めようとする部分輪郭線が同一の部分輪郭線でない場合(ステップS410,No)には、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、第1の部分輪郭線の垂線と第2の部分輪郭線の垂線との交点が存在する座標を算出する(ステップS411)。なお、交点を求めようとする部分輪郭線が同一の部分輪郭線である場合(ステップS410,Yes)には、ステップS411〜S414までの処理を跳ばし、ステップS415へ移行する。   At this time, if the partial contour lines for which the intersection is to be obtained are not the same partial contour line (step S410, No), the image processing apparatus 10 executes the following processing. That is, the image processing apparatus 10 calculates the coordinates where the intersection of the perpendicular of the first partial outline and the perpendicular of the second partial outline exists (step S411). In addition, when the partial outline which is going to obtain | require an intersection is the same partial outline (step S410, Yes), the process from step S411 to S414 is skipped and it transfers to step S415.

ここで言う「第1の部分輪郭線」は、カウンタA1の領域番号を持つ第1の領域に含まれる部分輪郭線であってカウンタB1の部分輪郭線番号を持つ部分輪郭線を指す。また、「第2の部分輪郭線」は、カウンタA2の領域番号を持つ第2の領域に含まれる部分輪郭線であってカウンタB2の部分輪郭線番号を持つ部分輪郭線を指す。   The “first partial contour line” here refers to a partial contour line included in the first region having the region number of the counter A1 and having the partial contour number of the counter B1. The “second partial contour line” refers to a partial contour line included in the second region having the region number of the counter A2 and having the partial contour number of the counter B2.

そして、画像処理装置10は、ステップS411で算出された交点が存在する領域を判別する(ステップS412)。続いて、画像処理装置10は、交点が画像の端を含まない領域、例えば画像を形成する4辺の画素を含まない領域上にあるか否かを判定する(ステップS413)。   Then, the image processing apparatus 10 determines a region where the intersection calculated in step S411 exists (step S412). Subsequently, the image processing apparatus 10 determines whether or not the intersection is on a region that does not include the edge of the image, for example, a region that does not include the pixels on the four sides that form the image (step S413).

このとき、交点が画像の端を含まない領域上にある場合(ステップS413,Yes)には、画像処理装置10は、レジスタに保持された交点数のうちステップS412で交点が存在すると判別された領域の交点数をインクリメントする(ステップS414)。なお、交点が画像の端を含む領域上にある場合(ステップS413,No)には、交点数をインクリメントせずにステップS415へ移行する。   At this time, if the intersection is on an area not including the edge of the image (step S413, Yes), the image processing apparatus 10 has determined that the intersection exists in step S412 out of the number of intersections held in the register. The number of intersections of the areas is incremented (step S414). If the intersection is on the area including the edge of the image (step S413, No), the process proceeds to step S415 without incrementing the number of intersections.

そして、画像処理装置10は、カウンタB2に保持された第2の部分輪郭線の部分輪郭線番号を1つインクリメントし(ステップS415)、上記のステップS409へ移行する。   Then, the image processing apparatus 10 increments the partial contour line number of the second partial contour line held in the counter B2 by 1 (step S415), and proceeds to the above step S409.

その後、カウンタB2に保持された第2の部分輪郭線の部分輪郭線番号の値が領域A2に含まれる全部分輪郭線の数を超えると(ステップS409,No)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、カウンタA2に保持された第2の領域の領域番号の値を1つインクリメントし(ステップS417)、ステップS407へ移行する。   Thereafter, when the value of the partial outline number of the second partial outline held in the counter B2 exceeds the number of all partial outlines included in the area A2 (No in step S409), the image processing apparatus 10 The process like this is executed. That is, the image processing apparatus 10 increments the value of the area number of the second area held in the counter A2 by 1 (step S417), and proceeds to step S407.

そして、カウンタA2に保持された第2の領域の領域番号の値が全領域の数を超えると(ステップS407,No)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、カウンタB1に保持された第1の部分輪郭線の部分輪郭線番号を1つインクリメントし(ステップS418)、上記のステップS405へ移行する。   Then, when the value of the area number of the second area held in the counter A2 exceeds the number of all areas (step S407, No), the image processing apparatus 10 executes the following process. That is, the image processing apparatus 10 increments the partial outline number of the first partial outline held in the counter B1 by 1 (step S418), and proceeds to the above step S405.

その後、カウンタB1に保持された第1の部分輪郭線の部分輪郭線番号の値が領域A1に含まれる全部分輪郭線の数を超えると(ステップS405,No)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、カウンタA1に保持された第1の領域の領域番号の値を1つインクリメントし(ステップS419)、ステップS403へ移行する。   Thereafter, when the value of the partial contour number of the first partial contour line held in the counter B1 exceeds the number of all partial contour lines included in the region A1 (step S405, No), the image processing apparatus 10 The process like this is executed. That is, the image processing apparatus 10 increments the value of the area number of the first area held in the counter A1 by 1 (step S419), and proceeds to step S403.

そして、カウンタA1に保持された第1の領域の領域番号の値が全領域の数を超えると(ステップS403,No)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、レジスタに領域別に保持された交点数のうち交点数が最も多い領域をカラーパッチ1の計測領域として検出し(ステップS420)、処理を終了する。   When the value of the area number of the first area held in the counter A1 exceeds the number of all areas (step S403, No), the image processing apparatus 10 executes the following process. That is, the image processing apparatus 10 detects the area having the largest number of intersections among the number of intersections held for each area in the register as the measurement area of the color patch 1 (step S420), and ends the process.

[実施例1の効果]
上述してきたように、本実施例に係る画像処理装置10は、カラーパッチ1が写る画像中の画素を色でグルーピングした各領域の輪郭線を連接角度の変化が少ない範囲で分割し、部分輪郭線の垂線同士の交点の投票数が最多の領域を色の計測領域と検出する。このため、本実施例に係る画像処理装置10では、ハフ変換を用いる場合のように円や楕円を行わずともカラーパッチ1の計測領域を検出することができる。
[Effect of Example 1]
As described above, the image processing apparatus 10 according to the present embodiment divides the contour line of each region obtained by grouping the pixels in the image in which the color patch 1 is captured with a color within a range in which the change in the connection angle is small, and the partial contour. An area having the largest number of votes at the intersection of the perpendicular lines is detected as a color measurement area. For this reason, the image processing apparatus 10 according to the present embodiment can detect the measurement region of the color patch 1 without performing a circle or an ellipse as in the case of using the Hough transform.

したがって、本実施例に係る画像処理装置10によれば、計測領域の検出時に実行される演算処理量を低減できる。さらに、本実施例に係る画像処理装置10では、標示領域を区切る境界線の有無とは無関係にカラーパッチ1の計測領域を検出できるので、汎用性も高めることができる。   Therefore, according to the image processing apparatus 10 according to the present embodiment, it is possible to reduce the amount of calculation processing executed when the measurement area is detected. Furthermore, since the image processing apparatus 10 according to the present embodiment can detect the measurement area of the color patch 1 regardless of the presence or absence of a boundary line that divides the marking area, versatility can also be improved.

さて、これまで開示の装置に関する実施例について説明したが、本発明は上述した実施例以外にも、種々の異なる形態にて実施されてよいものである。そこで、以下では、本発明に含まれる他の実施例を説明する。   Although the embodiments related to the disclosed apparatus have been described above, the present invention may be implemented in various different forms other than the above-described embodiments. Therefore, another embodiment included in the present invention will be described below.

[応用例]
開示の装置は、部分輪郭線の垂線と部分輪郭線の垂線との交点を算出した後に、当該交点と部分輪郭線との位置関係が妥当であるか否かを判定することもできる。図22は、応用例を説明するための図である。図22に示すように、開示の装置は、部分輪郭線410の両端の輪郭点を結ぶ線分413と垂直な直線を計算することによって部分輪郭線410の垂線415を算出する。また、開示の装置は、部分輪郭線420の垂線425についても、部分輪郭線420の両端の輪郭点を結ぶ線分423と垂直な直線を計算することによって算出する。そして、開示の装置は、垂線415及び垂線425の交点Pの座標を算出する。
[Application example]
The disclosed apparatus can also determine whether the positional relationship between the intersection and the partial contour is appropriate after calculating the intersection between the perpendicular of the partial contour and the perpendicular of the partial contour. FIG. 22 is a diagram for explaining an application example. As shown in FIG. 22, the disclosed apparatus calculates a perpendicular 415 of the partial contour 410 by calculating a straight line perpendicular to a line segment 413 connecting the contour points at both ends of the partial contour 410. The disclosed apparatus also calculates the perpendicular line 425 of the partial contour line 420 by calculating a straight line perpendicular to the line segment 423 connecting the contour points at both ends of the partial contour line 420. Then, the disclosed apparatus calculates the coordinates of the intersection point P between the perpendicular line 415 and the perpendicular line 425.

その上で、開示の装置は、交点Pを形成する部分輪郭線410及び部分輪郭線240について次のような判定を実行する。そして、開示の装置は、交点Pと部分輪郭線410との位置関係及び交点Pと部分輪郭線420との位置関係の両方に妥当性がある場合に、当該交点が存在する領域の交点数を更新する。   In addition, the disclosed apparatus performs the following determination on the partial outline 410 and the partial outline 240 that form the intersection P. The disclosed apparatus calculates the number of intersection points in the region where the intersection point exists when both the positional relationship between the intersection point P and the partial contour line 410 and the positional relationship between the intersection point P and the partial contour line 420 are valid. Update.

これを具体的に説明すると、開示の装置は、交点Pから部分輪郭線410の中点までの距離が交点Pから部分輪郭線410の両端の輪郭画素を結ぶ線分413の中間点までの距離よりも大きいか否かを判定する。図22の例では、交点Pから部分輪郭線410の中点までの距離が交点Pから部分輪郭線410の両端の輪郭画素を結ぶ線分413の中間点までの距離よりも大きいので、交点と部分輪郭線との位置関係が妥当であると推定できる。すると、開示の装置は、交点Pから部分輪郭線420の中点までの距離が交点Pから部分輪郭線420の両端の輪郭画素を結ぶ線分423の中間点までの距離よりも大きいか否かを判定する。図22の例では、交点Pから部分輪郭線420の中点までの距離が交点Pから部分輪郭線420の両端の輪郭画素を結ぶ線分423の中間点までの距離以下であるので、交点と部分輪郭線との位置関係に妥当性がないと推定できる。このように、一方の部分輪郭線でも交点との間で位置関係に妥当性がない場合には、当該交点が存在する領域の交点数を更新しない。なお、上記の位置関係の妥当性を判定する処理は、図21に示したフローチャートのステップS411の後で実行することにより容易に実装することが可能である。   Specifically, in the disclosed apparatus, the distance from the intersection point P to the midpoint of the partial contour line 410 is the distance from the intersection point P to the middle point of the line segment 413 connecting the contour pixels at both ends of the partial contour line 410. It is judged whether it is larger than. In the example of FIG. 22, the distance from the intersection point P to the middle point of the partial contour line 410 is larger than the distance from the intersection point P to the middle point of the line segment 413 connecting the contour pixels at both ends of the partial contour line 410. It can be estimated that the positional relationship with the partial contour line is appropriate. Then, the disclosed apparatus determines whether the distance from the intersection point P to the midpoint of the partial contour line 420 is greater than the distance from the intersection point P to the middle point of the line segment 423 connecting the contour pixels at both ends of the partial contour line 420. Determine. In the example of FIG. 22, the distance from the intersection point P to the midpoint of the partial contour line 420 is equal to or less than the distance from the intersection point P to the middle point of the line segment 423 connecting the contour pixels at both ends of the partial contour line 420. It can be estimated that the positional relationship with the partial contour is not valid. As described above, when the positional relationship between the partial contour line and the intersection point is not valid, the number of intersection points in the region where the intersection point exists is not updated. Note that the processing for determining the validity of the above positional relationship can be easily implemented by executing it after step S411 in the flowchart shown in FIG.

これによって、カラーパッチ1の外周よりも外側に弓状のエッジの連なりや交点が集まりやすい領域が存在する場合でも、カラーパッチ1の計測領域をより正確に検出することが可能になる。   This makes it possible to more accurately detect the measurement area of the color patch 1 even when there is an area where arcuate edge series or intersections tend to gather outside the outer periphery of the color patch 1.

[適用例]
上記の実施例1では、各領域に含まれる輪郭点及びその周辺画素にX方向フィルタ及びY方向フィルタを適用して輪郭点の連接角度を算出する場合を例示したが、必ずしもX方向フィルタ及びY方向フィルタを輪郭点だけに適用する必要はない。例えば、開示の装置は、画像に含まれる各画素に各種のエッジ検出用のフィルタを適用することによって画像の輝度成分からエッジを抽出した上でエッジを構成する輪郭点ごとに連接角度を算出するようにしてもかまわない。
[Application example]
In the first embodiment, the case where the X direction filter and the Y direction filter are applied to the contour point included in each region and its surrounding pixels to calculate the joint angle of the contour point is illustrated. It is not necessary to apply the direction filter only to the contour points. For example, the disclosed apparatus applies various edge detection filters to each pixel included in the image to extract the edge from the luminance component of the image, and then calculates a connection angle for each contour point that constitutes the edge. It doesn't matter if you do.

また、上記の実施例1では、カラーパッチ1の貫通孔3によって形成される計測領域を画像処理装置10に検出させる場合を例示したが、開示の装置の適用範囲はこれに限定されない。例えば、開示の装置は、カラーパッチ1以外の対象であっても対象が同心円状に円、楕円や多角形が多重されたものであれば任意の対象を画像から検出することができるし、また、必ずしも円、楕円や多角形の多重が貫通孔によって実現される必要もない。   In the first embodiment, the case where the image processing apparatus 10 detects the measurement region formed by the through hole 3 of the color patch 1 is exemplified, but the application range of the disclosed apparatus is not limited to this. For example, the disclosed apparatus can detect an arbitrary object from an image even if it is an object other than the color patch 1 as long as the object is a concentric circle, ellipse, or polygon. However, it is not always necessary that a circle, an ellipse, or a polygonal multiplex be realized by the through holes.

[分散および統合]
また、図示した各装置の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、制御部15内の機能部15a〜15gの一部、例えば対応付け部15fや出力部15gを画像処理装置10の外部装置としてネットワーク経由で接続するようにしてもよい。また、制御部15内の機能部15a〜15gの一部、例えば対応付け部15fや出力部15gを別の装置がそれぞれ有し、ネットワーク接続されて協働することで、上記の画像処理装置10の機能を実現するようにしてもよい。
[Distribution and integration]
In addition, each component of each illustrated apparatus does not necessarily need to be physically configured as illustrated. In other words, the specific form of distribution / integration of each device is not limited to that shown in the figure, and all or a part thereof may be functionally or physically distributed or arbitrarily distributed in arbitrary units according to various loads or usage conditions. Can be integrated and configured. For example, a part of the function units 15 a to 15 g in the control unit 15, for example, the association unit 15 f and the output unit 15 g may be connected as an external device of the image processing apparatus 10 via a network. In addition, the image processing apparatus 10 described above is configured by another device having a part of the function units 15a to 15g in the control unit 15, for example, the association unit 15f and the output unit 15g, which are connected to each other through a network. You may make it implement | achieve the function of.

[画像処理プログラム]
また、上記の実施例で説明した各種の処理は、予め用意されたプログラムをパーソナルコンピュータやワークステーションなどのコンピュータで実行することによって実現することができる。そこで、以下では、図23を用いて、上記の実施例と同様の機能を有する画像処理プログラムを実行するコンピュータの一例について説明する。
[Image processing program]
The various processes described in the above embodiments can be realized by executing a prepared program on a computer such as a personal computer or a workstation. In the following, an example of a computer that executes an image processing program having the same function as that of the above-described embodiment will be described with reference to FIG.

図23は、実施例1及び実施例2に係る画像処理プログラムを実行するコンピュータの一例について説明するための図である。図23に示すように、コンピュータ100は、操作部110aと、スピーカ110bと、カメラ110cと、ディスプレイ120と、通信部130とを有する。さらに、このコンピュータ100は、CPU150と、ROM160と、HDD170と、RAM180とを有する。これら110〜180の各部はバス140を介して接続される。   FIG. 23 is a schematic diagram illustrating an example of a computer that executes an image processing program according to the first and second embodiments. As illustrated in FIG. 23, the computer 100 includes an operation unit 110a, a speaker 110b, a camera 110c, a display 120, and a communication unit 130. Further, the computer 100 includes a CPU 150, a ROM 160, an HDD 170, and a RAM 180. These units 110 to 180 are connected via a bus 140.

HDD170には、図23に示すように、上記の実施例1で示した取得部15a、グルーピング部15b、算出部15c、抽出部15d、検出部15e、対応付け部15f及び出力部15gと同様の機能を発揮する画像処理プログラム170aが予め記憶される。この画像処理プログラム170aについては、図2に示した各々の取得部15a、グルーピング部15b、算出部15c、抽出部15d、検出部15e、対応付け部15f及び出力部15gの各構成要素と同様、適宜統合又は分離しても良い。すなわち、HDD170に格納される各データは、常に全てのデータがHDD170に格納される必要はなく、処理に必要なデータのみがHDD170に格納されれば良い。   As shown in FIG. 23, the HDD 170 is similar to the acquisition unit 15a, grouping unit 15b, calculation unit 15c, extraction unit 15d, detection unit 15e, association unit 15f, and output unit 15g described in the first embodiment. An image processing program 170a that exhibits the function is stored in advance. The image processing program 170a is similar to the components of the acquisition unit 15a, grouping unit 15b, calculation unit 15c, extraction unit 15d, detection unit 15e, association unit 15f, and output unit 15g shown in FIG. You may integrate or isolate | separate suitably. In other words, all data stored in the HDD 170 need not always be stored in the HDD 170, and only data necessary for processing may be stored in the HDD 170.

そして、CPU150が、画像処理プログラム170aをHDD170から読み出してRAM180に展開する。これによって、図23に示すように、画像処理プログラム170aは、画像処理プロセス180aとして機能する。この画像処理プロセス180aは、HDD170から読み出した各種データを適宜RAM180上の自身に割り当てられた領域に展開し、この展開した各種データに基づいて各種処理を実行する。なお、画像処理プロセス180aは、図2に示した取得部15a、グルーピング部15b、算出部15c、抽出部15d、検出部15e、対応付け部15f及び出力部15gにて実行される処理、例えば図17〜図21に示す処理を含む。また、CPU150上で仮想的に実現される各処理部は、常に全ての処理部がCPU150上で動作する必要はなく、処理に必要な処理部のみが仮想的に実現されれば良い。   Then, the CPU 150 reads the image processing program 170 a from the HDD 170 and develops it in the RAM 180. Accordingly, as shown in FIG. 23, the image processing program 170a functions as an image processing process 180a. The image processing process 180a expands various data read from the HDD 170 in an area allocated to itself on the RAM 180 as appropriate, and executes various processes based on the expanded data. The image processing process 180a is performed by the acquisition unit 15a, grouping unit 15b, calculation unit 15c, extraction unit 15d, detection unit 15e, association unit 15f, and output unit 15g illustrated in FIG. 17 to 21 are included. In addition, each processing unit virtually realized on the CPU 150 does not always require that all processing units operate on the CPU 150, and only a processing unit necessary for the processing needs to be virtually realized.

なお、上記の画像処理プログラム170aについては、必ずしも最初からHDD170やROM160に記憶させておく必要はない。例えば、コンピュータ100に挿入されるフレキシブルディスク、いわゆるFD、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させる。そして、コンピュータ100がこれらの可搬用の物理媒体から各プログラムを取得して実行するようにしてもよい。また、公衆回線、インターネット、LAN、WANなどを介してコンピュータ100に接続される他のコンピュータまたはサーバ装置などに各プログラムを記憶させておき、コンピュータ100がこれらから各プログラムを取得して実行するようにしてもよい。   Note that the image processing program 170a is not necessarily stored in the HDD 170 or the ROM 160 from the beginning. For example, each program is stored in a “portable physical medium” such as a flexible disk inserted into the computer 100, so-called FD, CD-ROM, DVD disk, magneto-optical disk, or IC card. Then, the computer 100 may acquire and execute each program from these portable physical media. In addition, each program is stored in another computer or server device connected to the computer 100 via a public line, the Internet, a LAN, a WAN, etc., and the computer 100 acquires and executes each program from these. It may be.

1 カラーパッチ
3 貫通孔
C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16 標示領域
W1,W2,W3,W4 白色の標示領域
10 画像処理装置
11 カメラ
13 記憶部
13a 連接角度データ
13b 部分輪郭線データ
13c 投票データ
15 制御部
15a 取得部
15b グルーピング部
15c 算出部
15d 抽出部
15e 検出部
15f 対応付け部
15g 出力部
1 Color patch 3 Through hole C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16 Marking area W1, W2, W3, W4 White marking area DESCRIPTION OF SYMBOLS 10 Image processing apparatus 11 Camera 13 Memory | storage part 13a Connection angle data 13b Partial outline data 13c Voting data 15 Control part 15a Acquisition part 15b Grouping part 15c Calculation part 15d Extraction part 15e Detection part 15f Correlation part 15g Output part

Claims (7)

画像を取得する取得部と、
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングして領域に分けるグルーピング部と、
グルーピングされた領域の輪郭を形成する輪郭画素ごとに当該輪郭画素が領域の輪郭上にある他の輪郭画素と連接する連接角度を算出する算出部と、
前記領域を形成する輪郭線を前記輪郭画素の連接角度の変化が所定の閾値以内である区間で分割することによって前記輪郭線から部分輪郭線を抽出する抽出部と、
前記グルーピング部が分けた領域から前記部分輪郭線の垂線同士の交点が最も多い領域を検出する検出部と
を有することを特徴とする画像処理装置。
An acquisition unit for acquiring images;
A grouping unit that groups pixels having similar pixel values between adjacent pixels among the pixels included in the image, and divides the pixels into regions;
For each contour pixel that forms the contour of the grouped region, a calculation unit that calculates a connection angle at which the contour pixel is connected to another contour pixel on the contour of the region;
An extraction unit that extracts a partial contour line from the contour line by dividing the contour line forming the region by a section in which the change in the connection angle of the contour pixels is within a predetermined threshold;
An image processing apparatus comprising: a detection unit configured to detect a region having the largest number of intersections between the perpendicular lines of the partial contour lines from the region divided by the grouping unit.
前記検出部は、
前記領域別に前記部分輪郭線の垂線同士の交点数を保持し、
前記部分輪郭線の組合せごとに、前記領域別に保持された交点数のうち、当該組合せに含まれる一方の部分輪郭線の両端の輪郭画素を結ぶ線分の垂線と、他方の部分輪郭線の両端の輪郭画素を結ぶ線分の垂線との交点が存在する領域の交点数を更新し、
前記グルーピング部が分けた領域から前記交点数が最も多い領域を検出することを特徴とする請求項1に記載の画像処理装置。
The detector is
Holds the number of intersections between the perpendiculars of the partial contour lines for each region,
For each combination of the partial contour lines, out of the number of intersections held for each region, a perpendicular line connecting the contour pixels at both ends of one partial contour line included in the combination and both ends of the other partial contour line Update the number of intersections in the area where the intersection with the perpendicular to the line segment connecting
The image processing apparatus according to claim 1, wherein an area having the largest number of intersection points is detected from areas divided by the grouping unit.
前記検出部は、前記交点から前記部分輪郭線までの距離が前記交点から部分輪郭線の両端の輪郭画素を結ぶ線分までの距離よりも大きい場合に、当該交点が存在する領域の交点数を更新することを特徴とする請求項1または2に記載の画像処理装置。   When the distance from the intersection point to the partial contour line is greater than the distance from the intersection point to the line segment connecting the contour pixels at both ends of the partial contour line, the detection unit calculates the number of intersection points of the region where the intersection point exists. The image processing apparatus according to claim 1, wherein the image processing apparatus is updated. 前記抽出部は、
部分輪郭線の始点の候補となる輪郭画素の連接角度を保持し、
前記領域の輪郭線上にある輪郭画素を探索し、
探索された輪郭画素の連接角度と、前記部分輪郭線の始点の候補として保持された輪郭画素の連接角度との差分が所定の分割閾値を超えるか否かを判定し、
前記差分が前記分割閾値を超える場合に、前記部分輪郭線の始点の候補として保持された輪郭画素から当該分割閾値を超えた輪郭画素の直前に探索された輪郭画素までの区間を前記部分輪郭線として抽出し、
部分輪郭線の始点の候補として保持される輪郭画素の連接角度に、当該分割閾値を超えた輪郭画素の連接角度を上書きすることを特徴とする請求項1、2または3に記載の画像処理装置。
The extraction unit includes:
Holds the articulation angle of the contour pixels that are candidates for the start point of the partial contour line,
Search for contour pixels on the contour line of the region,
Determining whether the difference between the concatenated angle of the searched contour pixel and the concatenated angle of the contour pixel held as a candidate for the start point of the partial contour line exceeds a predetermined division threshold;
When the difference exceeds the division threshold, a section from the contour pixel held as a candidate for the starting point of the partial contour to the contour pixel searched immediately before the contour pixel exceeding the division threshold is the partial contour. Extract as
The image processing apparatus according to claim 1, 2, or 3, wherein a concatenated angle of contour pixels exceeding the division threshold is overwritten on a concatenated angle of contour pixels held as a candidate for a starting point of a partial contour line. .
前記算出部は、前記輪郭画素ごとに当該輪郭画素の周辺画素との輝度勾配を算出し、算出した輝度勾配が表す方向と直角な方向を前記輪郭画素の連接方向として算出することを特徴とする請求項1〜4のいずれか一つに記載の画像処理装置。   The calculation unit calculates a luminance gradient with a peripheral pixel of the contour pixel for each contour pixel, and calculates a direction perpendicular to a direction represented by the calculated luminance gradient as a connection direction of the contour pixels. The image processing apparatus according to claim 1. コンピュータに、
画像を取得し、
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングして領域に分け、
グルーピングされた領域の輪郭を形成する輪郭画素ごとに当該輪郭画素が領域の輪郭上にある他の輪郭画素と連接する連接角度を算出し、
前記領域を形成する輪郭線を前記輪郭画素の連接角度の変化が所定の閾値以内である区間で分割することによって前記輪郭線から部分輪郭線を抽出し、
グルーピングして分けた領域から前記部分輪郭線の垂線同士の交点が最も多い領域を検出する
処理を実行させることを特徴とする画像処理プログラム。
On the computer,
Get an image,
Grouping pixels that have similar pixel values between adjacent pixels among the pixels included in the image,
For each contour pixel that forms the contour of the grouped region, calculate the connection angle at which the contour pixel is connected to other contour pixels on the region contour,
Extracting a partial contour line from the contour line by dividing the contour line forming the region by a section in which the change in the connection angle of the contour pixels is within a predetermined threshold;
An image processing program for executing a process of detecting a region having the largest number of intersections between perpendiculars of the partial contour lines from the grouped regions.
コンピュータが、
画像を取得し、
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングして領域に分け、
グルーピングされた領域の輪郭を形成する輪郭画素ごとに当該輪郭画素が領域の輪郭上にある他の輪郭画素と連接する連接角度を算出し、
前記領域を形成する輪郭線を前記輪郭画素の連接角度の変化が所定の閾値以内である区間で分割することによって前記輪郭線から部分輪郭線を抽出し、
グルーピングして分けた領域から前記部分輪郭線の垂線同士の交点が最も多い領域を検出する
処理を実行することを特徴とする画像処理方法。
Computer
Get an image,
Grouping pixels that have similar pixel values between adjacent pixels among the pixels included in the image,
For each contour pixel that forms the contour of the grouped region, calculate the connection angle at which the contour pixel is connected to other contour pixels on the region contour,
Extracting a partial contour line from the contour line by dividing the contour line forming the region by a section in which the change in the connection angle of the contour pixels is within a predetermined threshold;
An image processing method comprising: executing a process of detecting an area having the largest number of intersections between perpendiculars of the partial contour lines from the grouped areas.
JP2012104041A 2012-04-27 2012-04-27 Image processing apparatus, image processing program, and image processing method Active JP5853848B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012104041A JP5853848B2 (en) 2012-04-27 2012-04-27 Image processing apparatus, image processing program, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012104041A JP5853848B2 (en) 2012-04-27 2012-04-27 Image processing apparatus, image processing program, and image processing method

Publications (2)

Publication Number Publication Date
JP2013232115A JP2013232115A (en) 2013-11-14
JP5853848B2 true JP5853848B2 (en) 2016-02-09

Family

ID=49678488

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012104041A Active JP5853848B2 (en) 2012-04-27 2012-04-27 Image processing apparatus, image processing program, and image processing method

Country Status (1)

Country Link
JP (1) JP5853848B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7262927B2 (en) 2018-03-30 2023-04-24 キヤノン株式会社 Image processing device, image processing method and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007156764A (en) * 2005-12-05 2007-06-21 Hitachi Computer Peripherals Co Ltd Figure detection processing program and paper sheets processing device
JP2010161591A (en) * 2009-01-07 2010-07-22 Softbank Mobile Corp Extension device for mobile phone

Also Published As

Publication number Publication date
JP2013232115A (en) 2013-11-14

Similar Documents

Publication Publication Date Title
CN110599548A (en) Camera calibration method and device, camera and computer readable storage medium
US8660309B2 (en) Image processing apparatus, image processing method, image processing program and recording medium
JP5818091B2 (en) Image processing apparatus, image processing system, image processing method, and program
CN110189322B (en) Flatness detection method, device, equipment, storage medium and system
CN109104596A (en) Optical projection system and the bearing calibration for showing image
JP5880184B2 (en) Color measurement program and color measurement method
KR20100020903A (en) Image identifying method and imaging apparatus
JP6566768B2 (en) Information processing apparatus, information processing method, and program
CN112614085A (en) Object detection method and device and terminal equipment
EP3922232B1 (en) Medicine identification system, medicine identification device, medicine identification method, and program
CN111614888B (en) Image blurring processing method and system
JP6325902B2 (en) Dimension measurement method, electronic device with camera, and program for electronic device with camera
CN105227948B (en) The method and device of distorted region in a kind of lookup image
CN111383254A (en) Depth information acquisition method and system and terminal equipment
CN112434715A (en) Target identification method and device based on artificial intelligence and storage medium
KR20110014960A (en) Image processing apparatus and image processing method
KR20150107580A (en) Image processing apparatus and image processing method
JP5853848B2 (en) Image processing apparatus, image processing program, and image processing method
CN107644442B (en) Spatial position calibration method of double-camera module
JP2010271921A (en) Skin area extraction method, skin area extraction device, and skin area extracting program
JP5811915B2 (en) Image processing apparatus, image processing program, and image processing method
JP2005316958A (en) Red eye detection device, method, and program
EP2541469B1 (en) Image recognition device, image recognition method and image recognition program
KR20150009842A (en) System for testing camera module centering and method for testing camera module centering using the same
JP6851337B2 (en) Imaging device, control method and control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150203

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151029

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151123

R150 Certificate of patent or registration of utility model

Ref document number: 5853848

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150