JP5132403B2 - Apparatus, method, and program for measuring shape of spiral spring - Google Patents

Apparatus, method, and program for measuring shape of spiral spring Download PDF

Info

Publication number
JP5132403B2
JP5132403B2 JP2008107803A JP2008107803A JP5132403B2 JP 5132403 B2 JP5132403 B2 JP 5132403B2 JP 2008107803 A JP2008107803 A JP 2008107803A JP 2008107803 A JP2008107803 A JP 2008107803A JP 5132403 B2 JP5132403 B2 JP 5132403B2
Authority
JP
Japan
Prior art keywords
hook
image
spiral spring
photographed
outer hook
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
JP2008107803A
Other languages
Japanese (ja)
Other versions
JP2009257950A (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.)
Chuo Hatsujo KK
Original Assignee
Chuo Hatsujo KK
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 Chuo Hatsujo KK filed Critical Chuo Hatsujo KK
Priority to JP2008107803A priority Critical patent/JP5132403B2/en
Publication of JP2009257950A publication Critical patent/JP2009257950A/en
Application granted granted Critical
Publication of JP5132403B2 publication Critical patent/JP5132403B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)

Description

本発明は、画像処理を用いて物体の形状を測定する技術に関する。特に、画像処理を用いて渦巻きばねの形状を測定する技術に関する。ここでいう渦巻きばねとは、平面視したときに、内フックから外フックまで渦巻状に伸びるばねを意味する。   The present invention relates to a technique for measuring the shape of an object using image processing. In particular, the present invention relates to a technique for measuring the shape of a spiral spring using image processing. The spiral spring here means a spring that spirally extends from the inner hook to the outer hook when viewed in plan.

特許文献1に、画像処理を用いて物体の形状を測定する技術が開示されている。この技術では、測定対象である物体を撮影した撮影画像から、予め登録された測定対象領域を抽出し、抽出した測定対象領域の画像を用いて物体の各部の寸法を測定する。測定対象領域を抽出する際には、基準となる物体を撮影した基準画像の測定対象領域を用い、パターンマッチングによる測定対象領域の補正を行なっている。   Patent Document 1 discloses a technique for measuring the shape of an object using image processing. In this technique, a pre-registered measurement target region is extracted from a captured image obtained by photographing an object that is a measurement target, and the dimensions of each part of the object are measured using the extracted measurement target region image. When extracting the measurement target area, the measurement target area of the reference image obtained by photographing the reference object is used to correct the measurement target area by pattern matching.

特開平11−334244号公報Japanese Patent Laid-Open No. 11-334244

特許文献1の技術は、渦巻きばねの形状測定にも適用することができる。渦巻きばねの形状測定では、主に、内フックや外フックの位置や形状を測定する必要がある。そのことから、特許文献1の技術を用いる場合には、前記した測定対象領域を内フックや外フックの位置に合わせて登録しておく必要がある。
しかしながら、渦巻きばねの場合、必要とされるばね定数等の特性に応じて、その形状が様々に変化する。従って、特許文献1の技術を利用するためには、渦巻きばねの形状に応じて、測定対象領域を個々に設定しておく必要がある。さらに、渦巻きばねの場合、同一種類の渦巻きばねであっても、例えば外フックの位置等が比較的にばらつきやすく、その形状に個体差が生じやすい。そのことから、予め設定された測定対象領域では、内フックや外フックの像を抽出できない場合がある。
上記の問題を鑑み、本発明は、渦巻きばねの撮影画像から内フックや外フックの位置を正しく特定することができる技術を提供する。
The technique of Patent Document 1 can also be applied to shape measurement of a spiral spring. In measuring the shape of the spiral spring, it is mainly necessary to measure the position and shape of the inner hook and the outer hook. Therefore, when using the technique of Patent Document 1, it is necessary to register the above-described measurement target region in accordance with the positions of the inner hook and the outer hook.
However, in the case of a spiral spring, its shape changes variously according to characteristics such as a required spring constant. Therefore, in order to use the technique of Patent Document 1, it is necessary to individually set the measurement target areas according to the shape of the spiral spring. Further, in the case of a spiral spring, even if the same type of spiral spring is used, for example, the positions of the outer hooks and the like are relatively likely to vary, and individual differences are likely to occur in their shapes. For this reason, there are cases where images of the inner hook and the outer hook cannot be extracted in the measurement target region set in advance.
In view of the above problems, the present invention provides a technique capable of correctly specifying the positions of the inner hook and the outer hook from a captured image of a spiral spring.

本発明は、内フックから外フックまで渦巻状に伸びる渦巻きばねの形状を測定する形状測定装置に具現化されるこの形状測定装置は、渦巻きばねを撮影した撮影画像を入力する画像入力手段と、前記撮影画像を極座標変換した極座標画像を作成する画像変換手段と、前記極座標画像を用いて、内フックが撮影されている内フック位置、及び/又は、前記撮影画像中の外フックが撮影されている外フック位置を、前記撮影画像中に特定するフック位置特定手段を備えている。   The present invention is embodied in a shape measuring device that measures the shape of a spiral spring that spirally extends from an inner hook to an outer hook, and includes an image input unit that inputs a photographed image of the spiral spring; Image conversion means for creating a polar coordinate image obtained by converting the photographed image into polar coordinates, and using the polar coordinate image, an inner hook position where an inner hook is photographed and / or an outer hook in the photographed image is photographed. A hook position specifying means for specifying the outer hook position in the captured image is provided.

この形状測定装置では、渦巻きばねの撮影画像に対して極座標変換を行い、極座標画像を作成する。極座標画像では、半径軸に沿って、内フックと素線の周回部分と外フックが、互いに分かれて存在する。そのことから、内フックや外フックの位置を、正確に特定することが可能となる。極座標画像上で特定された内フックや外フック位置は、直交座標への逆変換を行うことによって、撮影画像における内フックや外フック位置に変換することができる。
この形状測定装置によると、渦巻きばねの撮影画像から内フックや外フックの位置を正しく特定することができ、渦巻きばねの形状測定を正しく行うことができる。
In this shape measuring apparatus, polar coordinate conversion is performed on a captured image of a spiral spring to create a polar coordinate image. In the polar coordinate image, along the radial axis, the inner hook, the wire winding portion, and the outer hook are separated from each other. As a result, the positions of the inner hook and the outer hook can be accurately specified. The inner hook and outer hook positions specified on the polar coordinate image can be converted into the inner hook and outer hook positions in the photographed image by performing inverse conversion to orthogonal coordinates.
According to this shape measuring apparatus, the positions of the inner hook and the outer hook can be correctly specified from the captured image of the spiral spring, and the shape measurement of the spiral spring can be performed correctly.

上記した形状測定装置において、フック位置特定手段は、極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定することが好ましい。
上記のようなr方向ヒストグラムを用いると、内フック位置や外フック位置を正確かつ容易に特定することが可能となる。
In the above-described shape measuring apparatus, the hook position specifying means creates an r-direction histogram in which each pixel value of the polar coordinate image is added for each position in the radial axis direction, and using the r-direction histogram, the inner hook position and / or the outer hook position is generated. It is preferable to specify the hook position.
When the r-direction histogram as described above is used, the inner hook position and the outer hook position can be accurately and easily specified.

本発明に係る形状測定装置は、前記した内フック位置及び/又は外フック位置を用いて、撮影画像中の内フックが撮影されている内フック領域、及び/又は、外フックが撮影されている外フック領域を特定するフック領域特定手段をさらに備えることが好ましい。
この装置によると、渦巻きばねの撮影画像から内フックや外フックの撮影領域を抽出し、内フックや外フックの形状、あるいは内フックや外フックを基準とする渦巻きばね全体の形状を正確に測定することができる。
In the shape measuring apparatus according to the present invention, the inner hook region and / or the outer hook in which the inner hook is photographed in the photographed image is photographed using the inner hook position and / or the outer hook position. It is preferable to further include hook area specifying means for specifying the outer hook area.
According to this device, the shooting area of the inner hook and the outer hook is extracted from the captured image of the spiral spring, and the shape of the inner hook and the outer hook, or the entire shape of the spiral spring based on the inner hook and the outer hook is accurately measured. can do.

前記したフック領域特定手段は、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムと、前記極座標画像の各画素値を角度軸方向の位置毎に加算したθ方向ヒストグラムを作成し、そのr方向ヒストグラムとθ方向ヒストグラムを用いて前記内フック領域及び/又は外フック領域を特定することが好ましい。
上記のようなr方向ヒストグラムとθ方向ヒストグラムを用いると、内フック領域や外フック領域を正確かつ容易に特定することができる。
The hook area specifying means includes an r-direction histogram obtained by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and a θ-direction histogram obtained by adding each pixel value of the polar coordinate image for each position in the angle axis direction. It is preferable that the inner hook region and / or the outer hook region is specified using the r-direction histogram and the θ-direction histogram.
By using the r-direction histogram and the θ-direction histogram as described above, the inner hook region and the outer hook region can be specified accurately and easily.

前記したフック領域特定手段は、前記r方向ヒストグラムを用いて外フック領域の半径方向の境界位置を特定し、前記θ方向ヒストグラムを用いて外フック領域の周方向の境界位置を特定することが好ましい。
この手法によると、特に外フック領域を正確かつ容易に特定することができる。
Preferably, the hook area specifying means specifies the boundary position in the radial direction of the outer hook area using the r-direction histogram, and specifies the boundary position in the circumferential direction of the outer hook area using the θ-direction histogram. .
According to this method, the outer hook region can be specified accurately and easily.

前記したフック領域特定手段は、前記極座標画像の内フック上を通る半径軸に平行なラインを順次抽出し、抽出したライン上の各画素値を半径軸方向の位置毎に加算していく累積ヒストグラムを作成し、その累積ヒストグラムを用いて前記内フック領域を特定することが好ましい。
上記のような累積ヒストグラムを用いると、例えば内フックが極座標変換の原点に重なる場合でも、内フック領域を正確に特定することができる。
The above hook area specifying means sequentially extracts lines parallel to the radial axis passing through the inner hook of the polar coordinate image, and adds each pixel value on the extracted line for each position in the radial axis direction. It is preferable that the inner hook region is specified using the accumulated histogram.
By using the cumulative histogram as described above, for example, even when the inner hook overlaps the origin of the polar coordinate conversion, the inner hook region can be specified accurately.

前記した画像変換手段は、撮影画像に撮影された渦巻きばねの像の重心を算出し、その重心を中心として極座標変換を行うことが好ましい。
この手法によると、撮影画像に撮影された渦巻きばねの位置にかかわらず、内フックや外フックの位置を正しく特定することができる。
The image conversion means described above preferably calculates the center of gravity of the spiral spring image captured in the captured image and performs polar coordinate conversion around the center of gravity.
According to this method, the positions of the inner hook and the outer hook can be correctly specified regardless of the position of the spiral spring photographed in the photographed image.

本発明の形状測定装置は、撮影画像に撮影された渦巻きばねの巻き方向を判別する第1の巻き方向判別手段を備えることが好ましい。第1の巻き方向判別手段は、前述した累積ヒストグラムを用いて、渦巻きばねの巻き方向を判別することが好ましい。
前述した累積ヒストグラムは、撮影画像に撮影された渦巻きばねの巻き方向に応じて、その形状が対称的に変化する。そのことから、累積ヒストグラムのこの特徴を利用すると、撮影画像に撮影された渦巻きばねの巻き方向を判別することができる。渦巻きばねの巻き方向を判別することにより、内フックや外フックの位置を誤って特定することが防止される。
The shape measuring apparatus of the present invention preferably includes a first winding direction discriminating unit that discriminates the winding direction of the spiral spring photographed in the photographed image. The first winding direction discriminating means preferably discriminates the winding direction of the spiral spring using the cumulative histogram described above.
The shape of the cumulative histogram described above changes symmetrically according to the winding direction of the spiral spring photographed in the photographed image. Therefore, by using this feature of the cumulative histogram, it is possible to determine the winding direction of the spiral spring photographed in the photographed image. By discriminating the winding direction of the spiral spring, it is possible to prevent the positions of the inner hook and the outer hook from being specified incorrectly.

本発明の形状測定装置は、撮影画像に撮影された渦巻きばねの巻き方向を判別する第2の巻き方向判別手段を備えることが好ましい。第2の巻き方向判別手段は、前記撮影画像を内フックに沿った直線によって分割し、分割した二つの領域を比較することによって、渦巻きばねの巻き方向を判別することが好ましい。
内フックの基端部では、渦巻きばねの素線がその巻き方向に応じて一方に湾曲していく。そのことから、撮影画像を内フックに沿った直線によって分割すると、一方の領域には内フックの基端部が存在し、他方の領域には内フックの基端部が存在しないことになる。そのことから、分割した二つの領域の画素値を比較することによって、撮影画像に撮影された渦巻きばねの巻き方向を判別することができる。渦巻きばねの巻き方向を判別することにより、内フックや外フックの位置を誤って特定することが防止される。
The shape measuring apparatus of the present invention preferably includes a second winding direction discriminating unit that discriminates the winding direction of the spiral spring photographed in the photographed image. The second winding direction determining means preferably determines the winding direction of the spiral spring by dividing the photographed image by a straight line along the inner hook and comparing the two divided areas.
At the base end portion of the inner hook, the strand of the spiral spring is bent in one direction depending on the winding direction. Therefore, when the captured image is divided by a straight line along the inner hook, the base end portion of the inner hook exists in one region, and the base end portion of the inner hook does not exist in the other region. Therefore, the winding direction of the spiral spring photographed in the photographed image can be determined by comparing the pixel values of the two divided regions. By discriminating the winding direction of the spiral spring, it is possible to prevent the positions of the inner hook and the outer hook from being specified incorrectly.

