JP2013196373A - Image processing apparatus, image processing program and image processing method - Google Patents
Image processing apparatus, image processing program and image processing method Download PDFInfo
- Publication number
- JP2013196373A JP2013196373A JP2012062757A JP2012062757A JP2013196373A JP 2013196373 A JP2013196373 A JP 2013196373A JP 2012062757 A JP2012062757 A JP 2012062757A JP 2012062757 A JP2012062757 A JP 2012062757A JP 2013196373 A JP2013196373 A JP 2013196373A
- Authority
- JP
- Japan
- Prior art keywords
- region
- area
- color
- contour
- measurement
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
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.
このように上記の補正において変化量を得る前段階には、計測領域の周囲に配置された標示領域を周回順に取り出す必要がある。かかる標示領域の並び順を取り出す技術としては、リングターゲットに埋め込まれた位置マークを検出し、予め定められた形状の三角形の頂点に位置マークが一致するように撮影画像を探索し、そこからリングを構成する各領域を判別する測定方式が提案されている。 Thus, before obtaining the amount of change in the above correction, it is necessary to take out the sign areas arranged around the measurement area in order of circulation. As a technique for extracting the arrangement order of the marking areas, a position mark embedded in a ring target is detected, a photographed image is searched so that the position mark coincides with a vertex of a triangle having a predetermined shape, and a ring is obtained therefrom. A measurement method has been proposed for discriminating each of the regions constituting the.
しかしながら、上記の従来技術では、カラーパッチ等の色標のデザイン性を損なうことなく、色標の標示領域の並び順を簡易に抽出することができないという問題がある。 However, the above-described prior art has a problem in that the order of arrangement of the marking areas of the color targets cannot be easily extracted without impairing the design of the color targets such as color patches.
すなわち、上記の測定方法では、リングターゲットに位置マークを付けねばならず、デザイン性が損なわれる。その上、上記の測定方法では、位置マークを付けたとしても、リングターゲットが正面ではなく斜め方向から撮影された場合には、三角形が変形することによって識別が困難になり、さらに、リングターゲット上の領域の数が変更される度に三角形を設定し直す必要がある。また、位置マーク等を設けずに領域の並び順を抽出するために、領域ごとの接合関係を組合せによって判断することも考えられるが、その場合には、組合せの判断によって処理が煩雑化してしまう。 That is, in the measurement method described above, a position mark must be attached to the ring target, and design is impaired. In addition, in the measurement method described above, even if a position mark is attached, if the ring target is photographed from an oblique direction instead of the front, it becomes difficult to identify because the triangle is deformed. It is necessary to reset the triangle every time the number of areas is changed. In addition, in order to extract the arrangement order of regions without providing a position mark or the like, it is conceivable to determine the joining relationship for each region by a combination, but in that case, the processing becomes complicated due to the determination of the combination. .
開示の技術は、上記に鑑みてなされたものであって、色標のデザイン性を損なうことなく、色標の標示領域の並び順を簡易に抽出できる画像処理装置、画像処理プログラム及び画像処理方法を提供することを目的とする。 The disclosed technology has been made in view of the above, and an image processing apparatus, an image processing program, and an image processing method capable of easily extracting the order of arrangement of the marking areas of the color targets without impairing the design of the color targets The purpose is to provide.
本願の開示する画像処理装置は、画像を取得する取得部と、前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングするグルーピング部とを有する。さらに、前記画像処理装置は、グルーピングされた領域のうち、前記画像に含まれる色標であって、色の標示領域が形成される表示面および前記表示面の裏面を貫通する貫通孔が形成されるとともに同一色の標示領域が前記貫通孔を挟んで前記表示面の両側にそれぞれ形成された色標の貫通孔によって形成される色の計測領域を選択する選択部を有する。さらに、前記画像処理装置は、前記画像上で前記計測領域の輪郭を形成する各輪郭画素に番号を採番する採番部を有する。さらに、前記画像処理装置は、前記計測領域の輪郭画素ごとに、各領域の輪郭を形成する輪郭画素のうち当該計測領域の輪郭画素との間で最も距離が近い対応輪郭画素を抽出する抽出部を有する。さらに、前記画像処理装置は、前記対応輪郭画素に前記計測領域の輪郭画素の番号を付与する付与部を有する。さらに、前記画像処理装置は、前記対応輪郭画素が抽出される度に、前記領域のうち前記対応輪郭画素が抽出された領域を対象に当該領域が持つ対応輪郭画素の個数と、当該領域が持つ対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値を更新する更新部を有する。さらに、前記画像処理装置は、前記対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値および前記対応輪郭画素の個数を用いて、前記領域別に当該領域の代表値を算出する算出部を有する。さらに、前記画像処理装置は、前記領域別に算出された代表値を用いて、前記色標の標示領域の並び順であって前記計測領域を周回する時計回りまたは反時計回りの並び順に前記領域を対応付ける対応付け部を有する。 An image processing apparatus disclosed in the present application includes an acquisition unit that acquires an image, and a grouping unit that groups pixels having similar pixel values between adjacent pixels among the pixels included in the image. Further, the image processing device includes a color plane included in the image among the grouped areas, and a display surface on which the color marking area is formed and a through-hole penetrating the back surface of the display surface. And a selection unit for selecting a color measurement region formed by the through holes of the color targets respectively formed on the both sides of the display surface with the through holes interposed therebetween. Furthermore, the image processing apparatus includes a numbering unit that numbers each contour pixel that forms the contour of the measurement region on the image. Further, the image processing apparatus extracts, for each contour pixel of the measurement region, a corresponding contour pixel that is closest to the contour pixel of the measurement region from the contour pixels that form the contour of each region. Have Furthermore, the image processing apparatus includes an assigning unit that assigns a contour pixel number of the measurement region to the corresponding contour pixel. Further, each time the corresponding contour pixel is extracted, the image processing apparatus has the number of corresponding contour pixels that the region has in the region from which the corresponding contour pixel is extracted, and the region has The update unit updates the total value of the contour pixel numbers of the measurement region assigned to the corresponding contour pixels. Further, the image processing device calculates a representative value of the region for each region by using a total value of the contour pixel numbers of the measurement region and the number of the corresponding contour pixels assigned to the corresponding contour pixel. Part. Further, the image processing apparatus uses the representative value calculated for each area to arrange the areas in the order of arrangement of the marking areas of the color targets in the clockwise or counterclockwise arrangement around the measurement area. It has the matching part matched.
本願の開示する画像処理装置の一つの態様によれば、色標のデザイン性を損なうことなく、色標の標示領域の並び順を簡易に抽出できるという効果を奏する。 According to one aspect of the image processing apparatus disclosed in the present application, there is an effect that the arrangement order of the marking areas of the color targets can be easily extracted without impairing the design of the color targets.
以下に、本願の開示する画像処理装置、画像処理プログラム及び画像処理方法の実施例を図面に基づいて詳細に説明する。なお、この実施例は開示の技術を限定するものではない。そして、各実施例は、処理内容を矛盾させない範囲で適宜組み合わせることが可能である。 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
図1に示すように、カラーパッチ1は、色を計測する対象者に貼付または載置された上で計測部位とともに撮像されることによって、撮影が行われた画像に計測部位と同様に光源の影響を受けたカラーパッチ1を写り込ませるためのものである。
As shown in FIG. 1, the
ここで、本実施例に係るカラーパッチ1は、カラーパッチ1の表示面及び裏面を貫通する貫通孔3が形成される。このように、カラーパッチ1の中央部に貫通孔3を形成するのは、色を計測する対象者にカラーパッチ1が貼付された場合に、貫通孔3から計測部位である対象者の肌を計測領域として露出させるためである。このように、貫通孔3から対象者の肌が露出すると、カラーパッチ1の表示面に形成された標示領域C1〜C16は、対象者の肌を取り囲むように配置されることになる。
Here, in the
このため、本実施例に係るカラーパッチ1では、互いに貫通孔3を中心に円環状に配置された各々の標示領域を、漏れなく計測部位に近接させることが可能になる。それゆえ、本実施例に係るカラーパッチ1は、色の標示をマトリクス状に二次元配列された従来のカラーパッチよりも、計測部位に近接する部分を大きくすることができる。
For this reason, in the
さらに、本実施例に係るカラーパッチ1では、同一色の標示領域C1、C6、C9及びC14が貫通孔3を挟んで表示面の両側に夫々形成される。さらに、同一の標示領域C2、C5、C10及びC13についても貫通孔3を挟んで表示面の両側に夫々形成される。また、同一の標示領域C3、C8、C11及びC16についても貫通孔3を挟んで表示面の両側に夫々形成される。さらに、同一の標示領域C4、C7、C12及びC15についても貫通孔3を挟んで表示面の両側に夫々形成される。
Furthermore, in the
図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
すなわち、一箇所の標示領域における変化量を観測しただけでは、補正によって対象者の肌の色を再現するには不十分な場合がある。なぜなら、対象者の肌が光源によって受ける影響は、必ずしも計測領域全体にわたって一様ではないからである。このことから、本実施例に係るカラーパッチ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
さらに、同一色の標示領域をペアにして配置する場合には、貫通孔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-
このように、本実施例に係るカラーパッチ1では、互いに貫通孔3を中心に円環状に配置された各々の標示領域を、漏れなく計測部位に近接させることが可能になる。さらに、本実施例に係るカラーパッチ1が計測部位とともに撮影された場合には、当該撮影された画像から同一色の標示領域のうちペアとされた標示領域に挟み込まれた部分の色の変化量を正確に算出させることができる。それゆえ、カラーパッチ1に配置された標示領域の色の変化量を用いて画像に写った計測部位の色を補正させる場合に、計測部位が本来有する色もしくはそれに近い色を再現する確率を高めることができる。したがって、本実施例に係るカラーパッチ1によれば、色の計測精度を向上させることができる。
As described above, in the
また、本実施例に係るカラーパッチ1には、白色の標示領域W1〜W4が所定の間隔、例えば90度間隔で配置される。このため、計測領域に近接する4つの白色の標示領域W1〜W4が画像に写った際の画素値を用いてホワイトバランスを補正させることができる。
Further, in the
さらに、本実施例に係るカラーパッチ1は、表示面の外周および表示面の内周を形成する貫通孔3の形状を円形に形成することによってカラーパッチ1の外形を円環状に形成する。これによって、後述のカメラ11によって計測部位とともに撮影される計測領域を円形にするとともに、カラーパッチ1の外形を円環状にすることができる。このため、カラーパッチ1の表示面が正面から撮影されずに正面以外の多角的な向きから撮影されたとしても、撮影された画像には、対象者の肌における計測領域やカラーパッチ1の表示面の変形を楕円形に抑えることができる。よって、撮影された画像から計測領域や表示面を検出させやすくできる。
Furthermore, in the
加えて、本実施例に係るカラーパッチ1では、表示面を外周側の円環と内周側の円環の二層に分けて、標示領域C1、C6、C9及びC14と、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とを配置する。このため、外周側の円環と内周側の円環に分けずに標示領域を配置する場合に比べて、より多くの標示領域を効率的に配置することができる。
In addition, in the
なお、標示領域C1、C6、C9及びC14と、標示領域C2、C5、C10及びC13と、標示領域C3、C8、C11及びC16と、標示領域C4、C7、C12及びC15とに標示させる色には、任意の色を採用することができる。好ましくは、肌色に類する色を採用するのがよい。例えば、4色の標示領域を配置する場合には、RGB(Red-Green-Blue color model)空間上で一般に人の肌色が分布すると想定される領域の外延を囲む位置に分布する色、例えば肌色よりも赤みがかった色や黄みがかった色などを採用することができる。なお、カラーパッチ1の表示面上で表示される標示領域の色は、印刷によって着色されたものあってもよいし、その他の方法によって着色されたものであってもよい。
Note that the colors to be displayed in 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. Any color can be adopted. Preferably, a color similar to skin color is employed. For example, in the case where four color marking areas are arranged, a color distributed in a position surrounding an extension of an area where 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
[画像処理装置]
続いて、本実施例に係る画像処理装置の機能的構成について説明する。図2は、実施例1に係る画像処理装置の機能的構成を示すブロック図である。図2に示す画像処理装置10は、カメラ11等によって撮影された画像中に含まれるカラーパッチ1の貫通孔3によって形成された計測領域の色を計測するために、計測領域を取り囲む標示領域の並び順を特定する画像処理を実行するものである。
[Image processing device]
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. 2 measures the color of the measurement area formed by the through
かかる画像処理装置10の一態様としては、デジタルカメラが接続されたパーソナルコンピュータやカメラ機能を搭載するスマートフォン等の携帯端末に上記の画像処理サービスを提供する画像処理プログラムをインストールさせることにより実装できる。他の一態様としては、上記の画像処理プログラムを実行するWebサーバとして実装することとしてもよいし、また、画像処理サービスをアウトソーシングにより提供するクラウドとして実装することもできる。
As an aspect of the
図2に示すように、画像処理装置10は、カメラ11と、記憶部13と、制御部15とを有する。なお、画像処理装置10は、図2に示した機能部以外にも既知のコンピュータが有する各種の機能部、例えば各種の入力デバイス、音声出力デバイスや外部の装置と通信を行うための通信インタフェースなどの機能部を有することとしてもかまわない。
As illustrated in FIG. 2, the
カメラ11は、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)などを用いた撮像装置である。かかるカメラ11の実装例としては、デジタルカメラを接続することとしてもよいし、携帯端末のように、カメラが予め搭載されている場合にはそのカメラを使用することができる。なお、ここでは、画像処理装置10がカメラ11を有する場合を例示したが、ネットワーク経由または記憶デバイス経由で画像を取得できる場合には、必ずしもカメラ11を有する必要はない。
The
記憶部13は、制御部15で実行されるOS(Operating System)や画像処理プログラムなどの各種プログラムを記憶する記憶デバイスである。記憶部13の一態様としては、フラッシュメモリなどの半導体メモリ素子、ハードディスク、光ディスクなどの記憶装置が挙げられる。なお、記憶部13は、上記の種類の記憶装置に限定されるものではなく、RAM(Random Access Memory)、ROM(Read Only Memory)であってもよい。
The
記憶部13は、制御部15で実行されるプログラムに用いられるデータの一例として、計測領域データ13aと、対応輪郭点データ13bと、並び順データ13cとを記憶する。なお、記憶部13は、計測領域データ13aや対応輪郭点データ13b以外にも、カラーパッチ1の標示領域のRGB値が定義されたマスタデータ等を記憶することもできる。
The
計測領域データ13aは、計測領域に関するデータである。以下では、領域の輪郭を形成する画素のことを「輪郭点」と記載するとともに、計測領域の輪郭点へ採番される番号のことを「輪郭点番号」と記載する場合がある。かかる計測領域データ13aの一態様としては、計測領域に付与された領域番号、計測領域の各輪郭点の輪郭点番号および各輪郭点の位置情報が対応付けられたデータが挙げられる。一例として、計測領域データ13aは、計測領域の各輪郭点に輪郭点番号が採番された場合に、採番部15dによって登録される。 The measurement area data 13a is data related to the measurement area. Hereinafter, the pixels forming the contour of the region are referred to as “contour points”, and the numbers assigned to the contour points of the measurement region may be referred to as “contour point numbers”. As one aspect of the measurement region data 13a, there is data in which the region number assigned to the measurement region, the contour point number of each contour point in the measurement region, and the position information of each contour point are associated with each other. As an example, the measurement area data 13a is registered by the numbering unit 15d when the outline point number is assigned to each outline point of the measurement area.
対応輪郭点データ13bは、計測領域の輪郭点と最も距離が近い領域の輪郭点に関するデータである。以下では、計測領域の輪郭点と最も近い距離を持つ領域の輪郭点のことを、計測領域の輪郭点に対応する域の輪郭点という意味合いから「対応輪郭点」と記載する場合がある。かかる対応輪郭点データ13bの一態様としては、領域に付与された領域番号ごとに当該領域が持つ対応輪郭点の個数と、当該領域が持つ対応輪郭点に付与された輪郭点番号の合計値とが対応付けられたデータが挙げられる。一例として、対応輪郭点データ13bは、対応輪郭点が抽出された場合に、対応輪郭点が抽出された領域の領域番号に対応付けられた対応輪郭点の個数及び対応輪郭点に付与された輪郭点番号の合計値が後述の更新部15gによって更新される。
Corresponding contour point data 13b is data relating to the contour point of the region closest to the contour point of the measurement region. Hereinafter, the contour point of the region having the closest distance to the contour point of the measurement region may be referred to as “corresponding contour point” in the sense of the contour point of the region corresponding to the contour point of the measurement region. As one mode of the corresponding contour point data 13b, for each region number assigned to the region, the number of corresponding contour points that the region has, and the total value of the contour point numbers assigned to the corresponding contour points that the region has, Are associated with each other. As an example, when the corresponding contour point is extracted, the corresponding contour point data 13b includes the number of corresponding contour points associated with the region number of the region from which the corresponding contour point is extracted and the contour given to the corresponding contour point. The total value of the point numbers is updated by the
並び順データ13cは、カラーパッチ1の並び順に関するデータである。ここで言う「並び順」には、カラーパッチ1の計測領域に近接する領域の並び順と、計測領域を起点として近接領域よりも外側に配置された領域の並び順とが含まれる。以下では、計測領域に近接する領域のことを「近接領域」と記載する場合がある。さらに、以下では、計測領域を起点として近接領域よりも外側に配置された領域のことを「外側領域」と記載する場合がある。
The arrangement order data 13 c is data relating to the arrangement order of the
かかる並び順データ13cの一態様としては、計測領域の輪郭を時計回りに周回する場合の並び順と、近接領域の領域番号と、外側領域の領域番号とが対応付けられたデータを採用できる。一例として、並び順データ13cは、近接領域の領域番号と並び順との対応付けがなされた場合に、2つの並び順のうち近接領域の領域番号の並び順が後述の第1対応付け部15jによって登録される。他の一例として、並び順データ13cは、外側領域の領域番号と並び順との対応付けがなされた場合に、残りの外側領域の領域番号の並び順が後述の第2対応付け部15kによって登録される。
As one aspect of the arrangement order data 13c, data in which the arrangement order in the case where the outline of the measurement area is rotated clockwise, the area number of the proximity area, and the area number of the outer area can be used. As an example, when the order number data 13c is associated with the area number of the adjacent area and the arrangement order, the arrangement order of the area numbers of the adjacent areas of the two arrangement orders is the first association unit 15j described later. Registered by As another example, the arrangement order data 13c is registered in the
制御部15は、各種の処理手順を規定したプログラムや制御データを格納するための内部メモリを有し、これらによって種々の処理を実行する。制御部15は、図2に示すように、取得部15aと、グルーピング部15bと、選択部15cと、採番部15dと、抽出部15eと、付与部15fと、更新部15gと、算出部15hと、第1対応付け部15jとを有する。さらに、制御部15は、第2対応付け部15kと、貫通領域判別部15mと、出力部15nとを有する。
The
取得部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
グルーピング部15bは、画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングする処理部である。一態様としては、グルーピング部15bは、取得部15aによって取得された画像に含まれる画素のうち輝度が所定の閾値、例えば100以上である画素を対象に、隣接する画素間でR成分、G成分及びB成分が類似する画素同士をグルーピングする。このように、閾値以上の画素に絞ってグルーピングするのは、カラーパッチ1の標示領域および計測領域に露出すると想定される肌に対応する画素以外の画素をグルーピングの対象から除外することによって処理の精度および効率を向上させるためである。その後、グルーピング部15bは、グルーピングの結果として得られた領域に当該領域を識別する領域番号を付与する。
The
ここで、図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
選択部15cは、グルーピング部15bによってグルーピングされた領域のうち、カラーパッチ1の貫通孔3によって形成される計測領域に対応するものを選択する処理部である。一態様としては、選択部15cは、カラーパッチ1の貫通孔3の形状に対応する形状の領域を選択する。例えば、図1に示すカラーパッチ1のように、貫通孔3の形状が円形に形成されている場合には、図4に示した領域番号1〜23のうち形状が円形である領域番号11を計測領域として選択すればよい。このとき、カラーパッチ1の表示面が正面から撮影されていない場合には、貫通孔3の形状が変形する場合がある。この場合には、楕円形状を持つ領域番号のものを計測領域として選択すればよい。なお、カラーパッチ1の貫通孔の形状が円形でなく、多角形である場合には、形状が先の多角形である領域番号の領域を計測領域として選択すればよい。
The
採番部15dは、画像上で計測領域の輪郭を形成する各輪郭点に番号を採番する処理部である。一態様としては、採番部15dは、画像の左上の点を原点とし、画像の幅方向をX軸、高さ方向をY軸とした場合に、計測領域の輪郭点のうちY座標が最も小さい値を持つ画素を起点とし、起点から時計回りに計測領域の輪郭点を探索する。その上で、採番部15dは、計測領域の輪郭点へ輪郭点番号を探索順に採番する。その後、採番部15dは、計測領域の領域番号、各輪郭点の輪郭点番号および各輪郭点の位置情報を対応付けて計測領域データ13aとして記憶部13へ登録する。なお、ここでは、計測領域の輪郭点のうちY座標が最も小さい値を持つ画素を起点とする場合を例示したが、計測領域の任意の輪郭点を起点とすることができる。また、ここでは、計測領域の輪郭点へ昇順に番号を採番する場合を想定するが、開示の装置はこれに限定されず、降順に番号を付与することもできる。
The numbering unit 15d is a processing unit that numbers each contour point that forms the contour of the measurement region on the image. As one aspect, the numbering unit 15d uses the upper left point of the image as the origin, the X direction is the width direction of the image, and the Y axis is the height direction. A pixel having a small value is set as a starting point, and a contour point in the measurement region is searched clockwise from the starting point. Then, the numbering unit 15d assigns contour point numbers to the contour points of the measurement region in the search order. Thereafter, the numbering unit 15d associates the region number of the measurement region, the contour point number of each contour point, and the position information of each contour point, and registers them in the
抽出部15eは、計測領域データ13aを用いて、計測領域の輪郭点ごとに、各領域の輪郭点のうち当該計測領域の輪郭点と最も距離が近い対応輪郭点を抽出する処理部である。一態様としては、領域ごとに当該領域の輪郭点のうち最も計測領域に近い位置にある輪郭点と計測領域の輪郭点との間で両者の輪郭点間の距離を算出する。その上で、抽出部15eは、最も計測領域の輪郭点との間で距離が短い輪郭点を対応輪郭点として抽出する。このようにして、抽出部15eは、計測領域の全輪郭点を対象に、対応輪郭点を抽出する処理を繰り返し実行する。 The extraction unit 15e is a processing unit that extracts, for each contour point in the measurement region, a corresponding contour point that is closest to the contour point in the measurement region, for each contour point in the measurement region, using the measurement region data 13a. As one aspect, the distance between the contour points between the contour point closest to the measurement region and the contour point of the measurement region is calculated for each region. Then, the extracting unit 15e extracts a contour point having a short distance from the contour point of the measurement region as a corresponding contour point. In this way, the extraction unit 15e repeatedly executes a process of extracting corresponding contour points for all contour points in the measurement region.
付与部15fは、対応輪郭点に計測領域の輪郭点の輪郭点番号を付与する処理部である。一態様としては、付与部15fは、抽出部15eによって対応輪郭点が抽出された場合に、当該対応輪郭点に対し、計測領域の輪郭点の輪郭点番号を付与する。
The assigning
更新部15gは、対応輪郭点データ13bを更新する処理部である。一態様としては、更新部15gは、抽出部15eによって対応輪郭点が抽出される度に、記憶部13に記憶された対応輪郭点データ13bのうち対応輪郭点が抽出された領域の領域番号を持つ対応輪郭点データを対象に、次のような処理を実行する。すなわち、更新部15gは、当該領域が持つ対応輪郭点の個数を1つインクリメントするとともに、当該領域が持つ対応輪郭点に付与された輪郭点番号の合計値に今回抽出された対応輪郭点へ付与された輪郭点番号を加算する更新を実行する。
The
算出部15hは、対応輪郭点データ13bを用いて、領域別に当該領域の代表値を算出する処理部である。一態様としては、算出部15hは、計測領域の全ての輪郭点にわたって対応輪郭点が抽出されると、対応輪郭点データ13bを参照して、最大の対応輪郭点の個数を取得する。そして、算出部15hは、最大の対応輪郭点の個数に所定の係数、例えば5%を乗算することによって標示領域の並び順に含めるにあたって不適正な領域をフィルタリングする閾値を算出する。続いて、算出部15hは、対応輪郭点データ13bのうち対応輪郭点の個数が先に算出した閾値を超える対応輪郭点データ13bを読み出す。これによって、対応輪郭点の個数が閾値以下である対応輪郭点データ13bを除外する。その上で、算出部15hは、先に読み出した対応輪郭点データ13bごとに対応輪郭点へ付与された輪郭点番号の合計値を対応輪郭点の個数で除算する計算を実行することによって領域番号別の輪郭点番号の平均値を各領域の代表値として算出する。なお、ここでは、対応輪郭点の個数の最大値からフィルタリングの閾値を算出する場合を例示したが、対応輪郭点の個数がゼロである対応輪郭点データ13bだけを除外して読み出すこととしてもかまわない。
The
このように、算出部15hは、最大の対応輪郭点の個数から導出される閾値を用いて、近接領域として並び順に対応付けるのに使用する対応輪郭点データ13bをフィルタリングする。これによって、対応輪郭点を持たない外側領域や対応輪郭点を持っていてもノイズとなる微少な領域等の領域番号が並び順位対応付けられるのを防止することができる。
In this way, the
図5は、対応輪郭点の一例を示す図である。図5の例では、各々の四角のマスが対応輪郭点を指す。この四角のマスの中の数字は、計測領域の輪郭点から各々の領域の対応輪郭点に付与された輪郭点番号を指す。これら対応輪郭点のうち、同一の領域に属する対応輪郭点には、同一の塗りつぶしがなされている。図5に示すように、輪郭点番号1〜7まで連続した後に輪郭点番号8〜9を跳ばして輪郭点番号10〜11は、同一の領域が持つ対応輪郭点であり、対応輪郭点の個数は9個となる。この場合には、対応輪郭点の輪郭点番号の合計である「49=1+2+3+4+5+6+7+10+11」を対応輪郭点の個数「9」で除算することによって代表値が「5」と算出される。また、輪郭点番号8〜9まで連続した後に輪郭点番号10〜11を跳ばして輪郭点番号12〜17は、同一の領域が持つ対応輪郭点であり、対応輪郭点の個数は8個となる。この場合には、対応輪郭点の輪郭点番号の合計である「104=8+9+12+13+14+15+16+17」を対応輪郭点の個数「8」で除算することによって代表値が「13」と算出される。さらに、輪郭点番号18〜20は、同一の領域が持つ対応輪郭点であり、対応輪郭点の個数は3個となる。この場合には、対応輪郭点の輪郭点番号の合計である「57=18+19+20」を対応輪郭点の個数「3」で除算することによって代表値が「19」と算出される。
FIG. 5 is a diagram illustrating an example of corresponding contour points. In the example of FIG. 5, each square cell indicates a corresponding contour point. The numbers in the squares indicate the contour point numbers assigned to the corresponding contour points in each region from the contour points in the measurement region. Among these corresponding contour points, corresponding contour points belonging to the same region are filled with the same color. As shown in FIG. 5, after the
第1対応付け部15jは、カラーパッチ1の計測領域に近接する近接領域の領域番号と、計測領域の輪郭を時計回りに周回する場合の並び順とを対応付ける処理部である。ここでは、一例として、計測領域の輪郭を時計回りに周回する場合の並び順に領域番号を対応付ける場合を想定する。この場合、第1対応付け部15jは、算出部15hによって算出された代表値が小さい領域の領域番号から順番に領域番号を並び順に対応付ける。その後、第1対応付け部15jは、近接領域の領域番号の並び順を並び順データ13cとして記憶部13へ登録する。
The first associating unit 15j is a processing unit that associates the region number of the adjacent region close to the measurement region of the
これによって、グルーピングされた領域のうちカラーパッチ1の計測領域に近接する近接領域の並び順が特定されることになる。かかる近接領域には、カラーパッチ1の標示領域の中でも内周に配置された白色以外の標示領域以外にも、カラーパッチ1の内周および外周を貫通する白色の標示領域が含まれる。
As a result, the arrangement order of the adjacent areas close to the measurement area of the
図6は、並び順データ13cの一例を示す図である。図7は、カラーパッチ1上における並び順を表す図である。図6に示す並び順データ13cは、2つの並び順のうち近接領域の領域番号の並び順が対応付けされた時点のものである。図6に示すように、図4に示した領域番号1〜23の領域のうち領域番号2、6、10、14、17、20、21、19、15、13、9及び5が近接領域として特定されたことを示す。図6に示す並び順データ13cは、図7に示す並び順1に図4に示した領域番号2の領域が近接領域として対応付けられたことを示す。さらに、図6に示す並び順データ13cは、図7に示す並び順2に図4に示した領域番号6の領域が近接領域として対応付けられたことを示す。さらに、図6に示す並び順データ13cは、図7に示す並び順3に図4に示した領域番号10の領域が近接領域として対応付けられたことを示す。同様に、図6に示す並び順データ13cは、図7に示す並び順4〜12に、図4に示した領域番号14、17、20、21、19、15、13、9、5の領域が近接領域として対応付けられたことを示す。
FIG. 6 is a diagram illustrating an example of the arrangement order data 13c. FIG. 7 is a diagram illustrating the arrangement order on the
第2対応付け部15kは、近接領域の領域番号の並び順にしたがって、近接領域よりも外側に存在する外側領域の並び順と、領域の領域番号とを対応付ける処理部である。一態様としては、第2対応付け部15kは、計測領域の中心座標(CX,CY)を起点とし、近接領域の中心座標(AX,AY)を経由して当該近接領域の外側に存在する外側領域まで画素を探索する。そして、第2対応付け部15kは、画素の探索が近接領域の外側に存在する領域に至った場合に、当該近接領域の外側領域の領域番号の並び順を並び順データ13cへ追加登録する。
The
これによって、グルーピングされた領域のうち近接領域よりも外側に存在する外側領域の並び順が特定されることになる。かかる外側領域には、カラーパッチ1の標示領域の中でも外周に配置された白色以外の標示領域以外にも、カラーパッチ1の内周および外周を貫通する白色の標示領域が含まれる。なお、以下では、カラーパッチ1の内周および外周を貫通する白色の標示領域のことを「貫通領域」と記載する場合がある。
As a result, the arrangement order of the outer areas existing outside the adjacent area in the grouped areas is specified. The outer area includes a white marking area penetrating the inner and outer circumferences of the
図8は、並び順データ13cの一例を示す図である。図8に示す並び順データ13cは、残りの外側領域の領域番号の並び順が対応付けされた時点のものである。図8に示すように、図4に示した領域番号1〜23の領域のうち領域番号1、4、8、18、23、22、16、7及び3が外側領域として特定されたことを示す。図8に示す並び順データ13cは、並び順1、4、7及び10に図4に示した領域番号1の領域が外側領域として対応付けられたことを示す。これらの並び順は、実際には貫通領域である白色の標示領域に対応するが、外側領域が対応付けられた時点では並び順が貫通領域であること、すなわち外側領域1が標示領域でない背景領域であることは判別されていない。これは、後述の貫通領域判別部15mによって判別される。
FIG. 8 is a diagram illustrating an example of the arrangement order data 13c. The arrangement order data 13c shown in FIG. 8 is the data when the arrangement order of the area numbers of the remaining outer areas is associated. As shown in FIG. 8, the
貫通領域判別部15mは、貫通領域を判別する処理部である。一態様としては、貫通領域判別部15mは、第2対応付け部15kによって全ての近接領域について外側領域が探索されると、計測領域の中心座標(CX,CY)から近接領域の外縁部までの距離が最長である並び順が貫通領域であると判別する。ここで、カラーパッチ1の例で言えば、貫通領域である白色の標示領域は、2つの並び順を跳ばして配置されるという規則性がある。したがって、貫通領域判別部15は、先に貫通領域であると判別した並び順Lに加え、並び順L+3、並び順L+6及び並び順L+9をさらに貫通領域であると判別する。
The penetration region determination unit 15m is a processing unit that determines a penetration region. As one aspect, when the outer area is searched for all the adjacent areas by the second associating
図9は、計測領域の中心座標から近接領域の外縁部までの距離を示す図である。図10は、図9に示した距離の数値例を示す図である。図9に示すように、計測領域の中心座標(CX,CY)を起点とし、各近接領域の中心座標(AX,AY)を経由して当該近接領域の外側に存在する外側領域まで画素を探索する過程で、計測領域の中心座標(CX,CY)から各近接領域の外縁部までの距離が測定される。この距離の測定結果が図10のものであるとしたとき、最大値「185」の距離を持つ並び順1が貫通領域であると判別される。かかる判別を行うのは、カラーパッチ1の内周および外周の二層に分けて配置された白色以外の色の標示領域の外縁部までの距離よりもカラーパッチ1の内周および外周を貫通する白色の標示領域までの距離が長いという規則性を利用するためである。そして、距離の中でも最大値に着目するのは、貫通領域である並び順をより確度よく判別するためである。このように、貫通領域がある並び順が1つ判別されると、貫通領域である白色の標示領域が2つの並び順を跳ばして配置されるという規則性をさらに利用して、残りの貫通領域がある並び順4、7及び10をさらに判別できる。
FIG. 9 is a diagram illustrating the distance from the center coordinate of the measurement region to the outer edge of the proximity region. FIG. 10 is a diagram illustrating a numerical example of the distance illustrated in FIG. As shown in FIG. 9, the search is performed from the center coordinates (CX, CY) of the measurement area to the outer area existing outside the proximity area via the center coordinates (AX, AY) of each proximity area. In the process, the distance from the center coordinates (CX, CY) of the measurement area to the outer edge of each adjacent area is measured. Assuming that the measurement result of this distance is that of FIG. 10, it is determined that the
出力部15nは、並び順データ13c及び貫通領域の判別結果を用いて、カラーパッチ1の各標示領域のRGB値を所定の出力先へ出力する処理部である。ここで、以下では、出力先へのデータの出力形式が白色の標示領域W1〜W4のRGB値および白色以外の色の標示領域C1〜C16のRGB値を出力する形式である場合を想定する。さらに、標示領域C1の輝度が標示領域C2の輝度よりも高い場合を想定する。なお、上記のRGB値は、各々の標示領域を構成する画素のRGB値の平均値であるものとする。
The output unit 15n is a processing unit that outputs the RGB value of each marking area of the
かかる出力部15nは、並び順と対応付けられた領域番号と、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16との間でマッピングを行うために、並び順データ13cの並び順のうちマッピング出力の起点とする並び順を特定する。 The output unit 15n performs mapping between the area number associated with the arrangement order, the white marking areas W1 to W4, and the marking areas C1 to C16 of colors other than white. Specify the order of mapping output from the mapping output.
これを説明すると、カラーパッチ1には、カラーパッチ1の貫通領域とその90度隣の貫通領域との間に挟まれる内側および外側の標示領域は、90度ごとに内側の標示領域の色と外側の標示領域の色が入れ替わるように配置されると規則性がある。これを利用して、出力部15nは、並び順データ13cの並び順のうち貫通領域と判別された並び順Lよりも1つ並び順が大きい近接領域、すなわち貫通領域よりも1つ右側にある近接領域の輝度がその外側領域の輝度よりも大きいか否かを判定する。このように、互いに隣接する近接領域及び外側領域を比較するのは、局所的に見れば、光源による影響が少ないからである。さらに、輝度を比較するのは、光源による影響がRGB値よりも輝度の方が光源によって受ける影響が小さく、撮影によって近接領域と外側領域の輝度の大小関係が逆転するケースは想定しなくてよいからである。
Explaining this, the
そして、近接領域の輝度がその外側領域の輝度よりも高い場合には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順と対応すると判別できる。この場合には、出力部15nは、並び順をシフトさせずに、当該貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする。一方、近接領域の輝度がその外側領域の輝度以下である場合には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順とズレていると判別できる。この場合には、出力部15nは、貫通領域の並び順Lよりも1つの先の貫通領域の並び順L+3が並び順Lとなるように並び順をシフトする。これによって、出力部15nは、元の並び順L+3を並び順Lへシフトさせ、元の並び順L+6を並び順L+3へシフトさせ、元の並び順L+9を並び順L+6へシフトさせ、元の並び順Lを並び順L+9へシフトさせる。このようにして、画像に写るカラーパッチ1を90度回転させた場合の並び順にシフトさせる。その後、出力部15nは、シフト後の貫通領域の並び順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 15n starts from the arrangement order L of the penetrating areas without shifting the arrangement order, and uses the area numbers associated with each arrangement order as 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 15n shifts the arrangement order so that the arrangement order L + 3 of the penetrating area one prior to the arrangement order L of the through areas becomes the arrangement order L. Accordingly, the output unit 15n 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
例えば、標示領域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.
ここで、図11を用いて、マッピングの具体例を説明する。図11は、マッピングの一例を示す図である。図11に示すように、図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. 11 is a diagram illustrating an example of mapping. As shown in FIG. 11, the area of
その後、出力部15nは、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域ごとに当該標示領域に含まれる画素のRGB値の平均値を算出する。その上で、出力部15nは、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域別に算出されたRGB値を所定の出力先へ出力する。このとき、出力部15nは、各々の標示領域のRGB値とともに、各々の標示領域の色が本来有するRGB値を併せて出力することもできる。 Thereafter, the output unit 15n calculates an 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 15n 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 15n can also output the RGB values inherent in the colors of the respective marking areas together with the RGB values of the respective marking areas.
図12は、マッピング出力の一例を示す図である。図12に示すように、図11に示したマッピングされた白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域ごとに当該標示領域に含まれる画素のRGB値の平均値が算出される。その上で、白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16の各々の標示領域別に算出されたRGB値の平均値とともに、各々の標示領域の色が本来有するRGB値が出力される。 FIG. 12 is a diagram illustrating an example of the mapping output. As shown in FIG. 12, the RGB values of the pixels included in each of the marking areas 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
なお、制御部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
[処理の流れ]
次に、本実施例に係る画像処理装置10の処理の流れについて説明する。なお、ここでは、画像処理装置10によって実行される(1)全体処理を説明した後に、全体処理のサブフローとして実行される(2)第1対応付け処理および(3)第2対応付け処理を説明する。
[Process flow]
Next, a processing flow of the
(1)全体処理
図13は、実施例1に係る画像処理装置10の全体処理の手順を示すフローチャートである。この全体処理は、取得部15aによって画像が取得された場合に処理が起動される。図13に示すように、画像が取得されると(ステップS101)、画像処理装置10は、画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングする(ステップS102)。
(1) Overall Processing FIG. 13 is a flowchart illustrating a procedure of overall processing of the
そして、画像処理装置10は、グルーピングされた領域のうち、カラーパッチ1の貫通孔3によって形成される計測領域に対応する領域を選択する(ステップS103)。
Then, the
その後、画像処理装置10は、カラーパッチ1の計測領域に近接する近接領域の領域番号と、計測領域の輪郭を時計回りに周回する場合の並び順とを対応付ける「第1対応付け処理」を実行する(ステップS104)。
Thereafter, the
続いて、画像処理装置10は、近接領域の領域番号の並び順にしたがって、近接領域よりも外側に存在する外側領域の並び順と、領域の領域番号とを対応付ける「第2対応付け処理」を実行する(ステップS105)。
Subsequently, the
そして、画像処理装置10は、計測領域の中心座標(CX,CY)から近接領域の外縁部までの距離が最長である並び順Lと、その並び順と一定の規則にある並び順L+3、L+6及びL+9とを貫通領域であると判別する(ステップS106)。
The
続いて、画像処理装置10は、並び順データ13cの並び順のうち貫通領域と判別された並び順Lよりも1つ並び順が大きい近接領域の輝度がその外側領域の輝度よりも大きいか否かを判定する(ステップS107)。
Subsequently, the
このとき、近接領域の輝度がその外側領域の輝度以下である場合(ステップS107否定)には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順とズレていると判別できる。この場合には、画像処理装置10は、貫通領域の並び順Lよりも1つの先の貫通領域の並び順L+3が並び順Lとなるように並び順をシフトする(ステップS108)。その上で、画像処理装置10は、シフト後の貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする(ステップS109)。
At this time, if the brightness of the proximity area is equal to or less than the brightness of the outside area (No in step S107), the arrangement order of the proximity area and the outside area is different from the alignment order of the marking area defined in the data output format. Can be determined. In this case, the
一方、近接領域の輝度がその外側領域の輝度よりも高い場合(ステップS107肯定)には、近接領域及び外側領域の並び順がデータの出力形式で定められている標示領域の整列順と対応すると判別できる。この場合には、画像処理装置10は、並び順をシフトさせずに、当該貫通領域の並び順Lを起点とし、各々の並び順と対応付けられた領域番号を白色の標示領域W1〜W4および白色以外の色の標示領域C1〜C16とマッピングする(ステップS109)。
On the other hand, when the brightness of the proximity area is higher than the brightness of the outside area (Yes in step S107), the arrangement order of the proximity area and the outside area corresponds to the order of arrangement of the marking areas defined in the data output format. Can be determined. In this case, the
その後、画像処理装置10は、各々の標示領域W1〜W4およびC1〜C16のRGB値とともに、各々の標示領域W1〜W4およびC1〜C16のRGBの色が本来有するRGB値を併せて所定の出力先へ出力し(ステップS110)、処理を終了する。
Thereafter, the
(2)第1対応付け処理
図14は、実施例1に係る第1対応付け処理の手順を示すフローチャートである。この第1対応付け処理は、図13に示したステップS104に対応する処理であり、計測領域が選択された後に実行される。
(2) First Association Processing FIG. 14 is a flowchart illustrating a procedure of first association processing according to the first embodiment. This first association process is a process corresponding to step S104 shown in FIG. 13, and is executed after the measurement region is selected.
図14に示すように、まず、画像処理装置10は、各領域別に対応輪郭点の個数及び輪郭点番号の合計値を保持する代表値算出用のレジスタの値をゼロにそれぞれ初期化する(ステップS301)。続いて、画像処理装置10は、計測領域の各輪郭点に輪郭点番号を採番する(ステップS302)。その後、画像処理装置10は、計測領域の輪郭点番号をカウントするカウンタAに初期値、例えば輪郭点番号が開始する番号を設定する初期化を実行する(ステップS303)。
As shown in FIG. 14, first, the
そして、輪郭点番号のカウンタAの値が計測領域の全輪郭点の数、すなわち最後の輪郭点番号を超えるまで(ステップS304否定)、下記に説明するステップS305〜ステップS315までの処理を繰り返し実行する。 Then, until the value of the contour point number counter A exceeds the number of all contour points in the measurement region, that is, the last contour point number (No in step S304), the processing from step S305 to step S315 described below is repeatedly executed. To do.
すなわち、画像処理装置10は、領域番号及び最短距離の対を保持する最短距離用のレジスタの値を初期化する(ステップS305)。例えば、領域番号の値がゼロへ初期化されるとともに、最短距離の値が計測領域の輪郭点および領域の輪郭点間の距離よりも大きいとみなすことができる距離、例えば画像の幅のピクセル数+画像の高さのピクセル数へ初期化される。そして、画像処理装置10は、領域番号をカウントするカウンタBに初期値、例えば領域番号が開始する番号を設定する初期化を実行する(ステップS306)。
In other words, the
その上で、画像処理装置10は、領域番号のカウンタBの値が全領域数以下であるか否かを判定する(ステップS307)。このとき、領域番号のカウンタBの値が全領域数以下である場合(ステップS307肯定)には、画像処理装置10は、領域番号のカウンタBの値が計測領域の領域番号でないかどうかをさらに判定する(ステップS308)。なお、領域番号のカウンタBの値が計測領域の領域番号である場合(ステップS308否定)には、ステップS312の処理へ移行する。
Then, the
そして、領域番号のカウンタBの値が計測領域の領域番号ではない場合(ステップS308肯定)には、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、カウンタBの領域番号に対応する領域の輪郭点のうち最も計測領域に近い位置にある輪郭点と計測領域の輪郭点Aとの間で両者の輪郭点間の距離dを算出する(ステップS309)。
If the value of the area number counter B is not the area number of the measurement area (Yes at step S308), the
このとき、輪郭点間の距離dが最短距離用のレジスタの値よりも小さい場合(ステップS310肯定)には、画像処理装置10は、最短距離用のレジスタの値をカウンタBに保持された領域番号および距離dへ更新する(ステップS311)。そして、画像処理装置10は、領域番号のカウンタBの値を1つインクリメントし(ステップS312)、ステップS307の処理へ移行する。なお、輪郭点間の距離dが最短距離用のレジスタの値以上である場合(ステップS310否定)には、最短距離用のレジスタの値を更新せずに、ステップS312の処理へ移行する。
At this time, when the distance d between the contour points is smaller than the value of the register for the shortest distance (Yes in step S310), the
その後、領域番号のカウンタBの値が全領域数を超えた場合(ステップS307否定)には、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、代表値算出用のレジスタに保持された対応輪郭点の個数のうち最短距離用のレジスタに保持された領域番号に対応する対応輪郭点の個数の値を1つインクリメントする(ステップS313)。
Thereafter, when the value of the region number counter B exceeds the total number of regions (No in step S307), the
続いて、画像処理装置10は、代表値算出用のレジスタに保持された輪郭点番号の合計値のうち最短距離用のレジスタに保持された領域番号に対応する輪郭点番号の合計値に輪郭点番号のカウンタAの値を加算する(ステップS314)。そして、画像処理装置10は、輪郭点番号のカウンタAの値を1つインクリメントし(ステップS315)、ステップS304の処理へ移行する。
Subsequently, the
その後、輪郭点番号のカウンタAの値が計測領域の全輪郭点の数、すなわち最後の輪郭点番号を超えると(ステップS304否定)、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、代表値算出用のレジスタに保持された対応輪郭点の個数のうち最大の対応輪郭点の個数に所定の係数を乗算することによって標示領域の並び順に含めるのに不適正な領域をフィルタリングする閾値を算出する(ステップS316)。
Thereafter, when the value of the contour point number counter A exceeds the number of all contour points in the measurement area, that is, the last contour point number (No in step S304), the
続いて、画像処理装置10は、代表値算出用のレジスタに保持された対応輪郭点の個数がステップS316で算出した閾値以下である領域番号の対応輪郭点の個数および輪郭点番号の合計値を代表値の算出対象から除外する(ステップS317)。
Subsequently, the
その上で、画像処理装置10は、代表値算出用のレジスタに保持された輪郭点番号の合計値を対応輪郭点の個数で除算する計算を領域番号別に実行することによって領域番号別の輪郭点番号の平均値を各領域の代表値として算出する(ステップS318)。
After that, the
その後、画像処理装置10は、ステップS318で算出された代表値が小さい領域の領域番号から順番に領域番号を並び順に対応付け(ステップS319)、処理を終了する。
Thereafter, the
(3)第2対応付け処理
図15及び図16は、実施例1に係る第2対応付け処理の手順を示すフローチャートである。この第2対応付け処理は、図13に示したステップS105に対応する処理であり、図14に示した第1対応付け処理が実行された後に実行される。
(3) Second Association Processing FIGS. 15 and 16 are flowcharts illustrating the procedure of the second association processing according to the first embodiment. This second association process is a process corresponding to step S105 shown in FIG. 13, and is executed after the first association process shown in FIG. 14 is executed.
図15に示すように、画像処理装置10は、計測領域の中心から近接領域の外縁部までの最長外縁距離および最長外縁距離を持つ領域番号である最長外縁領域を保持する最長外縁距離用のレジスタに初期値、例えばゼロを設定する初期化を実行する(ステップS501)。
As shown in FIG. 15, the
続いて、画像処理装置10は、計測領域の中心の座標(CX,CY)を計算する(ステップS502)。そして、画像処理装置10は、近接領域の領域番号をカウントするカウンタAに初期値、例えば最初の並び順に対応する近接領域の領域番号を設定する初期化を実行する(ステップS503)。
Subsequently, the
このとき、近接領域の領域番号のカウンタAに全ての近接領域の領域番号がカウントされるまで(ステップS504否定)、下記のステップS506〜ステップS516までの処理を繰り返し実行する。 At this time, the following steps S506 to S516 are repeatedly executed until the area numbers of all adjacent areas are counted by the area number counter A of the adjacent areas (No in step S504).
すなわち、画像処理装置10は、カウンタAに保持された領域番号に対応する近接領域の中心の座標(AX,AY)を計算する(ステップS505)。そして、画像処理装置10は、計測領域の中心から近接領域の中心へ向かう直線のXY増分を算出する(ステップS506)。
That is, the
例えば、上記のXY増分の算出は、次のようにして算出できる。すなわち、画像処理装置10は、近接領域の中心の座標(AX,AY)と計測領域の中心の座標(CX,CY)の間でX差分とY差分を算出する。このとき、X差分の絶対値がY差分の絶対値よりも小さい場合には、画像処理装置10は、X差分をY差分の絶対値で除算することによってX増分を算出する。その上で、画像処理装置10は、Y差分が正であるならばY増分を「1」とし、Y差分が負であるならばY増分を「−1」に定める。一方、Y差分の絶対値がX差分の絶対値以下である場合には、画像処理装置10は、Y差分をX差分の絶対値で除算することによってY増分を算出する。その上で、画像処理装置10は、X差分が正であるならばX増分を「1」とし、X差分が負であるならばX増分を「−1」に定める。かかるXY増分によって、画素を1ピクセルずつ探索することが可能になる。
For example, the above XY increment can be calculated as follows. That is, the
続いて、画像処理装置10は、計測領域の中心の座標(CX,CY)から近接領域の中心の座標(AX,AY)を経由して外側領域まで探索する探索画素の座標カウンタ(X,Y)に初期値、例えば計測領域の中心の座標(CX,CY)を設定する初期化を実行する(ステップS507)。
Subsequently, the
そして、画像処理装置10は、探索画素の座標(X,Y)が画像内であるか否かを判定する(ステップS508)。このとき、探索画素の座標(X,Y)が画像内である場合(ステップS508肯定)には、画像処理装置10は、探索画素の座標(X,Y)が近接領域内であるか否かをさらに判定する(ステップS509)。
Then, the
ここで、探索画素の座標(X,Y)が近接領域内である場合(ステップS509肯定)には、画像処理装置10は、計測領域の中心の座標(CX,CY)から探索画素の座標(X,Y)までの距離dを算出する(ステップS510)。
Here, when the coordinates (X, Y) of the search pixel are within the proximity region (Yes in step S509), the
このとき、探索画素までの距離dが最長外縁距離用のレジスタに保持された最長外縁距離よりも大きい場合(ステップS511肯定)には、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、最長外縁距離用のレジスタに保持された最長外縁距離の値をステップS510で算出された距離dに更新するとともに、最長外縁領域の値をカウンタAに保持された近接領域の領域番号に更新する(ステップS512)。その後、画像処理装置10は、探索画素の座標カウンタ(X,Y)にステップS506で算出したXY増分を加算し(ステップS513)、ステップS508の処理へ移行する。
At this time, when the distance d to the search pixel is larger than the longest outer edge distance held in the register for the longest outer edge distance (Yes in step S511), the
一方、探索画素までの距離dが最長外縁距離用のレジスタに保持された最長外縁距離以下である場合(ステップS511否定)には、画像処理装置10は、次のような処理を実行する。すなわち、画像処理装置10は、最長外縁距離用のレジスタの更新を実行せずに、探索画素の座標カウンタ(X,Y)にステップS506で算出したXY増分を加算し(ステップS513)、ステップS508の処理へ移行する。
On the other hand, when the distance d to the search pixel is less than or equal to the longest outer edge distance held in the longest outer edge distance register (No in step S511), the
また、探索画素の座標(X,Y)が近接領域外である場合(ステップS509否定)には、画像処理装置10は、探索画素の座標(X,Y)が計測領域外であるか否かを判定する(ステップS514)。
When the coordinates (X, Y) of the search pixel are outside the proximity region (No in step S509), the
このとき、探索画素の座標(X,Y)が計測領域内である場合(ステップS514否定)には、画像処理装置10は、探索画素の座標カウンタ(X,Y)にステップS506で算出したXY増分を加算し(ステップS513)、ステップS508の処理へ移行する。
At this time, if the coordinates (X, Y) of the search pixel are within the measurement region (No in step S514), the
一方、探索画素の座標(X,Y)が計測領域外である場合(ステップS514肯定)には、探索画素が近接領域および計測領域にも所在せず、近接領域の外縁部に到達したことがわかる。この場合には、画像処理装置10は、カウンタAに保持された領域番号を持つ近接領域の並び順に探索画素の座標(X,Y)を内包する外側領域の領域番号を対応付ける(ステップS515)。その後、画像処理装置10は、近接領域の領域番号のカウンタAの値を次の並び順の近接領域の領域番号へ更新し(ステップS516)、ステップS504へ移行する。
On the other hand, when the coordinates (X, Y) of the search pixel are outside the measurement region (Yes in step S514), the search pixel is not located in the proximity region and the measurement region, but has reached the outer edge of the proximity region. Recognize. In this case, the
また、探索画素の座標(X,Y)が画像内でない場合(ステップS508否定)にも、画像処理装置10は、近接領域の領域番号のカウンタAの値を次の並び順の近接領域の領域番号へ更新し(ステップS516)、ステップS504へ移行する。
Even when the coordinates (X, Y) of the search pixel are not in the image (No in step S508), the
その後、近接領域の領域番号のカウンタAに全ての近接領域の領域番号がカウントされた場合(ステップS504肯定)には、画像処理装置10は、処理を終了する。
Thereafter, when the area numbers of all adjacent areas are counted by the area number counter A of the adjacent areas (Yes in step S504), the
[実施例1の効果]
上述してきたように、本実施例に係る画像処理装置10は、画像上でカラーパッチ1の計測領域の輪郭点を探索して得た各近接領域が持つ輪郭点数と輪郭点番号の合計値から代表値を求めて領域を並び順に対応付ける。このため、本実施例に係る画像処理装置10では、カラーパッチ1にマーク等を付加せずとも並び順を特定できる。さらに、本実施例に係る画像処理装置10では、標示領域の接合関係を組合せにより判断せずとも、四則演算を中心にした処理で標示領域の並び順を得ることができる。
[Effect of Example 1]
As described above, the
したがって、本実施例に係る画像処理装置10によれば、カラーパッチ1のデザイン性を損なわず、カラーパッチ1の標示領域の並び順を簡易に抽出できる。さらに、本実施例に係る画像処理装置10では、標示領域を区切る境界線の有無とは無関係にカラーパッチ1の標示領域の並び順を抽出できるので、汎用性も高めることができる。
Therefore, according to the
さて、これまで開示の装置に関する実施例について説明したが、本発明は上述した実施例以外にも、種々の異なる形態にて実施されてよいものである。そこで、以下では、本発明に含まれる他の実施例を説明する。 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.
[応用例]
例えば、上記の実施例1では、外側領域の領域番号を並び順に対応付けるにあたって探索画素が近接領域から離脱した段階でその画素を含む領域を外側領域としてみなす場合を例示したが、必ずしも近接領域から離脱した段階で外側領域と判断する必要はない。
[Application example]
For example, in the first embodiment, the case where the area including the pixel is regarded as the outer area when the search pixel leaves the adjacent area when the area numbers of the outer areas are associated with each other in order is illustrated. At this stage, it is not necessary to determine the outer region.
すなわち、開示の装置は、外側領域でも小さい領域を除く処理を追加することができる。例えば、計測領域の中心から各近接領域の中心の向きで探索する場合に、近接領域の始まりと終わりの座標を記録し、近接領域の外側領域の候補を探索する時にも当該領域の始まりと終わりの座標を記録し、これらの座標から近接領域及び外側領域候補の幅を算出する。そして、開示の装置は、近接領域と外側領域候補の幅が同等である場合は、当該外側領域候補を、当該近接領域に対応する外側領域と記録する。一方、開示の装置は、近接領域と外側領域候補の幅が同等でなかった場合は、当該外側領域候補は対応する外側領域ではないと判断し、次の領域を探索する処理を続ける。かかる手順によって、近接領域と外側領域の間にある非常に小さい領域を除外し、正規の領域による外側領域を取り出すことが可能になる。 In other words, the disclosed apparatus can add processing for excluding a small region even in the outer region. For example, when searching in the direction from the center of the measurement area to the center of each proximity area, the coordinates of the start and end of the proximity area are recorded, and the start and end of the area are also searched when searching for candidates for the outer area of the proximity area. Are recorded, and the widths of the proximity region and the outside region candidate are calculated from these coordinates. Then, when the widths of the proximity area and the outside area candidate are equal, the disclosed apparatus records the outside area candidate as the outside area corresponding to the proximity area. On the other hand, when the widths of the proximity area and the outside area candidate are not equal, the disclosed apparatus determines that the outside area candidate is not a corresponding outside area, and continues the process of searching for the next area. Such a procedure makes it possible to exclude a very small area between the adjacent area and the outer area, and to take out the outer area of the regular area.
[変形例]
上記の実施例1では、図1に示したカラーパッチ1に対応する画像処理について例示したが、カラーパッチ1と同様の規則性を有するカラーパッチであれば、領域数や領域の大きさが異なっても標示領域の並び順を同様に特定することが可能である。図17は、変形例を説明するための図である。図17に示すカラーパッチ5のように、90度ごとに近接領域と外側領域が2つずつでなく、1つずつであり、各々の領域の大きさが異なる場合でも、同様にして、各々の標示領域の並び順を特定できる。
[Modification]
In the first embodiment, the image processing corresponding to the
[分散および統合]
また、図示した各装置の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、制御部15内の機能部15a〜15nの一部を画像処理装置10の外部装置としてネットワーク経由で接続するようにしてもよい。また、制御部15内の機能部15a〜15nの一部を別の装置がそれぞれ有し、ネットワーク接続されて協働することで、上記の画像処理装置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 15a to 15n in the
[画像処理プログラム]
また、上記の実施例で説明した各種の処理は、予め用意されたプログラムをパーソナルコンピュータやワークステーションなどのコンピュータで実行することによって実現することができる。そこで、以下では、図18を用いて、上記の実施例と同様の機能を有する画像処理プログラムを実行するコンピュータの一例について説明する。
[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.
図18は、実施例1及び実施例2に係る画像処理プログラムを実行するコンピュータの一例について説明するための図である。図18に示すように、コンピュータ100は、操作部110aと、スピーカ110bと、カメラ110cと、ディスプレイ120と、通信部130とを有する。さらに、このコンピュータ100は、CPU150と、ROM160と、HDD170と、RAM180とを有する。これら110〜180の各部はバス140を介して接続される。
FIG. 18 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. 18, the
HDD170には、図18に示すように、上記の実施例1で示した制御部15内の機能部15a〜15nと同様の機能を発揮する画像処理プログラム170aが予め記憶される。この画像処理プログラム170aについては、図2に示した制御部15内の機能部15a〜15nの各構成要素と同様、適宜統合又は分離しても良い。すなわち、HDD170に格納される各データは、常に全てのデータがHDD170に格納される必要はなく、処理に必要なデータのみがHDD170に格納されれば良い。
As shown in FIG. 18, the
そして、CPU150が、画像処理プログラム170aをHDD170から読み出してRAM180に展開する。これによって、図18に示すように、画像処理プログラム170aは、画像処理プロセス180aとして機能する。この画像処理プロセス180aは、HDD170から読み出した各種データを適宜RAM180上の自身に割り当てられた領域に展開し、この展開した各種データに基づいて各種処理を実行する。なお、画像処理プロセス180aは、図2に示した制御部15内の機能部15a〜15nにて実行される処理、例えば図13〜図16に示す処理を含む。また、CPU150上で仮想的に実現される各処理部は、常に全ての処理部がCPU150上で動作する必要はなく、処理に必要な処理部のみが仮想的に実現されれば良い。
Then, the
なお、上記の画像処理プログラム170aについては、必ずしも最初からHDD170やROM160に記憶させておく必要はない。例えば、コンピュータ100に挿入されるフレキシブルディスク、いわゆるFD、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させる。そして、コンピュータ100がこれらの可搬用の物理媒体から各プログラムを取得して実行するようにしてもよい。また、公衆回線、インターネット、LAN、WANなどを介してコンピュータ100に接続される他のコンピュータまたはサーバ装置などに各プログラムを記憶させておき、コンピュータ100がこれらから各プログラムを取得して実行するようにしてもよい。
Note that the
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 更新部
15h 算出部
15j 第1対応付け部
15k 第2対応付け部
15m 貫通領域判別部
15n 出力部
1
Claims (4)
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングするグルーピング部と、
グルーピングされた領域のうち、前記画像に含まれる色標であって、色の標示領域が形成される表示面および前記表示面の裏面を貫通する貫通孔が形成されるとともに同一色の標示領域が前記貫通孔を挟んで前記表示面の両側にそれぞれ形成された色標の貫通孔によって形成される色の計測領域を選択する選択部と、
前記画像上で前記計測領域の輪郭を形成する各輪郭画素に番号を採番する採番部と、
前記計測領域の輪郭画素ごとに、各領域の輪郭を形成する輪郭画素のうち当該計測領域の輪郭画素との間で最も距離が近い対応輪郭画素を抽出する抽出部と、
前記対応輪郭画素に前記計測領域の輪郭画素の番号を付与する付与部と、
前記対応輪郭画素が抽出される度に、前記領域のうち前記対応輪郭画素が抽出された領域を対象に当該領域が持つ対応輪郭画素の個数と、当該領域が持つ対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値を更新する更新部と、
前記対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値および前記対応輪郭画素の個数を用いて、前記領域別に当該領域の代表値を算出する算出部と、
前記領域別に算出された代表値を用いて、前記色標の標示領域の並び順であって前記計測領域を周回する時計回りまたは反時計回りの並び順に前記領域を対応付ける対応付け部と
を有することを特徴とする画像処理装置。 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;
Among the grouped areas, the color markers included in the image, the display surface on which the color marking region is formed, and the through hole penetrating the back surface of the display surface are formed, and the marking region of the same color is formed A selection unit for selecting a color measurement region formed by through holes of color targets respectively formed on both sides of the display surface across the through hole;
A numbering unit for numbering each contour pixel forming the contour of the measurement region on the image;
For each contour pixel of the measurement region, an extraction unit that extracts a corresponding contour pixel that is the closest to the contour pixel of the measurement region out of the contour pixels that form the contour of each region;
An assigning unit for assigning a contour pixel number of the measurement region to the corresponding contour pixel;
Each time the corresponding contour pixel is extracted, the number of corresponding contour pixels that the region has for the region from which the corresponding contour pixel is extracted, and the corresponding contour pixel that the region has An update unit for updating the total number of contour pixel numbers in the measurement region;
Using a total value of the number of contour pixels of the measurement region assigned to the corresponding contour pixel and the number of the corresponding contour pixels, a calculation unit that calculates a representative value of the region for each region;
Using a representative value calculated for each area, and an association unit that associates the areas in the clockwise or counterclockwise order around the measurement area, which is the order of the color target marking areas. An image processing apparatus.
画像を取得し、
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングし、
グルーピングされた領域のうち、前記画像に含まれる色標であって、色の標示領域が形成される表示面および前記表示面の裏面を貫通する貫通孔が形成されるとともに同一色の標示領域が前記貫通孔を挟んで前記表示面の両側にそれぞれ形成された色標の貫通孔によって形成される色の計測領域を選択し、
前記画像上で前記計測領域の輪郭を形成する各輪郭画素に番号を採番し、
前記計測領域の輪郭画素ごとに、各領域の輪郭を形成する輪郭画素のうち当該計測領域の輪郭画素との間で最も距離が近い対応輪郭画素を抽出し、
前記対応輪郭画素に前記計測領域の輪郭画素の番号を付与し、
前記対応輪郭画素が抽出される度に、前記領域のうち前記対応輪郭画素が抽出された領域を対象に当該領域が持つ対応輪郭画素の個数と、当該領域が持つ対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値を更新し、
前記対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値および前記対応輪郭画素の個数を用いて、前記領域別に当該領域の代表値を算出し、
前記領域別に算出された代表値を用いて、前記色標の標示領域の並び順であって前記計測領域を周回する時計回りまたは反時計回りの並び順に前記領域を対応付ける
処理を実行させることを特徴とする画像処理プログラム。 On the computer,
Get an image,
Grouping pixels having similar pixel values between adjacent pixels among the pixels included in the image;
Among the grouped areas, the color markers included in the image, the display surface on which the color marking region is formed, and the through hole penetrating the back surface of the display surface are formed, and the marking region of the same color is formed Select a color measurement area formed by the through holes of the color targets formed on both sides of the display surface across the through hole,
Number each contour pixel that forms the contour of the measurement area on the image,
For each contour pixel of the measurement region, extract the corresponding contour pixel that is the closest to the contour pixel of the measurement region from the contour pixels that form the contour of each region,
Giving a contour pixel number of the measurement region to the corresponding contour pixel,
Each time the corresponding contour pixel is extracted, the number of corresponding contour pixels that the region has for the region from which the corresponding contour pixel is extracted, and the corresponding contour pixel that the region has Update the total number of contour pixel numbers in the measurement area,
Using the total value of the contour pixel numbers of the measurement region assigned to the corresponding contour pixel and the number of the corresponding contour pixels, a representative value of the region is calculated for each region,
Using the representative value calculated for each area, the process of associating the areas with the order of the marking areas of the color targets in the clockwise or counterclockwise order of circulating around the measurement area is performed. An image processing program.
画像を取得し、
前記画像に含まれる画素のうち隣接する画素間で画素値が類似する画素同士をグルーピングし、
グルーピングされた領域のうち、前記画像に含まれる色標であって、色の標示領域が形成される表示面および前記表示面の裏面を貫通する貫通孔が形成されるとともに同一色の標示領域が前記貫通孔を挟んで前記表示面の両側にそれぞれ形成された色標の貫通孔によって形成される色の計測領域を選択し、
前記画像上で前記計測領域の輪郭を形成する各輪郭画素に番号を採番し、
前記計測領域の輪郭画素ごとに、各領域の輪郭を形成する輪郭画素のうち当該計測領域の輪郭画素との間で最も距離が近い対応輪郭画素を抽出し、
前記対応輪郭画素に前記計測領域の輪郭画素の番号を付与し、
前記対応輪郭画素が抽出される度に、前記領域のうち前記対応輪郭画素が抽出された領域を対象に当該領域が持つ対応輪郭画素の個数と、当該領域が持つ対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値を更新し、
前記対応輪郭画素に付与された前記計測領域の輪郭画素の番号の合計値および前記対応輪郭画素の個数を用いて、前記領域別に当該領域の代表値を算出し、
前記領域別に算出された代表値を用いて、前記色標の標示領域の並び順であって前記計測領域を周回する時計回りまたは反時計回りの並び順に前記領域を対応付ける
処理を実行することを特徴とする画像処理方法。 Computer
Get an image,
Grouping pixels having similar pixel values between adjacent pixels among the pixels included in the image;
Among the grouped areas, the color markers included in the image, the display surface on which the color marking region is formed, and the through hole penetrating the back surface of the display surface are formed, and the marking region of the same color is formed Select a color measurement area formed by the through holes of the color targets formed on both sides of the display surface across the through hole,
Number each contour pixel that forms the contour of the measurement area on the image,
For each contour pixel of the measurement region, extract the corresponding contour pixel that is the closest to the contour pixel of the measurement region from the contour pixels that form the contour of each region,
Giving a contour pixel number of the measurement region to the corresponding contour pixel,
Each time the corresponding contour pixel is extracted, the number of corresponding contour pixels that the region has for the region from which the corresponding contour pixel is extracted, and the corresponding contour pixel that the region has Update the total number of contour pixel numbers in the measurement area,
Using the total value of the contour pixel numbers of the measurement region assigned to the corresponding contour pixel and the number of the corresponding contour pixels, a representative value of the region is calculated for each region,
Using the representative value calculated for each area, the process of associating the areas in the clockwise or counterclockwise order that circulates around the measurement area, which is the order of the marking areas of the color targets, is performed. An image processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012062757A JP5811915B2 (en) | 2012-03-19 | 2012-03-19 | Image processing apparatus, image processing program, and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012062757A JP5811915B2 (en) | 2012-03-19 | 2012-03-19 | Image processing apparatus, image processing program, and image processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013196373A true JP2013196373A (en) | 2013-09-30 |
JP5811915B2 JP5811915B2 (en) | 2015-11-11 |
Family
ID=49395234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012062757A Active JP5811915B2 (en) | 2012-03-19 | 2012-03-19 | Image processing apparatus, image processing program, and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5811915B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105049822A (en) * | 2014-04-18 | 2015-11-11 | 富士通株式会社 | Image processing device and image processing method |
-
2012
- 2012-03-19 JP JP2012062757A patent/JP5811915B2/en active Active
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105049822A (en) * | 2014-04-18 | 2015-11-11 | 富士通株式会社 | Image processing device and image processing method |
US9378429B2 (en) | 2014-04-18 | 2016-06-28 | Fujitsu Limited | Image processing device and image processing method |
Also Published As
Publication number | Publication date |
---|---|
JP5811915B2 (en) | 2015-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10083522B2 (en) | Image based measurement system | |
JP6260620B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5880184B2 (en) | Color measurement program and color measurement method | |
EP2339292A1 (en) | Three-dimensional measurement apparatus and method thereof | |
JP2017520050A (en) | Local adaptive histogram flattening | |
JPWO2013145295A1 (en) | Color chart detection apparatus, color chart detection method, and computer program for color chart detection | |
US10560686B2 (en) | Photographing device and method for obtaining depth information | |
KR101165415B1 (en) | Method for recognizing human face and recognizing apparatus | |
CN110794955B (en) | Positioning tracking method, device, terminal equipment and computer readable storage medium | |
CN112614085A (en) | Object detection method and device and terminal equipment | |
JP2016151955A (en) | Image processing apparatus, imaging device, distance measuring device, and image processing method | |
US20130170756A1 (en) | Edge detection apparatus, program and method for edge detection | |
JP2017032335A (en) | Information processing device, information processing method, and program | |
US20180197006A1 (en) | Imaging support system, device and method, and imaging terminal | |
JP2015127668A (en) | Measurement device, system and program | |
KR101462473B1 (en) | Search Method by Object Recognition on Image and Search Server thereof | |
JP2011019177A (en) | Program for specify subject position, and camera | |
CN117333928B (en) | Face feature point detection method and device, electronic equipment and storage medium | |
JP2024033803A (en) | Angle measurement device, method for measuring angle, and angle measurement program | |
JP5811915B2 (en) | Image processing apparatus, image processing program, and image processing method | |
KR20170010826A (en) | Picture processing method and electronic device | |
JP5853848B2 (en) | Image processing apparatus, image processing program, and image processing method | |
JP3919722B2 (en) | Skin shape measuring method and skin shape measuring apparatus | |
CN107734324B (en) | Method and system for measuring illumination uniformity of flash lamp and terminal equipment | |
EP2541469B1 (en) | Image recognition device, image recognition method and image recognition program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20141204 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150814 |
|
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: 20150825 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150907 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5811915 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |