Image processing method, lens inspection method, and lens inspection device

The image processing method for lens inspection devices accurately specifies the center coordinates of lenses by generating a difference image and identifying thin line portions, overcoming the challenge of connected support parts or chucks, and enabling precise defect detection.

JP2025043484APending Publication Date: 2025-04-01SCREEN HOLDINGS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023150791
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Existing lens inspection devices struggle to accurately specify the center coordinates of lenses with connected support parts or chucks, as these connections deviate the lens contour from a perfect arc, making it difficult to use Hough transforms effectively.

Method used

An image processing method that involves a thin line erasing step to generate a thin line erased image, a difference image generation step to create a difference image between the original and erased images, and a center identification step to specify the lens center coordinates based on the thin line portions in the difference image.

Benefits of technology

This method allows for accurate suppression of the influence of wide portions and effectively specifies the center coordinates of the lens, enabling precise image synthesis and defect detection in lens inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025043484000001_ABST
    Figure 2025043484000001_ABST
Patent Text Reader

Abstract

To provide a technology that can accurately determine the center coordinates of a lens in a photographed image.SOLUTION: A photographed image Ia includes a thin line part 911 that follows the outline of a lens and a wide part 912 that has a larger radial width than the thin line part 911. By erasing the thin line part 911 out of the thin line part 911 and the wide part 912, a thin line erased image is generated. Next, a difference image between the photographed image Ia and the thin line erased image is generated. After that, the center coordinates of the lens are identified on the basis of the thin line part 911 contained in the difference image. This suppresses the influence of the wide part 912 and enables the center coordinates of the lens in the photographed image Ia to be identified with high accuracy.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image processing method for processing a captured image of a lens, a lens inspection method, and a lens inspection apparatus. [Background technology]

[0002] Conventionally, there is known an inspection device that photographs a transparent lens and inspects the lens for scratches and foreign matter adhering to the lens based on the photographed image. In this type of inspection device, since the lens is transparent, it is difficult to clearly photograph all areas of the lens in one photograph. Therefore, there are cases where the lens is rotated relative to the camera and lighting unit, photographed multiple times, and defects are detected based on a composite image of the multiple images obtained.