本発明は、渦巻きばねの形状を測定する形状測定方法にも具現化される。この形状測定方法は、コンピュータに、渦巻きばねを撮影した撮影画像を入力する画像入力処理と、前記撮影画像を極座標変換した極座標画像を作成する画像変換処理と、前記極座標画像を用いて、内フックが撮影されている内フック位置、及び/又は、前記撮影画像中の外フックが撮影されている外フック位置を、前記撮影画像中に特定するフック位置特定処理を実行させる。このフック位置特定処理では、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定する。
この方法によっても、渦巻きばねの撮影画像から内フックや外フックの位置を正しく特定することができ、渦巻きばねの形状測定を正しく行うことができる。
The present invention is also embodied in a shape measuring method for measuring the shape of a spiral spring. This shape measuring method includes an image input process for inputting a captured image obtained by photographing a spiral spring to a computer, an image conversion process for creating a polar coordinate image obtained by converting the captured image into a polar coordinate, and an inner hook using the polar coordinate image. A hook position specifying process is performed for specifying in the captured image the inner hook position where the image is photographed and / or the outer hook position where the outer hook in the photographed image is photographed. In this hook position specifying process, an r-direction histogram is created by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and the inner hook position and / or the outer hook position is specified using the r-direction histogram. .
Also by this method, the positions of the inner hook and the outer hook can be correctly specified from the captured image of the spiral spring, and the shape of the spiral spring can be correctly measured.

本発明はさらに、渦巻きばねの形状を測定するためのプログラムにも具現化される。このプログラムは、コンピュータに、渦巻きばねを撮影した撮影画像を入力する画像入力処理と、前記撮影画像を極座標変換した極座標画像を作成する画像変換処理と、前記極座標画像を用いて、内フックが撮影されている内フック位置、及び/又は、前記撮影画像中の外フックが撮影されている外フック位置を、前記撮影画像中に特定するフック位置特定処理を実行させる。このフック位置特定処理では、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定する。
このプログラムにより、コンピュータを用いて、渦巻きばねの撮影画像から内フックや外フックの位置を正しく特定することができ、渦巻きばねの形状測定を正しく行うことができる。
The present invention is further embodied in a program for measuring the shape of a spiral spring. This program uses an image input process for inputting a captured image obtained by photographing a spiral spring to a computer, an image conversion process for creating a polar coordinate image obtained by converting the captured image into a polar coordinate, and an inner hook using the polar coordinate image. A hook position specifying process is performed to specify in the photographed image the inner hook position that has been photographed and / or the outer hook position in which the outer hook in the photographed image has been photographed. In this hook position specifying process, an r-direction histogram is created by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and the inner hook position and / or the outer hook position is specified using the r-direction histogram. .
With this program, the position of the inner hook and the outer hook can be correctly specified from the captured image of the spiral spring using a computer, and the shape of the spiral spring can be correctly measured.

本発明によれば、渦巻きばねを撮影した画像から内フックや外フックが撮影された位置を正しく特定し、渦巻きばねの形状を正しく測定することが可能となる。   According to the present invention, it is possible to correctly specify the position where the inner hook and the outer hook are photographed from the image obtained by photographing the spiral spring, and to correctly measure the shape of the spiral spring.

本発明を実施するための好適な形態を列記する。
(形態1) 形状測定装置は、r方向ヒストグラムを用いて、渦巻きばねを第1タイプと第2タイプに分類することができる。ここで、第1タイプとは、内フックが渦巻きばねの重心に重ならないものを意味し、第2タイプとは、内フックが渦巻きばねの重心に重なるものを意味する。
(形態2) 形状測定装置は、以下の手順(1)−(4)により、渦巻きばねの撮影画像から、内フック又は外フックの特徴点を抽出することができる。
(1)渦巻きばねの撮影画像中に特定した内フック領域又は外フック領域から、内フック又は外フックの像の輪郭線を抽出する。
(2)抽出した輪郭線を座標点群で表す輪郭線座標系列を作成し、その輪郭線座標系列から複数の部分輪郭線系列を抽出する。
(3)抽出した複数の部分輪郭線系列に対して類似度又は距離尺度を算出する。
(4)算出した類似度又は距離尺度を用いて、内フック又は外フックの輪郭線上に特徴点を特定する。
(形態3) 形状測定装置は、上記の形態2で算出した特徴点を用いて、内フック又は外フックの輪郭線座標系列から内側輪郭線系列と外側輪郭線系列を特定することができる。
(形態4) 形状測定装置は、上記の形態3で特定した内側輪郭線系列と外側輪郭線系列の少なくとも一部を、円近似することができる。
(形態5) 形状測定装置は、コンピュータを用いて構成されている。コンピュータは、そのハードウエアや記憶しているソフトウエア(プログラム)によって、各処理を実行する構成が実現されている。
(形態6) 形状測定装置は、渦巻きばねを撮影し、その画像データを作成するカメラを備えている。
(形態7) 形状測定装置は、撮影画像を二値化処理することができる。
Preferred embodiments for carrying out the present invention will be listed.
(Mode 1) The shape measuring apparatus can classify the spiral spring into a first type and a second type using an r-direction histogram. Here, the first type means that the inner hook does not overlap the center of gravity of the spiral spring, and the second type means that the inner hook overlaps the center of gravity of the spiral spring.
(Mode 2) The shape measuring apparatus can extract the feature points of the inner hook or the outer hook from the captured image of the spiral spring by the following procedures (1) to (4).
(1) The contour line of the image of the inner hook or the outer hook is extracted from the inner hook region or the outer hook region specified in the captured image of the spiral spring.
(2) Create an outline coordinate series that represents the extracted outline by coordinate point groups, and extract a plurality of partial outline series from the outline coordinate series.
(3) A similarity or distance measure is calculated for the extracted partial outline series.
(4) A feature point is specified on the contour line of the inner hook or the outer hook using the calculated similarity or distance scale.
(Embodiment 3) The shape measuring apparatus can identify the inner contour line series and the outer contour line series from the contour coordinate series of the inner hook or the outer hook, using the feature points calculated in the second aspect.
(Form 4) The shape measuring apparatus can circularly approximate at least a part of the inner contour line series and the outer contour line series specified in the third form.
(Mode 5) The shape measuring apparatus is configured using a computer. The computer is configured to execute each process by its hardware and stored software (program).
(Mode 6) The shape measuring apparatus includes a camera that captures a spiral spring and creates image data thereof.
(Mode 7) The shape measuring apparatus can binarize the captured image.

本発明を具現化した実施例について図面を参照しながら説明する。図1は、本実施例の形状測定装置10を示す。形状測定装置10は、渦巻きばね30の各部の寸法を計測する装置である。
図1に示すように、形状測定装置10は、ステージ12と、ステージ12上に配置された照明器14と、ステージ12に固定されているCCDカメラ16と、CCDカメラ16に通信線18を介して接続されているコンピュータ22と、コンピュータ22に接続されているディスプレイ20を備えている。
照明器14は、面光源であり、その発光面上に渦巻きばね30が載置される。CCDカメラ16は、照明器14上に配置されており、照明器14上に載置された渦巻きばね30を撮影する。即ち、渦巻きばね30は照明器14によって下方から照明され、照明器14の透過光(渦巻きばね30の影)がCCDカメラ16によって撮影される。なお、照明器14は、本実施例のような透過照明に限定されず、渦巻きばね30を上方から照明するものでもよい。この場合、渦巻きばね30が全周方向から均等に照明されるように、複数の照明器やリング型の照明器を用いることが好ましい。
CCDカメラ16が撮影した画像データは、通信線18を介してコンピュータ22に入力される。コンピュータ22には、後述する形状測定処理を実行するためのプログラムが記憶されている。コンピュータ22は、CCDカメラ16が撮影した撮影画像の画像データを処理し、渦巻きばね30の各部の寸法を算出する。コンピュータ22は、算出した渦巻きばね30の各部の寸法を、ディスプレイ20に表示する。
Embodiments embodying the present invention will be described with reference to the drawings. FIG. 1 shows a shape measuring apparatus 10 of this embodiment. The shape measuring device 10 is a device that measures the dimensions of each part of the spiral spring 30.
As shown in FIG. 1, the shape measuring apparatus 10 includes a stage 12, an illuminator 14 disposed on the stage 12, a CCD camera 16 fixed to the stage 12, and a communication line 18 connected to the CCD camera 16. And a display 20 connected to the computer 22.
The illuminator 14 is a surface light source, and a spiral spring 30 is placed on the light emitting surface thereof. The CCD camera 16 is disposed on the illuminator 14 and photographs the spiral spring 30 placed on the illuminator 14. That is, the spiral spring 30 is illuminated from below by the illuminator 14, and the transmitted light (shadow of the spiral spring 30) of the illuminator 14 is photographed by the CCD camera 16. The illuminator 14 is not limited to transmitted illumination as in the present embodiment, and may illuminate the spiral spring 30 from above. In this case, it is preferable to use a plurality of illuminators or ring-type illuminators so that the spiral spring 30 is illuminated uniformly from the entire circumferential direction.
Image data captured by the CCD camera 16 is input to the computer 22 via the communication line 18. The computer 22 stores a program for executing a shape measurement process described later. The computer 22 processes image data of a photographed image photographed by the CCD camera 16 and calculates the dimensions of each part of the spiral spring 30. The computer 22 displays the calculated dimensions of each part of the spiral spring 30 on the display 20.

図2は、形状測定装置10による渦巻きばね30の形状測定の流れを示すフローチャートである。図3は、図2のフローチャートに示すステップS14のフック領域の特定処理の流れを示すフローチャートである。形状測定装置10は、図2、図3に示す工程、処理を経て、渦巻きばね30の各部の寸法値を測定する。図4は、形状測定装置10が寸法を測定する箇所を示す。図4に示すように、形状測定装置10は、(1)渦巻きばねの内径Din、(2)フリー角度θf、(3)フック半径HR、(4)外フック長さLoh、(5)内フック長さLih、(6)外フック曲率半径Roh、(7)内フック曲率半径Rih、(8)外フック角度θmt、(9)内フック先端からの距離Dtip、の9種の寸法を測定することができる。以下、図2、図3に示すフローチャートに沿って、形状測定装置10による渦巻きばね30の形状測定の流れを説明する。   FIG. 2 is a flowchart showing a flow of measuring the shape of the spiral spring 30 by the shape measuring apparatus 10. FIG. 3 is a flowchart showing the flow of the hook area specifying process in step S14 shown in the flowchart of FIG. The shape measuring apparatus 10 measures the dimensional values of each part of the spiral spring 30 through the processes and processes shown in FIGS. 2 and 3. FIG. 4 shows locations where the shape measuring apparatus 10 measures dimensions. As shown in FIG. 4, the shape measuring apparatus 10 includes (1) an inner diameter Din of the spiral spring, (2) a free angle θf, (3) a hook radius HR, (4) an outer hook length Loh, and (5) an inner hook. Measure nine dimensions: length Lih, (6) outer hook radius of curvature Roh, (7) inner hook radius of curvature Rih, (8) outer hook angle θmt, and (9) distance Dtip from inner hook tip. Can do. The flow of measuring the shape of the spiral spring 30 by the shape measuring device 10 will be described below with reference to the flowcharts shown in FIGS.

先ず、図2のステップS12において、CCDカメラ16により、渦巻きばね30の撮影を行う。図5、図6に、2種類の渦巻きばね30の撮影画像100を例示する。ここで、渦巻きばね30を撮影する際には、上から見て右巻きとなるように渦巻きばね30を配置する。また、内フック32がおよそ上方を向くように配置する。CCDカメラ16による撮影画像100は、コンピュータ22に入力される。
図5、図6に示す2種類の渦巻きばね30は、共に、内フック32から外フック34まで、渦巻状に伸びている。ただし、これら2種類の渦巻きばね30は、その内フック32の形状に有意な違いを有する。即ち、図5に示す渦巻きばね30は、その内フック32が渦巻きばね30の重心Gと重ならないが、図6に示す渦巻きばね30は、その内フック32が渦巻きばね30の重心Gと重なっている。本明細書では、図5に示す渦巻きばね30を第1タイプと称し、図6に示す渦巻きばね30を第2タイプと称する。形状測定装置10は、第1タイプと第2タイプの双方の渦巻きばね30の形状測定を行うことができる。詳しくは後述するが、形状測定装置10は、測定する渦巻きばね30が第1タイプであるのか第2タイプであるのかを判別し、一部の処理についてタイプ毎に異なる処理を実行する。なお、特に区別した説明がない場合は、第1タイプと第2タイプで共通の処理が行われるものとする。
撮影画像100は、画素(x,y)毎にグレイスケール値GS(x,y)を有するグレイスケール画像である。ここで、撮影画像100に対し、ノイズを除去する各種の処理を必要に応じて行うとよい。
First, in step S <b> 12 of FIG. 2, the spiral spring 30 is photographed by the CCD camera 16. 5 and 6 illustrate captured images 100 of two types of spiral springs 30. FIG. Here, when photographing the spiral spring 30, the spiral spring 30 is arranged so as to be clockwise when viewed from above. Moreover, it arrange | positions so that the inner hook 32 may face upwards. An image 100 taken by the CCD camera 16 is input to the computer 22.
Both of the two types of spiral springs 30 shown in FIGS. 5 and 6 extend from the inner hook 32 to the outer hook 34 in a spiral shape. However, these two types of spiral springs 30 have a significant difference in the shape of the inner hook 32. That is, the spiral spring 30 shown in FIG. 5 does not have its inner hook 32 overlapped with the center of gravity G of the spiral spring 30, but the spiral spring 30 shown in FIG. 6 has its inner hook 32 overlapped with the center of gravity G of the spiral spring 30. Yes. In this specification, the spiral spring 30 illustrated in FIG. 5 is referred to as a first type, and the spiral spring 30 illustrated in FIG. 6 is referred to as a second type. The shape measuring apparatus 10 can measure the shapes of the spiral springs 30 of both the first type and the second type. As will be described in detail later, the shape measuring apparatus 10 determines whether the spiral spring 30 to be measured is the first type or the second type, and executes different processes for each type for some processes. In addition, when there is no description in particular distinguished, a common process shall be performed by 1st type and 2nd type.
The photographed image 100 is a gray scale image having a gray scale value GS (x, y) for each pixel (x, y). Here, various processes for removing noise may be performed on the captured image 100 as necessary.

