Scale plate posture inspection method
The scale plate attitude inspection method addresses the issue of distinguishing between gauge defects and inspection method issues by aligning the camera and scale plate accurately, enhancing inspection precision and reducing unnecessary part replacements.
Patent Information
- Application Number
- JP2023108962
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-01-17
AI Technical Summary
Existing dial gauge inspection methods fail to distinguish between defects in the gauge itself and issues with the inspection method, leading to unnecessary replacement of parts and increased costs.
A scale plate attitude inspection method that involves acquiring image data, extracting contrast regions, and comparing brightness or color to determine the relative posture between a camera and a scale plate, ensuring accurate alignment and detection of defects.
Enables precise identification of defects in the dial gauge by ensuring the camera and scale plate are correctly aligned, reducing false failures in inspection and minimizing unnecessary replacement of parts.
Smart Images

Figure 2025007517000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a method for inspecting the attitude of a scale plate. [Background technology]
[0002] An example of a measuring instrument that displays a measured value in analog form is a dial gauge. Precision measuring instruments such as dial gauges are inspected by measuring instrument manufacturers or inspection agencies before product shipment or periodically to ensure measurement accuracy and perform precision calibration. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication No. 2017-067628 Summary of the Invention [Problem to be solved by the invention]
[0004] Inspection of dial gauges involves displacing the spindle of the dial gauge under inspection by a specified amount using a gauge inspection device (master measuring device), comparing the indications of the dial gauge under inspection and the master measuring device at that time, and measuring the indication error. However, even if an indication error defect is found in a dial gauge using this inspection method, it is not possible to distinguish whether the cause is due to the dial gauge itself or whether there is a problem with the inspection method. If there is a problem with the inspection method, even if the measuring device is originally a passing product, it will fail the inspection of the defect of the scale plate or the accuracy inspection of the measuring device, and problems such as the effort and cost required to investigate the cause or to replace parts that are not actually necessary will arise.
[0005] SUMMARY OF THE PRESENT EMBODIMENT An object of the present invention is to provide a method for inspecting the relative attitude between a camera and a scale plate. [Means for solving the problem]
[0006] The method for inspecting the position of a scale plate according to the present invention comprises the steps of: A method for inspecting a relative attitude between a camera and a scale plate, comprising the steps of: an image data acquisition step of acquiring image data of the scale plate from a camera; a region calculation step of extracting a first contrast region and a second contrast region from the image data; A comparison processing step of comparing the first contrast area and the second contrast area based on brightness or color, The relative position of the camera and the scale plate is inspected based on the comparison result of the comparison processing step. It is characterized by:
[0007] In one embodiment of the present invention, The first and second contrast areas are located on opposite sides of the center of the scale plate or a virtual straight line passing through the center of the scale plate. It is preferable.
[0008] In one embodiment of the present invention, The first contrast area and the second contrast area each include a background color portion of the scale plate and a printed or engraved mark within the area. It is preferable.
[0009] In one embodiment of the present invention, The comparison process includes obtaining a difference between pixel values or luminance values of adjacent pixels in the first comparison area and the second comparison area, and comparing the magnitude of the difference between the first comparison area and the second comparison area. It is preferable.
[0010] In one embodiment of the present invention, Before executing the contrast region extraction step, A brightness adjustment step is provided for adjusting the exposure of the lighting and the camera so that the exposure time of the camera is the longest within a range in which the brightness of pixels in the image data is not saturated, and the number of pixels having a brightness equal to or greater than a predetermined threshold value is a count value equal to or greater than a preset certain number. It is preferable.
[0011] In one embodiment of the present invention, The area calculation step includes a center calculation step of determining a center of a scale plate, The center calculation step includes: A line connecting a first set of graduation lines that are located point-symmetrically with respect to the center; A line connecting the second set of graduation lines that are in a point-symmetrical position with respect to the center is found, The intersection of the line connecting the first set of graduation lines and the line connecting the second set of graduation lines is the center of the scale plate. It is preferable.
[0012] In one embodiment of the present invention, searching for edge coordinates on one side of the scale line in the width direction using a predetermined algorithm, and searching for edge coordinates on the other side of the scale line in the width direction using the same algorithm with the direction of the predetermined algorithm reversed; The midpoint between the edge coordinates on one side and the edge coordinates on the other side is set as the center coordinate of the width of the scale line, and the center coordinates of the scale lines are connected to obtain a line connecting the pair of scale lines. It is preferable.
[0013] The scale plate attitude inspection program of the present invention is On the computer, an image data acquisition step of acquiring image data of the scale plate from a camera; a region calculation step of extracting a first contrast region and a second contrast region from the image data; A comparison processing step of comparing the first contrast region and the second contrast region based on brightness or color is executed; The relative position of the camera and the scale plate is inspected based on the comparison result of the comparison processing step. It is characterized by:
[0014] The scale plate position inspection device of the present invention is A scale plate attitude inspection device for inspecting the relative attitude between a camera and a scale plate, an image data acquisition unit that acquires image data of the scale plate from a camera; a region calculation unit that extracts a first contrast region and a second contrast region from the image data; a comparison processing unit that compares the first comparison area and the second comparison area based on brightness or color, The relative position of the camera and the scale plate is inspected based on the comparison result by the comparison processing unit. It is characterized by:
[0015] In one embodiment of the present invention, A base plate is provided extending from a stand portion for holding a measuring instrument to be inspected having a scale plate to be inspected, and the camera is mounted on the base plate. It is preferable.
[0016] In one embodiment of the present invention, The stand unit is installed on a master gauge, and the relative positions and attitudes of the inspection target measuring device, the master gauge, and the camera can be fixed. It is preferable. [Brief description of the drawings]
[0017] [Figure 1] FIG. 2 is a system configuration diagram of a measuring instrument inspection device. [Diagram 2] FIG. 2 is a functional block diagram of a processor; [Diagram 3] FIG. 4 is a block diagram of a scale plate attitude inspection unit. [Figure 4] 4 is a flowchart for explaining the overall procedure of the operation of the scale attitude inspection method. [Diagram 5] 11 is a flowchart illustrating a procedure of a brightness adjustment process. [Figure 6] 13 is a flowchart illustrating a region calculation step. [Figure 7] 4 is a flowchart for explaining a procedure for determining the center of the scale plate. [Figure 8] 10 is a flowchart for explaining a procedure for calculating a center coordinate value in the width direction of a scale line. [Figure 9] 10 is a flowchart for explaining a procedure for calculating a center coordinate value in the width direction of a scale line. [Figure 10]11 is a flowchart illustrating a procedure of a comparison region extraction step. [Figure 11] 13 is a flowchart showing the procedure of a comparison processing step. [Figure 12] 13 is a flowchart illustrating a procedure of a filter processing step. [Figure 13] 10 is a flowchart illustrating a procedure of a tilt determination step. [Figure 14] 11A to 11C are diagrams illustrating a procedure for determining the center of the scale plate. [Figure 15] FIG. [Figure 16] FIG. 4 is a diagram illustrating a first contrast region and a second contrast region. [Figure 17] FIG. 13 is a diagram showing a schematic representation of a change in luminance difference when a one-dimensional differential filter is applied along a vertical section of a scale mark. [Figure 18] FIG. 11 is a diagram showing an example of a guidance display. [Figure 19] FIG. 11 is a diagram showing an example of a guidance display. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be illustrated and described with reference to the reference numerals given to the various elements in the drawings. (First embodiment) A first embodiment of a measuring device inspection device of the present invention will be described. The measuring instrument inspection device 100 inspects, for example, a measuring instrument 10 that displays a measured value in analog form using a disk-shaped scale 200 and a rotating pointer, such as an (analog display) dial gauge. (Dial gauges are also called indicators or test indicators.)
[0019] A precision measuring instrument 10 such as a dial gauge is periodically inspected by a measuring instrument manufacturer or an inspection agency to guarantee measurement accuracy and perform precise calibration. The measuring instrument inspection device 100 of this embodiment inspects whether the installation posture of the measuring instrument inspection device 100 and the measuring instrument 10 is appropriate (dial posture inspection) before inspecting the measuring instrument 10 itself (defect inspection and indication value error inspection of the disc-shaped scale 200).
[0020] FIG. 1 is a system configuration diagram of a measuring device inspection apparatus 100. The measuring instrument inspection device 100 comprises a master gauge 20 which serves as the reference for the measuring instrument indication value, a stand unit 30 for placing the measuring instrument 10 to be inspected on the master gauge 20, a camera 40 for capturing an image of the analog display unit 200 of the measuring instrument 10 to be inspected, an illumination unit 50 for illuminating the analog display unit 200 of the measuring instrument 10 to be inspected, and an arithmetic processing unit 300.
[0021] The master gauge 20 has a reference spindle 22 that moves back and forth, and a precisely calibrated high-precision encoder (displacement detector) 23. The reference spindle 22 displaces the probe 11 of the measuring instrument 10 under test, and the high-precision encoder 23 detects the displacement of the reference spindle 22. The deviation between the indication value of the master gauge 20 (the value detected by the high-precision encoder 23) and the indication value of the measuring instrument 10 under test is the error of the measuring instrument 10 under test.
[0022] In this example, it is assumed that an indication value error inspection will also be performed following the scale attitude inspection and scale defect inspection, and so the measuring instrument inspection device 100 includes a master gauge 20. However, if only a scale defect inspection is performed as the inspection of the measuring instrument 10, and an indication value error inspection using the master gauge 20 is not performed, then the master gauge 20 is not necessary. In other words, in the present invention, the master gauge 20 is an additional element and is not essential.
[0023] The stand portion 30 has a column 31 and a bracket portion 32. The column 31 is installed on the upper cover portion 21 of the master gauge 20, and the bracket portion 32 is provided so as to be movable along the column 31. The bracket portion 32 has an arm portion extending perpendicularly to the column 31, and holds the measuring device 10 under test at the tip of the arm portion. Specifically, a part of the measuring device 10 under test (the stem of a dial gauge in the figure) is clamped at the tip of the bracket portion 32.
[0024] When the master gauge 20 is not used, a so-called stand having a base and a column 31 standing thereon is prepared, and the stand (base) is placed on a workbench or the like.
[0025] The camera 40 has a lens optical system and an imaging element (image sensor) such as a CCD or CMOS. The camera 40 is installed so as to capture an image of the scale plate 200 of the measuring device 10 under inspection from the front. That is, the camera 40 is installed so as to capture an image of the scale plate 200 of the measuring device 10 under inspection held by the stand unit 30 from the front. In this embodiment, the camera 40 is installed in a fixed manner, and it is assumed that the relative attitude and relative position between the camera 40 and the measuring device 10 under inspection are adjusted by adjusting the orientation (tilt) and position of the measuring device 10 under inspection. Note that, since the ultimate goal is to adjust the attitude so that the camera 40 and the measuring device 10 under inspection (scale plate 200) face each other directly, the orientation (tilt) and position of the camera 40 may also be adjustable.
[0026] Here, the camera 40 and the inspection target measuring instrument 10 (scale plate 200) ideally face each other means that, assuming the surface of the scale plate 200 to be a plane, the scale plate 200 is perpendicular to the optical axis of the camera 40. It can also be said that the normal to the scale plate 200 and the optical axis of the camera 40 are parallel.
[0027] The illumination unit 50 is, for example, a ring illumination, and illuminates the scale plate 200 of the measuring device 10 under inspection so as to prevent uneven brightness caused by shadows.
[0028] In this embodiment, a long plate-shaped base plate 33 is attached to the column 31 of the stand unit 30, and the camera 40 and the lighting unit 50 are installed on this base plate 33. That is, a lighting installation stand 34 and a camera installation stand 35 are provided on the base plate 33, so that the lighting unit 50 and the camera 40 can be fixedly installed on the stand unit 30 that holds the inspection target measuring instrument 10. The lighting installation stand 34 and the camera installation stand 35 can be moved back and forth and left and right to an extent that their positions can be adjusted relative to the base plate 33, and further, it is preferable that their positions can be fixed with set screws or the like.
[0029] When the stand unit 30 is installed on the master gauge 20, the relative positions and attitudes of the master gauge 20, the measuring device 10 under test, the illumination unit 50, and the camera 40 can be fixed. When inspecting the accuracy of the measuring device 10 under test, the accuracy may be inspected by changing the attitude, such as vertical, horizontal, or inverted. In this case, the master gauge 20 and the measuring device 10 under test are tilted to a horizontal attitude, or further rotated to an inverted attitude, and are changed to various other attitudes. Even in this case, the illumination unit 50 and the camera 40 move integrally with the master gauge 20, the stand unit 30, and the measuring device 10 under test. Therefore, once the brightness and attitude adjustments are performed, there is no need to redo the adjustments even if the inspection attitude is changed.
[0030] In this embodiment, the base plate 33 is attached at a right angle to the column 31, the camera installation stand 35 is attached at a right angle to the base plate 33, and the camera 40 is attached at a right angle to the camera installation stand 35. As a result, when the measuring device 10 under inspection (e.g., a dial gauge) is attached to the stand unit 30, the vertical axis (axis parallel to the spindle and stem) of the measuring device 10 under inspection is perpendicular to the optical axis of the camera 40. In this embodiment, the tilt in the left-right direction (rotation about an axis parallel to the spindle and stem) is verified. Note that the method of this embodiment can also be applied to the vertical direction to correct the tilt in the up-down and left-right directions.
[0031] The arithmetic processing device 300 is typically a small computer, and has a keyboard, mouse, microphone, display, printer, and speaker built in or externally attached as input / output devices to the computer body. Alternatively, the arithmetic processing device 300 may be a tablet terminal or a smartphone (mobile high-function phone).
[0032] 2 is a functional block diagram of the arithmetic processing device 300. The arithmetic processing device 300 is configured with a CPU (Central Processing Unit), memories (ROM, RAM), etc., and realizes the functions of each functional unit by executing an inspection program with the CPU (Central Processing Unit). The inspection program may be distributed by recording it on a non-volatile recording medium (CD-ROM, memory card, etc.), or by downloading it via the Internet line, etc.
[0033] The calculation processing device 300 includes an inspection execution unit 310 that executes various inspections of the measuring device 10. The inspection execution unit 310 includes a scale attitude inspection unit 400, a scale defect detection unit 320, and an indication error evaluation unit 330.
[0034] Here, the dial plate attitude inspection section 400 inspects the relative attitude between the camera 40 and the dial plate 200 from image data of the dial plate 200 captured by the camera 40. Details will be described later. The scale plate defect detection unit 320 detects defects such as distortions and scratches on the scale plate 200, broken scale lines, and intervals between scale lines from image data of the scale plate 200 captured by the camera 40. In this case, if the scale plate 200 is inclined with respect to the camera 40, the scale plate 200 or the graduations cannot be inspected accurately based on the image data. In other words, even if there is a defect in the scale plate 200 or the graduations in the image data, it is necessary to distinguish whether the defect is a defect in the measuring device to be inspected itself or the image data is originally distorted. The indication value error evaluation unit 330 evaluates the deviation between the indication value of the master gauge 20 (the value detected by the high-precision encoder 23) and the indication value of the measuring device 10 to be inspected. In this case, it is assumed that the camera 40 captures an image of the analog display unit 200 of the measuring device 10 to be inspected, and the pointer indication value is automatically read from the captured image data. In this case, if the scale plate 200 is inclined with respect to the camera 40, the image data will have a parallax corresponding to the inclination, and the reading of the pointer indication value will have a deviation. Even if the pointer indication value of the measuring device 10 to be inspected deviates from the indication value of the master gauge 20, it is necessary to distinguish whether the deviation is a defect in the internal mechanism of the measuring device 10 to be inspected or a problem such as parallax when the image data is acquired.
[0035] Since the measuring device 10 to be inspected displays measured values with a resolution on the order of micrometers, the inventors' verification has revealed that if the relative attitude between the camera 40 and the measuring device 10 to be inspected is deviated by about 5° from facing each other, it will hinder the detection of defects on the scale plate or the evaluation of errors in the indicated values, and it is considered ideal to keep the deviation in the relative attitude between the camera 40 and the measuring device 10 to within 3°. Such deviations of 3° or 5° are not discernible by the human eye. Therefore, a scale plate attitude inspection process is performed before the detection of defects on the scale plate or the evaluation of errors in the indicated values.
[0036] FIG. 3 is a block diagram of the dial attitude inspection unit 400. As shown in FIG. The scale plate attitude inspection unit 400 includes a brightness adjustment unit 410, an image data acquisition unit 420, a region calculation unit 430, a comparison processing unit 440, and a guidance unit 450. The region calculation unit 430 further includes a center calculation unit 431 and a comparison region extraction unit 432. The comparison processing unit 440 further includes a filter processing unit 441 and a tilt determination unit 442.
[0037] The operation of each functional unit will be described later with reference to a flowchart.
[0038] The steps of the scale plate orientation inspection method according to the first embodiment will be described in order. Before carrying out the scale plate orientation inspection method, the operator installs the inspection target measuring device 10 on the stand unit 30 and adjusts the inspection target measuring device 10 and the camera 40 so that they face each other as directly as possible. The focus of the camera 40 on the scale plate 200 of the inspection target measuring device 10 and the settings of the illumination and exposure may be set to initial settings that have been set in advance, or automatic adjustment of the camera 40 (automatic focusing and exposure adjustment) may be performed as an initial adjustment. Installation (replacement) of the inspection target measuring device 10 on the stand unit 30 and setting of the camera 40 may be automated by having a robot perform the tasks instead of the operator's manual tasks.
[0039] FIG. 4 is a flowchart for explaining the overall procedure of the operation of the scale attitude inspection method according to the first embodiment. As shown in FIG. 4, the method for inspecting the attitude of the scale plate includes a brightness adjusting step ST1000, an imaging step ST2000, a region calculating step ST3000, a comparison processing step ST4000, and a guidance display step ST5000. I will explain in order.
[0040] FIG. 5 is a flowchart for explaining the procedure of the brightness adjustment process ST1000. Considering the subsequent processing, it is preferable that the image data of the scale plate 200 uses the widest possible range of brightness. Therefore, the lighting and exposure are adjusted so that the brightness of the pixels in the image data is as bright as possible without being saturated.
[0041] First, the brightness of the illumination unit 50 is set to a predetermined initial value (ST1100), and the exposure time of the camera 40 is set to the minimum (ST1200). The exposure time of the camera 40 is set to the minimum in the specifications of the camera 40, in other words, the shutter speed is set to the fastest. The initial brightness value of the illumination unit 50 may be considered to be, for example, a predetermined initial value for the current value or voltage value applied to the illumination unit 50. Alternatively, an illuminometer may be placed near the inspection target measuring device 10, and the current value (voltage value) applied to the illumination unit 50 may be automatically adjusted to a preset illuminance. With this setting, a test image of the scale plate 200 of the inspection target measuring device 10 is taken and image data is acquired (ST1300). The acquired image data is recorded in the image data acquisition unit 420.
[0042] The presence or absence of pixels in the test image data whose brightness values are saturated is verified (ST1400), and if the brightness values are not saturated (ST1400: NO), the exposure time of the camera 40 is increased by one unit (ST1500). One unit of the exposure time of the camera 40 is set appropriately in units such as 1 / 1000 seconds, 1 / 100 seconds, or 1 / 10 seconds, taking into consideration the specifications of the camera 40, the accuracy of the inspection of the scale plate 200, the time available for the inspection, and the like. Here, the exposure of the camera 40 is set to the minimum, so the brightness does not become saturated from the beginning, and test shooting is repeated (ST1300) while increasing the exposure time of the camera 40 (ST1500) until the first pixel whose brightness value is saturated appears (ST1400).
[0043] Then, when a pixel with a saturated brightness value appears for the first time (ST1400: YES), the exposure time is decreased by one unit from this point (ST1600). This means that the exposure time has been set to the maximum possible value within the range in which the brightness of pixels in the image data does not become saturated.
[0044] It is verified whether the image data has a predetermined standard brightness or higher with these lighting and exposure time settings (ST1700). The brightness distribution (histogram) of the image data is obtained, and the number of pixels with a brightness (brightness value) above a predetermined threshold is counted. If the count value is above a preset certain number, it is determined that the brightness adjustment was successful. If the number of pixels with a brightness (brightness value) above the predetermined threshold is insufficient, the brightness of the lighting unit 50 is increased by one unit (applied current value or illuminance is increased), and the process returns to ST1200 to redo the brightness adjustment.
[0045] This brightness adjustment optimizes the luminance distribution of the image data every time, ensuring stable posture inspections every time.
[0046] If the brightness adjustment is successful (ST1000), the process returns to the flowchart of FIG. 4, where the camera 40 (image sensor) captures an image of the scale plate 200, acquires image data (ST2000), and records the image data in the image data acquisition unit 420 as image data for inspection.
[0047] Now that the scale plate image data for inspection has been acquired, the relative attitude between the scale plate 200 and the camera 40 is inspected based on this scale plate image data. To this end, a comparison region extraction step (ST3500 in FIG. 6) is performed to extract a first comparison region and a second comparison region to be compared in the image data. The first comparison region and the second comparison region are regions that are in a point-symmetric relationship with the center of the scale plate 200 as the center of symmetry in the image data, as exemplified in FIG. 16, for example, or are regions that are on opposite sides of a virtual line passing through the center of the scale plate 200. The relative attitude between the camera 40 and the scale plate 200 is verified by comparing pixel values (color and brightness) between the first comparison region and the second comparison region.
[0048] FIG. 6 is a flow chart for explaining the procedure for extracting the comparison region (region calculating step ST3000). In calculating the comparison area (area calculation step ST3000), first, the center of the scale plate 200 in the image data is found (center calculation step ST3100). There are various ways to find the center of the scale plate 200. For example, the scale plate 200 in the image data may be regarded as a circle, and the center of the circle may be found. The outline of the scale plate (circle) 200 may be extracted by image recognition, and the center of the circle may be found from several points on the circumference. If the scale plate 200 is tilted with respect to the camera 40, strictly speaking, the scale plate 200 is captured as an ellipse, but this distortion is extremely slight, so the center may be found as a circle, and even if it is viewed as an ellipse, the intersection of the major axis and minor axis may be used as the center.
[0049] Here, taking into consideration that the scale lines of the scale plate 200 are one of the important elements in the subsequent detection of scale plate defects and evaluation of indicated value errors, the center of the scale plate 200 is found based on the scale lines in the procedure of the flowchart in FIG. 7 (center calculation step ST3100). Fig. 14 is a diagram illustrating the center of the scale plate 200. Please also refer to Fig. 14. The scale plate image data is viewed in two-dimensional orthogonal coordinates (x, y) and two scale lines parallel to the Y-axis are detected, thereby locating the 0° scale line and the 180° scale line (ST3200) (see FIG. 14). Also, the scale plate image data is viewed in two-dimensional orthogonal coordinates (x, y) and two scale lines parallel to the X-axis are detected, thereby locating the 90° scale line and the 270° scale line (ST3200). Next, the center coordinate of the width direction of the 0° scale line is found, and the center coordinate of the width direction of the 180° scale line is found (ST3300). Similarly, the center coordinate of the width direction of the 90° scale line is found, and the center coordinate of the width direction of the 270° scale line is found (ST3300).
[0050] Once the center coordinates of each scale line in the width direction are obtained, the center coordinates of the 0° scale line and the center coordinates of the 180° scale line are connected to form the y1 line. Similarly, the center coordinates of the 90° scale line and the center coordinates of the 270° scale line are connected to form the x1 line. The intersection of y1 and x1 is determined to be the center of the scale plate 200 (ST3400).
[0051] However, because the scale lines have a width, the coordinate value of the center of the scale line width is taken as the position of the scale line (ST3300). At this time, when taking the center of the scale line width at the 0° position, for example, the midpoint between the coordinate values of the left edge and the right edge of the scale line is taken. To prevent the midpoint coordinate from being biased to the left or right within the scale line width, the left edge and the right edge are searched for using the same procedure and the same threshold value.
[0052] 8 and 9 are flow charts for explaining the procedure for calculating the coordinate value of the center in the width direction of a scale line. Here, the calculation of the coordinate value of the center in the width direction of a scale line at 0° is explained as an example. FIG. 15 is an enlarged view of the scale line. Please also refer to FIG. 15. The center of the width of a scale line at the 180° position can be found in the same way, and the center of the width of a scale line at the 90° and 270° positions can be found in the same way by changing the orientation (switching the x-axis and y-axis) and applying the same method.
[0053] In ST3311, one line parallel to the X-axis is extracted from the 0° scale line area. A scale line parallel to the Y-axis and located on the positive side of the Y-axis (or a scale line with a larger Y coordinate value) can be recognized as a 0° scale line. Since the background is white and the scale lines are black, for example, the scale line area may be an area of pixels with a brightness of half (128) or less of the maximum brightness (255). Alternatively, the scale line area may be an area of pixels with a brightness of 0.7 (179) or less of the maximum brightness (255), or an area of pixels with a brightness of 0.65 (166) or less. Here, the scale line area is considered to be an area that includes both the scale line itself and the surrounding background. In other words, the scale line area is an area where a scale line crossing line, which will be described later, can cross from the background to the scale line to the background.
[0054] Then, to find the central coordinate value of the scale line width (here, width in the X direction), a line is extracted that crosses the scale line area in a direction (parallel to the X axis) perpendicular to the scale line (here, parallel to the Y direction). This is called the scale line crossing line. In Figure 15, the scale line crossing line is shown longer for ease of understanding.
[0055] The scale line crossing line only needs to cross the scale line without fail, and there are no particular limitations on where on the scale line it crosses (which one line to extract); however, as an example here, it is a line that crosses the center of the scale line area in the Y direction (the vertical center of the scale line).
[0056] For the scale line crossings thus extracted, the left edge coordinate (here, the coordinate of the edge in the direction with the smaller X coordinate value) and the right edge coordinate (here, the coordinate of the edge in the direction with the larger X coordinate value) are searched for using the same algorithm with the direction reversed.First, the left edge coordinate (here, the coordinate of the edge in the direction with the smaller X coordinate value) is searched for by ST3312 to ST3320 in Fig. 8.
[0057] In ST3312, the pixel with the smallest X coordinate value among the scale line crossings is set as the pixel of interest, and the luminance value of this pixel of interest is obtained. This obtained luminance value is designated as L0.
[0058] In ST3313, the number of stable times N is reset to 0 (zero). The number of stable times N will be explained later.
[0059] In ST3314, the pixel of interest is moved one pixel to the positive side in the X direction (the pixel next to it on the positive side), and the luminance value of this new pixel of interest is obtained and set as L(k) using index number k. Here, it is set as L1. In ST3315, the luminance difference L(k)-L(k-1) between two pixels adjacent in the X direction, specifically the luminance difference L1-L0, is calculated, and the magnitude of the luminance difference |L1-L0| is compared with a preset stability determination threshold to determine whether the luminance difference |L1-L0|≦satisfies the stability determination threshold. Satisfying the luminance difference |L1-L0|≦stable determination threshold indicates that the pixel of interest is not on the transitional boundary between the background and the scale line, but on or inside the scale line. If the luminance difference |L1-L0|≦the stability determination threshold is satisfied, the stability count N is incremented by 1 (N=N+1) (ST3317), and ST3314 to ST3318 are repeated while moving the pixel of interest in the positive X direction (ST3319, ST3314) until the stability count N reaches a preset stability count threshold (for example, 5) (ST3318). When the luminance difference L(k)-L(k-1) of adjacent pixels is continuously stable and the stability count N reaches the stability count threshold (for example, 5), the coordinate value (here, the X coordinate value) of the pixel of interest at that time is stored as the left edge coordinate ELmin.
[0060] If the luminance difference |L1-L0| is not greater than the stability determination threshold (ST3315: NO), it is considered that the pixel of interest is on the transitional boundary between the background and the scale line and is not on the scale line, so the stability count is reset to zero (ST3313) and the search continues.
[0061] ST3321 to ST3329 in FIG. 9 are steps for searching for the right edge coordinates (the coordinates of the edge with the larger X coordinate value). The difference between ST3312 to ST3320 in FIG. 8 is that the search is from right to left (from larger X coordinate value to smaller X coordinate value), and first in ST3312, the pixel with the maximum X coordinate value among the scale line crossings is set as the pixel of interest, and the luminance value L0 of this pixel of interest is obtained (ST3321). Then, in ST3323, the luminance value L(j) of the neighboring pixel on the negative side is obtained. Note that in the search for the right edge coordinate (flowchart in FIG. 9), the index number j is used to set L(j). In other steps, the same stability determination threshold and stability count threshold are used as in ST3312 to ST3320 in FIG. 8. In this way, the right edge coordinate is searched for using the same algorithm with the direction changed, and is stored as the right edge coordinate ELmax (ST3329).
[0062] The center coordinate value CLx of the scale line is the midpoint between the left edge coordinate ELmin and the right edge coordinate ELmax, and is equal to (ELmin+ELmax) / 2 (ST3330).
[0063] In this way, by searching for edges from both the left and right sides in the same procedure, it is possible to eliminate bias in detecting the midpoint within the width of the scale mark.
[0064] Two or more crossing lines of the scale mark may be extracted, their median coordinate values in the width direction may be calculated, and their average value may be calculated.
[0065] Now that the center of the scale plate 200 has been found (ST3100), we will return to the flow chart of FIG. 6 (area calculation step ST3000) and explain the comparison area extraction step (ST3500). FIG. 10 is a flow chart for explaining the procedure of the comparison region extraction step (ST3500). FIG. 16 is a diagram illustrating the first comparison region and the second comparison region. Please also refer to FIG. 16. In ST3510, the previously obtained central coordinate value of the scale plate 200 is read out. Then, an area of a predetermined size including the scale line on the negative side of the X direction from the center is extracted (ST3520). (The scale line at 270° is found by searching on the negative side along a line parallel to the X axis through the center.) This is set as the first comparison region (ST3530). Here, the area including the scale line at 270° is the first comparison region. As for this comparison region, an area that is expected to include both the scale line and the background is extracted and set as the comparison region.
[0066] Next, a region of a predetermined size is extracted at a position symmetrical to the first contrast region (ST3540). This is set as a second contrast region (ST3550). Here, the first contrast region and the second contrast region are assumed to be point-symmetrical with respect to the center, but may be positioned to be line-symmetrical with respect to a virtual line that passes through the center and is parallel to the Y axis.
[0067] It is verified whether the first and second contrast regions include the background and the scale lines (ST3560). Considering the circular scale plate 200, the scale lines are located symmetrically with respect to the center, so if the second contrast region is located symmetrically with the first contrast region, both the first and second contrast regions should be regions that include the scale lines and the background. If it is determined that at least one of the first and second contrast regions does not include both the scale lines and the background (ST3560: NO), the extraction range is expanded and a retry is performed (ST3570). If the extraction of the first and second contrast regions is not successful after a predetermined number of retries, an error is reported and the process is interrupted.
[0068] Once the first and second comparison regions are obtained, the process returns to the flowchart of Fig. 4 (scale plate attitude inspection method) and next executes a comparison processing step (ST4000) in which the first and second comparison regions are compared based on luminance. Fig. 11 is a flowchart showing the procedure of the comparison processing step (ST4000). The comparison processing step (ST4000) includes a filter processing step (ST4100) in which a filter processing (differential filter in this case) is performed on each of the first and second comparison regions to obtain a luminance difference in each comparison region, and an inclination determination step (ST4200) in which the luminance difference data obtained in the filter processing step (ST4100) is compared to evaluate the inclination of the scale plate 200.
[0069] 12 is a flow chart for explaining the procedure of the filter processing step. The filter processing step ST4100 includes a first comparison luminance difference calculation step (ST4110) for performing filter processing on the first comparison region to obtain a first comparison luminance difference, and a second comparison luminance difference calculation step (ST4120) for performing filter processing on the second comparison region to obtain a second comparison luminance difference. The first comparison luminance difference calculation step (ST4110) and the second comparison luminance difference calculation step (ST4120) have the same processing content, except for the difference in the calculation target.
[0070] In the first comparison luminance difference calculation step (ST4110), first, the maximum value of the luminance difference between adjacent pixels is calculated for each line of the first comparison region (ST4111). Here, the first comparison region is an area including the 270° scale line, and the 270° scale line is parallel to the X-axis, so the line that cuts the scale line along the X-direction is the scale line vertical section line. Please also refer to FIG. 16. For each scale line vertical section line, a one-dimensional differential filter, for example, (1,-1) is multiplied to the pixel value (luminance value) of the pixel along the X-direction to calculate the luminance difference between the target pixel and its adjacent pixel. FIG. 17 is a diagram that shows a schematic diagram of the change in luminance difference when a one-dimensional differential filter is applied along the scale line vertical section line. Please also refer to FIG. 17. For example, if the luminance value of the target pixel is L1 and the luminance value of the adjacent pixel is L2, the luminance difference DL is |L1-L2|. Ultimately, what is needed is to compare the "magnitude" of the luminance difference obtained in the first comparison area and the second comparison area, so the luminance difference here should be interpreted as the magnitude (absolute value) of the luminance difference. The maximum luminance difference DLmax is found for each line (each vertical section of the scale line).
[0071] When calculating the maximum luminance difference DLmax in the first comparative luminance difference calculation step (ST4110), the calculation may be performed on only one line (vertical scale line section), but it is preferable to calculate the maximum luminance difference DLmax for each line (vertical scale line section) for multiple lines (vertical scale line sections). Then, in ST4112, the average of the multiple maximum luminance differences DLmax obtained is calculated and this is set as the first comparative luminance difference DL1 (ST4112).
[0072] For the second contrast region (here, the region including the 90° scale line), the maximum value DLmax of the luminance differences between adjacent pixels for each line is also found (ST4121), and the average of these is found and used as the second contrast luminance difference DL2 (ST4122).
[0073] Since the first contrast luminance difference DL1 of the first contrast region and the second contrast luminance difference DL2 of the second contrast region are obtained by the filter processing step ST4100, the flow returns to the flowchart of Fig. 11 (comparison processing step ST4000) to execute the tilt determination step (ST4200). As shown in the flowchart of Fig. 13, first, the difference between the first contrast luminance difference DL1 of the first contrast region and the second contrast luminance difference DL2 of the second contrast region is calculated, and this is set as the brightness difference difference ΔDL (= DL1 - DL2) (ST4210). If the magnitude |ΔDL| of this brightness difference difference ΔDL is equal to or less than a preset tilt determination threshold (ST4220: YES), this means that the left and right sides of the scale plate 200 are captured in the same way, and it is determined that there is no tilt of the scale plate 200 (or that it is within the allowable range) (ST4230).
[0074] On the other hand, if the difference between the first and second contrast luminance differences DL1 and DL2 is large (ST4220: NO), it is determined that the scale plate 200 is tilted with respect to the optical axis of the camera 40. The fact that the difference between the first and second contrast luminance differences DL1 and DL2 is large means that there is a difference in the sharpness of the scale lines on the left and right in the image data. Since the focus of the camera 40 should be on the scale plate 200 for the time being, it may be said that the focus is on the scale plate 200 within the range of the depth of field, but when viewed in detail, there is a difference in the sharpness of the scale lines on the left and right. Although it may be a small difference, when a scale line defect inspection or an indication value error inspection is subsequently performed based on the image data, a difference will occur in the detection of the scale lines and pointers on the left and right of the image data.
[0075] When the magnitude |ΔDL| of the luminance difference difference ΔDL exceeds the slope determination threshold, the first contrast luminance difference DL1 and the second contrast luminance difference DL2 are stored. The first contrast luminance difference DL1 and the second contrast luminance difference DL2 may be compared to determine which is larger (which is smaller) and stored.
[0076] Furthermore, in ST4250, the magnitude of the luminance difference difference ΔDL (=DL1-DL2) is converted into the amount of tilt. This can be done by determining in advance the relationship between the magnitude of the tilt angle between the scale plate 200 and the camera optical axis and the magnitude of the luminance difference difference ΔDL through preliminary experiments and storing it in a table. Alternatively, instead of strictly converting the luminance difference difference ΔDL into a tilt angle at intervals of 0.1°, an evaluation index can be given that classifies the luminance difference difference ΔDL into, for example, 10 levels according to the magnitude of the luminance difference difference ΔDL.
[0077] Next, the guidance display step (ST5000) will be described. In the guidance display step (ST5000), the inclination (or the level of inclination) of the scale plate 200 is visualized and displayed on a display device (monitor), and auxiliary information for adjusting the attitude of the scale plate 200 is provided to the operator. Figures 18 and 19 are diagrams showing examples of guidance display. In the examples of Figures 18 and 19, the scale plate 200 is displayed on a monitor screen, and the balance of the inclination of the scale plate 200 is shown by the length of the colored bars (e.g., blue and yellow) below it. If there is no inclination of the scale plate 200, as shown in Figure 19, the left (yellow) bar and the right (blue) bar are the same length. If there is an inclination of the scale plate 200, the lengths of the left and right bars are changed to express the magnitude of the inclination. Here, the bar on the side with the smaller luminance difference (first relative luminance difference DL1, second relative luminance difference DL2) is expressed as being longer. The operator adjusts the attitude of the scale plate 200 with reference to this guidance display, and repeats the scale plate attitude inspection several times until it reaches the ideal attitude of Figure 19. This allows the measuring device 10 to be installed so that the scale plate 200 faces the camera 40 directly, and makes it possible to confirm that the scale plate 200 and the camera 40 face each other directly.
[0078] It was not possible to accurately determine whether the scale plate 200 and the camera 40 were facing each other by simply looking at the measuring instrument 10 (scale plate 200) or by looking at the image data captured by the measuring instrument 10 (scale plate 200) on a screen. Therefore, it was not possible to install the scale plate 200 and the camera 40 so that they faced each other exactly. As a result, problems such as failure of the defect inspection of the scale plate 200 or the accuracy inspection of the measuring instrument 10 even if the measuring instrument 10 was originally an acceptable product, or the investigation of the cause or the replacement of parts that was not actually necessary, etc., were occurring, which was time-consuming and costly. In this regard, the inventors of the present invention carefully investigated the reasons why the defect inspection of the scale plate 200 and the accuracy inspection of the measuring instrument 10 often did not go well, and as a result of intensive research, they realized that the root of the problem was the installation posture of the measuring instrument 10 (scale plate 200) and the camera 40. The present invention enables the relative attitude of the camera 40 and the scale plate 200 to be precisely inspected by focusing on pixel values or differences in pixel values (difference in pixel values between adjacent pixels) in contrasting areas (first contrasting area, second contrasting area) located symmetrically.
[0079] The present invention is not limited to the above-described embodiment, and may be modified as appropriate without departing from the spirit and scope of the present invention. The scale plate 200 may be an analog scale plate (analog dial) on which scale lines are engraved or printed on an actual plate, or it may be a scale plate displayed on a digital display panel such as a liquid crystal panel or an organic EL panel.
[0080] In the above embodiment, the comparison is performed using graduation lines that are point symmetrical with respect to the center of the scale plate 200 or symmetrical with respect to a virtual line passing through the center. However, the comparison is not limited to graduation lines, and may be made using marks (e.g., numbers, symbols, etc.) that are symmetrical.
[0081] In the above explanation, a one-dimensional differential filter is used, but the present invention is not limited to this as long as the processing can emphasize the pixel values (brightness values) of the boundary between the background of the scale plate and the printing on the scale plate (for example, marks such as scale lines).
[0082] In the above embodiment, luminance values are used as pixel values, but color shading (black and white gradation or RGB gradation) may also be used for comparison. [Explanation of symbols]
[0083] 100 Measuring Instrument Inspection Equipment 10 Measuring instrument (measuring instrument to be inspected) 200 Scale plate 12 Guidelines 11 Probe 20 Master Gauge 21 Top cover 22 Reference Spindle 23 Encoder 30 Stand section 31 Column 32 Bracket part 33 Pedestal plate 34 Lighting installation stand 35 Camera installation stand 40 Camera 50 Lighting Department 300 Processing unit 310 Inspection Execution Department 400 Scale plate position inspection section 410 Brightness adjustment section 420 Image data acquisition unit 430 Area calculation section 431 Center calculation part 432 Contrast Region Extraction Unit 440 Contrast Processing Section 441 Filter Processing Unit 442 Tilt determination unit 450 Guidance Department
Claims
1. A method for inspecting a relative attitude between a camera and a scale plate, comprising the steps of: an image data acquisition step of acquiring image data of the scale plate from a camera; a region calculation step of extracting a first contrast region and a second contrast region from the image data; A comparison processing step of comparing the first contrast area and the second contrast area based on brightness or color, The relative position of the camera and the scale plate is inspected based on the comparison result of the comparison processing step. A method for inspecting the attitude of a scale plate, comprising:
2. The method for inspecting the attitude of a scale plate according to claim 1, The first and second contrast areas are located on opposite sides of the center of the scale plate or a virtual straight line passing through the center of the scale plate. A method for inspecting the attitude of a scale plate, comprising:
3. The method for inspecting the attitude of a scale plate according to claim 1, The first contrast area and the second contrast area each include a background color portion of the scale plate and a printed or engraved mark within the area. A method for inspecting the attitude of a scale plate, comprising:
4. The method for inspecting the attitude of a scale plate according to claim 1, The comparison process includes obtaining a difference between pixel values or luminance values of adjacent pixels in the first comparison area and the second comparison area, and comparing the magnitude of the difference between the first comparison area and the second comparison area. A method for inspecting the attitude of a scale plate, comprising:
5. The method for inspecting the attitude of a scale plate according to claim 1, Before executing the contrast region extraction step, A brightness adjustment step is provided for adjusting the exposure of the lighting and the camera so that the exposure time of the camera is the longest within a range in which the brightness of pixels in the image data is not saturated, and the number of pixels with brightness equal to or greater than a predetermined threshold value is counted to a predetermined number or more. A method for inspecting the attitude of a scale plate, comprising:
6. The method for inspecting the attitude of a scale plate according to claim 1, The area calculation step includes a center calculation step of determining a center of a scale plate, The center calculation step includes: A line connecting a first set of graduation lines that are located point-symmetrically with respect to the center; A line connecting the second set of graduation lines that are in a point-symmetrical position with respect to the center is found, The intersection of the line connecting the first set of graduation lines and the line connecting the second set of graduation lines is the center of the scale plate. A method for inspecting the attitude of a scale plate, comprising:
7. The method for inspecting the attitude of a scale plate according to claim 6, searching for edge coordinates on one side of the scale line in the width direction using a predetermined algorithm, and searching for edge coordinates on the other side of the scale line in the width direction using the same algorithm with the direction of the predetermined algorithm reversed; The midpoint between the edge coordinates on one side and the edge coordinates on the other side is set as the center coordinate of the width of the scale line, and the center coordinates of the scale lines are connected to obtain a line connecting the pair of scale lines. A method for inspecting the attitude of a scale plate, comprising:
8. On the computer, an image data acquisition step of acquiring image data of the scale plate from a camera; a region calculation step of extracting a first contrast region and a second contrast region from the image data; A comparison processing step of comparing the first contrast region and the second contrast region based on brightness or color is executed; The relative position of the camera and the scale plate is inspected based on the comparison result of the comparison processing step. A scale plate attitude inspection program comprising:
9. A scale plate attitude inspection device for inspecting the relative attitude between a camera and a scale plate, an image data acquisition unit that acquires image data of the scale plate from a camera; a region calculation unit that extracts a first contrast region and a second contrast region from the image data; a comparison processing unit that compares the first comparison area and the second comparison area based on brightness or color, The relative position of the camera and the scale plate is inspected based on the comparison result by the comparison processing unit. A scale plate attitude inspection device characterized by the above.
10. The scale attitude inspection device according to claim 9, A base plate is provided extending from a stand portion for holding a measuring instrument to be inspected having a scale plate to be inspected, and the camera is mounted on the base plate. A scale plate attitude inspection device characterized by the above.
11. The scale attitude inspection device according to claim 10, The stand unit is installed on a master gauge, and the relative positions and attitudes of the inspection target measuring device, the master gauge, and the camera can be fixed. A scale plate attitude inspection device characterized by the above.
Citation Information
Patent Citations
Gauge checkup machine
JP2017067628A