Industrial camera
The industrial camera calculates pixel resolution and field of view size using lens adjustments and camera parameters, addressing the need for ToF sensors in determining inspection area accuracy without increasing costs.
Patent Information
- Application Number
- JP2023058166
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-15
AI Technical Summary
Existing industrial cameras face challenges in determining pixel resolution for inspection areas without using expensive ToF sensors, which are difficult to integrate and can only measure distances to single points, limiting the accuracy of image inspection.
An industrial camera with a non-telecentric lens and focusing lens group, combined with a distance measuring unit and calculation unit, calculates pixel resolution by adjusting lens positions and using camera parameters to determine the field of view size and distance to a partial area, eliminating the need for a ToF sensor.
Enables accurate determination of pixel resolution and field of view size for inspection areas without adding a ToF sensor, improving inspection accuracy and reducing costs.
Smart Images

Figure 2024145701000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to an industrial camera that generates a workpiece image by capturing an image of the workpiece. [Background technology]
[0002] For example, as disclosed in Patent Document 1, in image inspection, an inspection is performed to check for the presence or absence of scratches, etc., using a workpiece image generated by an industrial camera. A user wants to know the pixel resolution of the inspection target area according to the size of the scratches to be inspected, etc., in order to determine whether the inspection can be performed at a level required by the user. The pixel resolution of the inspection target area is obtained by dividing the field of view size corresponding to the inspection target area by the number of pixels. The field of view size is calculated from the distance from the camera to the inspection target area (working distance: WD) and the angle of view of the camera. Here, since the angle of view of the camera is stored as a camera parameter, the pixel resolution of the inspection target area can be known by calculating the WD. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2020-169958 A Summary of the Invention [Problem to be solved by the invention]
[0004] As described above, the pixel resolution of the inspection target area can be known by calculating the working distance. When calculating the working distance, a method of measuring the distance from the camera to the inspection target area using a distance sensor (ToF sensor) can be considered, but ToF sensors are expensive, and incorporating a ToF sensor into an industrial camera would significantly increase costs.
[0005] In addition, since a ToF sensor can only measure the distance to one point, it may not be possible to measure the distance to the area that the user wants to inspect.
[0006] The present disclosure has been made in consideration of the above points, and has as its object to enable a user to obtain the pixel resolution of an area that he or she wishes to inspect, without adding a distance sensor. [Means for solving the problem]
[0007] In order to achieve the above object, one aspect of the present disclosure can be premised on an industrial camera that generates a workpiece image obtained by capturing an image of a workpiece to be inspected. The industrial camera includes an image sensor and a group of focusing lenses made of non-telecentric lenses, an image capturing unit for generating a workpiece image, a storage unit for storing camera parameters including the focal length of the image capturing unit and the number of pixels and size of the image sensor, a lens driving unit for adjusting the lens position of the group of focusing lenses, a focus adjustment unit for controlling the lens driving unit to determine a focused lens position based on a partial area that is a part of the field of view of the image capturing unit, a distance measuring unit for calculating a distance to a position of the workpiece corresponding to the partial area based on the focused lens position and the focal length determined by the focus adjustment unit, and a calculation unit for calculating a field of view size in the partial area based on the distance calculated by the distance measuring unit and the camera parameters stored in the storage unit.
[0008] According to this configuration, when the focus adjustment unit controls the lens drive unit to adjust the lens position so that the focusing lens group is focused on a partial region of the field of view of the imaging unit, the distance measurement unit calculates the distance to the position of the workpiece corresponding to the partial region of the field of view of the imaging unit based on the focused lens position and the focal length of the imaging unit. When the distance measurement unit calculates the distance, the calculation unit calculates the field of view size in the partial region based on the calculated distance and the camera parameters. Therefore, by using the distance calculated by the distance measurement unit, it is possible to obtain the pixel resolution of the region that the user wants to inspect without adding an expensive ToF sensor.
[0009] The calculation unit can calculate a first number of pixels of the image sensor corresponding to the partial region, and calculate a pixel resolution in the partial region based on the first number of pixels and the field of view size. In this case, the industrial camera may further include an interface unit for displaying the pixel resolution calculated by the calculation unit on a display unit. By presenting the pixel resolution calculated by the calculation unit to a user via the interface unit, the user can easily determine whether a desired inspection accuracy can be achieved. An example of the display unit can be a monitor of a client device such as a personal computer.
[0010] The focus adjustment unit can also calculate high-frequency components contained in the partial region in the workpiece image and determine the in-focus lens position based only on the high-frequency components. In other words, the focus is adjusted by calculating high-frequency components in the partial region in the workpiece image, so that the distance to the average height of the workpiece in the partial region can be calculated.
[0011] The interface unit may be configured to display the workpiece image generated by the imaging unit on a display unit and to accept designation of the partial area in the workpiece image from a user. This allows the user to designate a partial area in the workpiece image while viewing the workpiece image generated by the imaging unit, so that the user can more accurately designate an area to be measured, i.e., an area to be grasped for pixel resolution, and improves inspection accuracy when performing image inspection using the workpiece image.
[0012] The industrial camera may further include a zoom optical system capable of electrically performing optical zoom. The interface unit is configured to be able to receive an instruction to start distance measurement from a user, and when the zoom optical system receives the instruction to start distance measurement from the user via the interface unit, it sets the optical magnification to a predetermined threshold value or more. The distance measurement unit calculates a distance to a position of the workpiece corresponding to the partial area of the workpiece, based on a lens position in focus determined by the focus adjustment unit and a focal length corresponding to the optical magnification, for the partial area in the workpiece image zoomed by the set optical magnification. The calculation unit can calculate a field of view size in a specified partial area in the zoomed workpiece image, based on the distance calculated by the distance measurement unit and the camera parameters stored in the storage unit. That is, if the focal length of the optical system is short, the depth of field becomes deep and the distance measurement accuracy becomes low, so the distance measurement accuracy can be improved by performing distance measurement with the optical magnification set to a predetermined threshold value or more and the focal length lengthened.
[0013] The imaging unit may be configured to generate an image having a larger number of pixels than the workpiece image, and to downscale an image corresponding to an output area, which is the entire or partial area of the field of view of the imaging unit, to generate a workpiece image having a smaller number of pixels than the image. The calculation unit calculates a downscaling magnification based on the number of pixels corresponding to the entire field of view of the image and the number of pixels corresponding to the output area, and calculates the field of view size in the partial area based on the distance calculated by the distance measuring unit, the camera parameters, and the downscaling magnification. In this way, the working distance can be calculated even when downscaling is used. Effect of the Invention
[0014] As described above, the distance to the work position corresponding to a partial area of the imaging unit's field of view can be calculated based on the focused lens position and the focal length of the imaging unit, and the field of view size in the partial area of the imaging unit's field of view can be calculated based on the calculated distance to the work position and the camera parameters, so that the pixel resolution of the area that the user wants to inspect can be obtained without adding any distance sensors. [Brief description of the drawings]
[0015] [Figure 1] 1 is an overall view showing a state in which an image inspection device equipped with an industrial camera according to an embodiment of the present invention is used; [Diagram 2] FIG. 2 is a cross-sectional view showing the internal structure of the industrial camera. [Diagram 3] FIG. 1 is a block diagram of an image processing device. [Figure 4] 11 is a flowchart showing an example of a procedure for calculating and displaying a field of view size and a pixel resolution. [Diagram 5] FIG. 4 is a diagram showing an example of a display screen. [Figure 6] FIG. 6 is a diagram equivalent to FIG. 5 and showing a state in which a partial region has been specified. [Figure 7] FIG. 2 is a diagram showing the relationship between a workpiece and an image of an image sensor. [Figure 8] 1 is a graph showing the relationship between the working distance and the lens position. [Figure 9] 5 showing the results of distance measurement, the field of view size, and the pixel resolution. FIG. [Figure 10] FIG. 1 is a diagram illustrating the concept of downscaling. [Figure 11] 11A and 11B are diagrams illustrating a case where downscaling is performed based on an image of a specific workpiece. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. Note that the following description of the preferred embodiments is merely illustrative in nature and is not intended to limit the present invention, its applications, or its uses.
[0017] Fig. 1 is a diagram showing the configuration of an image processing device 1 according to an embodiment of the present invention, and Fig. 2 is a block diagram of the image processing device 1. Fig. 1 shows the image processing device 1 during operation, and the image processing device 1 includes an industrial camera 2 that captures an image of a workpiece W and generates a workpiece image obtained by capturing the image of the workpiece W, and an image processing controller 3 that performs inspection and the like based on the workpiece image generated by the industrial camera 2. The image processing device 1 may also include an external device 4 such as a PLC (Programmable Logic Controller), and the external device 4 may or may not be a component of the image processing device 1.
[0018] The image processing device 1 is used at a site where multiple workpieces W are transported in sequence. At such a site, the workpieces W are transported at a predetermined speed by a transport device such as a belt conveyor C. The industrial camera 2 is controlled by, for example, an external device 4 or an image processing controller 3, so as to capture an image of the workpiece W transported by the belt conveyor C when the workpiece W enters the field of view of the industrial camera 2. By repeating this process, the industrial camera 2 sequentially captures images of the multiple workpieces W transported by the belt conveyor C.
[0019] Although not shown, the industrial camera 2 can also capture an image of a stationary workpiece W. The industrial camera 2 can also be operated in a state where it is attached to, for example, a robot arm, and the operation form of the image processing device 1 is not particularly limited.
[0020] The image processing controller 3 performs various settings of the industrial camera 2, and may be configured, for example, as a desktop personal computer, a notebook personal computer, or as a processor dedicated to image inspection; its form is not particularly limited. The image processing controller 3 includes a main body 5, an operation unit 7, and a monitor (display unit) 8. The main body 5 is communicatively connected to the industrial camera 2 via a communication line 6. In addition, when an external device 4 is included, the main body 5 is communicatively connected to the external device 4 via another communication line 9.
[0021] The main body 5 is provided with a control unit 5a configured with a central processing unit, ROM, RAM, etc. The main body 5 is also provided with a storage unit 5b configured with a hard disk drive, a solid state drive, etc. The storage unit 5b stores programs for operating the control unit 5a, setting information for the industrial camera 2, various images, etc. A part of the storage unit 5b may be provided in the industrial camera 2, in which case the setting information for the industrial camera 2, various images, etc. can be held in the industrial camera 2.
[0022] The operation unit 7 includes, for example, a keyboard 7a and a mouse 7b. The keyboard 7a and the mouse 7b are an example of a member for operating the image processing controller 3, and the operation states of the keyboard 7a and the mouse 7b are detected by the control unit 5a. The operation unit 7 is not limited to the keyboard 7a and the mouse 7b, and may be a so-called touch panel type operation unit. The monitor 8 is composed of, for example, a liquid crystal display device, and is controlled by the control unit 5a to display various user interface screens, various images, etc. for setting the industrial camera 2. A touch panel type operation unit may also be incorporated in the monitor 8.
[0023] 2, the industrial camera 2 has a lens unit 20, a sensor board 30, a main board 40, a housing 50, and a memory unit 39 (shown in FIG. 3). The memory unit 39 stores setting information for the industrial camera 2, various images, etc.
[0024] The lens unit 20 mounted on the industrial camera 2 is a zoom lens equipped with a zoom optical system capable of electrically controlling optical zoom, and the optical zoom magnification can be switched to any magnification within a predetermined range. The lens unit 20 is fixed to a housing 50 and is integrated with the housing 50.
[0025] The lens unit 20 has a first lens group 21, a second lens group 22, a third lens group 23, a fourth lens group 24, a fifth lens group 25, and a lens barrel 26 that holds the first to fifth lens groups 21 to 25. The first to fifth lens groups 21 to 25 form a condenser lens that condenses light incident from a light receiving window 51a formed in a housing 50. The number of lenses that constitute each of the first to fifth lens groups 21 to 25 is not particularly limited, and may be any number, and the number of lens groups may be four or less, or six or more. The lens unit 20 may be a zoom optical system that allows manual optical zoom.
[0026] The first lens group 21 is a fixed lens group fixed to the housing 50, and receives light reflected from the workpiece W. The second lens group 22 is a movable lens group for zooming arranged behind the first lens group 21, and receives light emitted from the first lens group 21. The third lens group 23 is a fixed lens group arranged behind the second lens group 22, and receives light emitted from the second lens group 22. The fourth lens group 24 is a focusing lens group (movable lens group) consisting of a non-telecentric lens, and arranged behind the third lens group 23, and receives light emitted from the third lens group 23. The fifth lens group 25 is a fixed lens group arranged behind the fourth lens group 24, and receives light emitted from the fourth lens group 24.
[0027] The lens barrel 26 is provided with a zoom ball screw 56a, a zoom guide shaft 56b, and a zoom motor 56c for rotating the zoom ball screw 56a in forward and reverse directions. The second lens group 22 is supported by the zoom ball screw 56a and the zoom guide shaft 56b, and when the zoom ball screw 56a is rotated by the zoom motor 56c, the second lens group 22 moves in the optical axis direction, thereby obtaining a desired zoom magnification. The zoom ball screw 56a, the zoom guide shaft 56b, and the zoom motor 56c form a zoom lens driving mechanism that drives the second lens group 22 in the optical axis direction to adjust the optical magnification.
[0028] The lens barrel 26 is also provided with a focusing ball screw 56d, a focusing guide shaft 56e, and a focusing motor 56f for rotating the focusing ball screw 56d in forward and reverse directions. The fourth lens group 24 is supported by the focusing ball screw 56d and the focusing guide shaft 56e, and when the focusing ball screw 56d is rotated by the focusing motor 56f, the fourth lens group 24 moves in the optical axis direction, thereby performing focus adjustment. The focusing ball screw 56d, the focusing guide shaft 56e, and the focusing motor 56f are a focusing lens driving mechanism that drives the fourth lens group 24 in the optical axis direction to adjust the focal position, and the focusing motor 56f is a lens driving unit that adjusts the lens position of the fourth lens group 24.
[0029] As shown in FIG. 3, the main board 40 is provided with a zoom control unit 40a, an AF control unit 40b, an interface unit 40c, and a distance measurement unit 40d. The interface unit 40c is a unit that accepts various instructions and designations from a user and outputs the results of calculations performed by the main board 40, workpiece images, etc. to the image processing controller 3 and the external device 4. For example, data of a workpiece image generated by the imaging unit 2A is output to the image processing controller 3 via the interface unit 40c and the input / output terminal 60. Based on the data of the workpiece image output to the image processing controller 3, the control unit 5a generates a display screen for displaying the workpiece image, and displays the display screen on the monitor 8. In other words, the interface unit 40c is a member for displaying the workpiece image generated by the imaging unit 2A on the monitor 8.
[0030] The interface unit 40c is configured to be able to accept, from the user, a designation of a partial area in the work image displayed on the monitor 8. When the user operates the operation unit 7 to designate a partial area in the work image while the work image is displayed on the monitor 8, the interface unit 40c acquires information for identifying the designated area in the work image based on the operation, and can accept the designation of the partial area in the work image based on the information. Information on the designated partial area, i.e., information for identifying the partial area in the work image, is stored in the storage unit 39 or the like.
[0031] The interface unit 40c is configured to be able to receive from a user a zoom instruction for optical zoom, an instruction to start distance measurement, etc. When the interface unit 40c receives, for example, a zoom instruction for optical zoom, the zoom control unit 40a controls the zoom motor 56c to move the second lens group 22 in the optical axis direction so as to achieve the zoom magnification received by the interface unit 40c.
[0032] The AF control unit 40b is a part that executes autofocus control of a conventionally known contrast method or phase difference method, and corresponds to a focus adjustment unit. The AF control unit 40b controls the focus motor 56f to move the fourth lens group 24 in the optical axis direction so that the focal position matches the workpiece W. Since the workpiece W is usually present only in a part of the field of view of the imaging unit 2A, the AF control unit 40b determines the lens position where the focus is achieved based on a partial area that is a part of the field of view of the imaging unit 2A. Information regarding the determined lens position is output to, for example, the distance measurement unit 40d, etc.
[0033] The AF control unit 40b is configured to be able to calculate high-frequency components contained in a partial area in the workpiece image. The partial area is a part of the field of view of the imaging unit 2A, and when this partial area contains high-frequency components, the AF control unit 40b calculates the high-frequency components and determines the in-focus lens position based only on the calculated high-frequency components.
[0034] As shown in FIG. 2, the sensor board 30 is disposed behind the fifth lens group 25. An image sensor 31 is mounted on the sensor board 30. The image sensor 31 and the lens unit 20 constitute an imaging section 2A for generating a workpiece image. The focal length of the imaging section 2A is determined by the positional relationship between the image sensor 31 and the first to fifth lens groups 21 to 25 constituting the lens unit 20. In this embodiment, the lens unit 20 is a zoom lens and the optical magnification can be changed, so that the focal length corresponding to the optical magnification can be acquired as one of the camera parameters.
[0035] The image sensor 31 has a light receiving surface composed of a large number of light receiving elements, and specifically, as shown in FIG. 3, has a photoelectric conversion unit 31a that receives light collected by the first to fifth lens groups 21 to 25 of the lens unit 20, and an imaging control unit 31b that generates a work image from the electrical signal converted by the photoelectric conversion unit 31a.
[0036] The photoelectric conversion unit 31a is capable of generating a captured image having a larger number of pixels than the workpiece image. The photoelectric conversion unit 31a is a CMOS type imaging element of a global shutter type or a rolling shutter type. In the case of the global shutter type, an image without distortion can be captured even for a moving object. In the case of the rolling shutter type, a high pixel count can be achieved with a pixel pitch that is about half that of the global shutter type, so that the size of each lens of the lens unit 20 can be reduced, which in turn allows the housing 50 to be reduced in size, improving the degree of freedom in installation. The pixel group of the photoelectric conversion unit 31a forms the field of view of the image sensor 31. The field of view of the image sensor 31 is also called the field of view of the photoelectric conversion unit 31a.
[0037] The storage unit 39 of the industrial camera 2 shown in Fig. 3 is composed of, for example, a semiconductor memory. Camera parameters are stored in the storage unit 39. The camera parameters include the focal length of the imaging unit 2A and the number of pixels and size of the image sensor 31. The camera parameters stored in the storage unit 39 can be read by the distance measuring unit 40d and the processor 41 as necessary.
[0038] The distance measuring unit 40d acquires information regarding the in-focus lens position determined by the AF control unit 40b, and reads the focal length stored in the storage unit 39 of the industrial camera 2. Then, based on the in-focus lens position and the focal length, the distance measuring unit 40d calculates the distance to the position of the workpiece W corresponding to a partial region that is a part of the field of view of the imaging unit 2A. The method of calculating this distance will be described in detail later.
[0039] The calculation unit 41a acquires the distance calculated by the distance measuring unit 40d and reads the camera parameters stored in the storage unit 39 of the industrial camera 2. The calculation unit 41a then calculates the field of view size of a partial region that is a part of the field of view of the imaging unit 2A based on the distance calculated by the distance measuring unit 40d and the camera parameters. A method for calculating the field of view size will be described in detail later.
[0040] The calculation unit 41a can also calculate a first pixel number of the image sensor 31 corresponding to a partial region that is a part of the visual field of the imaging unit 2A. In this case, the calculation unit 41a calculates the pixel resolution in the partial region that is a part of the visual field of the imaging unit 2A based on the calculated first pixel number and the visual field size. Data related to the calculated pixel resolution is output to the image processing controller 3 via the interface unit 40c and the input / output terminal 60. Based on the data related to the pixel resolution output to the image processing controller 3, the control unit 5a generates a display screen for displaying the pixel resolution, and causes the monitor 8 to display the display screen. In other words, the interface unit 40c is a member for displaying the pixel resolution calculated by the calculation unit 41a on the monitor 8.
[0041] Next, the calculation and display procedure of the visual field size and pixel resolution of a partial area, which is a part of the visual field of the imaging unit 2A, will be described with reference to the flowchart shown in Fig. 4. This flowchart starts when an instruction to start distance measurement is received from the user via the interface unit 40c. The instruction to start distance measurement is given by operating the visual field measurement start button 105a (shown in Fig. 5) displayed on the monitor 8.
[0042] In step SA1 after the start, the focal length is adjusted. The focal length adjustment in this step is not an autofocus for focusing, but is to change the focal length of the lens unit 20, i.e., the angle of view. Specifically, the zoom control unit 40a controls the zoom motor 56c to move the second lens group 22 in the optical axis direction so that the focal length of the lens unit 20 becomes longer (so that the zoom magnification increases).
[0043] That is, if the focal length is short, the depth of field is deep, and the focal distance range is wide, which may result in a decrease in accuracy during distance measurement. However, by lengthening the focal length and making the depth of field shallow in step SA1, the focal range is narrowed, and the accuracy during distance measurement can be improved. In this way, when the lens unit 20, which is a zoom optical system, receives an instruction to start distance measurement from the user via the interface unit 40c, it sets the optical magnification to a predetermined threshold value or more. If the optical magnification is already equal to or greater than the predetermined threshold value, step SA1 can be omitted.
[0044] In step SA2, the processor 41 receives a trigger signal issued by, for example, the external device 4 via the input / output terminal 60. Upon receiving the trigger signal, the processor 41 outputs an image capture instruction to the imaging control unit 31b, and the imaging control unit 31b executes imaging. As a result, a workpiece image zoomed by the optical magnification set in step SA1 is generated by the imaging unit 2A.
[0045] The workpiece image generated by the imaging unit 2A is output to the image processing controller 3 via the interface unit 40c and the input / output terminal 60. Based on the data of the workpiece image output to the image processing controller 3, the control unit 5a generates a display screen for displaying the workpiece image, and causes the monitor 8 to display the display screen.
[0046] Specifically, the control unit 5a generates a display screen 100 as shown in Fig. 5 and displays it on the monitor 8. The display screen 100 is provided with a work image display area 101 in which a work image generated by the imaging unit 2A is displayed, a magnification designation area 102 in which a zoom magnification is designated, a center movement setting area 103 for moving the center, an angle setting area 104 in which a rotation angle is set, and an installation condition display area 105. When a user designates a zoom magnification in the magnification designation area 102 using the operation unit 7, the designated zoom magnification is received by the zoom control unit 40a via the input / output terminal 60. The zoom control unit 40a controls the zoom motor 56c so as to achieve the received zoom magnification.
[0047] The user can set the direction and amount of movement of the center of the workpiece image in the center movement setting area 103. Also, the user can set the direction and amount of rotation of the workpiece image in the angle setting area 104. The workpiece image moves or rotates according to the set direction and amount of movement, direction and amount of rotation.
[0048] The installation condition display area 105 is provided with a visual field measurement start button 105a, a reduced display area 105b in which a work image is displayed in a reduced size, and a visual field size display area 105c. The visual field measurement start button 105a is a button that the user operates when starting calculation of the visual field size. The visual field size display area 105c is an area in which the calculated visual field size is displayed as a numerical value, and the size in the X direction and the size in the Y direction can be displayed separately. The unit of the visual field size is mm, but is not limited to this.
[0049] In step SA4 of the flowchart shown in Fig. 4, a user's designation of a partial region that is a part of the visual field of the imaging unit 2A is accepted. As shown in Fig. 6, when a partial region is designated, a visual field measurement window 110 is displayed on the display screen 100. In the visual field measurement window 110, a message is displayed prompting the user to designate a partial region that is a part of the visual field of the imaging unit 2A, and an OK button 110a for confirming the designation of the partial region and a cancel button 110b for canceling the designation of the partial region are displayed.
[0050] When the user operates the operation unit 7, a frame 120 capable of surrounding a desired area on the workpiece image displayed in the workpiece image display area 101 is displayed superimposed on the workpiece image. The position, aspect ratio, and size of the frame 120 can be freely changed by operating the operation unit 7. The area surrounded by the frame 120 is an area that will be a partial area that is part of the field of view of the imaging unit 2A. When the OK button 110a is operated, the area surrounded by the frame 120 is determined to be a partial area that is part of the field of view of the imaging unit 2A, and is accepted by the interface unit 40c.
[0051] Here, if the partial region set by the user is too small, there may be no sufficient high-frequency components in the partial region, and the distance measuring unit 40d may not be able to perform high-precision distance measurement. In response to this, a lower limit for the size of the partial region, which is a part of the field of view of the imaging unit 2A, may be set in advance. This allows the partial region to contain sufficient high-frequency components, improving the accuracy of distance measurement by the distance measuring unit 40d. Note that the user may specify the partial region arbitrarily, and in the initial state, for example, a part of the center of the field of view may be set as the partial region.
[0052] In step SA5, distance measurement unit 40d performs distance measurement of the partial area specified in step SA4. Specifically, as shown in Fig. 7, distance a between the lens and a part of work W corresponding to the partial area is the working distance (WD), and distance b is the distance between the lens and image sensor 31. In this case, 1 / a+1 / b=1 / f holds.
[0053] When the fourth lens group 24, which is a lens group for focusing, is moved in the optical axis direction by the focusing motor 56f, when the fourth lens group 24 is moved by n steps toward the workpiece W, a→an×pitch b→b+n×pitch The distance measuring unit 40d can obtain n based on the operation of the focus motor 56f.
[0054] Here, "pitch" is the amount of movement of the fourth lens group 24 per step of the focusing motor 56f, and is actually about several μm, so that an×pitch can be approximated to a.
[0055] 1 / WD+1 / (b+n×pitch)=1 / f
[0056] 8 shows the relationship between the working distance and the lens position (the position of the fourth lens group 24). The horizontal axis is the working distance (unit: mm), and the vertical axis is the position (n×pitch) of the fourth lens group 24. Based on this graph, the working distance can be calculated from the position of the fourth lens group 24.
[0057] In step SA6, the calculation unit 41a calculates the field of view size of the partial region designated in step SA4. The following formula can be used to calculate the field of view size.
[0058] WD / f × sensor width / downscaling magnification × lens principal point position correction coefficient
[0059] The sensor width is the width of the light receiving surface of the image sensor 31 (the size of the image sensor 31). The downscaling magnification will be described later. The lens principal point position correction coefficient is a value determined by the focal length. The field of view size calculated by the calculation unit 41a is stored in the storage unit 39 of the industrial camera 2.
[0060] In step SA7, the calculation unit 41a calculates the pixel resolution. The pixel resolution can be calculated by dividing the field of view size calculated in step SA6 by the number of pixels in the partial region. The pixel resolution calculated by the calculation unit 41a is stored in the storage unit 39 of the industrial camera 2.
[0061] In step SA8, the interface unit 40c outputs the distance measurement result (working distance) in step SA5, the field of view size calculated in step SA6, and the pixel resolution calculated in step SA7 to the image processing controller 3 via the input / output terminal 60. Then, the control unit 5a displays the field of view size in the field of view size display area 105c of the display screen 100, displays the pixel resolution in the pixel resolution display area 105d, and displays the working distance in the WD display area 105e, as shown in Fig. 9, for example.
[0062] In this embodiment, the temperature characteristic of the focus motor 56f is corrected. That is, in order to prevent the origin of the focus motor 56f from shifting due to temperature, even the excitation angle of the focus motor 56f is adjusted when returning to the origin. As a result, even if the origin return position shifts due to the variation of the electrical signal, the origin does not shift even by one pulse by adjusting the excitation pattern, and as a result, the distance measurement accuracy is improved.
[0063] (Downscaling) Next, downscaling will be described. The imaging control unit 31b of the imaging unit 2A is configured to perform downscaling on a captured image corresponding to an output area, which is the entire or partial area of the pixel group (the field of view range of the image sensor 31) of the photoelectric conversion unit 31a, to generate a work image having a smaller number of pixels than the captured image. The work image generated by performing downscaling is output to the processor 41, etc. Here, downscaling refers to a process of lowering the pixel resolution of the target captured image.
[0064] The concept of downscaling will be described with reference to FIG. 10. FIG. 10 is a schematic diagram showing a case where a workpiece W is imaged by an industrial camera 2. For example, assume that the number of pixels of the photoelectric conversion unit 31a is 20 MP (megapixels) (in the drawing, it is simply written as 20M, etc.). As shown on the left side of FIG. 10, by optical zooming, the field of view becomes narrower than the normal field of view, and the region of interest (ROI) becomes even narrower than the field of view after optical zooming. As shown on the right side of FIG. 10, when a region of interest is cut out from an image A1 captured with a pixel count of 20 MP, the pixel resolution remains the same, and the region of interest A2 has a pixel count of 5 MP, for example. Similarly, when a region of interest is cut out from an image A3 captured after optical zooming, the pixel resolution remains the same, and the region of interest A4 has a pixel count of 5 MP.
[0065] When downscaling from the captured image A1, the downscaling magnification can be set arbitrarily. The scaling magnification can be calculated, for example, by the calculation unit 41a. Specifically, the calculation unit 41a calculates a downscaling magnification based on the number of pixels corresponding to the entire field of view range of the captured image A1 and the number of pixels corresponding to the output area, and when an image with the same field of view as an image captured at 20 MP is output at 10 MP, for example, the scaling magnification is 2x.
[0066] Downscaling can be performed with the aspect ratio of the image kept constant, or can be performed by changing the aspect ratio of the image. When the aspect ratio of the image remains constant, as described above, for example, when an image of the same field of view as an image captured at 20 MP is output at 10 MP, the scaling factor is 2x. On the other hand, when the aspect ratio of the image is changed, for example, when an image captured at 5000 x 4000 pixels at 20 MP is output at 2500 x 2000 pixels at 5 MP with the same field of view, the scaling factor is 4x. Also, when a region of interest of 3200 x 4000 is downscaled to 2000 x 2500, the scaling factor is 2.56x.
[0067] If the aspect ratio of the image is kept constant and the scaling factor is set to, for example, 4x, an entire workpiece image A5 with a pixel count of 5 MP is obtained. By combining optical zoom and downscaling on image A5, an area of interest A4 with a higher pixel resolution than image A5 is obtained. In addition, by downscaling captured image A3 after optical zoom, a workpiece image A6 with a lower pixel resolution than captured image A3 is obtained.
[0068] 11 is a diagram for explaining downscaling based on an image of a specific workpiece W. The workpiece image corresponding to the output area, which is the entire pixel group of the photoelectric conversion unit 31a, i.e., the entire area of the field of view of the imaging unit 2A, is defined as a first workpiece image B1. The imaging control unit 31b downscales the first workpiece image B1 at an arbitrary first scaling factor to generate a workpiece image B2 having a first pixel count (e.g., 1.6 MP) smaller than the pixel count (e.g., 20 MP) of the first workpiece image B1.
[0069] The interface unit 40c can accept the designation of the output area in the field of view of the photoelectric conversion unit 31a, i.e., the imaging unit 2A. For example, the interface unit 40c is configured to be able to accept a first zoom instruction from a user to change the output area of the photoelectric conversion unit 31a to a relatively small area. Specifically, the first zoom instruction changes the output area to a part of the pixel group of the photoelectric conversion unit 31a, i.e., a part of the field of view of the imaging unit 2A. The second work image B1' is a work image corresponding to the output area after being changed by the first zoom instruction. The second work image B1' is captured at a different timing from the first work image B1, and is independent of the first work image B1. The imaging control unit 31b downscales the second work image B1' at a second scaling magnification to generate a work image B3 having a first pixel number (e.g., 1.6 MP) smaller than the pixel number (e.g., 5 MP) of the second work image B1'. The second workpiece image B1' may be generated based on the first workpiece image B1, for example, by cutting out a part of the first workpiece image B1. The interface unit 40c is configured to be able to accept an instruction to adjust the first zoom magnification not only to an integer but also to a decimal point.
[0070] The calculation unit 41a calculates a second scaling factor required to make the second workpiece image B1' corresponding to the changed output area within the field of view of the photoelectric conversion unit 31a have the above-mentioned first pixel count. The calculation unit 41a outputs the calculated second scaling factor to the imaging control unit 31b. The imaging control unit 31b generates a workpiece image B3 having the first pixel count by downscaling the second workpiece image B1' by the second scaling factor calculated by the calculation unit 41a. The workpiece image B3 having the first pixel count has a lower resolution than the first workpiece image B1 corresponding to the output area of the photoelectric conversion unit 31a, but has a resolution sufficient to ensure the necessary inspection accuracy, and no problem occurs in terms of inspection accuracy.
[0071] The calculation unit 41a calculates the ratio of one pixel of the workpiece image B3 having the first number of pixels to how many pixels of the second captured image B1' correspond to, based on the first zoom magnification received by the interface unit 40c. Using this ratio, the calculation unit 41a calculates the second scaling magnification.
[0072] When the interface unit 40c receives an instruction to adjust the first zoom magnification with decimal precision, the calculation unit 41a calculates, to the decimal point, the ratio of one pixel of the workpiece image B3 to how many pixels of the second captured image B1' correspond to, based on the zoom magnification for which the adjustment instruction was received with decimal precision. As a result, the calculation unit 41a calculates the second scaling magnification with decimal precision. The imaging control unit 31b generates a workpiece image based on the second scaling magnification calculated with decimal precision.
[0073] The calculated downscaling magnification is used when calculating the field of view size described above. Also, as shown by reference numeral 130 in FIG. 11, a frame 130 for designating a partial area that is a part of the field of view of the imaging unit 2A can be superimposed on the downscaled work image B3. The position, aspect ratio, and size of this frame 130 can be freely changed by operating the operation unit 7, similar to the frame 120 shown in FIG. 6. This makes it possible to designate a partial area on the downscaled work image B3. Note that the downscaling function does not have to be provided.
[0074] (Effects of the embodiment) As described above, according to this embodiment, when a user specifies a partial area that is part of the field of view of the imaging unit 2A, the AF control unit 40b moves the fourth lens group 24, which is a focusing lens group, in the optical axis direction by the focusing motor 56f so that the partial area is in focus.
[0075] When the adjustment of the lens position is completed, the distance to the position of the workpiece W corresponding to the partial area of the field of view of the imaging unit 2A is calculated as the working distance by the distance measuring unit 40d based on the focused lens position and the focal length of the imaging unit 2A. When the distance is calculated by the distance measuring unit 40d, the field of view size of the partial area that is a part of the field of view of the imaging unit 2A is calculated by the calculation unit 41a based on the calculated distance and the camera parameters. Therefore, by using the distance calculated by the distance measuring unit 40d, it is possible to obtain the field of view size of the area that the user wants to inspect and the pixel resolution calculated based on the field of view size without adding an expensive ToF sensor. The calculated field of view size and pixel resolution can be presented to the user by displaying them on the monitor 8. By displaying the pixel resolution, the user can easily determine whether the pixel resolution is appropriate for the size of the flaw to be inspected and the dimensions to be measured.
[0076] Furthermore, according to one aspect of this embodiment, it is possible to calculate the distance to the position of the workpiece corresponding to a partial region of the field of view rather than the entire field of view. Therefore, even if the workpiece includes an area with a large difference in elevation, the field of view size and pixel resolution of the inspection location can be calculated with higher accuracy by aligning the partial region with the inspection location.
[0077] The above-described embodiment is merely illustrative in all respects and should not be construed as limiting. Furthermore, all modifications and variations within the scope of the claims are within the scope of the present invention. [Industrial Applicability]
[0078] As described above, an industrial camera according to the present disclosure can be used, for example, to generate workpiece images for image inspection. [Explanation of symbols]
[0079] 2. Industrial Cameras 7 Control section 8 Monitor (display) 24 Fourth lens group (focus lens group) 31 Image Sensor 39 Memory section 40b AF control section (focus adjustment section) 40c Interface section 40d distance measuring section 41a Arithmetic unit 56f Focus motor (lens drive unit)
Claims
1. An industrial camera for capturing an image of a workpiece to be inspected and generating a workpiece image, An imaging unit having an image sensor and a focusing lens group consisting of a non-telecentric lens, for generating a workpiece image; a storage unit that stores camera parameters including a focal length of the imaging unit and a number of pixels and a size of the image sensor; a lens driving unit that adjusts the lens positions of the focusing lens group; a focus adjustment unit that controls the lens driving unit to determine a lens position where focus is achieved based on a partial area that is a part of the field of view of the imaging unit; A distance measuring unit that calculates a distance to a position of the workpiece corresponding to the partial area based on the focal length and the focused lens position determined by the focus adjustment unit; a calculation unit that calculates a field of view size in the partial region based on the distance calculated by the distance measuring unit and the camera parameters stored in the memory unit.
2. 2. The industrial camera according to claim 1, the calculation unit calculates a first number of pixels of the image sensor corresponding to the partial region, and calculates a pixel resolution in the partial region based on the first number of pixels and the field of view size; The industrial camera further comprises an interface unit for displaying the pixel resolution calculated by the calculation unit on a display unit.
3. 3. The industrial camera according to claim 2, The focus adjustment unit calculates high-frequency components contained in the partial region of the work image, and determines the in-focus lens position based only on the high-frequency components.
4. 3. The industrial camera according to claim 2, The interface unit is configured to display a workpiece image generated by the imaging unit on a display unit and to accept designation of the partial area in the workpiece image from a user, in an industrial camera.
5. 3. The industrial camera according to claim 2, Further comprising a zoom optical system capable of electrically controlling optical zoom, the interface unit is configured to be able to receive an instruction to start distance measurement from a user, When the zoom optical system receives an instruction to start distance measurement from a user via the interface unit, the zoom optical system sets an optical magnification to a predetermined threshold value or more; The distance measuring unit calculates a distance to a position of the workpiece corresponding to the partial area of the workpiece, based on a lens position at which the focus is achieved determined by the focus adjustment unit and a focal length corresponding to the optical magnification, for the partial area in the workpiece image zoomed by the set optical magnification, The calculation unit calculates the field of view size in the partial area in the zoomed work image based on the distance calculated by the distance measuring unit and the camera parameters stored in the memory unit.
6. 3. The industrial camera according to claim 2, The imaging unit is configured to generate an image having a larger number of pixels than the workpiece image, and to generate a workpiece image having a smaller number of pixels than the image by downscaling an image corresponding to an output area which is a whole or part of the field of view range of the imaging unit; The calculation unit calculates a downscaling magnification based on the number of pixels corresponding to the entire field of view range of the captured image and the number of pixels corresponding to the output area, and calculates the field of view size in the partial area based on the distance calculated by the distance measuring unit, the camera parameters, and the downscaling magnification.
Citation Information
Patent Citations
Image inspection system and image inspection method
JP2020169958A