次に、図2のステップS14では、ステップS12で撮影された撮影画像100から、内フック32が撮影されている内フック領域と、外フック34が撮影されている外フック領域の特定が行われる。この内外フックの特定処理について、図3に示すフローチャ−トに沿って説明する。なお、このステップS14からS38までの処理は、コンピュータ22によって実行される。
先ず、図3のステップS112では、ステップS12による撮影画像100から、極座標画像を作成する。図7(a)に、第1タイプの渦巻きばね30(図5参照)の極座標画像を示す。図8(a)に、第2タイプの渦巻きばね30(図6参照)の極座標画像を示す。極座標画像の作成は、渦巻きばね30の像の重心G(cx,cy)を仮の中心として求めた後、以下の変換式によって行うことができる。なお、Polar(θ,R)は、極座標画像におけるグレイスケール値を示す。
Next, in step S14 of FIG. 2, the inner hook area where the inner hook 32 is photographed and the outer hook area where the outer hook 34 is photographed are identified from the photographed image 100 photographed in step S12. . The inner / outer hook specifying process will be described with reference to the flowchart shown in FIG. The processing from step S14 to step S38 is executed by the computer 22.
First, in step S112 in FIG. 3, a polar coordinate image is created from the captured image 100 obtained in step S12. FIG. 7A shows a polar coordinate image of the first type spiral spring 30 (see FIG. 5). FIG. 8A shows a polar coordinate image of the second type spiral spring 30 (see FIG. 6). A polar coordinate image can be created by obtaining the center of gravity G (cx, cy) of the image of the spiral spring 30 as a temporary center and then using the following conversion formula. Note that Polar (θ, R) indicates a gray scale value in the polar coordinate image.

次に、ステップS114では、ステップS112で作成した極座標画像を用い、r方向ヒストグラムHr(r)を作成する。r方向ヒストグラムHr(r)は、極座標画像のグレイスケール値Polar(θ,R)をθ軸方向に加算して平均したものである。図7(b)に、第1タイプの渦巻きばね30(図5参照)のr方向ヒストグラムを示す。図8(b)に、第2タイプの渦巻きばね30(図6参照)のr方向ヒストグラムを示す。r方向ヒストグラム値Hr(r)は、下記の式によって算出される。なお、下記式のTHeは、ノイズを除去するためのしきい値である。   Next, in step S114, an r-direction histogram Hr (r) is created using the polar coordinate image created in step S112. The r-direction histogram Hr (r) is an average obtained by adding the gray scale values Polar (θ, R) of the polar coordinate image in the θ-axis direction. FIG. 7B shows an r-direction histogram of the first type spiral spring 30 (see FIG. 5). FIG. 8B shows an r-direction histogram of the second type spiral spring 30 (see FIG. 6). The r-direction histogram value Hr (r) is calculated by the following equation. Note that THe in the following equation is a threshold value for removing noise.

次に、ステップS116では、内フック形状32の識別が行われる。即ち、測定対象の渦巻きばね30が、第1タイプであるのか第2タイプであるのかが判定される。この処理には、ステップS114で作成したr方向ヒストグラムが用いられる。図7(b)、図8(b)を比較して明らかなように、第1タイプの渦巻きばね30では、内フック32上に重心Gが位置しないので(図5参照)、r方向ヒストグラムではθ軸(r=0)の近傍の値が小さくなる。一方、第2タイプの渦巻きばね30では、内フック32上に重心Gが位置するので(図6参照)、r方向ヒストグラムではθ軸(r=0)の近傍は値が大きくなる。そのことから、このステップS116の処理では、0≦r≦15までのr方向ヒストグラム値Hr(r)に注目する。そして、その範囲における最小のr方向ヒストグラム値Hr(r)が所定の判定値以下のときに第1タイプと判定し、その範囲における最小のr方向ヒストグラム値Hr(r)がその判定値を超えるときに第2タイプと判定する。   Next, in step S116, the inner hook shape 32 is identified. That is, it is determined whether the spiral spring 30 to be measured is the first type or the second type. For this process, the r-direction histogram created in step S114 is used. As is clear from comparison between FIG. 7B and FIG. 8B, the center of gravity G is not located on the inner hook 32 in the first type spiral spring 30 (see FIG. 5). The value near the θ-axis (r = 0) becomes small. On the other hand, in the second type spiral spring 30, since the center of gravity G is located on the inner hook 32 (see FIG. 6), the value is large in the vicinity of the θ axis (r = 0) in the r-direction histogram. Therefore, in the process of step S116, attention is paid to the r-direction histogram value Hr (r) up to 0 ≦ r ≦ 15. When the minimum r-direction histogram value Hr (r) in the range is equal to or smaller than a predetermined determination value, the first type is determined, and the minimum r-direction histogram value Hr (r) in the range exceeds the determination value. Sometimes it is determined as the second type.

次に、ステップS118では、内フック32及び外フック34の位置(座標)を検出する。この処理では、r方向ヒストグラムが利用される。この処理では、以下の(1)、(2)のように、渦巻きばね30のタイプ毎に異なる処理が実行される。
(1)第1タイプの場合
(外フック位置)
図7(a)に示すように、渦巻きばね30の極座標画像において、重心Gから最も遠い極座標(θout,Rout)を、外フック34の極座標画像における位置として検出する。外フック34の極座標(θout,Rout)は、以下のように特定される。先ず、注目座標rを最大値(極座標画像の右端)から順に減算していき、r方向ヒストグラム値Hr(r)が所定のしきい値TH(図示省略)を超えるときのr座標を、外フック34のr座標Routとする。次いで、極座標画像においてr=Routの1ラインに注目し、そのライン上でグレイスケール値Polar(θ,Rout)が最小となるθ座標を、外フック34のθ座標θoutとする。算出された外フック34の極座標(θout,Rout)は、外フック34の直交座標(xout,yout)に変換される。
Next, in step S118, the positions (coordinates) of the inner hook 32 and the outer hook 34 are detected. In this process, an r-direction histogram is used. In this processing, different processing is executed for each type of spiral spring 30 as in the following (1) and (2).
(1) For the first type (outer hook position)
As shown in FIG. 7A, the polar coordinate (θout, Rout) farthest from the center of gravity G in the polar coordinate image of the spiral spring 30 is detected as the position of the outer hook 34 in the polar coordinate image. The polar coordinates (θout, Rout) of the outer hook 34 are specified as follows. First, the target coordinate r is sequentially subtracted from the maximum value (right end of the polar coordinate image), and the r coordinate when the r-direction histogram value Hr (r) exceeds a predetermined threshold value TH (not shown) is determined as an outer hook. The r coordinate Rout of 34 is assumed. Next, paying attention to one line of r = Rout in the polar coordinate image, the θ coordinate on which the gray scale value Polar (θ, Rout) is minimum is set as the θ coordinate θout of the outer hook 34. The calculated polar coordinates (θout, Rout) of the outer hook 34 are converted into orthogonal coordinates (xout, yout) of the outer hook 34.

(内フック位置)
図7(a)に示すように、渦巻きばね30の極座標画像において、重心Gから最も近い極座標(θin,Rin)を、内フック32の極座標画像における位置の位置として検出する。内フック32の極座標(θin,Rin)は、以下のように特定される。先ず、注目座標rをr=0(極座標画像の左端)から順に加算していき、r方向ヒストグラム値Hr(r)が所定のしきい値THcを超えるときのr座標rthcを特定する。次に、注目座標rをr=rthcから順に減算していき、r方向ヒストグラム値Hr(r)がゼロとなるr座標rc0を特定する。内フック32のr座標Rinは、r方向ヒストグラム値Hr(r)がゼロとなる1つ前のr座標として、Rin=rc0+1と特定される。次に、極座標画像においてr=Rinの1ラインに注目し、そのライン上でグレイスケール値Polar(θ,Rin)が最小となるθ座標を、内フック32のθ座標θinとする。算出された内フック32の極座標(θin,Rin)は、内フック32の直交座標(xin,yin)に変換される。
(Inner hook position)
As shown in FIG. 7A, the polar coordinate (θin, Rin) closest to the center of gravity G in the polar coordinate image of the spiral spring 30 is detected as the position of the position of the inner hook 32 in the polar coordinate image. The polar coordinates (θin, Rin) of the inner hook 32 are specified as follows. First, the attention coordinate r is sequentially added from r = 0 (the left end of the polar coordinate image), and the r coordinate rthc when the r-direction histogram value Hr (r) exceeds a predetermined threshold value THc is specified. Next, the attention coordinate r is sequentially subtracted from r = rthc, and the r coordinate rc0 at which the r-direction histogram value Hr (r) becomes zero is specified. The r coordinate Rin of the inner hook 32 is specified as Rin = rc0 + 1 as the previous r coordinate where the r-direction histogram value Hr (r) becomes zero. Next, paying attention to one line of r = Rin in the polar coordinate image, the θ coordinate at which the gray scale value Polar (θ, Rin) is minimum on the line is set as the θ coordinate θin of the inner hook 32. The calculated polar coordinates (θin, Rin) of the inner hook 32 are converted into orthogonal coordinates (xin, yin) of the inner hook 32.

(2)第2タイプの場合
(外フック位置)
図8(a)に示すように、渦巻きばね30の極座標画像において、重心Gから最も遠い極座標(θout,Rout)を、外フック34の極座標画像における位置として検出する。外フック34の極座標(θout,Rout)及び直交座標(xout,yout)は、上記した第1タイプと同じように特定される。
(内フック位置)
図8(a)に示すように、渦巻きばね30の極座標画像において、極座標画像のくびれた部分の極座標(θin,Rin)を、内フック32の極座標画像における位置として検出する。先ず、注目座標rをr=Routから順に減算していき、r方向ヒストグラム値Hr(r)が所定のしきい値THdを超えるときのr座標を、渦巻きばね30の仮の外径Rdとして特定する。次いで、15≦r<Rdの範囲のr方向ヒストグラム値Hr(r)に注目し、r方向ヒストグラム値Hr(r)の最小値hmと、その最小値hmを与えるr座標Rmを、仮の内フックのr座標として特定する。図9に、r座標Rmの近傍におけるr方向ヒストグラムを拡大して示す。図9に示すように、次いで、仮の内フック座標Rmを起点に、r座標をr=Rmからr=Rm+Δまで順に加算していき、r方向ヒストグラム値Hr(r)がhm+δを超えるr座標rbを特定する。また、r座標をr=Rmからr=Rm−Δまで順に減算していき、r方向ヒストグラム値Hr(r)がhm+δを超えるr座標raを特定する。そして、r座標raとr座標rbの中央値(ra+rb)/2を、内フック32のr座標Rinとする。内フック32のθ座標θinは、第1タイプと同様に、グレイスケール値Polar(θ,Rin)が最小となるθ座標を、内フック32のθ座標θinとする。算出された内フック32の極座標(θin,Rin)は、内フック32の直交座標(xin,yin)に変換される。
(2) For the second type (outer hook position)
As shown in FIG. 8A, the polar coordinate (θout, Rout) farthest from the center of gravity G in the polar coordinate image of the spiral spring 30 is detected as the position of the outer hook 34 in the polar coordinate image. The polar coordinates (θout, Rout) and the orthogonal coordinates (xout, yout) of the outer hook 34 are specified in the same manner as in the first type.
(Inner hook position)
As shown in FIG. 8A, in the polar coordinate image of the spiral spring 30, the polar coordinates (θin, Rin) of the constricted portion of the polar coordinate image are detected as positions in the polar coordinate image of the inner hook 32. First, the attention coordinate r is sequentially subtracted from r = Rout, and the r coordinate when the r-direction histogram value Hr (r) exceeds a predetermined threshold value THd is specified as the provisional outer diameter Rd of the spiral spring 30. To do. Next, paying attention to the r-direction histogram value Hr (r) in the range of 15 ≦ r <Rd, the minimum value hm of the r-direction histogram value Hr (r) and the r coordinate Rm that gives the minimum value hm are temporarily It is specified as the r coordinate of the hook. FIG. 9 shows an enlarged r direction histogram in the vicinity of the r coordinate Rm. As shown in FIG. 9, the r coordinate is then added in order from r = Rm to r = Rm + Δ starting from the temporary inner hook coordinate Rm, and the r coordinate whose r-direction histogram value Hr (r) exceeds hm + δ. Specify rb. Further, the r coordinate is subtracted sequentially from r = Rm to r = Rm−Δ, and the r coordinate ra in which the r-direction histogram value Hr (r) exceeds hm + δ is specified. Then, the median value (ra + rb) / 2 of the r coordinate ra and the r coordinate rb is set as the r coordinate Rin of the inner hook 32. As for the θ coordinate θin of the inner hook 32, the θ coordinate at which the gray scale value Polar (θ, Rin) is minimum is set as the θ coordinate θin of the inner hook 32, as in the first type. The calculated polar coordinates (θin, Rin) of the inner hook 32 are converted into orthogonal coordinates (xin, yin) of the inner hook 32.