[0003] In this case, in order to accurately synthesize the lenses, it is necessary to accurately identify the center coordinates of the lenses in each captured image. A technique for determining the center coordinates of the lenses in a captured image is described in, for example, Patent Document 1. The technique in Patent Document 1 estimates the center coordinates of a circle using a Hough transform (paragraph 0056 of Cited Document 1). [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2015-18324 A Summary of the Invention [Problem to be solved by the invention]

[0005] However, the lens to be inspected may have a support, a chuck, or other member connected to a portion of its contour. In such a case, the portion of the contour of the lens in the captured image has a shape that deviates from a circular arc, which causes a problem in that it is difficult to accurately identify the center coordinates of the lens by the Hough transform or the like.

[0006] The present invention has been made in consideration of the above circumstances, and has an object to provide a technique that can accurately identify the center coordinates of a lens in a captured image. [Means for solving the problem]

[0007] The first invention of the present application is an image processing method for processing a captured image of a lens, comprising: a thin line erasing step for generating a thin line-erased image by erasing thin line portions that follow the contour of the lens in the captured image and wide portions that are wider radially than the thin line portions; a differential image generating step for generating a difference image between the captured image and the thin line-erased image; and a center identification step for identifying the center coordinates of the lens based on the thin line portions included in the difference image.

[0008] A second aspect of the present invention is the image processing method according to the first aspect of the present invention, wherein in the center specifying step, the center coordinates are specified by applying a Hough transform to the difference image.

[0009] A third invention of the present application is the image processing method of the first or second invention, wherein in the thin line erasing step, contraction and expansion are performed on the thin line portions and the wide portions in the captured image.

[0010] A fourth invention of the present application is an image processing method according to any one of the first to third inventions, further comprising an image synthesis step of executing the thin line erasing step, the difference image generating step, and the center identifying step for each of the plurality of captured images, and synthesizing the plurality of captured images while aligning the center coordinates identified in the center identifying step.

[0011] A fifth aspect of the present invention is the image processing method according to the fourth aspect of the present invention, wherein the image synthesis step generates a maximum value image of the plurality of captured images.

[0012] A sixth aspect of the present invention is a lens inspection method, comprising an inspection step of detecting defects in the lens based on the maximum value image generated by the image processing method of the fifth aspect of the invention.

[0013] A seventh invention of the present application is the lens inspection method of the sixth invention, further comprising: a circular ring arrangement step of arranging a circular ring centered on the central coordinates and following a contour of the lens in the maximum value image; a first area calculation step of calculating a first area which is the area of ​​an overlapping area between the circular ring and a high luminance area of ​​the maximum value image; a second calculation step of calculating a second area which is the area of ​​an overlapping area between the high luminance area and the circular ring while gradually reducing the radius of the circular ring; and a contour mask creation step of creating a contour mask area which follows the contour of the lens based on the circular ring when a ratio of the second area to the first area becomes substantially the same as a predetermined reference value, and in the inspection step, the contour mask area is excluded from inspection.

[0014] An eighth invention of the present application is a lens inspection method according to the sixth or seventh invention, further comprising an outer mask creating step of creating an outer mask area by taking the logical sum of a high-brightness area in the maximum value image and an outer area of ​​a circular ring centered on the central coordinates and following the contour of the lens, and in the inspection step, the outer mask area is excluded from inspection.

[0015] A ninth aspect of the present invention is the lens inspection method of the eighth aspect, wherein in the outer mask creating step, a non-masked area that is isolated in the outer mask area and has an area equal to or smaller than a predetermined area is changed to an outer mask area.

[0016] A tenth invention of the present application is a lens inspection method according to the eighth or ninth invention, wherein the image synthesis step further generates a minimum value image of the multiple captured images, and the inspection step includes a first inspection step of detecting defects of the lens in an area other than the outer mask area in the maximum value image, and a second inspection step of detecting defects of the lens inside a circular ring shape centered on the central coordinates in the minimum value image and following the contour of the lens.

[0017] An eleventh invention of the present application is a lens inspection device for inspecting lenses, comprising a camera for photographing a lens to obtain a photographed image, and a computer for processing the photographed image, wherein the computer executes a thin line erasing step for generating a thin line-erased image by erasing thin line portions that follow the contour of the lens in the photographed image and wide portions that are wider in radial width than the thin line portions, a differential image generating step for generating a differential image between the photographed image and the thin line-erased image, and a center identification step for identifying the center coordinates of the lens based on the thin line portions included in the differential image. Effect of the Invention

[0018] According to the first to eleventh aspects of the present application, by utilizing the thin line portions contained in the differential image, the influence of the wide portions can be suppressed and the center coordinates of the lens in the captured image can be specified with high accuracy.

[0019] In particular, according to the fourth aspect of the present invention, by aligning the center coordinates that are specified with high accuracy, a plurality of captured images can be synthesized with high accuracy.

[0020] In particular, according to the fifth aspect of the present invention, a maximum value image of a plurality of captured images can be generated with high accuracy.

[0021] In particular, according to the sixth aspect of the present invention, defects in the lens can be detected with high accuracy based on a maximum value image that is generated with high accuracy.

[0022] In particular, according to the seventh aspect of the present invention, the outline of the lens in the maximum value image can be excluded from the inspection target.

[0023] In particular, according to the eighth aspect of the present invention, the portion outside the lens in the maximum value image and the chuck portion gripping the peripheral edge of the lens can be excluded from inspection.

[0024] In particular, according to the ninth aspect of the present invention, the entire chuck portion in the maximum value image can be excluded from the inspection target.

[0025] In particular, according to the tenth aspect of the present invention, by performing inspection using a maximum value image and inspection using a minimum value image, it is possible to reduce the number of defects that go undetected. [Brief description of the drawings]

[0026] [Figure 1] FIG. 1 is a diagram showing a configuration of a lens inspection device. [Diagram 2] FIG. 2 is a top view of a lens product held in a holder. [Diagram 3] 11 is a flowchart showing a flow of an inspection process. [Figure 4] FIG. 13 is a diagram showing an example of a captured image. [Diagram 5] 10 is a flowchart showing a process for identifying the center coordinates of a lens in a captured image. [Figure 6] FIG. 13 is a diagram showing an example of a captured image from which unnecessary portions have been erased. [Figure 7] FIG. 13 is a diagram showing an example of a thin line erased image in which thin lines in a captured image have been erased. [Figure 8] FIG. 13 is a diagram showing an example of a difference image. [Figure 9] 11 is a flowchart showing a flow of a process for combining photographed images. [Figure 10] 13 is a flowchart showing a procedure for creating a contour mask region. [Figure 11] FIG. 13 is a diagram showing a state in which a circular ring is arranged in a maximum value image. [Figure 12] FIG. 13 is a diagram showing an example of a contour mask region created on a maximum value image. [Figure 13] 13 is a flowchart showing a procedure for creating an outer mask region. [Figure 14] FIG. 13 is a diagram showing an example of a binarized maximum value image. [Figure 15] FIG. 13 is a diagram showing an example of an outer mask region. [Figure 16] FIG. 13 is a diagram showing an example of an outer mask region after the process of step S74 is performed. [Figure 17]FIG. 13 is a diagram showing an example of an outer mask region after the process of step S75 is performed. [Figure 18] 1 is a flowchart showing a flow of an inspection process. [Figure 19] FIG. 13 is a diagram showing an example of a maximum value image to which a contour mask region and an outer mask region are applied. [Figure 20] FIG. 13 is a diagram showing an example of a minimum value image. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings.

[0028] <1. Lens inspection device configuration> FIG. 1 is a diagram showing the configuration of a lens inspection device 1 according to an embodiment of the present invention. This lens inspection device 1 is an appearance inspection device that inspects a lens product 9, which is an object to be inspected, based on an image captured by a camera 40. The lens product 9 is, for example, a lens that is attached to the human body, such as an intraocular lens or a contact lens. The lens product 9 may also be a lens used in an optical instrument. The following describes the case where the lens product 9 is an intraocular lens.

[0029] As shown in FIG. 1, the lens product 9 is held by a holder 90. FIG. 2 is a top view of the lens product 9 held by the holder 90. As shown in FIG. 2, the lens product 9 has a lens 91 and two support parts 92. The lens 91 is a transparent member that can transmit light. The lens 91 has a substantially circular shape when viewed from above. The support parts 92 are members for fixing the lens 91 in the eye. The support parts 92 extend outward from the peripheral edge of the lens 91. The two support parts 92 are located on opposite sides of each other with respect to the center of the lens 91.

[0030] As shown in FIG. 1 and FIG. 2, the holder 90 has a flat holder body 901 and three chuck portions 902. The holder body 901 has a first through hole 903. The first through hole 903 penetrates the holder body 901 in the up-down direction. The first through hole 903 has a circular shape when viewed from above. The three chuck portions 902 are provided at intervals around the first through hole 903 on the upper surface of the holder body 901. Each chuck portion 902 grips the peripheral portion of the lens 91. This holds the lens 91 at a position above the first through hole 903.

[0031] As shown in FIG. 1, the lens inspection apparatus 1 includes a stage 10, a rotation mechanism 20, an illumination unit 30, a camera 40, and a computer 50.

[0032] The stage 10 is a platform that supports a holder 90 that holds a lens product 9. The holder 90 is placed on the upper surface of the stage 10. The stage 10 also has a holding mechanism 11 that holds the holder 90. The holding mechanism 11, for example, clamps the holder 90 from both sides in the horizontal direction. However, the holding mechanism 11 may also be one that adsorbs the lower surface of the holder 90 by applying negative pressure. By holding the holder 90 on the stage 10, the position of the lens product 9 relative to the stage 10 is fixed.

[0033] 1, the stage 10 has a second through hole 12. The second through hole 12 passes through the stage 10 in the up-down direction. When inspecting the lens product 9, the holder 90 is disposed on the stage 10 such that the first through hole 903 of the holder 90 overlaps with the second through hole 12 of the stage 10.

[0034] The rotation mechanism 20 is a mechanism for rotating the stage 10 around an axis 8 extending in the vertical direction. The rotation mechanism 20 has a motor 21. The stage 10 is connected to the motor 21 via a power transmission mechanism such as a gear. When the motor 21 is driven, the stage 10 rotates around the axis 8 extending in the vertical direction. This allows the lens 91 to rotate around the axis 8 relative to the camera 40 and the illumination unit 30. The rotation mechanism 20 is capable of rotating the stage 10 by a predetermined angle θ, which will be described later, based on a signal supplied from the computer 50.

[0035] The illumination unit 30 is a light source that irradiates the lens 91 with illumination light for imaging. For example, an LED illumination is used for the illumination unit 30. The illumination unit 30 is disposed below the second through-hole 12 of the stage 10. The illumination unit 30 emits illumination light upward. The illumination light emitted from the illumination unit 30 passes through the second through-hole 12 and the first through-hole 903 and is irradiated to the lens 91.

[0036] The illumination unit 30 may be configured by a light source disposed to the side of the stage 10 and an optical system such as a mirror that guides the light emitted from the light source to the lens 91.

[0037] The camera 40 is a unit that photographs the lens 91 on the holder 90 supported by the stage 10. The camera 40 is disposed above the stage 10 with a gap therebetween. The camera 40 has an image sensor having an imaging element such as a CCD or a CMOS, and an optical system that forms an image of light incident on the camera 40 on the image sensor. The camera 40 photographs the lens 91 to obtain a multi-tone photographed image Ia composed of a large number of pixels. The camera 40 outputs the obtained photographed image Ia to the computer 50.

[0038] The computer 50 is a unit that controls the operation of each part of the lens inspection apparatus 1 and inspects the lens 91 based on the captured image Ia. As shown in Fig. 1, the computer 50 has a processor 51 such as a CPU, a memory 52 such as a RAM, and a storage unit 53 such as a hard disk drive. The storage unit 53 stores a control program P1 for controlling the operation of each part of the lens inspection apparatus 1 and an inspection program P2 for inspecting the lens product 9 based on the captured image Ia. The control program P1 and the inspection program P2 may be stored in a storage medium such as an optical disk.

[0039] 1, computer 50 is electrically connected to rotation mechanism 20, lighting unit 30, and camera 40. Processor 51 of computer 50 executes control program P1 to control the operations of rotation mechanism 20, lighting unit 30, and camera 40. In this way, an image of lens 91 is captured. Processor 51 of computer 50 also processes captured image Ia output from camera 40 based on inspection program P2 to inspect lens 91.

[0040] <2. Inspection procedure> Next, an explanation will be given of the inspection of the lens product 9 by the above-mentioned lens inspection device 1. Fig. 3 is a flowchart showing the flow of the inspection process. The process in Fig. 3 is executed by the computer 50 operating in accordance with the control program P1 and the inspection program P2.

[0041] <2-1. Shooting with lenses> When inspecting the lens 91, first, the lens product 9 is set in the holder 90. Then, the holder 90 holding the lens product 9 is set on the stage 10. Thereafter, the lens inspection device 1 irradiates the lens 91 with illumination light from the illumination unit 30 while capturing an image of the lens 91 with the camera 40 (step S1). This results in a captured image Ia of the lens 91 captured with transmitted light. The captured image Ia is input from the camera 40 to the computer 50.

[0042] Fig. 4 is a diagram showing an example of a captured image Ia. As shown in Fig. 4, the captured image Ia includes a low-luminance region (a portion shown in gray in Fig. 4) and a high-luminance region (a portion shown in white in Fig. 4) that is brighter than the low-luminance region. Since the lens 91 is transparent, most of the lens 91 is a low-luminance region. However, the outline of the lens 91 and a defect d on the lens 91 are high-luminance regions. In addition, the support portion 92 and the peripheral portion of the chuck portion 902 are also high-luminance regions.

[0043] When the photographing of the lens 91 is completed, the computer 50 judges whether or not the number of photographs has reached a predetermined number N (step S2). If the number of photographs has not reached the predetermined number N (No in step S2), the rotation mechanism 20 rotates the stage 10 by a predetermined angle θ around the axis 8. When the stage 10 rotates, the lens 91 rotates by the predetermined angle θ together with the stage 10 and the holder 90 (step S3).

[0044] The above-mentioned predetermined angle θ is set so that one full rotation (360°) is achieved by repeating the rotation the above-mentioned predetermined number N. For example, when the predetermined number N is 8 times, the predetermined angle θ is set to 45°.

[0045] After rotating the lens 91 by the predetermined angle θ, the process returns to step S1, and the lens inspection device 1 again photographs the lens 91 with the camera 40. The lens inspection device 1 repeats the processes of steps S1 to S3 described above until the number of photographs reaches a predetermined number N.

[0046] When the number of times the lens 91 has been photographed reaches the predetermined number N (Yes in step S2), the lens inspection device 1 ends photographing the lens 91. This results in obtaining a predetermined number N of photographed images Ia (one rotation's worth of photographed images) in which the rotation angle of the lens 91 is changed by the predetermined angle θ at a time.

[0047] It is difficult to obtain a uniform captured image Ia in one capture due to biased illumination light, etc. For this reason, in the lens inspection device 1, as described above, a predetermined number N of captured images Ia are obtained by repeatedly capturing images while rotating the lens 91 relative to the illumination unit 30 and the camera 40. The predetermined number N of captured images Ia are stored in the storage unit 53 of the computer 50 with the rotation angles aligned. The computer 50 inspects the lens 91 by performing image processing based on the predetermined number N of captured images Ia.

[0048] <2-2. Identifying the center coordinates> The axis 8 of rotation of the stage 10 by the rotation mechanism 20 does not necessarily coincide with the center of the lens 91. Therefore, in order to accurately synthesize the captured images Ia, which will be described later, the computer 50 first identifies the center coordinates O of the lens 91 in each of the predetermined number N of captured images Ia (step S4). Figure 5 is a flowchart showing the flow of a process for identifying the center coordinates O of the lens 91 in one captured image Ia.

[0049] First, the computer 50 erases unnecessary parts in the captured image Ia (step S41). That is, parts in the captured image Ia that are not necessary for identifying the center coordinates O are erased. FIG. 6 is a diagram showing an example of the captured image Ia from which unnecessary parts have been erased. In the processing of subsequent steps S42 to S45, the center coordinates O of the lens 91 are identified using a thin line portion 911 that follows the contour of the lens 91. Therefore, in step S41, as shown in FIG. 6, a part that is sufficiently inside the contour of the lens 91 and a part that is sufficiently outside the contour of the lens 91 are erased as unnecessary parts. Specifically, all unnecessary parts are made into low-luminance areas.

[0050] 6, the high brightness region in the captured image Ia includes a thin line portion 911 and a wide portion 912 that follow the contour of the lens 91. The thin line portion 911 corresponds to a portion of the contour of the lens 91 to which the support portion 92 and the chuck 902 are not connected. The wide portion 912 corresponds to a portion of the contour of the lens 91 to which the support portion 92 or the chuck 902 is connected. The radial width of the wide portion 912 is wider than the radial width of the thin line portion 911.

[0051] Next, the computer 50 erases the thin line portion 911 from the above-mentioned thin line portion 911 and wide portion 912 in the captured image Ia (step S42: thin line erasing process). The thin line portion 911 can be erased, for example, by an opening process. Specifically, the computer 50 performs a contraction (thinning) process on a high-luminance region in the captured image Ia, and then performs an expansion (thickening) process. This makes the thin line portion 911 a low-luminance region. As a result, as shown in FIG. 7, a thin-line erased image Ib is obtained in which the thin line portion 911 in the captured image Ia has been erased.

[0052] Next, the computer 50 generates a difference image Ic by taking the difference between the thin line erased image Ib and the captured image Ia immediately before erasing the thin line portion 911 (step S43: difference image generating step). Fig. 8 is a diagram showing an example of the difference image Ic. When the difference between the thin line erased image Ib and the captured image Ia is taken, the thin line portion 911 erased in step S42 appears, as shown in Fig. 8. Therefore, in the difference image Ic, only the thin line portion 911 becomes a high brightness area, and the other parts become low brightness areas.

[0053] Thereafter, the computer 50 identifies the center coordinates O of the lens 91 based on the thin line portion 911 included in the difference image Ic (step S44: center identification step). The center coordinates O can be identified, for example, by applying a Hough transform to the difference image Ic. That is, the center coordinates O are identified by performing voting processing in a Hough space for a plurality of points on the thin line portion 911. By using the difference image Ic, it is possible to perform a Hough transform based only on the thin line portion 911, excluding the wide portion 912. Therefore, it is possible to accurately identify the center coordinates O of the lens 91 in the captured image Ia while suppressing the influence of the wide portion 912.

[0054] The computer 50 executes the processes of steps S41 to S44 described above for each of the captured images Ia of the predetermined number N. As a result, the center coordinates O of the lens 91 are identified for each captured image Ia.

[0055] <2-3. Combining captured images> Next, the computer 50 synthesizes a predetermined number N of photographed images Ia (step S5: image synthesis step). Fig. 9 is a flowchart showing the flow of processing for synthesizing the photographed images Ia.

[0056] 9, in step S5, the computer 50 generates one maximum value image Id based on a predetermined number N of captured images Ia (step S51). The maximum value image Id is an image composed of the maximum values ​​of the luminance values ​​of the predetermined number N of captured images Ia. In step S8, which will be described later, detection of a defect d is basically performed based on the maximum value image Id.

[0057] In step S51, the computer 50 first aligns the center coordinates O of a predetermined number N of captured images Ia. Then, with the center coordinates O aligned, the computer 50 calculates the maximum luminance value of the predetermined number N of captured images Ia for each coordinate. Then, the computer 50 applies the maximum luminance value to each coordinate of the image to generate a maximum value image Id.

[0058] In one shooting, there may be unclear parts in the shot image Ia due to bias of the illumination light, etc. However, as described above, if a maximum value image Id is generated from a predetermined number N of shot images Ia with different rotation angles, the entire image becomes clear. Therefore, the detection of the defect d in step S8 described later can be performed with high accuracy.

[0059] In this embodiment, in step S4, the center coordinate O of the lens 91 is identified with high accuracy for each captured image Ia, and maximum value images Id of a predetermined number N of captured images Ia are generated with the identified center coordinate O aligned. This makes it possible to generate the maximum value images Id with high accuracy.

[0060] 9, in this embodiment, the computer 50 also generates one minimum value image Ie based on the predetermined number N of captured images Ia (step S52). The minimum value image Ie is an image composed of the minimum luminance values ​​of the predetermined number N of captured images Ia. The minimum value image Ie is used in step S82, which will be described later, to suppress missed detection of a defect d.

[0061] In step S52, the computer 50 first aligns the center coordinates O of a predetermined number N of captured images Ia. Then, with the center coordinates O aligned, the computer 50 calculates the minimum luminance value of the predetermined number N of captured images Ia for each coordinate. Then, the computer 50 applies the minimum luminance value to each coordinate of the image to generate a minimum value image Ie.

[0062] In this embodiment, in step S4, the center coordinates O of the lens 91 are accurately specified for each captured image Ia, and a minimum value image Ie of a predetermined number N of captured images Ia is generated in a state where the specified center coordinates O are aligned. This makes it possible to generate the minimum value image Ie with high accuracy.

[0063] In the flowchart of FIG. 9, the maximum value image Id is generated first, and then the minimum value image Ie is generated, but the order of these may be reversed, or they may be generated simultaneously.

[0064] <2-4. Creating a contour mask area> When detecting the defect d based on the maximum value image Id, erroneous detection of the defect d is likely to occur near the contour of the lens 91. Therefore, the computer 50 creates a contour mask region M1 for excluding the vicinity of the contour of the lens 91 in the maximum value image Id from the inspection target (step S6). Figure 10 is a flowchart showing the procedure for creating the contour mask region M1.

[0065] As shown in Fig. 10, in step S6, the computer 50 first arranges an annular figure C in the maximum value image Id (step S61: annular figure arrangement step). The annular figure C is a circular figure centered on central coordinates O and following the contour of the lens 91. The radius of the annular figure C that is arranged first may be a value that is preset according to the design values ​​of the lens 91. Fig. 11 is a diagram showing the state in which the annular figure C is arranged in the maximum value image Id. In Fig. 11, the annular figure C is indicated by a dashed line.

[0066] The computer 50 calculates the area of ​​the overlapping area between the high luminance area in the maximum value image Id and the initially placed annular figure C as a first area A1 (step S62: first area calculation step). Then, the computer 50 stores the calculated first area A1 in the storage unit 53.

[0067] Next, the computer 50 calculates the area of ​​the overlapping area between the high luminance region in the maximum value image Id and the annular figure C as the second area A2 while gradually decreasing the radius of the annular figure C (step S63: second area calculation step). Then, the computer 50 calculates the ratio A2 / A1 of the second area A2 to the above-mentioned first area A1. As the annular figure C moves inward from the contour of the lens 91, the above-mentioned ratio A2 / A1 gradually decreases.

[0068] A reference value of the ratio A2 / A1 suitable for the contour mask region M1 is stored in advance in the storage unit 53 of the computer 50. The computer 50 gradually reduces the size of the annular shape C until the ratio A2 / A1 of the second area A2 to the first area A1 becomes substantially the same as the reference value stored in the storage unit 53.

[0069] The computer 50 determines the annular figure C when the ratio A2 / A1 is substantially equal to the reference value as the final annular figure C. More specifically, the computer 50 determines the immediately preceding annular figure C when the ratio A2 / A1 is equal to or smaller than the reference value for the first time as the final annular figure C. The computer 50 creates an outline mask region M1 based on the final annular figure C (step S64: outline mask creation step).

[0070] Fig. 12 is a diagram showing an example of the contour mask region M1 created on the maximum value image Id. As shown in Fig. 12, the contour mask region M1 is an annular mask region that follows the contour of the lens 91. A portion of the maximum value image Id that is covered by the contour mask region M1 is not subject to inspection. The computer 50 creates the contour mask region M1, for example, by increasing the radial width of the final annular figure C.

[0071] As described above, the computer 50 does not create an outline mask region M1 for each of the predetermined number N of captured images Ia, but creates one outline mask region M1 for the combined maximum value image Id. In this way, the processing load on the computer 50 can be reduced while excluding the area near the outline of the lens 91 from the inspection target. Also, in this embodiment, in step S4, the center coordinates O of the lens 91 are identified for each captured image Ia, and an outline mask region M1 is created for the maximum value image Id that is accurately created based on the identified center coordinates O. This makes it possible to more accurately mask the area near the outline of the lens 91.

[0072] <2-5. Creating an outer mask area> In the maximum value image Id, there is no need to inspect the portion outside the lens 91. Therefore, the computer 50 creates an outer mask region M2 for excluding the portion outside the lens 91 in the maximum value image Id from the inspection target (step S7: outer mask creating step). Figure 13 is a flowchart showing the procedure for creating the outer mask region M2.

[0073] As shown in Fig. 13, in step S7, the computer 50 first binarizes the maximum value image Id (step S71). Specifically, the maximum value image Id is binarized into a low luminance region and a high luminance region using a predetermined luminance value as a threshold. At that time, the luminance value of the high luminance region is set according to the luminance value of the outer mask region M2 to be created. Fig. 14 is a diagram showing an example of the binarized maximum value image If.

[0074] Next, the computer 50 arranges the annular figure C in the binarized maximum value image If (step S72). The arrangement of the annular figure C is performed in the same manner as in step S61 described above. However, the annular figure C to be arranged may be the final annular figure C determined in steps S63 to S64 described above.

[0075] Next, the computer 50 creates an outer mask region M2 by taking the logical sum of the high luminance region (black region in FIG. 14) of the binarized maximum value image If and the region outside the annular figure C (step S73). FIG. 15 is a diagram showing an example of the outer mask region M2. By taking the logical sum as described above, the chuck portion 902 that grips the peripheral portion of the lens 91 can also be included in the outer mask region M2.

[0076] Next, the computer 50 changes an isolated non-mask area in the outer mask area M2 that is equal to or smaller than a predetermined area to the outer mask area M2 (step S74). For example, as shown in FIG. 15, if an isolated non-mask area remains inside the chuck portion 902, the computer 50 changes the non-mask area to the outer mask area M2. This makes it possible to exclude the entire chuck portion 902 in the maximum value image If from the inspection target. FIG. 16 is a diagram showing an example of the outer mask area M2 after the process of step S74 has been performed.

[0077] Thereafter, the computer 50 leaves only the area continuous from the outer end of the maximum value image If in the outer mask area M2, and excludes the other areas from the outer mask area M2 (step S75). This makes it possible to exclude areas such as the defect d located inside the contour of the lens 91 from the outer mask area M2. Fig. 17 is a diagram showing an example of the outer mask area M2 after the process of step S75 has been performed.

[0078] As described above, the computer 50 does not create an outer mask region M2 for each of the predetermined number N of captured images Ia, but creates one outer mask region M2 for the combined maximum value image Id. In this way, the processing load on the computer 50 can be reduced while the region outside the lens 91 can be excluded from the inspection target. Also, in this embodiment, in step S4, the center coordinates O of the lens 91 are identified for each captured image Ia, and the outer mask region M2 is created for the maximum value image Id that is accurately created based on the identified center coordinates O. This makes it possible to more accurately mask the region outside the lens 91.

[0079] <2-6. Inspection> Thereafter, the computer 50 detects a defect d in the lens 91 (step S8: inspection process). The defect d is, for example, a scratch on the lens 91 or a foreign matter attached to the lens 91. Fig. 18 is a flowchart showing the flow of the inspection process.

[0080] As shown in Fig. 18, in step S8, the computer 50 first detects a defect d in the lens 91 based on the maximum value image Id (step S81: first inspection step). Fig. 19 is a diagram showing an example of a maximum value image Id to which the above-mentioned contour mask region M1 and outer mask region M2 are applied. The computer 50 excludes the contour mask region M1 and outer mask region M2 in the maximum value image Id from inspection. In other words, the computer 50 excludes the region other than the contour mask region M1 and outer mask region M2 in the maximum value image Id from inspection in the maximum value image Id.

[0081] The computer 50 detects a defect d of the lens 91 in the above-mentioned inspection target region of the maximum value image Id. Specifically, the computer 50 detects a portion in the inspection target region where the brightness value is higher than a predetermined threshold as the defect d.

[0082] Next, the computer 50 detects a defect d in the lens 91 based on the minimum value image Ie (step S82: second inspection step). FIG. 20 is a diagram showing an example of the minimum value image Ie. The computer 50 arranges a circular figure C in the minimum value image Ie. The arrangement of the circular figure C is performed in the same manner as in step S61 described above. Then, the computer 50 determines the area inside the circular figure C as the inspection target area in the minimum value image Ie.

[0083] The computer 50 detects a defect d of the lens 91 in the above-mentioned inspection target area of ​​the minimum value image Ie. Specifically, the computer 50 detects a portion in the inspection target area where the brightness value is higher than a predetermined threshold as the defect d.

[0084] Some small defects d may not appear in the minimum value image Ie. For this reason, it is basically desirable to detect defects d based on the maximum value image Id. However, in the inspection of the maximum value image Id in step S81, the outer mask region M2 may be set broadly near the support portion 92, masking the defects d. This may result in the defects d not being detected.

[0085] For example, in the maximum value image Id of Fig. 19, defect d in the portion surrounded by a dashed line is part of the outer mask region M2 and is therefore excluded from inspection. However, in the minimum value image Ie of Fig. 20, the support portion 92 is smaller than in the maximum value image Id, so that the defect d can be included in the inspection target region. Therefore, defect d that could not be detected in the maximum value image Id can be detected in the minimum value image Ie. In this way, by using inspection using the maximum value image Id and inspection using the minimum value image Ie in combination, it is possible to reduce oversight of detection of defect d.

[0086] The computer 50 integrates the inspection result based on the maximum value image Id and the inspection result based on the minimum value image Ie, and outputs the final detection result of the defect d (step S83). Specifically, the computer 50 determines the union of the defect d detected in the maximum value image Id and the defect d detected in the minimum value image Ie as the final detection result of the defect d. The computer 50 stores the final detection result of the defect d in the storage unit 53, and displays it on a display unit connected to the computer 50.

[0087] <3. Modifications> Although one embodiment of the present invention has been described above, the present invention is not limited to the above embodiment.

[0088] In the above embodiment, the computer 50 specifies the center coordinates O by applying the Hough transform to the thin line portion 911 in the difference image Ic. However, the computer 50 may specify the center coordinates O by using other methods such as fitting or template matching based on the thin line portion 911 in the difference image Ic.

[0089] In the above embodiment, the computer 50 generates a maximum value image Id and a minimum value image Ie from the predetermined number N of captured images Ia, and performs inspection using the maximum value image Id and inspection using the minimum value image Ie. However, the computer 50 may generate only the maximum value image Id from the predetermined number N of captured images Ia, and perform only inspection using the maximum value image Id.

[0090] In the above embodiment, the computer 50 sets both the contour mask region M1 and the outer mask region M2 for the maximum value image Id. However, the mask region set for the maximum value image Id may be only the outer mask region M2. Furthermore, the computer 50 may set a mask region other than the contour mask region M1 and the outer mask region M2 for the maximum value image Id.

[0091] Additionally, to the extent that no inconsistency arises, some of the elements appearing in the above embodiments may be deleted, or other known elements may be added. [Explanation of symbols]

[0092] 1 Lens inspection equipment 9. Lens Products 10 Stages 20 Rotation mechanism 30 Lighting Department 40 Camera 50 Computer 90 Holder 91 Lens 92 Support part 902 Chuck part 911 Thin line part 912 Wide section A1 1st area A2 2nd area C Circular figure Ia Photographed Image Ib Thin line erase image Ic difference image Id maximum value image Ie Minimum Image M1 Contour mask area M2 outer mask area O center coordinates P1 Control Program P2 Inspection Program d Defect

Claims

1. An image processing method for processing an image captured by a lens, comprising the steps of: a thin line erasing step of erasing a thin line portion along a contour of the lens in the captured image and a wide portion having a radial width wider than that of the thin line portion, thereby generating a thin line erased image; a differential image generating step of generating a differential image between the captured image and the thin line erased image; a center identifying step of identifying center coordinates of the lens based on the thin line portion included in the difference image; An image processing method comprising the steps of:

2. 2. The image processing method according to claim 1, In the center specifying step, the center coordinates are specified by applying a Hough transform to the difference image.

3. 3. The image processing method according to claim 1, further comprising: In the thin line erasing step, shrinking and expanding are performed on the thin line portions and the wide portions in the captured image.

4. 3. The image processing method according to claim 1, further comprising: performing the thin line erasing step, the difference image generating step, and the center identifying step for each of the plurality of captured images; an image synthesis step of synthesizing the plurality of photographed images while aligning the center coordinates identified in the center identification step; The image processing method further comprises:

5. 5. The image processing method according to claim 4, In the image synthesis step, a maximum value image of the plurality of captured images is generated.

6. A lens inspection method, comprising an inspection step of detecting defects in the lens based on the maximum value image generated by the image processing method according to claim 5.

7. 7. A lens inspection method according to claim 6, comprising: a ring-shaped figure arrangement step of arranging a ring-shaped figure along a contour of the lens, the ring-shaped figure being centered on the central coordinates, in the maximum value image; a first area calculation step of calculating a first area which is an area of ​​an overlapping region between the annular figure and a high luminance region of the maximum value image; a second calculation step of calculating a second area, which is an area of ​​an overlapping region between the high luminance region and the annular figure, while gradually decreasing a radius of the annular figure; a contour mask creating step of creating a contour mask area along a contour portion of the lens based on the annular shape when a ratio of the second area to the first area becomes substantially equal to a predetermined reference value; and The lens inspection method, wherein the contour mask region is excluded from inspection in the inspection step.

8. 7. A lens inspection method according to claim 6, comprising: an outer mask creating step of creating an outer mask area by taking a logical sum of a high luminance area in the maximum value image and an outer area of ​​a ring shape centered on the central coordinates and following the contour of the lens; and The lens inspection method, wherein the outer mask area is excluded from inspection in the inspection step.

9. 9. A lens inspection method according to claim 8, comprising: In the outer mask creating step, an isolated non-masked area having a predetermined area or less in the outer mask area is changed to an outer mask area.

10. 9. A lens inspection method according to claim 8, comprising: In the image synthesis step, a minimum value image of the plurality of captured images is further generated, The inspection step includes: a first inspection step of detecting defects of the lens in a region other than the outer mask region in the maximum value image; a second inspection step of detecting defects of the lens inside a circular ring shape centered on the central coordinate in the minimum value image and along a contour of the lens; A lens inspection method comprising:

11. A lens inspection apparatus for inspecting a lens, comprising: a camera for capturing an image by photographing a lens; A computer for processing the captured image; Equipped with The computer includes: a thin line erasing step of erasing a thin line portion along a contour of the lens in the captured image and a wide portion having a radial width wider than that of the thin line portion, thereby generating a thin line erased image; a differential image generating step of generating a differential image between the captured image and the thin line erased image; a center identifying step of identifying center coordinates of the lens based on the thin line portion included in the difference image; A lens inspection device that performs the above steps.

Citation Information

Patent Citations

  • Lens tilt detection device

    JP2015018324A