次いで、図3のステップS120、S122では、図10に示す外フック領域104の特定が行われる。外フック領域104とは、渦巻きばね30の撮影画像100のなかで、その外フック34が撮影されている領域である。本実施例の形状測定装置10は、以下に説明する処理によって、渦巻きばね30の撮影画像100から外フック領域104を特定する。なお、ステップS120、S122の処理は、渦巻きばね30のタイプによらず共通である。
先ず、ステップS120において、図10に示す外フック領域104の境界半径Rcutを特定する。この境界半径Rcutは、外フック領域104の半径方向内側の境界を決定するものである。境界半径Rcutは、以下のように特定される。図11(a)(b)に示すように、注目座標rを最大値(極座標画像の右端)から順に減算していき、r方向ヒストグラム値Hr(r)が所定のしきい値THr/2を超えるときのr座標を、外フック34のr座標Rcutとする。
Next, in steps S120 and S122 in FIG. 3, the outer hook area 104 shown in FIG. 10 is specified. The outer hook region 104 is a region where the outer hook 34 is photographed in the photographed image 100 of the spiral spring 30. The shape measuring apparatus 10 of the present embodiment identifies the outer hook region 104 from the captured image 100 of the spiral spring 30 by the process described below. Note that the processes in steps S120 and S122 are the same regardless of the type of the spiral spring 30.
First, in step S120, the boundary radius Rcut of the outer hook region 104 shown in FIG. 10 is specified. This boundary radius Rcut determines the boundary inside the outer hook region 104 in the radial direction. The boundary radius Rcut is specified as follows. As shown in FIGS. 11A and 11B, the target coordinate r is sequentially subtracted from the maximum value (right end of the polar coordinate image), and the r-direction histogram value Hr (r) is set to a predetermined threshold value THr / 2. The r coordinate when exceeding is set as the r coordinate Rcut of the outer hook 34.

次いで、ステップS122では、図10に示す外フック領域104の周方向の境界である境界上限角θeと境界下限角θsを特定する。これらの境界上限角θeと境界下限角θsは、外フック領域104の周方向の境界を決定するものである。境界上限角θeと境界下限角θsは、以下のように特定される。先ず、図11(a)に示す極座標画像のr座標が境界半径Rcutよりも大きい範囲に対し、θ方向ヒストグラムHo(θ)を作成する。図12に、θ方向ヒストグラムHo(θ)を示す。θ方向ヒストグラムHo(θ)は、θ座標毎に、グレイスケール値Polar(θ,r)をr軸に沿って加算したものである。θ方向ヒストグラムHo(θ)は、下記の式によって算出される。なお、下記式のTHoは、ノイズを除去するためのしきい値である。   Next, in step S122, a boundary upper limit angle θe and a boundary lower limit angle θs that are boundaries in the circumferential direction of the outer hook region 104 shown in FIG. 10 are specified. These boundary upper limit angle θe and boundary lower limit angle θs determine the boundary in the circumferential direction of the outer hook region 104. The boundary upper limit angle θe and the boundary lower limit angle θs are specified as follows. First, a θ-direction histogram Ho (θ) is created for a range in which the r coordinate of the polar coordinate image shown in FIG. 11A is larger than the boundary radius Rcut. FIG. 12 shows a θ-direction histogram Ho (θ). The θ-direction histogram Ho (θ) is obtained by adding the gray scale value Polar (θ, r) along the r-axis for each θ coordinate. The θ direction histogram Ho (θ) is calculated by the following equation. Note that THo in the following equation is a threshold value for removing noise.

図12に示すθ方向ヒストグラムHo(θ)において、注目座標θを、ステップS118で特定した内フック32のθ座標であるθinからθin+θ1(θ1:既定の角度値)まで増加させていき、θ方向ヒストグラムHo(θ)がゼロとなるθ座標θoeを特定する(Ho(θoe)=0)。また、注目座標θを、θinからθin−θ1まで減算させていき、θ方向ヒストグラムHo(θ)がゼロとなるθ座標θosを特定する(Ho(θos)=0)。外フック領域104の境界上限角θeと境界下限角θsは、ここで特定したθ座標θoeとθosに余裕幅θ2(θ2<θ1)を与え、境界上限角θe=θoe+θ2、境界下限角θs=θos−θ2と定める。
以上により、外フック領域104を画定する境界半径Rcut、境界上限角θe、及び境界下限角θsが決定され、外フック領域104が特定される。これらの境界値Rcut,θe,θsにより、渦巻きばね30の撮影画像100から、図13に示すような外フック34のみを示す外フック画像114を得ることができる。
In the θ direction histogram Ho (θ) shown in FIG. 12, the attention coordinate θ is increased from θin, which is the θ coordinate of the inner hook 32 specified in step S118, to θin + θ1 (θ1: predetermined angle value), The θ coordinate θoe at which the histogram Ho (θ) is zero is specified (Ho (θoe) = 0). Further, the attention coordinate θ is subtracted from θin to θin−θ1, and the θ coordinate θos at which the θ direction histogram Ho (θ) becomes zero is specified (Ho (θos) = 0). The boundary upper limit angle θe and the boundary lower limit angle θs of the outer hook region 104 give a margin width θ2 (θ2 <θ1) to the θ coordinates θoe and θos specified here, the boundary upper limit angle θe = θoe + θ2, and the boundary lower limit angle θs = θos. It is defined as -θ2.
As described above, the boundary radius Rcut, the boundary upper limit angle θe, and the boundary lower limit angle θs that define the outer hook region 104 are determined, and the outer hook region 104 is specified. With these boundary values Rcut, θe, and θs, an outer hook image 114 that shows only the outer hook 34 as shown in FIG. 13 can be obtained from the captured image 100 of the spiral spring 30.

次に、図3のステップS124では、図14に示す内フック領域102の特定が行われる。内フック領域102とは、渦巻きばね30の撮影画像100のなかで、その内フック32が撮影されている領域である。本実施例の形状測定装置10は、以下に説明する処理によって、渦巻きばね30の撮影画像100から内フック領域102を特定する。なお、ステップS124の処理は、渦巻きばね30のタイプによって一部の処理が相違する。   Next, in step S124 of FIG. 3, the inner hook area 102 shown in FIG. 14 is specified. The inner hook region 102 is a region where the inner hook 32 is photographed in the photographed image 100 of the spiral spring 30. The shape measuring apparatus 10 of the present embodiment identifies the inner hook region 102 from the captured image 100 of the spiral spring 30 by the process described below. Note that part of the processing of step S124 differs depending on the type of the spiral spring 30.

(1)第1タイプの場合
図15に示すように、内フック領域102は、極座標画像上で矩形の範囲となる。従って、図15に示すr軸(半径軸)方向の境界線r=rcとθ軸(角度軸)方向の境界線θ=θis,θ=θieを決定することにより、図14に示す扇形の内フック領域102を特定することができる。
境界線r=rc,θ=θis,θ=θieの決定には、ステップS118で算出した内フック32のθ座標θinを基準に、角度範囲θin≦θ≦θin+k(k=0,1,2,・・・)のグレイスケール値Polar(θ,r)をr座標毎に累積した累積ヒストグラムHin(r,k)を用いる。累積ヒストグラムHin(r,k)は、下記式によって算出することができる。
(1) First Type As shown in FIG. 15, the inner hook area 102 is a rectangular area on the polar coordinate image. Therefore, by determining the boundary line r = rc in the r-axis (radial axis) direction and the boundary lines θ = θis and θ = θie in the θ-axis (angle axis) direction shown in FIG. The hook area 102 can be specified.
The determination of the boundary lines r = rc, θ = θis, θ = θie is based on the θ coordinate θin of the inner hook 32 calculated in step S118, and the angle range θin ≦ θ ≦ θin + k (k = 0, 1, 2, ..)) Is used as a cumulative histogram Hin (r, k) obtained by accumulating the gray scale value Polar (θ, r) for each r coordinate. The cumulative histogram Hin (r, k) can be calculated by the following equation.

図16(a)(b)に、累積ヒストグラムHin(r,k)を例示する。図16(a)は、k=0の累積ヒストグラムHin(r,0)を示す。Hin(r,0)は、Polar(θin,r)に等しい。図16(b)は、累積ヒストグラムHin(r,k)を示す。このように、累積ヒストグラムHin(r,k)には、渦巻きばね30の巻数に応じて複数の山が現われる。このうち、左端の山は内フック32を示し、その隣の山は、内フック32より1本外側の素線を示す。従って、内フック32を示す山の右端点をakとし、1本外側の素線を示す山の左端点をbkとすると、内フック領域102の径方向の境界線r=rcは、ak<rc<bkの範囲内に特定することができる。点akと点bkは、累積するライン数kが増加するほど、互いに間隔が狭くなる。そのことから、累積するライン数kを増加させるほど、境界線r=rcを正確に特定することができる。ただし、ライン数kを増加させすぎると、ak=bk、あるいはak>bkとなり、境界線r=rcを特定することができなくなる。従って、ak<bkとなる範囲で累積するライン数kを増加させていき、内フック領域102の径方向の境界線r=rcを、rc=(ak+bk)/2として特定する。 FIGS. 16A and 16B illustrate the cumulative histogram Hin (r, k). FIG. 16A shows a cumulative histogram Hin (r, 0) for k = 0. Hin (r, 0) is equal to Polar (θin, r). FIG. 16B shows a cumulative histogram Hin (r, k). Thus, a plurality of peaks appear in the cumulative histogram Hin (r, k) according to the number of turns of the spiral spring 30. Of these, the peak at the left end indicates the inner hook 32, and the peak next to it indicates a strand outside the inner hook 32. Therefore, when the right end point of the peak indicating the inner hook 32 is ak and the left end point of the peak indicating one outer strand is bk, the radial boundary line r = rc of the inner hook region 102 is expressed as ak <rc <Bk can be specified. The interval between the points ak and bk becomes narrower as the number of accumulated lines k increases. Therefore, the boundary line r = rc can be specified more accurately as the number of accumulated lines k is increased. However, if the number of lines k is increased too much, ak = bk or ak> bk, and the boundary line r = rc cannot be specified. Therefore, the number k of accumulated lines is increased in a range where ak <bk, and the radial boundary line r = rc of the inner hook region 102 is specified as rc = (ak + bk) / 2.

上記した累積ヒストグラムHin(r,k)の作成、及び径方向の境界線r=rcの特定は、内フック32のθ座標θinを基準に、θ座標の正方向及び負方向のそれぞれについて行う。即ち、k=0°,1°,2°,・・・,θ3(既定の角度値)までの範囲について、仮の境界線r=rc1=(ak+bk)/2の探索を行い、そのときのθ座標θin+θ3を内フック領域102の境界上限角θie=θin+Δpとする(Δp=k)。また、k=0°,−1°,−2°,・・・,−θ3まで範囲についても、仮の境界線r=rc2=(ak+bk)/2の探索を行い、そのときのθ座標θin+kを内フック領域102の境界下限角θis=θin−Δmとする。そして、算出した2つの仮の境界線r=rc1,rc2のうち、大きい方を真の境界線r=rcとして選択する。
以上により、第1タイプの渦巻きばねに対して、内フック領域102を画定する境界半径rc、境界上限角θie、及び境界下限角θisが決定され、内フック領域102が特定される。これらの境界値rc,θie,θisにより、渦巻きばね30の撮影画像100から、図17に示すような内フック32のみを示す内フック画像112を得ることができる。
The creation of the cumulative histogram Hin (r, k) and the specification of the radial boundary line r = rc are performed for each of the positive and negative directions of the θ coordinate with reference to the θ coordinate θin of the inner hook 32. That is, a temporary boundary line r = rc1 = (ak + bk) / 2 is searched for the range up to k = 0 °, 1 °, 2 °,..., Θ3 (predetermined angle value), and The θ coordinate θin + θ3 is set as the boundary upper limit angle θie = θin + Δp of the inner hook region 102 (Δp = k). Further, for the range up to k = 0 °, −1 °, −2 °,..., −θ3, a temporary boundary line r = rc2 = (ak + bk) / 2 is searched, and the θ coordinate θin + k at that time is searched. Is the boundary lower limit angle θis = θin−Δm of the inner hook region 102. Then, the larger one of the two calculated temporary boundary lines r = rc1 and rc2 is selected as the true boundary line r = rc.
As described above, the boundary radius rc, the boundary upper limit angle θie, and the boundary lower limit angle θis that define the inner hook region 102 are determined for the first type spiral spring, and the inner hook region 102 is specified. With these boundary values rc, θie, and θis, an inner hook image 112 showing only the inner hook 32 as shown in FIG. 17 can be obtained from the captured image 100 of the spiral spring 30.

ここで、上記で算出した仮の境界線r=rc1,rc2を用いて、渦巻きばね30の巻き方向を判定することが可能となる。なお、渦巻きばね30の巻き方向とは、渦巻きばね30に特有のものではなく、渦巻きばね30が照明器14上に置かれた向きを意味するものである。本実施例の形状測定装置10は、算出した二つの仮の境界線r=rc1,rc2を用い、rc1>rc2であれば右巻きと判定し、rc1<rc2であれば左巻きと判定する。形状測定装置10は、渦巻きばね30を撮影する際に、右巻きとなる向きに載置されることが前提となっている。そのことから、この段階で左巻きと判定された場合、その旨をディスプレイ20に表示して作業者に報知する。なお、作業者に報知することなく、撮影画像100を左右反転させた上で、ステップS112の処理からやり直してもよい。   Here, it is possible to determine the winding direction of the spiral spring 30 using the temporary boundary lines r = rc1 and rc2 calculated above. The winding direction of the spiral spring 30 is not specific to the spiral spring 30 but means the direction in which the spiral spring 30 is placed on the illuminator 14. The shape measuring apparatus 10 according to the present embodiment uses the two calculated temporary boundary lines r = rc1 and rc2, and determines that it is right-handed if rc1> rc2, and determines left-handed if rc1 <rc2. It is assumed that the shape measuring device 10 is placed in a right-handed direction when photographing the spiral spring 30. For this reason, when it is determined that the left-handed winding is performed at this stage, the fact is displayed on the display 20 to notify the operator. Note that the captured image 100 may be reversed left and right without notifying the operator, and the processing from step S112 may be performed again.

(2)第2タイプの場合
次に、第2タイプの渦巻きばね30に関して、内フック領域102を特定する処理について説明する。第2タイプの渦巻きばね30では、内フック32が重心G上に位置するため、内フック領域102が第1タイプのような扇形状とはならない。そのことから、第2タイプの渦巻きばね30では、第1タイプと同じように境界半径rcを求めた後、内フック32のr座標Rin、渦巻きばねの重心G:(cx,cy)を用いて、下記式を満たす範囲を内フック領域102として特定する。
(2) Case of Second Type Next, processing for specifying the inner hook region 102 for the second type spiral spring 30 will be described. In the second type spiral spring 30, the inner hook 32 is located on the center of gravity G, so the inner hook region 102 does not have a fan shape as in the first type. Therefore, in the second type spiral spring 30, after obtaining the boundary radius rc as in the first type, the r coordinate Rin of the inner hook 32 and the gravity center G of the spiral spring: (cx, cy) are used. A range that satisfies the following formula is specified as the inner hook region 102.

以上の処理により、図3に示すステップS112からステップS124までの処理が終了し、渦巻きばね30の撮影画像100から、内フック領域102及び外フック領域104の特定が完了する。即ち、図2に示すステップS14のフック領域の特定が完了する。   With the above processing, the processing from step S112 to step S124 shown in FIG. 3 is completed, and identification of the inner hook region 102 and the outer hook region 104 is completed from the captured image 100 of the spiral spring 30. That is, the specification of the hook area in step S14 shown in FIG. 2 is completed.

次に、図2のステップS16では、各種の寸法を算出する処理に先立ち、撮影画像100に対する前処理が行われる。具体的には、撮影画像100に対して二値化処理を行い、渦巻きばね30の二値化画像を得る。また、内フック画像112(図17参照)及び外フック画像114(図13参照)に対して二値化処理を行い、二値化した内フック画像112及び外フック画像114を得る。以下の処理では、渦巻きばね30のグレイスケール画像及び二値化画像と、内フックのグレイスケール画像及び二値化画像、外フックのグレイスケール画像及び二値化画像が用いられる。   Next, in step S <b> 16 of FIG. 2, preprocessing for the captured image 100 is performed prior to processing for calculating various dimensions. Specifically, binarization processing is performed on the captured image 100 to obtain a binarized image of the spiral spring 30. Also, binarization processing is performed on the inner hook image 112 (see FIG. 17) and the outer hook image 114 (see FIG. 13), and binarized inner hook image 112 and outer hook image 114 are obtained. In the following processing, the gray scale image and binarized image of the spiral spring 30, the gray scale image and binarized image of the inner hook, and the gray scale image and binarized image of the outer hook are used.

次に、図2のステップS18では、図18(a)(b)に示す基準線x=α・y+βの算出処理が行われる。この基準線は、内フックに沿ってその略中央を伸びる直線である。先ず、図18(a)に示すように、内フックのグレイスケール画像に対してx方向のソベルフィルタを施し、横方向エッジを検出する。次いで、Hough変換による直線検出によって、内フック32の両側に沿って伸びる2本の直線x=α1・y+β1,x=α2・y+β2を検出する。そして、これら2本の直線x=α1・y+β1,x=α2・y+β2の平均直線を、基準線x=α・y+βとして算出する。即ち、α=(α1+α2)/2,β=(β1+β2)/2である。基準線x=α・y+βを算出した後、図18(b)に示すように、内フックの先端Ptip:(xtip,ytip)を得る。内フックの先端Ptip:(xtip,ytip)は、内フックの二値化画像において、基準線x=α・y+βに沿ってy座標を下方に変化させ、最初に黒画素となる点である。   Next, in step S18 of FIG. 2, the calculation process of the reference line x = α · y + β shown in FIGS. 18A and 18B is performed. This reference line is a straight line extending substantially along the center along the inner hook. First, as shown in FIG. 18A, a sobel filter in the x direction is applied to the grayscale image of the inner hook to detect a lateral edge. Next, two straight lines x = α1 · y + β1 and x = α2 · y + β2 extending along both sides of the inner hook 32 are detected by straight line detection by Hough transform. Then, an average straight line of these two straight lines x = α1 · y + β1, x = α2 · y + β2 is calculated as a reference line x = α · y + β. That is, α = (α1 + α2) / 2, β = (β1 + β2) / 2. After calculating the reference line x = α · y + β, as shown in FIG. 18B, the tip Ptip: (xtip, ytip) of the inner hook is obtained. A tip Ptip: (xtip, ytip) of the inner hook is a point where the y coordinate is changed downward along the reference line x = α · y + β in the binarized image of the inner hook and first becomes a black pixel.

ここで、基準線x=α・y+βが特定されることにより、以下に説明する処理によって、渦巻きばね30の巻き方向を判定することが可能となる。なお、渦巻きばね30の巻き方向とは、渦巻きばね30に特有のものではなく、渦巻きばね30が照明器14上に置かれた向きを意味するものである。
図18(b)では、渦巻きばね30が右巻きとなっており、内フックが左方に連なっている。この場合、基準線x=α・y+βを境界とし、その左右の領域について画素値の合計値を比較すると、左側の領域のほうがその合計値が大きくなる。従って、基準線x=α・y+βを境界とし、左右の領域について画素値の合計値を比較すると、渦巻きばね30の巻き方向を判別することができる。また、左右の領域で画素値の合計値を算出する際に、基準線x=α・y+βからの距離が遠い画素については、その画素値を増大させるように重み付けを行うと、左右の領域の間で画素値の合計に顕著な差異が生じることから、渦巻きばね30の巻き方向をより正しく判別することが可能となる。
Here, by specifying the reference line x = α · y + β, the winding direction of the spiral spring 30 can be determined by the processing described below. The winding direction of the spiral spring 30 is not specific to the spiral spring 30 but means the direction in which the spiral spring 30 is placed on the illuminator 14.
In FIG. 18 (b), the spiral spring 30 is right-handed, and the inner hook is connected to the left. In this case, when the total value of the pixel values is compared for the left and right regions with the reference line x = α · y + β as a boundary, the total value is larger in the left region. Therefore, the winding direction of the spiral spring 30 can be determined by comparing the total pixel values of the left and right regions with the reference line x = α · y + β as a boundary. In addition, when calculating the total value of the pixel values in the left and right regions, if weighting is performed to increase the pixel values of pixels that are far from the reference line x = α · y + β, Since there is a significant difference in the sum of the pixel values between them, the winding direction of the spiral spring 30 can be more correctly determined.

次に、図2のステップS20では、内フック先端からの距離Dtipを算出する処理が実行される。図19に示すように、内フック先端からの距離Dtipとは、内フックの先端Ptipから最内周の素線までの距離を意味する。この処理では、内フックの二値化画像を用い、内フックの先端Ptipから一つ上方の点を起点に、基準線x=α・y+β上を上方に辿りながら、最初に黒画素となる点を検出する。そして、検出された点の一つ前の点と、内フックの先端Ptipとの距離を、内フック先端からの距離Dtipとして算出する。   Next, in step S20 of FIG. 2, a process of calculating the distance Dtip from the inner hook tip is executed. As shown in FIG. 19, the distance Dtip from the inner hook tip means the distance from the inner hook tip Ptip to the innermost strand. In this process, a binarized image of the inner hook is used, and a point that first becomes a black pixel is traced upward on the reference line x = α · y + β starting from a point one point above the tip Ptip of the inner hook. Is detected. Then, the distance between the point immediately before the detected point and the tip Ptip of the inner hook is calculated as the distance Dtip from the tip of the inner hook.

次に、図2のステップS22では、内フック長さLihを算出する処理が実行される。この処理では、内フックの二値化画像、基準線x=α・y+β、内フック先端Ptip:(xtip,ytip)が用いられる。図20を参照しながら、ステップS22の処理を以下に説明する。
先ず、内フック先端Ptipを通り、基準線x=α・y+βに直交する直線y=a・x+bを求める。さらに、その直線y=a・x+bを下方(y軸正方向)にNa(Na:既定の整数)ポイント移動させた直線y=a・x+b+Naを求める。次いで、その直線y=a・x+b+Naを下方に1ポイントずつ移動させながら、直線上に黒画素が存在しなくなる直線y=a・x+b+Na+nを特定する。次いで、その直線y=a・x+b+Na+nの一つ前の直線y=a・x+b+Na+n−1を、内フック接線y=as・x+bsとする。次いで、内フック接線y=as・x+bsと基準線x=α・y+βとの交点(xcr,ycr)を求める。そして、その交点(xcr,ycr)と内フック先端Ptipとの距離を求め、その距離を内フック長さLihとする。
Next, in step S22 of FIG. 2, a process of calculating the inner hook length Lih is executed. In this processing, the binarized image of the inner hook, the reference line x = α · y + β, and the inner hook tip Ptip: (xtip, ytip) are used. The process of step S22 will be described below with reference to FIG.
First, a straight line y = a · x + b passing through the inner hook tip Ptip and orthogonal to the reference line x = α · y + β is obtained. Further, a straight line y = a · x + b + Na obtained by moving the straight line y = a · x + b downward (Y-axis positive direction) by Na (Na: predetermined integer) point is obtained. Next, while moving the straight line y = a · x + b + Na downward one point at a time, a straight line y = a · x + b + Na + n in which no black pixel exists on the straight line is specified. Next, the straight line y = a · x + b + Na + n−1 immediately before the straight line y = a · x + b + Na + n is set as an inner hook tangent y = as · x + bs. Next, an intersection (xcr, ycr) between the inner hook tangent y = as · x + bs and the reference line x = α · y + β is obtained. Then, the distance between the intersection (xcr, ycr) and the inner hook tip Ptip is obtained, and the distance is defined as the inner hook length Lih.

次に、図2のステップS24では、中心位置を算出する処理が実行される。この処理では算出される中心位置は、渦巻きばねの中心を示す位置であり、以後の処理において基準として用いられるものである。この処理では、基準線x=α・y+β、内フック接線y=as・x+bs、内フック接線と基準線との交点(xcr,ycr)、内フック下端から中心までの距離distが用いられる。ここで、内フック下端から中心までの距離distは、作業者によって入力される値である。
中心位置の算出は、以下の手順で行われる。先ず、内フック接線y=as・x+bsを上方に距離distだけ平行移動した直線y=as・x+bs−distを求める。次いで、直線y=as・x+bs−distと基準線x=α・y+βとの交点を求め、その交点を中心位置Pc:(cx,cy)とする。
Next, in step S24 of FIG. 2, a process for calculating the center position is executed. In this processing, the calculated center position is a position indicating the center of the spiral spring, and is used as a reference in the subsequent processing. In this process, the reference line x = α · y + β, the inner hook tangent y = as · x + bs, the intersection (xcr, ycr) between the inner hook tangent and the reference line, and the distance dist from the lower end of the inner hook to the center are used. Here, the distance dist from the lower end of the inner hook to the center is a value input by the operator.
The calculation of the center position is performed according to the following procedure. First, a straight line y = as · x + bs−dist obtained by translating the inner hook tangent line y = as · x + bs upward by a distance dist is obtained. Next, an intersection point between the straight line y = as · x + bs−dist and the reference line x = α · y + β is obtained, and the intersection point is set as a center position Pc: (cx, cy).

次に、図2のステップS26では、内径Dinを算出する処理が実行される。この処理では、渦巻きばね30の撮影画像100、基準線x=α・y+β、中心位置Pc:(cx,cy)が用いられる。図21を参照しながら、このステップS26の処理を以下に説明する。
先ず、中心位置Pc:(cx,cy)を通り、基準線x=α・y+βに垂直な内径直線y=a・x+bcを求める。次いで、内径直線y=a・x+bc上の画素の濃度を、中心位置Pc:(cx,cy)から順にx座標を減算しながら確認していき、白画素から黒画素へと変化する一つ手前の点p1を検出する。同様に、内径直線y=a・x+bc上の画素の濃度を、中心位置Pc:(cx,cy)から順にx座標を加算しながら確認していき、白画素から黒画素へと変化する一つ手前の点p2を検出する。そして、検出した点p1と点p2の距離を、渦巻きばね30の内径Dinとして算出する。
Next, in step S26 of FIG. 2, a process for calculating the inner diameter Din is executed. In this processing, the captured image 100 of the spiral spring 30, the reference line x = α · y + β, and the center position Pc: (cx, cy) are used. The process of step S26 will be described below with reference to FIG.
First, an inner diameter straight line y = a · x + bc passing through the center position Pc: (cx, cy) and perpendicular to the reference line x = α · y + β is obtained. Next, the density of the pixels on the inner diameter straight line y = a · x + bc is confirmed while subtracting the x coordinate sequentially from the center position Pc: (cx, cy), and immediately before changing from a white pixel to a black pixel. The point p1 is detected. Similarly, the density of the pixel on the inner diameter straight line y = a · x + bc is checked while adding the x coordinate in order from the center position Pc: (cx, cy), and changes from white to black. The front point p2 is detected. Then, the detected distance between the points p1 and p2 is calculated as the inner diameter Din of the spiral spring 30.

次に、図2のステップS28では、内フックの曲率半径Rin及び外フックの曲率半径Rohを算出する処理が実行される。この処理では、内フックの二値化画像、外フックの二値化画像、内フック領域の座標、外フック領域の座標が用いられる。なお、内フックの曲率半径Rinと外フックの曲率半径Rohは、同じ手順によって算出される。従って、ここでは外フックの曲率半径Rohの算出手順についてのみ説明し、内フックの曲率半径Rinの算出手順についての説明は省略する。また、渦巻きばね30のタイプに応じた処理の変更もない。
先ず、外フックの二値化画像と外フック領域の座標を用い、外フックの二値化画像から外フック領域のみを切り出す。次いで、その外フック領域の切り出し画像から、外フックの重心Gmを求める。次いで、外フック領域の切り出し画像に対して輪郭線追跡を行い、図22に示すように輪郭座標系列Pi(i=0,1,・・・n−1)を取得する。このとき、輪郭線のノイズを必要に応じて除去するとよい。次いで、重心Gmと輪郭座標系列Piとの距離系列diを求める。図23に、距離系列diを例示する。ここで、距離系列の始端d0と終端dn−1は連続しており、dn=d0の関係にある。
距離系列diを求めた後、下記式で表される相関値r(k)をk=0,1,2,・・・,n−1についてそれぞれ求める。この相関値r(k)は、外フックの内側輪郭線と外側輪郭線の境界点pb,pdを特定するために用いられる。
Next, in step S28 of FIG. 2, a process of calculating the curvature radius Rin of the inner hook and the curvature radius Roh of the outer hook is executed. In this process, the binarized image of the inner hook, the binarized image of the outer hook, the coordinates of the inner hook region, and the coordinates of the outer hook region are used. The curvature radius Rin of the inner hook and the curvature radius Roh of the outer hook are calculated by the same procedure. Therefore, only the calculation procedure of the curvature radius Roh of the outer hook will be described here, and the description of the calculation procedure of the curvature radius Rin of the inner hook will be omitted. Further, there is no change in processing according to the type of the spiral spring 30.
First, using the binarized image of the outer hook and the coordinates of the outer hook region, only the outer hook region is cut out from the binarized image of the outer hook. Next, the center of gravity Gm of the outer hook is obtained from the cut image of the outer hook region. Next, contour tracking is performed on the cut image of the outer hook region, and a contour coordinate series Pi (i = 0, 1,... N−1) is acquired as shown in FIG. At this time, the noise on the contour line may be removed as necessary. Next, a distance series di between the center of gravity Gm and the contour coordinate series Pi is obtained. FIG. 23 illustrates the distance series di. Here, the start end d0 and the end dn-1 of the distance series are continuous and have a relationship of dn = d0.
After obtaining the distance series di, correlation values r (k) represented by the following formulas are obtained for k = 0, 1, 2,. The correlation value r (k) is used to specify boundary points pb and pd between the inner contour line and the outer contour line of the outer hook.

上記した相関値r(k)は、距離系列diが注目点(k,dk)を境に対称形となるとき、最大値である1を出力するものである。図22に示す外フックの輪郭線上の点pb及び点pdは、外フックの内側輪郭線と外側輪郭線の境界に位置する点である。外フックの内側輪郭線と外側輪郭線は、比較的に近似した形状を有している。そのことから、それら境界に位置する点pb及び点pdでは、上記した相関値r(k)が1に近い値を取ることになる。即ち、上記した相関値r(k)が極大となる輪郭線上の点を特定することで、外フックの内側輪郭線と外側輪郭線の境界位置を特定することができる。
なお、上記の数式6で示した相関値r(k)は、輪郭線同士の類似度又は距離(非類似度)を表す他の指標に置き換えることもできる。例えば、数式6の代わりに相関係数、ユークリッド距離、シティブロック距離などを用いて内側輪郭線と外側輪郭線の境界位置を特定してもよい。
The above-described correlation value r (k) outputs 1 which is the maximum value when the distance series di is symmetric with respect to the attention point (k, dk). The points pb and pd on the contour line of the outer hook shown in FIG. 22 are points located at the boundary between the inner contour line and the outer contour line of the outer hook. The inner and outer contour lines of the outer hook have a relatively approximate shape. Therefore, the correlation value r (k) described above takes a value close to 1 at the points pb and pd located at these boundaries. In other words, the boundary position between the inner contour line and the outer contour line of the outer hook can be identified by identifying the point on the contour line where the correlation value r (k) is maximized.
Note that the correlation value r (k) shown in Equation 6 above can be replaced with another index that represents the similarity or distance (dissimilarity) between contour lines. For example, the boundary position between the inner contour line and the outer contour line may be specified using a correlation coefficient, Euclidean distance, city block distance, and the like instead of Equation 6.

図24は、算出される相関値r(k)の一例を示す。図24に示すように、相関値r(k)では、極大値となる点が4点存在する。これらの4点は、図22に示す4点P1,P2,P3,P4に対応する。従って、相関値r(k)を算出することにより、内側輪郭線と外側輪郭線の境界点を含む4点を特定することができる。
次いで、特定した4点を輪郭線追跡の順に並べ、奇数順のペア(ここでは点P1と点P3)と偶数順のペア(ここでは点P2と点P4)のそれぞれについて、2点間の距離を算出する。そして、算出された距離が大きい方のペア(ここでは点P2と点P4)を、内側輪郭線と外側輪郭線の境界点として特定する。
次いで、境界点P1から鏡界点P3に到る第1の輪郭座標系列P1−P3と、境界点P2から境界点P4に到る第2の輪郭座標系列P2−P4のうち、どちらが内側輪郭線であるのかを判定する。そのために、第1の輪郭座標系列P1−P3と第2の輪郭座標系列P2−P4のそれぞれについて、輪郭座標系列と重心Gmとの距離の最小値を求め、その最小距離が小さいほうの輪郭座標系列を内側輪郭線(ここではP2−P4)と判定する。それにより、図25に示すように、内側輪郭線のみの輪郭線系列を得ることができる。
FIG. 24 shows an example of the calculated correlation value r (k). As shown in FIG. 24, in the correlation value r (k), there are four points that are maximum values. These four points correspond to the four points P1, P2, P3, and P4 shown in FIG. Therefore, by calculating the correlation value r (k), four points including the boundary point between the inner contour line and the outer contour line can be specified.
Next, the four specified points are arranged in the order of contour tracking, and the distance between two points for each of an odd-ordered pair (here, point P1 and point P3) and an even-numbered pair (here, point P2 and point P4). Is calculated. Then, the pair with the larger calculated distance (here, the point P2 and the point P4) is specified as a boundary point between the inner contour line and the outer contour line.
Next, which of the first contour coordinate series P1-P3 from the boundary point P1 to the specular point P3 and the second contour coordinate series P2-P4 from the boundary point P2 to the boundary point P4, which is the inner contour line? It is determined whether it is. Therefore, for each of the first contour coordinate series P1-P3 and the second contour coordinate series P2-P4, the minimum value of the distance between the contour coordinate series and the center of gravity Gm is obtained, and the contour coordinate having the smaller minimum distance is obtained. The series is determined to be an inner contour line (P2-P4 here). As a result, as shown in FIG. 25, a contour line series having only inner contour lines can be obtained.

次いで、内側輪郭線のみの内側輪郭線系列を用い、内側輪郭線系列における角度最大点を特定する。角度最大点とは、内側輪郭線の向きが最も変化する点であり、外フックの屈曲部を示す点である。先ず、図25に示すように、誤検出の防止を目的として内側輪郭線系列の両端Nbポイント(Nb:既定の整数)を削除しておく。次いで、下記式で表される平均ベクトルm(k)、平均ベクトルp(k)を算出する。相関値r(k)をk=0,1,2,・・・,n−1についてそれぞれ求める。   Next, the maximum angle point in the inner contour line sequence is specified using the inner contour line sequence of only the inner contour line. The maximum angle point is a point at which the direction of the inner contour line changes most, and is a point indicating a bent portion of the outer hook. First, as shown in FIG. 25, both end Nb points (Nb: default integer) of the inner contour line series are deleted for the purpose of preventing erroneous detection. Next, an average vector m (k) and an average vector p (k) represented by the following formula are calculated. Correlation values r (k) are obtained for k = 0, 1, 2,.

上記した平均ベクトルm(k)は、注目点(xtk,ytk)からそのNcポイント前(Nc:既定の整数)までの輪郭線系列が向いている方向を、大局的に示すものである。一方、平均ベクトルp(k)は、注目点(xtk,ytk)からそのNcポイント後ろまでの輪郭線系列が向いている方向を、大局的に示すものである。これら2つの平均ベクトルm(k),p(k)の方向が最も異なるとき、その注目点(xtk,ytk)を角度最大点として求めることができる。本実施例では、平均ベクトルm(k),p(k)が成す角θkについてその余弦cosθkを求め、1−cosθkが最大となる注目点(xtk,ytk)を角度最大点Pmaxとする(図26参照)。図27に示すように、角度最大点Pmaxを求めた後、その前後Ndポイント分(Nd:既定の整数)を切り出し、外フックの屈曲部に相当する輪郭線座標系列を抽出する。   The average vector m (k) described above generally indicates the direction in which the contour line series from the point of interest (xtk, ytk) to Nc points before (Nc: a predetermined integer) faces. On the other hand, the average vector p (k) generally indicates the direction in which the contour line series from the point of interest (xtk, ytk) to the back of the Nc point faces. When the directions of these two average vectors m (k) and p (k) are the most different, the point of interest (xtk, ytk) can be obtained as the maximum angle point. In this embodiment, the cosine cos θk is obtained for the angle θk formed by the average vectors m (k) and p (k), and the point of interest (xtk, ytk) at which 1-cos θk is maximum is set as the maximum angle point Pmax (FIG. 26). As shown in FIG. 27, after obtaining the maximum angle point Pmax, Nd points (Nd: a predetermined integer) before and after that are cut out, and a contour coordinate series corresponding to the bent portion of the outer hook is extracted.

次に、上記で抽出した輪郭線系列(図27参照)を用い、その輪郭線系列に角度最大点Pmaxで内接する円を、Hough変換によって算出する。それにより、図28に示すように、外フックに内接する円の中心Pco:(xco,yco)とその半径Roh、即ち、外フック曲率半径Rohを算出することができる。   Next, using the contour line sequence extracted above (see FIG. 27), a circle inscribed in the contour line sequence at the maximum angle point Pmax is calculated by Hough transform. Thereby, as shown in FIG. 28, the center Pco: (xco, yco) of the circle inscribed in the outer hook and its radius Roh, that is, the outer hook curvature radius Roh can be calculated.

次に、図2のステップS30では、フリー角度θfを算出する処理が実行される。この処理では、外フックの二値化画像、基準線x=α・y+β、中心位置(座標)Pc:(xc,yc)、外フック曲率半径Rohの中心Pcoが用いられる。図29を参照しながら、ステップS30の処理を以下に説明する。
先ず、中心座標Pc:(xc,yc)と外フック曲率半径Rohの中心Pcoとの距離Routを算出する。次いで、中心座標Pc:(xc,yc)を中心とし、半径を上記した距離Routとする円を作成する。次いで、作成した円と外フックの二値化画像が重なる座標群のなかで、外フック曲率半径Rohの中心Pcoに最寄りの点を、外フックの内側接点Pbo:(xb,yb)として求める。次いで、中心位置Pc:(xc,yc)と外フックの内側接点Pbo:(xb,yb)を通る直線y=af・x+bfを、フリー角度直線として求める。そして、フリー角度直線y=af・x+bfと基準線x=α・y+βが成す角を、フリー角度θfとして求める。
Next, in step S30 in FIG. 2, a process of calculating the free angle θf is executed. In this process, the binarized image of the outer hook, the reference line x = α · y + β, the center position (coordinates) Pc: (xc, yc), and the center Pco of the outer hook curvature radius Roh are used. The process of step S30 will be described below with reference to FIG.
First, a distance Rout between the center coordinate Pc: (xc, yc) and the center Pco of the outer hook curvature radius Roh is calculated. Next, a circle having the center coordinate Pc: (xc, yc) as the center and the radius as the distance Rout is created. Next, a point closest to the center Pco of the outer hook curvature radius Roh is obtained as an inner contact Pbo of the outer hook: (xb, yb) in a coordinate group in which the created binarized image and the binarized image of the outer hook overlap. Next, a straight line y = af · x + bf passing through the center position Pc: (xc, yc) and the inner contact Pbo: (xb, yb) of the outer hook is obtained as a free angle straight line. Then, an angle formed by the free angle line y = af · x + bf and the reference line x = α · y + β is obtained as the free angle θf.

次に、図2のステップS32では、フック半径HRを算出する処理が実行される。この処理では、中心座標Pc:(xc,yc)、外フックの内側接点Pbo:(xb,yb)が用いられる。図30に示すように、この処理では、中心座標Pc:(xc,yc)と外フックの内側接点Pbo:(xb,yb)との距離が、フック半径HRとして算出される。   Next, in step S32 of FIG. 2, a process of calculating the hook radius HR is executed. In this process, the center coordinates Pc: (xc, yc) and the inner contact Pbo: (xb, yb) of the outer hook are used. As shown in FIG. 30, in this process, the distance between the center coordinate Pc: (xc, yc) and the inner contact Pbo: (xb, yb) of the outer hook is calculated as the hook radius HR.

次に、図2のステップS34では、外フック長さLohを算出する処理が実行される。この処理では、外フックの二値化画像と、中心位置(座標)Pc:(xc,yc)が用いられる。図31、図32を参照しながら、ステップS34の処理について説明する。
先ず、外フックの二値化画像に対して輪郭線追跡を行い、図31に示すような輪郭座標系列Pi(i=0,1,・・・n−1)を取得する。このとき、輪郭線のノイズを必要に応じて除去するとよい。次いで、下記式で表される平均ベクトル角系列cosθkを、k=0,1,2,・・・,n−1についてそれぞれ求める。この平均ベクトル角系列cosθkは、外フック先端の角部Q1、Q2を特定するために用いられる。
Next, in step S34 of FIG. 2, a process of calculating the outer hook length Loh is executed. In this process, the binarized image of the outer hook and the center position (coordinates) Pc: (xc, yc) are used. The process of step S34 will be described with reference to FIGS.
First, contour tracking is performed on the binarized image of the outer hook, and a contour coordinate series Pi (i = 0, 1,... N−1) as shown in FIG. 31 is acquired. At this time, the noise on the contour line may be removed as necessary. Next, an average vector angle series cos θk represented by the following equation is obtained for k = 0, 1, 2,. This average vector angle series cos θk is used to specify the corners Q1 and Q2 of the outer hook tip.

上記した平均ベクトル角系列cosθkは、注目点(xk,yk)の前後Neポイント分(Ne:既定の整数)の輪郭座標系列を用い、注目点(xk,yk)が外フックの角部Q1〜Q4に相当する場合に、ゼロに近い値を出力するものである。従って、平均ベクトル角系列cosθを求め、それが極小値をとるときの4点を求めることにより、図31に示す4箇所の外フックの角部Q1〜Q4を特定することができる。そして、特定した4箇所の角部Q1〜Q4のうち、中心位置Pcから最も遠い2点を選択することにより、外フック先端の角部Q1、Q2を特定することができる。   The average vector angle series cos θk described above uses a contour coordinate series of Ne points before and after the point of interest (xk, yk) (Ne: default integer), and the point of interest (xk, yk) is the corners Q1 to Q1 of the outer hook. In the case corresponding to Q4, a value close to zero is output. Therefore, the corners Q1 to Q4 of the four outer hooks shown in FIG. 31 can be specified by obtaining the average vector angle series cos θ and obtaining four points when it takes the minimum value. Then, by selecting the two points farthest from the center position Pc among the four specified corners Q1 to Q4, the corners Q1 and Q2 at the front end of the outer hook can be specified.

次いで、外フック先端の角部Q1、Q2の間の輪郭座標系列を、直線に近似する処理を行う。直線近似は、例えば最小二乗法を用いることができるが、最小二乗法は局所的なノイズに影響を受けやすい。そのことから、本実施例では、下記式による直線式A・y+B・x=1を得る。直線A・y+B・x=1を、外フック先端直線という。   Next, a process for approximating the contour coordinate series between the corners Q1 and Q2 of the outer hook tip to a straight line is performed. For the linear approximation, for example, the least square method can be used, but the least square method is susceptible to local noise. Therefore, in this embodiment, a linear expression A · y + B · x = 1 is obtained by the following equation. The straight line A · y + B · x = 1 is referred to as the outer hook tip straight line.

次いで、外フック先端直線A・y+B・x=1を、外フックの外側輪郭線に接する位置まで平行移動させ、外フック長さLohを求める。ここで、外フック先端直線A・y+B・x=1を平行移動させる方向は、下記式のように定められている。ここで、(x(m+l)/2,y(m+l)/2)は、外フック先端の角部Q1、Q2の中間点であり、外フック先端点である。 Next, the outer hook tip straight line A · y + B · x = 1 is translated to a position in contact with the outer contour line of the outer hook to obtain the outer hook length Loh. Here, the direction in which the outer hook tip straight line A · y + B · x = 1 is translated is determined by the following equation. Here, (x (m + 1) / 2 , y (m + 1) / 2 ) is an intermediate point between corners Q1 and Q2 of the outer hook tip, and is an outer hook tip point.

上記の関係式により、例えば−x方向に外フック先端直線A・y+B・x=1を移動させる場合、例えばkポイント移動させた時点で外フックの外側輪郭線に接するのであれば、その移動後の直線はA・y+B・x=1−B・kとなる。そして、フック線端点(x(m+l)/2,y(m+l)/2)と直線A・y+B・x=1−B・kの間の距離が、外フック長さLohとして算出される。 For example, when the outer hook tip straight line A · y + B · x = 1 is moved in the −x direction by the above relational expression, for example, if it touches the outer contour line of the outer hook at the time of moving k points, The straight line of A · y + B · x = 1−B · k. The distance between the hook line end point (x (m + 1) / 2 , y (m + 1) / 2 ) and the straight line A.y + B.x = 1-B.k is calculated as the outer hook length Loh. Is done.

次ぎに、図2のステップS36では、外フック角度θmtを算出する処理が実行される。この処理では、外フックの二値化画像、フリー角直線af・x+bf、外フック先端の角部Q1,Q2、外フック曲率半径Rohが用いられる。図33、図34を参照しながら、ステップS36の処理について説明する。
先ず、外フックの二値化画像に対して輪郭線追跡を行い、先のステップS34と同様に、輪郭座標系列を取得する(図31参照)。次いで、図33に示すように、外フック先端の角部Q1,Q2をそれぞれ始点とし、Nfポイント分(Nf:既定の整数)の輪郭座標系列を取得する。一方の角部Q1を始点とするものは、外側の輪郭線に沿う輪郭座標系列であり、他方の角部Q1を始点とするものは、内側の輪郭線に沿う輪郭座標系列である。次いで、図34に示すように、フリー角直線y=af・x+bfを、外フック曲率半径Rohの中心Pco:(xco,yco)まで平行移動させたシフト直線y=af・x+(yco+af・xco)を得る。次いで、図33に示すように、上記した2組のNfポイント分の輪郭座標系列の中間に位置する中間座標系列Pmを求める。ここで、中間座標系列Pmの算出は、上記したシフト直線との距離が1未満となる位置で打ち切る。次いで、中間座標系列Pmを最小二乗法の一次式にあてはめ、図34に示す近似直線y=Am・x+Bmを得る。そして、フリー角直線y=af・x+bfと近似直線y=Am・x+Bmとが成す角を、外フック角度θmtとして算出する。
Next, in step S36 of FIG. 2, a process of calculating the outer hook angle θmt is executed. In this process, the binarized image of the outer hook, the free angle straight line af · x + bf, the corners Q1 and Q2 of the outer hook tip, and the outer hook curvature radius Roh are used. The process of step S36 will be described with reference to FIGS.
First, contour tracking is performed on the binarized image of the outer hook, and a contour coordinate series is acquired as in the previous step S34 (see FIG. 31). Next, as shown in FIG. 33, a corner coordinate series of Nf points (Nf: a predetermined integer) is acquired with the corners Q1 and Q2 of the outer hook tip as starting points. What starts at one corner Q1 is a contour coordinate series along the outer contour line, and what starts at the other corner Q1 is a contour coordinate series along the inner contour line. Next, as shown in FIG. 34, a shift straight line y = af · x + (yco + af · xco) obtained by translating the free angle straight line y = af · x + bf to the center Pco: (xco, yco) of the outer hook curvature radius Roh. Get. Next, as shown in FIG. 33, an intermediate coordinate series Pm located in the middle of the two sets of contour coordinate series for Nf points is obtained. Here, the calculation of the intermediate coordinate series Pm is terminated at a position where the distance from the shift straight line is less than 1. Next, the intermediate coordinate series Pm is applied to a linear expression of the least square method, and an approximate straight line y = Am · x + Bm shown in FIG. 34 is obtained. Then, the angle formed by the free angle line y = af · x + bf and the approximate line y = Am · x + Bm is calculated as the outer hook angle θmt.

次に、図2のステップS38では、これまでに計算した各部の寸法をディスプレイ20に表示する。ディスプレイ20には、(1)渦巻きばねの内径Din、(2)フリー角度θf、(3)フック半径HR、(4)外フック長さLoh、(5)内フック長さLih、(6)外フック曲率半径Roh、(7)内フック曲率半径Rih、(8)外フック角度θmt、(9)内フック先端からの距離Dtipが表示される。以上により、形状測定装置10による渦巻きばね30の形状測定処理が終了する。   Next, in step S38 of FIG. 2, the dimensions of the respective parts calculated so far are displayed on the display 20. Display 20 includes (1) spiral spring inner diameter Din, (2) free angle θf, (3) hook radius HR, (4) outer hook length Loh, (5) inner hook length Lih, (6) outer The hook curvature radius Roh, (7) inner hook curvature radius Rih, (8) outer hook angle θmt, and (9) distance Dtip from the inner hook tip are displayed. Thus, the shape measuring process of the spiral spring 30 by the shape measuring apparatus 10 is completed.

本実施例の形状測定装置10は、特定の形状を有する渦巻きばね30に限らず、様々な形状の渦巻きばね30の形状を、同じように測定することができる。特に、形状測定装置10は、渦巻きばね30の形状にかかわらず、渦巻きばね30の撮影画像100から内フック32と外フック34を特定し、内フック32や外フック34を基準とする寸法測定を正確に行うことができる。   The shape measuring apparatus 10 of the present embodiment is not limited to the spiral spring 30 having a specific shape, and can similarly measure the shapes of the spiral springs 30 having various shapes. In particular, the shape measuring device 10 identifies the inner hook 32 and the outer hook 34 from the captured image 100 of the spiral spring 30 regardless of the shape of the spiral spring 30, and performs dimension measurement based on the inner hook 32 and the outer hook 34. Can be done accurately.

以上、本発明の具体例を詳細に説明したが、これらは例示にすぎず、特許請求の範囲を限定するものではない。特許請求の範囲に記載の技術には、以上に例示した具体例を様々に変形、変更したものが含まれる。
また、本明細書または図面に説明した技術要素は、単独であるいは各種の組合せによって技術的有用性を発揮するものであり、出願時の請求項記載の組合せに限定されるものではない。また、本明細書または図面に例示した技術は、複数目的を同時に達成するものであり、そのうちの一つの目的を達成すること自体で技術的有用性を持つものである。
Specific examples of the present invention have been described in detail above, but these are merely examples and do not limit the scope of the claims. The technology described in the claims includes various modifications and changes of the specific examples illustrated above.
In addition, the technical elements described in the present specification or the drawings exhibit technical usefulness alone or in various combinations, and are not limited to the combinations described in the claims at the time of filing. In addition, the technology exemplified in this specification or the drawings achieves a plurality of objects at the same time, and has technical utility by achieving one of the objects.

形状測定装置の構成を示す図。The figure which shows the structure of a shape measuring apparatus. 形状測定装置による形状測定の流れを示すフローチャート。The flowchart which shows the flow of a shape measurement by a shape measuring apparatus. フック領域を特定する処理の流れを示すフローチャート。The flowchart which shows the flow of the process which pinpoints a hook area | region. 形状測定装置が寸法を測定する箇所を示す図。The figure which shows the location where a shape measuring apparatus measures a dimension. 渦巻きばねの撮影画像を示す図(第1タイプ)。The figure which shows the picked-up image of a spiral spring (1st type). 渦巻きばねの撮影画像を示す図(第2タイプ)。The figure which shows the picked-up image of a spiral spring (2nd type). 第1タイプの渦巻きばねについて、図7(a)は極座標画像を示し、図7(b)はr方向ヒストグラムを示す。FIG. 7A shows a polar coordinate image and FIG. 7B shows an r-direction histogram for the first type spiral spring. 第2タイプの渦巻きばねについて、図8(a)は極座標画像を示し、図8(b)はr方向ヒストグラムを示す。FIG. 8A shows a polar coordinate image and FIG. 8B shows an r-direction histogram for the second type spiral spring. 図8(b)の一部を拡大して示す図。The figure which expands and shows a part of FIG.8 (b). 外フック領域を示す図。The figure which shows an outer hook area | region. 外フック領域の境界半径Rcutを説明する図。The figure explaining boundary radius Rcut of an outside hook field. θ方向ヒストグラムを示す図。The figure which shows (theta) direction histogram. 外フック画像を示す図。The figure which shows an outer hook image. 内フック領域を示す図。The figure which shows an inner hook area | region. 内フック領域を極座標画像に示す図。The figure which shows an inner hook area | region in a polar coordinate image. 累積ヒストグラムを説明する図。The figure explaining a cumulative histogram. 内フック画像を示す図。The figure which shows an inner hook image. 基準線の算出処理を説明する図。The figure explaining the calculation process of a reference line. 内フック先端からの距離Dtipの算出処理を説明する図。The figure explaining the calculation process of distance Dtip from an inner hook front-end | tip. 内フック長さLihの算出処理を説明する図。The figure explaining calculation processing of inner hook length Lih. 内径Dinの算出処理を説明する図。The figure explaining the calculation process of the internal diameter Din. 外フック画像の輪郭座標系列及び距離系列を説明する図。The figure explaining the outline coordinate series and distance series of an outer hook image. 距離系列diの一例を示すグラフ。The graph which shows an example of distance series di. 相関値r(k)の一例を示すグラフ。The graph which shows an example of correlation value r (k). 外フックの内側輪郭線の座標系列を示す図。The figure which shows the coordinate series of the inner side outline of an outer hook. 角度最大点の算出に用いる平均ベクトルの成す角を示す図。The figure which shows the angle | corner which the average vector used for calculation of a maximum angle point forms. 外フックの屈曲部の輪郭線座標系列を示す図。The figure which shows the outline coordinate series of the bending part of an outer hook. 外フックに内接する円とその半径(外フック曲率半径)Rohを示す図。The figure which shows the circle | round | yen inscribed to an outer hook, and its radius (outer hook curvature radius) Roh. フリー角度θfの算出処理を説明する図。The figure explaining calculation processing of free angle thetaf. フック半径HRの算出処理を説明する図。The figure explaining the calculation process of hook radius HR. 外フック先端の角部Q1、Q2を特定する処理を説明する図。The figure explaining the process which pinpoints corner | angular part Q1, Q2 of an outer hook front-end | tip. 外フック長さLohの算出処理を説明する図。The figure explaining calculation processing of outer hook length Loh. 外フック先端の角部Q1、Q2を始点とする起点輪郭座標系列を示す図。The figure which shows the origin outline coordinate series which makes corner | angular part Q1, Q2 of an outer hook front-end | tip start. 外フック角度θmtの算出処理を説明する図。The figure explaining calculation processing of outside hook angle thetamt.

符号の説明Explanation of symbols

10:形状測定装置
12:ステージ
14:照明器
16:CCDカメラ
18:通信線
20:ディスプレイ
22:コンピュータ
30:渦巻きばね
32:渦巻きばねの内フック
34:渦巻きばねの外フック
10: shape measuring device 12: stage 14: illuminator 16: CCD camera 18: communication line 20: display 22: computer 30: spiral spring 32: spiral hook inner hook 34: spiral spring outer hook

Claims (10)

内フックから外フックまで渦巻状に伸びる渦巻きばねの形状を測定する形状測定装置であり、
渦巻きばねを撮影した撮影画像を入力する画像入力手段と、
前記撮影画像を極座標変換した極座標画像を作成する画像変換手段と、
前記極座標画像を用いて、前記撮影画像中の内フックが撮影されている内フック位置、及び/又は、外フックが撮影されている外フック位置を特定するフック位置特定手段と、
を備え
前記フック位置特定手段は、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定することを特徴とする形状測定装置。
It is a shape measuring device that measures the shape of a spiral spring that extends spirally from the inner hook to the outer hook,
An image input means for inputting a photographed image of the spiral spring;
Image conversion means for creating a polar coordinate image obtained by converting the captured image into polar coordinates;
Hook position specifying means for specifying an inner hook position where the inner hook in the photographed image is photographed and / or an outer hook position where the outer hook is photographed using the polar coordinate image;
Equipped with a,
The hook position specifying means creates an r-direction histogram in which each pixel value of the polar coordinate image is added for each position in the radial axis direction, and specifies the inner hook position and / or the outer hook position using the r-direction histogram. shape measuring device you wherein a.
前記内フック位置及び/又は外フック位置を用いて、前記撮影画像中の内フックが撮影されている内フック領域、及び/又は、外フックが撮影されている外フック領域を特定するフック領域特定手段をさらに備えることを特徴とする請求項1に記載の形状測定装置。 Using the inner hook position and / or the outer hook position, the hook area specification for specifying the inner hook area in which the inner hook is photographed in the photographed image and / or the outer hook area in which the outer hook is photographed. The shape measuring apparatus according to claim 1, further comprising means. 前記フック領域特定手段は、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムと、前記極座標画像の各画素値を角度軸方向の位置毎に加算したθ方向ヒストグラムを作成し、そのr方向ヒストグラムとθ方向ヒストグラムを用いて前記内フック領域及び/又は外フック領域を特定することを特徴とする請求項に記載の形状測定装置。 The hook area specifying means includes an r-direction histogram obtained by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and a θ-direction histogram obtained by adding each pixel value of the polar coordinate image for each position in the angle axis direction. The shape measuring apparatus according to claim 2 , wherein the shape measuring device is created and the inner hook region and / or the outer hook region is specified using the r-direction histogram and the θ-direction histogram. 前記フック領域特定手段は、前記r方向ヒストグラムを用いて外フック領域の半径方向の境界位置を特定し、前記θ方向ヒストグラムを用いて外フック領域の角度軸方向の境界位置を特定することを特徴とする請求項に記載の形状測定装置。 The hook area specifying means specifies a radial boundary position of the outer hook area using the r-direction histogram, and specifies a boundary position of the outer hook area in the angle axis direction using the θ-direction histogram. The shape measuring apparatus according to claim 3 . 前記フック領域特定手段は、前記極座標画像の半径軸に平行なラインを順次抽出し、抽出したライン上の各画素値を半径軸方向の位置毎に加算していく累積ヒストグラムを作成し、その累積ヒストグラムを用いて前記内フック領域を特定することを特徴とする請求項又はに記載の形状測定装置。 The hook region specifying means sequentially extracts lines parallel to the radial axis of the polar coordinate image, creates a cumulative histogram in which each pixel value on the extracted line is added for each position in the radial axis direction, and the cumulative histogram shape measuring apparatus according to claim 3 or 4, wherein the identifying the said hook region using a histogram. 前記画像変換手段は、前記撮影画像に撮影された渦巻きばねの像の重心を算出し、その重心を中心として極座標変換を行うことを特徴とする請求項1からのいずれか一項に記載の形状測定装置。 The image converting means, said calculating the centroid of the image of the spiral spring taken in the captured image, according to any one of claims 1 to 5, characterized in that the polar coordinate conversion around its center of gravity Shape measuring device. 前記極座標画像の半径軸に平行なラインを順次抽出し、抽出したライン上の各画素値を半径軸方向の位置毎に加算していく累積ヒストグラムを作成し、その累積ヒストグラムを用いて、渦巻きばねの巻き方向を判別する第1の巻き方向判別手段をさらに備えることを特徴とする請求項1からのいずれか一項に記載の形状測定装置。 A line that is parallel to the radial axis of the polar coordinate image is sequentially extracted, and a cumulative histogram is created in which each pixel value on the extracted line is added for each position in the radial axis direction. The shape measuring device according to any one of claims 1 to 6 , further comprising first winding direction discriminating means for discriminating a winding direction of the first winding direction. 前記撮影画像を内フックに沿った直線によって分割し、分割した二つの領域を比較することによって、渦巻きばねの巻き方向を判別する第2の巻き方向判別手段をさらに備えることを特徴とする請求項1からのいずれか一項に記載の形状測定装置。 2. The apparatus according to claim 1, further comprising second winding direction determining means for determining the winding direction of the spiral spring by dividing the photographed image by a straight line along the inner hook and comparing the two divided areas. The shape measuring apparatus according to any one of 1 to 7 . 内フックから外フックまで渦巻状に伸びる渦巻きばねの形状を測定する形状測定方法であり、コンピュータに下記の処理、即ち、
渦巻きばねを撮影した撮影画像を入力する画像入力処理と、
前記撮影画像を極座標変換した極座標画像を作成する画像変換処理と、
前記極座標画像を用いて、内フックが撮影されている内フック位置、及び/又は、前記撮影画像中の外フックが撮影されている外フック位置を、前記撮影画像中に特定するフック位置特定処理と、
を実行させ
前記フック位置特定処理では、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定することを特徴とする形状測定方法。
It is a shape measuring method for measuring the shape of a spiral spring that extends in a spiral shape from an inner hook to an outer hook.
Image input processing for inputting a captured image of the spiral spring;
Image conversion processing for creating a polar coordinate image obtained by polar conversion of the captured image;
Using the polar coordinate image, the hook position specifying process for specifying the inner hook position where the inner hook is photographed and / or the outer hook position where the outer hook in the photographed image is photographed in the photographed image. When,
Was executed,
In the hook position specifying process, an r-direction histogram is created by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and the inner hook position and / or the outer hook position is specified using the r-direction histogram. shape measuring how to characterized in that.
内フックから外フックまで渦巻状に伸びる渦巻きばねの形状を測定するためのプログラムであり、コンピュータに下記の処理、即ち、
渦巻きばねを撮影した撮影画像を入力する画像入力処理と、
前記撮影画像を極座標変換した極座標画像を作成する画像変換処理と、
前記極座標画像を用いて、内フックが撮影されている内フック位置、及び/又は、前記撮影画像中の外フックが撮影されている外フック位置を、前記撮影画像中に特定するフック位置特定処理と、
を実行させ
前記フック位置特定処理では、前記極座標画像の各画素値を半径軸方向の位置毎に加算したr方向ヒストグラムを作成し、そのr方向ヒストグラムを用いて内フック位置及び/又は外フック位置を特定することを特徴とするプログラム。
It is a program for measuring the shape of a spiral spring that spirally extends from an inner hook to an outer hook.
Image input processing for inputting a captured image of the spiral spring;
Image conversion processing for creating a polar coordinate image obtained by polar conversion of the captured image;
Using the polar coordinate image, the hook position specifying process for specifying the inner hook position where the inner hook is photographed and / or the outer hook position where the outer hook in the photographed image is photographed in the photographed image. When,
Was executed,
In the hook position specifying process, an r-direction histogram is created by adding each pixel value of the polar coordinate image for each position in the radial axis direction, and the inner hook position and / or the outer hook position is specified using the r-direction histogram. program that is characterized in that.
JP2008107803A 2008-04-17 2008-04-17 Apparatus, method, and program for measuring shape of spiral spring Active JP5132403B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008107803A JP5132403B2 (en) 2008-04-17 2008-04-17 Apparatus, method, and program for measuring shape of spiral spring

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008107803A JP5132403B2 (en) 2008-04-17 2008-04-17 Apparatus, method, and program for measuring shape of spiral spring

Publications (2)

Publication Number Publication Date
JP2009257950A JP2009257950A (en) 2009-11-05
JP5132403B2 true JP5132403B2 (en) 2013-01-30

Family

ID=41385554

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008107803A Active JP5132403B2 (en) 2008-04-17 2008-04-17 Apparatus, method, and program for measuring shape of spiral spring

Country Status (1)

Country Link
JP (1) JP5132403B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5802459B2 (en) * 2011-07-13 2015-10-28 中央発條株式会社 Image processing apparatus, method, and program for calculating shape of spiral spring
JP6009364B2 (en) * 2013-01-28 2016-10-19 中央発條株式会社 Image processing apparatus, method, and program for measuring shape of spiral spring

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61182509A (en) * 1985-02-08 1986-08-15 Daido Steel Co Ltd Spiral spring shape tester
JPS6280505A (en) * 1985-10-03 1987-04-14 Daido Steel Co Ltd Shape inspecting device for spiral spring

Also Published As

Publication number Publication date
JP2009257950A (en) 2009-11-05

Similar Documents

Publication Publication Date Title
CN106981077B (en) Infrared image and visible light image registration method based on DCE and LSS
JP6354589B2 (en) Object identification device, method and program
US20220319011A1 (en) Heterogeneous Image Registration Method and System
CN106709500B (en) Image feature matching method
JP2007508633A (en) Method and image processing device for analyzing object contour image, method and image processing device for detecting object, industrial visual device, smart camera, image display, security system, and computer program product
CN112288693B (en) Round hole detection method and device, electronic equipment and storage medium
CN105426809B (en) A kind of method of gauge pointer automatic identification
CN110555832B (en) Multi-parameter detection method, equipment and storage medium for quality of connecting rod of automobile engine
JP6039413B2 (en) Character cutout device, character recognition device, character cutout method, and program
CN110111387A (en) A kind of pointer gauge positioning and reading algorithm based on dial plate feature
JP2011113313A (en) Attitude estimation device
CN110738604B (en) Canny operator and Hough transformation-based large-dip angle certificate image correction method and system
JP2006285956A (en) Red eye detecting method and device, and program
JP5132403B2 (en) Apparatus, method, and program for measuring shape of spiral spring
JP4348702B2 (en) Plane four-finger image determination apparatus, plane four-finger image determination method, and plane four-finger image determination program
CN104268550A (en) Feature extraction method and device
WO2018061997A1 (en) Medium recognition device and medium recognition method
TWI543117B (en) Method for recognizing and locating object
CN111079802B (en) Matching method based on gradient information
JP5299196B2 (en) Marker detection device and program for marker detection device
JP5160366B2 (en) Pattern matching method for electronic parts
CN103700119A (en) Local texture description method based on local grouping comparison mode column diagram
JP6080424B2 (en) Corresponding point search device, program thereof, and camera parameter estimation device
KR100888674B1 (en) Method for measuring similarity using frenquency range
CN115019069A (en) Template matching method, template matching device and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110322

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120830

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120911

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121015

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121106

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151116

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5132403

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250