Industrial cameras and image inspection equipment
The industrial camera system with alignment light, distance measurement, and output instructions facilitates accurate camera installation by non-specialized personnel, addressing the challenge of replicating optical conditions during image inspection.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- KEYENCE CORP
- Filing Date
- 2022-05-26
- Publication Date
- 2026-06-18
AI Technical Summary
In image inspection, there is a challenge in ensuring that the optical conditions set by specialized personnel are accurately replicated during camera installation by non-specialized personnel, leading to inefficiencies in the installation process.
An industrial camera system that includes an aimer for alignment light, a distance measuring unit, and an output unit to generate installation instructions, allowing non-specialized personnel to correctly install cameras by following the instructions, which may also include attitude information and zoom settings.
Enables accurate and efficient camera installation by non-specialized personnel, ensuring that optical conditions are met, simplifying the installation process and improving the reliability of image inspection.
Smart Images

Figure 0007875729000001 
Figure 0007875729000002 
Figure 0007875729000003
Abstract
Description
【Technical Field】 【0001】 The present disclosure relates to an industrial camera and an image inspection apparatus that generate an inspection target image obtained by imaging an inspection target such as a workpiece. 【Background Art】 【0002】 Conventionally, as disclosed in Patent Document 1 for example, an image inspection system configured to determine the quality of an inspection target based on an inspection target image obtained by imaging the inspection target is known. The image inspection system disclosed in Patent Document 1 enables a multi-stage process to be performed in sequence on an imaging device conforming to a standardized specification, achieving both an improvement in the degree of freedom in selecting the model of the imaging device and an improvement in the accuracy of image inspection. 【Prior Art Documents】 【Patent Documents】 【0003】 【Patent Document 1】 Japanese Patent Application Laid-Open No. 2020-169958 【Summary of the Invention】 【Problems to be Solved by the Invention】 【0004】 By the way, in the field of image inspection, specialized knowledge is required to set the optical conditions of a camera, and the person in charge of condition setting who has such specialized knowledge may be different from the person in charge of camera installation who installs the camera on site. The person in charge of condition setting designs the optical conditions of the camera, for example, in a bench test and conveys them to the person in charge of camera installation on site. However, when the person in charge of camera installation on site installs the camera, it is not easy to make the installation conditions the same as those in the bench test. It is inefficient for the person in charge of condition setting to move to the site for camera installation, so it is desired that even a person in charge of camera installation on site without specialized knowledge can install the camera correctly. 【0005】 This disclosure is made in view of the above points, and its purpose is to enable field personnel with limited expertise in setting optical conditions to install cameras so that they meet the optical conditions set at the time of installation. [Means for solving the problem] 【0006】 To achieve the above objective, one aspect of this disclosure may be based on an industrial camera that captures an object to be inspected and generates an image of the object to be inspected. The industrial camera comprises an imaging unit for capturing an image of the object to be inspected and generating an image of the object to be inspected; an aimer for irradiating the object to be inspected with alignment light; and an output unit that outputs an installation instruction sheet including a reference image of the object to be inspected captured by the imaging unit and positional information of the alignment light that has been or should be irradiated onto the object to be inspected. When the industrial camera is installed, the aimer is configured to irradiate the object to be inspected with the alignment light. 【0007】 With this configuration, when installing industrial cameras on-site, the camera installer can easily and accurately determine, for example, where the alignment light should be directed onto the object being inspected by referring to the installation instructions. This simplifies the installation process of industrial cameras, as the industrial camera only needs to be positioned so that the alignment light actually emitted from the aimer illuminates the object being inspected as indicated in the installation instructions. 【0008】 The system may also further include a distance measuring unit for measuring the distance to the object to be inspected, and a main unit display unit for displaying the distance measured by the distance measuring unit. In this case, the installation instructions output by the output unit include the distance measured by the distance measuring unit, and the main unit display unit can display the distance to the object to be inspected when installing the industrial camera, so that the person in charge of camera installation can install the industrial camera while referring to the distance information. 【0009】 Furthermore, the system may also be equipped with an acceleration sensor to acquire attitude information of the industrial camera. In this case, the installation instructions output by the output unit will include the attitude information acquired by the acceleration sensor, and the main unit's display unit will be able to display the attitude information when installing the industrial camera, allowing the camera installer to install the industrial camera while referring to the attitude information. 【0010】 Furthermore, the alignment light is displayed on the reference image in a simulated position where it is expected to be illuminated onto the object being inspected when the aimer emits light. Therefore, by superimposing the alignment light onto the reference image, it can be made even easier to understand. 【0011】 The system may also include an interface unit for receiving instructions to create installation instructions. When the interface unit receives instructions to create installation instructions, it can control the zoom lens to zoom out, and then control the imaging unit to generate a reference image with an enlarged field of view. 【0012】 Furthermore, the industrial camera may further include an interface unit that accepts input from the user as a required specification, such as field of view size or pixel resolution, and a calculation unit that calculates a zoom magnification that satisfies the required specification at a predetermined installation distance. In this case, the output unit can output the predetermined installation distance used to calculate the zoom magnification that satisfies the required specification as a distance included in the installation instructions, and can also output a reference image taken at the predetermined installation distance as a reference image for the installation instructions. 【0013】 Furthermore, the system can be based on an image inspection device that can connect to multiple industrial cameras. The system can select which industrial camera will output installation instructions from among the multiple industrial cameras connected to the device, and can send an instruction signal to the selected industrial camera to output the installation instructions. This allows for the acquisition of installation instructions for the desired industrial camera. 【0014】 Furthermore, information specific to industrial cameras connected to the image inspection system can be viewed via a web browser. 【0015】 In addition, when the industrial camera is connected to the image inspection device via a cable in which a plurality of wirings are bundled, the information of the wirings constituting the cable is included in the installation instruction manual, making the cable connection work easier. 【Effect of the Invention】 【0016】 As described above, since it is possible to output an installation instruction manual including a reference image of the inspection object and the position information of the light for alignment, even an on-site person in charge lacking expertise regarding the setting of optical conditions can install the camera so as to achieve the optical conditions at the time of setting. 【Brief Description of the Drawings】 【0017】 [Figure 1] It is an overall view showing the usage state of an image inspection system equipped with an industrial camera according to an embodiment. [Figure 2] It is a perspective view of the industrial camera seen from above. [Figure 3] It is a front view of the industrial camera. [Figure 4] It is a side view of the industrial camera. [Figure 5] It is a perspective view of the industrial camera seen from below. [Figure 6] It is a cross-sectional view showing the internal structure of the industrial camera. [Figure 7] It is a block diagram of the image inspection system. [Figure 8] It is a diagram for explaining the concept of downscaling. [Figure 9] It is a diagram for explaining the case of performing downscaling based on an image of a specific work captured. [Figure 10] It is a diagram for explaining the case of performing downscaling based on a zoom instruction at an arbitrary position. [Figure 11] It is a diagram showing an example of a user interface screen for receiving a zoom instruction or the like. [Figure 12] It is a diagram for explaining the case of performing downscaling based on a zoom instruction by area selection using a mouse. [Figure 13] This is a diagram for explaining the case of performing downscaling after panning and tilting to an arbitrary position. [Figure 14] This is a diagram for explaining the case of performing downscaling while changing the aspect ratio of an image. [Figure 15] This is a diagram for explaining the case of performing panning and tilting after downscaling centered on a fixed position. [Figure 16] This is a diagram for explaining the case of a zoom ratio that can be handled only by downscaling. [Figure 17] This is a diagram for explaining the case of handling with downscaling and optical zoom. [Figure 18] This is a diagram for explaining an example of the case of combining optical zoom and downscaling. [Figure 19] This is a diagram for explaining an example of the case of changing only the aspect ratio during downscaling. [Figure 20] This is a diagram for explaining an example of the case of increasing or decreasing the number of pixels during downscaling. [Figure 21] This is a diagram for explaining an example of the case of generating an image of an inspection target after rotation. [Figure 22] This is a diagram showing an example of the case of realizing downscaling by a processor. [Figure 23] This is a conceptual diagram of the case of downscaling a color captured image. [Figure 24] This is a diagram showing the procedure for downscaling a color captured image. [Figure 25] This is a diagram showing an example of interpolation processing and downscaling of each pixel constituting a color captured image. [Figure 26] This is a diagram for explaining the case when a low-pass filter is applied. [Figure 27] This is a flowchart showing an example of the processing procedure when a zoom ratio is input. [Figure 28] This is a flowchart showing an example of the processing procedure when a visual field resolution is specified. [Figure 29]This is a flowchart showing an example of the pan-tilt processing procedure. [Figure 30] This flowchart shows an example of the procedure for changing the aspect ratio. [Figure 31] This diagram illustrates the general functionality of the installation instruction sheet output feature. [Figure 32] This figure shows an example of the user interface screen that appears before starting the installation instruction output function. [Figure 33] This is a diagram showing an example of a utility screen. [Figure 34] This is a diagram showing an example of a camera selection screen. [Figure 35] This figure shows an example of an installation information display screen. [Figure 36] This figure shows an example of a printable window. [Figure 37] This figure shows an example of a display screen when connection information is shown. [Modes for carrying out the invention] 【0018】 Embodiments of the present invention will be described in detail below with reference to the drawings. The following description of preferred embodiments is essentially illustrative and is not intended to limit the present invention, its applications, or its uses. 【0019】 Figure 1 is an overall view showing the usage state of an image inspection system 2 equipped with an industrial camera 1 according to an embodiment of the present invention. The image inspection system 2 shown in Figure 1 comprises two industrial cameras 1 and a control personal computer (hereinafter referred to as a controller) 3. The number of industrial cameras 1 is not limited to two; there may be one or three or more. The industrial camera 1 has a shape as shown in Figures 2 to 5, etc., which will be described in detail later, and has an internal structure as shown in Figure 6. This industrial camera 1 generates an inspection target image obtained by imaging a workpiece W, which is the object to be inspected. The image inspection system 2 including the industrial camera 1 that generates such an inspection target image can also be called an image processing device. 【0020】 Although not shown in the diagram, the industrial camera 1 is capable of receiving trigger signals output from, for example, a programmable logic controller or a sensor that detects the arrival of the workpiece W. Upon receiving a trigger signal, the industrial camera 1 performs imaging processing to generate an image of the object to be inspected. Alternatively, the industrial camera 1 may repeatedly perform imaging processing internally to generate an image of the object to be inspected without receiving a trigger signal from an external source. Although not shown in the diagram, the image inspection system 2 may also include an illumination unit for illuminating the workpiece W, and the illumination unit is controlled to illuminate the workpiece W in synchronization with the imaging processing of the industrial camera 1. 【0021】 In this example, as shown in Figure 1, we will describe a site where the industrial camera 1 is used, where multiple workpieces W are sequentially transported by a conveying device such as a belt conveyor B. However, it may also be a site where stationary workpieces W are inspected. The industrial camera 1 is attached to the camera mounting member 4 and is installed in a predetermined position and orientation. 【0022】 The controller 3 is used to configure various settings for the industrial camera 1, and can be configured as, for example, a desktop personal computer, a notebook personal computer, or a dedicated processing unit for image inspection; its form is not particularly limited. The controller 3 comprises a main unit 5, a storage unit 6, a keyboard 7, a mouse 8, and a monitor 9. The main unit 5 is connected to the industrial camera 1 via a cable 10 for communication. The main unit 5 is equipped with a control unit 5a, which consists of a central processing unit, ROM, RAM, etc. The storage unit 6 is composed of a hard disk drive or a solid-state drive, and stores programs for operating the control unit 5a, setting information for the industrial camera 1, various images, etc. Part of the storage unit 6 may be located in the industrial camera 1, in which case the setting information and various images of the industrial camera 1 can be stored in the industrial camera 1. 【0023】 The keyboard 7 and mouse 8 are operating units for operating the controller 3, and the operating status of the keyboard 7 and mouse 8 is detected by the control unit 5a. The operating units are not limited to the keyboard 7 and mouse 8, but may also be so-called touch panel type operating units. The monitor 9 is composed of, for example, a liquid crystal display device, and is controlled by the control unit 5a to display various user interfaces for setting the industrial camera 1, various images, etc. 【0024】 (Industrial camera configuration) As shown in Figure 6, the industrial camera 1 comprises a lens unit 20, a sensor board 30, a main board 40, a housing 50, and a storage unit 39. The storage unit 39 stores setting information, various images, and other data for the industrial camera 1. 【0025】 The housing 50 is made of a highly rigid material such as an aluminum alloy. For the sake of explanation, the vertical, horizontal, and front-to-back directions are defined as shown in Figures 2 to 5, but this does not limit the orientation during use, and the industrial camera 1 can be used in any orientation. 【0026】 As shown in Figure 7, an acceleration sensor 32 is attached to the industrial camera 1. The acceleration sensor 32 is a sensor for acquiring information about the attitude of the industrial camera 1, and can measure, for example, the tilt in the vertical direction and the tilt in the horizontal direction. Specifically, by using the acceleration sensor 32, angles such as pitch, tilt, and roll are calculated based on the difference from a reference point, and information about the attitude of the industrial camera 1 is acquired from the calculation results. 【0027】 The housing 50 has an upper portion 51 and a lower portion 52. The upper portion 51 is longer in the front-to-back direction than the lower portion 52. The lower portion 52 is formed to protrude downward from the rear of the upper portion 51. As shown in Figures 2 and 3, a light-receiving window 51a is formed on the front of the upper portion 51. Also, as shown in Figure 6, the lens unit 20 and the sensor substrate 30 are housed in the upper portion 51, and the main substrate 40 is housed in the lower portion 52. In other words, the housing 50 incorporates the image sensor 31, processor 41, and output unit 42, which will be described later. 【0028】 The lens unit 20 is a zoom lens equipped with a zoom optical system that allows for motorized optical zooming, and the optical zoom magnification can be switched to any magnification within a predetermined range. The lens unit 20 is fixed to the housing 50 and is integrated with the housing 50. 【0029】 In other words, the optical axis of the lens unit 20 coincides with the front-to-back direction of the housing 50. 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 constitute a condensing lens that collects light incident from the light-receiving window 51a. Furthermore, the number of lenses constituting 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 fewer, or six or more. In addition, the lens unit 20 may be a zoom optical system that allows manual optical zooming. 【0030】 The first lens group 21 is a fixed lens group located on the front of the housing 50 and receives reflected light from the workpiece W. The first lens group 21 faces the outside of the housing 50 through the light-receiving window 51a. The second lens group 22 is a movable zoom lens group located 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 located behind the second lens group 22 and receives light emitted from the second lens group 22. The fourth lens group 24 is a movable focus lens group located 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 located behind the fourth lens group 24 and receives light emitted from the fourth lens group 24. 【0031】 The lens barrel 26 is equipped with a zoom ball screw 56a, a zoom guide shaft 56b, and a zoom motor 56c that rotates 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. 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 the desired zoom magnification. The zoom ball screw 56a, zoom guide shaft 56b, and zoom motor 56c constitute a zoom lens drive mechanism that drives the second lens group 22 in the optical axis direction and adjusts the optical magnification. 【0032】 Furthermore, the lens barrel 26 is equipped with a focusing ball screw 56d, a focusing guide shaft 56e, and a focusing motor 56f that rotates 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 adjusting the focus. The focusing ball screw 56d, the focusing guide shaft 56e, and the focusing motor 56f constitute a zoom lens drive mechanism that drives the fourth lens group 24 in the optical axis direction to adjust the focal position. 【0033】 The industrial camera 1 is equipped with an aimer 29 that emits alignment light towards the workpiece W. The aimer 29 has a light source, such as a light-emitting diode, and is controlled by a processor 41. For example, when the industrial camera 1 is installed on-site, if the image inspection system 2 is set to setting mode and instructed to turn on the aimer 29, the processor 41 lights up the aimer 29, which emits alignment light towards the workpiece W, while turning off the aimer 29 during operation. 【0034】 The Aimer 29 can be constructed using, for example, a pointer, in which case a point-shaped light is emitted as the alignment light. The alignment light may also be in a shape other than a point, such as a linear light, an annular light, or a light in any combination thereof. The color of the alignment light can be a color other than natural light, such as red, green, or blue, but is not limited to these; it is sufficient as long as the difference from natural light is discernible to the naked eye. 【0035】 As shown in Figure 7, the main board 40 is provided with a zoom control unit 40a, an AF control unit 40b, and an interface unit 40c. The interface unit 40c is a part that receives external inputs such as zoom commands. When the interface unit 40c receives a zoom command 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 to achieve the zoom magnification received by the interface unit 40c. 【0036】 The AF control unit 40b is the part that performs conventionally known contrast-type or phase-detection-type autofocus control. 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 that of the workpiece W. 【0037】 The industrial camera 1 is equipped with a distance measuring unit 43 that measures the installation distance, which is the distance to the object to be inspected. The installation distance is the distance from the industrial camera 1 to the workpiece W. The distance measuring unit 43 may be, for example, a TOF (Time Of Flight) sensor, or it may be configured to measure the installation distance based on the focusing information acquired by the AF control unit 40b of the industrial camera 1, or it may be configured to obtain the installation distance based on a value entered by the user using a keyboard 7 or mouse 8. 【0038】 Furthermore, the industrial camera 1 is equipped with a main display unit 49. The main display unit 49 is composed of a display device capable of displaying numbers, symbols, graphics, etc., such as an LCD panel or an OLED panel. The main display unit 49 is controlled by the processor 41 and displays the distance (installation distance) measured by the distance measuring unit 43. In this example, as shown in Figure 2, the main display unit 49 is provided on the top surface of the housing 50. The main display unit 49 may also be provided on the side, front, back, bottom, etc. 【0039】 As shown in Figure 6, the sensor substrate 30 is positioned behind the fifth lens group 25. An image sensor 31, which acts as an imaging unit, is mounted on the sensor substrate 30. As shown in Figure 7, the image sensor 31 includes a photoelectric conversion unit 31a that receives light focused by a condensing lens, a logic unit 31b that generates an inspection target image from the image acquired by the photoelectric conversion unit 31a, and a color filter 31c (shown in Figure 6), enabling the generation of a color inspection target image obtained by imaging the object to be inspected. The photoelectric conversion unit 31a and the color filter 31c enable the generation of a color image where each color is formed in a predetermined arrangement pattern. The photoelectric conversion unit 31a can also generate a monochrome image. The following description applies to both monochrome and color images. 【0040】 The photoelectric conversion unit 31a is capable of generating an image with a larger number of pixels than the image to be inspected. The logic unit 31b is mounted on the same chip as the photoelectric conversion unit 31a and constitutes the image generation unit. Specifically, the photoelectric conversion unit 31a is a CMOS image sensor, composed of a stack of multiple wafers, and the logic unit 31b is formed from a portion of these wafers. The portion of the wafer may include memory or the like. 【0041】 Furthermore, the photoelectric conversion unit 31a is a CMOS image sensor using either a global shutter or a rolling shutter method. In the case of a global shutter method, distortion-free images can be captured even for moving objects. In the case of a rolling shutter method, high pixel count can be achieved with about half the pixel pitch of the global shutter method, which allows for miniaturization of the lens size of each lens in the lens unit 20, and consequently, miniaturization of the housing 50, improving the flexibility of 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. 【0042】 The logic unit 31b generates an inspection target image with a smaller number of pixels than the captured image by performing downscaling on the captured image corresponding to the output area, which is all or part of the pixel group (field of view of the image sensor 31) of the photoelectric conversion unit 31a, and outputs the inspection target image. Here, downscaling refers to the process of reducing the pixel resolution of the target image. 【0043】 The concept of downscaling will be explained based on Figure 8. Figure 8 schematically shows the case where a workpiece W is imaged by an industrial camera 1. For example, suppose the number of pixels of the photoelectric conversion unit 31a is 20MP (megapixels) (in the drawing, this is simply indicated as 20M, etc.). As shown on the left side of Figure 8, by optical zooming, the field of view becomes narrower than the normal field of view, and the region of interest (ROI) becomes an even narrower area than the field of view after optical zooming. As shown on the right side of Figure 8, if the region of interest is extracted from the image A1 captured with 20MP pixels, the pixel resolution remains the same, and the region of interest becomes, for example, a region of interest A2 with 5MP pixels. Similarly, if the region of interest is extracted from the image A3 after optical zooming, the pixel resolution remains the same, and the region of interest becomes a region of interest A4 with 5MP pixels. 【0044】 When downscaling from captured image A1, the scaling factor (also called the downscaling ratio) can be set arbitrarily. The scaling factor can be calculated by dividing the number of captured pixels by the number of output pixels. For example, if you want to output an image with the same field of view as an image captured at 20MP at 10MP, the scaling factor will be 2x. 【0045】 Downscaling can be performed while keeping the aspect ratio of the image constant, or while changing the aspect ratio. When the aspect ratio is kept constant, as mentioned above, for example, if you output an image with the same field of view as an image captured at 20MP at 10MP, the scaling factor will be 2x. On the other hand, if you change the aspect ratio, for example, if you output an image captured at 5000x4000 pixels (20MP) with the same field of view at 2500x2000 pixels (5MP), the scaling factor will be 4x. Also, if you downscale a 3200x4000 area of interest to 2000x2500, the scaling factor will be 2.56x. 【0046】 If the aspect ratio of the image remains constant and the scaling factor is set to, for example, 4x, then an image of the entire workpiece, A5, with 5MP pixels, is obtained. By using optical zoom and downscaling in combination with image A5, a focus area A4 with higher pixel resolution than image A5 can be obtained. Furthermore, by downscaling from the image A3 captured after optical zoom, a workpiece image A6 with lower pixel resolution than image A3 can be obtained. 【0047】 Figure 9 is a diagram illustrating downscaling based on an image of a specific workpiece W. The first image B1 is the image corresponding to the output region, which is the entire area of the field of view of the imaging unit, i.e., the entire area of the field of view of the imaging unit. The logic unit 31b downscales the first image B1 by an arbitrary first scaling factor to generate an inspection target image B2 with a first number of pixels (e.g., 1.6MP) smaller than the number of pixels of the first image B1 (e.g., 20MP). 【0048】 The interface unit 40c can receive a specification for an output area, which is the area to be output as an image to be inspected within the field of view of the photoelectric conversion unit 31a, i.e., the imaging unit. This output area may be, for example, the area of interest explained using Figure 8. The interface unit 40c can also receive an instruction to change at least one of the position, size, and shape of the output area. 【0049】 For example, the interface unit 40c is configured to receive a first zoom instruction from the user to change the output area of the photoelectric conversion unit 31a to a relatively smaller area. Specifically, the first zoom instruction changes the output area to a part of the pixel group of the photoelectric conversion unit 31a, that is, a part of the field of view of the imaging unit. The second image B1' is an image corresponding to the output area after it has been changed by the first zoom instruction. The second image B1' is captured at a different timing than the first image B1 and is independent of the first image B1. The logic unit 31b downscales the second image B1' by a second scaling factor to generate an inspection target image B3 with a first pixel count (e.g., 1.6MP) that is smaller than the pixel count of the second image B1' (e.g., 5MP). Alternatively, the second image B1' may be generated based on the first image B1, for example, by cropping a part of the first image B1. Furthermore, the interface unit 40c is configured to accept instructions to adjust the first zoom magnification not only as an integer but also with decimal precision. 【0050】 As shown in Figure 7, the main board 40 is equipped with a processor 41 that performs various calculations and controls the image sensor 31. The processor 41 has an arithmetic unit 41a, and based on the results calculated by the arithmetic unit 41a, the processor 41 controls the logic unit 31b of the image sensor 31 and causes the logic unit 31b to generate the desired inspection target image. 【0051】 The calculation unit 41a calculates a second scaling factor necessary to make the second captured image B1', which corresponds to the modified output area within the field of view of the photoelectric conversion unit 31a, have the first number of pixels. The calculation unit 41a outputs the calculated second scaling factor to the logic unit 31b. The logic unit 31b generates the inspection target image B3 with the first number of pixels by downscaling the second captured image B1' with the second scaling factor calculated by the calculation unit 41a. The inspection target image B3 with the first number of pixels has a lower resolution than the first captured image B1, which corresponds to the output area of the photoelectric conversion unit 31a, but it has enough resolution to ensure the necessary inspection accuracy, and no problems arise in terms of inspection accuracy. 【0052】 The calculation unit 41a calculates that the higher the first zoom magnification received by the interface unit 40c, the smaller the second scaling magnification. The logic unit 31b reduces the amount of downscaling for the second captured image B1' as the second scaling magnification calculated by the calculation unit 41a becomes smaller. As a result, the logic unit 31b generates an inspection target image with high pixel resolution. 【0053】 Based on the first zoom magnification received by the interface unit 40c, the calculation unit 41a calculates the ratio of how many pixels in the second captured image B1' correspond to one pixel of the first pixel-count inspection image B3. Using this ratio, the calculation unit 41a calculates the second scaling magnification. 【0054】 When the interface unit 40c receives an adjustment instruction for the first zoom magnification with decimal precision, the calculation unit 41a calculates, to the decimal extent, the ratio of how many pixels in the second image B1' correspond to one pixel of the image B3 under inspection, based on the zoom magnification adjustment instruction received with decimal precision. This allows the calculation unit 41a to calculate the second scaling magnification with decimal precision. The logic unit 31b generates the image under inspection based on the second scaling magnification calculated with decimal precision. 【0055】 Figure 10 illustrates the case where downscaling is performed based on a zoom instruction at an arbitrary position. The interface unit 40c is configured to accept a first zoom instruction, which changes the output area of the photoelectric conversion unit 31a to a relatively smaller area, as a zoom instruction at an arbitrary position in the image to be inspected. Specifically, for the sake of explanation, the frame C1 in the captured image B1 in Figure 10 indicates the position and area where the zoom instruction was received within the field of view of the imaging unit. The user may specify frame C1 relative to the image to be inspected B2 via a mouse 8 or the like while checking the monitor 9 which displays the downscaled image to be inspected B2 of the entire captured image B1 in Figure 9. The position of frame C1 can be placed anywhere in the image to be inspected B2 (i.e., within the field of view of the imaging unit), and the interface unit 40c detects the placed position. The size and shape of frame C1 can also be arbitrarily set by the user. 【0056】 When the interface unit 40c receives a zoom command specifying frame C1 as an arbitrary position, the logic unit 31b downscales the area corresponding to the output area including the arbitrary position within the field of view of the imaging unit (i.e., the captured image corresponding to frame C1, which has a pixel count greater than 1.6MP) by the scaling factor required to make it 1.6MP. As a result, the logic unit 31b generates an inspection target image B4 that includes the arbitrary position. The position of frame C1 may be shifted in the X direction (horizontal direction of the image) or Y direction (vertical direction of the image) from the center of the field of view of the imaging unit, and the area located at a position offset from the center of the field of view of the imaging unit, i.e., the optical axis, can be downscaled. In other words, while general optical zoom zooms along the optical axis center, in this example, not only the optical axis center but also areas offset from the optical axis center can be zoomed, and there is a high degree of freedom in setting the position of the downscaleable area. 【0057】 Figure 11 shows a user interface screen 100 for settings that can accept zoom commands. This user interface screen 100 is generated by the control unit 5a of the controller 3 and displayed on the monitor 9. On the user interface screen 100, operation is possible using the keyboard 7 and mouse 8, and the control unit 5a detects and stores what operations have been performed. 【0058】 The user interface screen 100 is provided with an image display area 101. The image display area 101 displays an overhead image D1 showing the position of the output area within the entire field of view of the photoelectric conversion unit 31a, and an inspection target image D2 corresponding to the output area. In other words, the interface unit 40c of the industrial camera 1 shown in Figure 7 is configured to output the overhead image D1 showing the position of the output area within the entire field of view of the photoelectric conversion unit 31a, and the inspection target image D2 corresponding to the output area to the outside. Specifically, the main board 40 is provided with an output unit 42. The output unit 42 is the part that outputs the overhead image D1 and the inspection target image D2 output from the image sensor 31 to the outside. When outputting, image data is transmitted from the industrial camera 1 to the controller 3, for example, via the input / output terminal 60 and cable 10. 【0059】 The user interface screen 100 shown in Figure 11 is provided with a zoom adjustment area 101A for the user to adjust the zoom magnification. By operating the zoom adjustment area 101A to the "T" side with the mouse 8, the field of view is narrowed by zooming to the telephoto side, while operating it to the "W" side expands the field of view. The zoom magnification can also be adjusted by operating the mouse wheel 8. The adjusted zoom magnification is temporarily stored on the controller 3 side and transferred to the interface unit 40c of the industrial camera 1, where it is accepted. 【0060】 The zoom level can also be adjusted numerically. Specifically, the user interface screen 100 is provided with a numerical input area 102. The numerical input area 102 is for the user to adjust the zoom level by entering a numerical value, which can be entered arbitrarily using the keyboard 7, mouse 8, etc. 【0061】 Figure 12 illustrates the case where downscaling is performed based on zoom instructions using area selection with the mouse 8. Frame C10 is formed by the operation of the mouse 8, for example, by dragging from the upper left to the lower right (or from the upper right to the lower left, etc.). The logic unit 31b generates a 5MP inspection target image by downscaling the captured image corresponding to the area enclosed by frame C10. Similarly, frame C11 can also be formed by the operation of the mouse 8, and the area within frame C11 is enlarged. At this time, if the area within frame C11 in the captured image B1 is less than 5MP, and the size of the inspection target image to be output is 5MP, it exceeds the maximum resolution (resolution of captured image B1). Therefore, the 5MP area including frame C11 is downscaled at a scaling factor of 1x (i.e., not actually downscaled) and output as the inspection target image. 【0062】 Figure 13 illustrates the case where downscaling is performed after pan-tilting an arbitrary position. The interface unit 40c is configured to accept a first pan-tilt instruction to adjust an arbitrary position in the X and Y directions. For example, after designating the center of the field of view of the photoelectric conversion unit 31a as the area of interest with frame C1, the position of frame C1 is moved in the X and Y directions to the position indicated by, for example, symbol C1'. When downscaling is performed with frame C1, the inspection target image B5 is obtained. The logic unit 31b generates the inspection target image B5' with adjusted positions in the X and Y directions by downscaling the captured image corresponding to the arbitrary position (position of frame C1') after adjustment in the X and Y directions. The logic unit 31b generates the inspection target image B6 by further downscaling a part of the area enclosed by frame C1'. 【0063】 Adjustments in the X and Y directions can be made using the user interface screen 100 shown in Figure 11. The user interface screen 100 is provided with a field of view position adjustment area 103. The field of view position adjustment area 103 is composed of a combination of arrows pointing in the up, down, left, and right directions. For example, operating the upward-pointing arrow moves the position of frame C1 upwards. Similarly, the position of frame C1 can be adjusted to any position down, left, or right. Frame C1 can also be directly dragged with the mouse 8. 【0064】 Figure 14 illustrates the case of downscaling while the aspect ratio of an image has been changed. The interface unit 40c is configured to accept changes in the aspect ratio of the output area of the photoelectric conversion unit 31a. For example, as shown by frame C1, when a zoom instruction is received for any position within the field of view of the imaging unit, the logic unit 31b generates the inspection target image B7 by downscaling the captured image corresponding to frame C1. Subsequently, the user can freely specify the aspect ratio of the area specified by frame C1. The area after the aspect ratio has been changed is shown by frame C2. The logic unit 31b generates the inspection target image B7' by downscaling the area corresponding to the output area with the changed aspect ratio (the area enclosed by frame C2). From there, the inspection target image B7'' is generated by further downscaling a part of the area enclosed by frame C2. 【0065】 Figure 15 illustrates the case where downscaling is performed around a fixed point, followed by pan-tilt. For example, if the center of the field of view of the photoelectric conversion unit 31a is set as the fixed point, the logic unit 31b generates the inspection target image B5 by downscaling the frame C1 which includes the center of the field of view of the imaging unit. Then, as shown in Figure 13, pan-tilt is performed, and the logic unit 31b generates the inspection target image B8 by downscaling the captured image corresponding to the pan-tilt region. 【0066】 Furthermore, the interface unit 40c is configured to accept a pixel count change instruction to change the number of pixels in the image to be inspected from the first number of pixels to the second number of pixels. The second number of pixels is a larger number of pixels than the first number of pixels. Specifically, the user interface screen 100 shown in Figure 11 is provided with a pixel count setting area 104. In the pixel count setting area 104, the number of pixels in the image to be inspected can be selected from a predetermined set of options in the form of a pull-down menu. The selectable number of pixels can be, for example, in the range of 1.6MP to 5MP, but is not limited to this range. 【0067】 Furthermore, the aspect ratio can also be selected in the pixel count setting area 104. That is, the pull-down menu in the pixel count setting area 104 displays multiple options, each being a combination of the pixel count and aspect ratio of the image to be inspected. The user can select one of these options. Information regarding the selected pixel count is received by the interface unit 40c and sent to the processor 41 of the industrial camera 1 as a pixel count change instruction. 【0068】 When the processor 41 receives a pixel count change instruction, the calculation unit 41a calculates the scaling factor required to set the captured image corresponding to the same output area as before the pixel count change instruction as the second pixel count, within the field of view of the photoelectric conversion unit 31a. The scaling factor calculated by the calculation unit 41a is sent to the logic unit 31b, and the logic unit 31b generates an inspection target image with the second pixel count by downscaling the captured image by that scaling factor. If the aspect ratio is changed, the logic unit 31b generates an inspection target image with a changed aspect ratio by downscaling the area corresponding to the output area with the changed aspect ratio, within the field of view of the photoelectric conversion unit 31a. In other words, the logic unit 31b generates an inspection target image according to the combination of the pixel count and aspect ratio of the inspection target image selected in the pixel count setting area 104. 【0069】 Figure 16 illustrates the case where the zoom magnification can be handled by downscaling alone, i.e., where optical zoom is unnecessary. The upper part of Figure 16 shows the captured images E1 and E2, and the lower part shows the inspection target images E3 and E4. The field of view of the captured image E1 on the left and the captured image E2 on the right is kept constant, and signals from the black areas where the workpiece W does not exist are not read out in the captured image E2 on the right. As a result, the number of pixels in the captured image E1 on the left is 20MP, and the number of pixels in the captured image E2 on the right is 10MP. Downscaling the captured image E1 on the left with a scaling magnification of 4x yields the inspection target image E3 on the left. The inspection target image E3 on the left is an image obtained by outputting an area with 20MP of pixels with a number of pixels of 5MP. Also, since signals from the black areas of the captured image E2 on the right are not read out, it becomes possible to downscale it with a scaling magnification of 2x, yielding the inspection target image E4 on the right. The inspection target image E4 on the right is an image obtained by outputting an area with 10MP of pixels with a number of pixels of 5MP. Furthermore, by zooming in on the center of the image E3 on the left, a more detailed image E4 of the same subject can be obtained. 【0070】 In other words, even without using optical zoom, an inspection image E4 is obtained that displays the workpiece W enlarged while increasing the pixel resolution compared to the inspection image E3. In this specification, this zoom process is sometimes referred to as "sensor zoom". 【0071】 Figure 17 illustrates a situation where the zoom magnification exceeds a certain level, requiring both downscaling and optical zoom. The upper part of Figure 17 shows the captured image F1, the optically zoomed image F2, and the captured image F3, while the lower part shows the images to be inspected E4, E5, and E6. By optically zooming the area where the captured image F1 was generated, an optically zoomed image F2 with a narrow field of view is obtained. In the captured image F3 on the right, signals from the black areas where the workpiece W does not exist are not read out. The area enclosed by frame F7 in the captured image F3 on the right is designated as the area of interest. The number of pixels in this area of interest is 6MP. 【0072】 Downscaling the left image F1 with a scaling factor of 4x yields the left inspection target image F4. The central inspection target image F5 is an image acquired by optical zoom, and is therefore zoomed along the center of the field of view of the photoelectric conversion unit 31a. Consequently, if the center of the workpiece W is offset from the center of the field of view of the photoelectric conversion unit 31a, the workpiece W will be offset from the center of the image in the zoomed image. The central inspection target image F5 has improved pixel resolution. The right inspection target image F6 is an image obtained by downscaling the area of interest enclosed by the frame F7 of the right image F3 with a scaling factor of 1.2x, resulting in a pixel count of 5MP. 【0073】 Figure 18 illustrates an example of combining optical zoom and downscaling, showing Pattern 1 and Pattern 2. In Pattern 1, from a low specified zoom magnification to a magnification near the downscaling limit, the optical zoom is turned off and zooming is performed by downscaling without using optical zoom. Downscaling is fixed at a magnification near the downscaling limit. When the magnification exceeds the downscaling limit, the optical zoom is turned on and zooming is performed up to the upper limit of the optical zoom magnification. At this time, as the specified zoom magnification increases, the optical zoom magnification also increases. When the upper limit of the optical zoom magnification is exceeded, the optical zoom is fixed and sensor zoom is performed by downscaling. According to Pattern 1, downscaling can be performed even after optical zooming (i.e., it is possible to retain sensor zoom capacity), so fine adjustments when determining the area to be ultimately output as the inspection target image can be performed by sensor zoom instead of optical zoom. 【0074】 In Pattern 2, zooming is performed by downscaling without optical zoom from a low zoom magnification range down to the downscaling limit magnification (1x). Since downscaling has been performed up to the downscaling limit magnification, no further downscaling is performed. When the downscaling limit magnification is exceeded, optical zoom is used to zoom up to the upper limit of the optical zoom magnification. 【0075】 In other words, as explained using Figures 16 to 18, the logic unit 31b is configured to generate an inspection target image by downscaling the second captured image with a second scaling magnification calculated based on the zoom magnification specified by the user via the interface unit 40c if the zoom magnification specified by the user via the interface unit 40c is less than or equal to a predetermined magnification. On the other hand, the logic unit 31b is configured to generate an inspection target image corresponding to the specified zoom magnification by optical zoom using the zoom optical system if the zoom magnification specified by the user via the interface unit 40c is greater than the predetermined magnification. The predetermined magnification can be a zoom magnification such that the second scaling magnification is a magnification near the scaling limit, close to 1x the lower limit. 【0076】 Furthermore, if the zoom magnification indicated by the user via the interface unit 40c is greater than the predetermined magnification, the calculation unit 41a performs optical zoom using the zoom optical system. The logic unit 31b generates an inspection target image at the indicated zoom magnification by performing downscaling at a magnification near the scaling limit. 【0077】 Furthermore, the interface unit 40c is configured to accept even higher zoom magnifications after the optical zoom's optical magnification has reached its upper limit. When the upper limit of the zoom magnification that the interface unit 40c can accept is reached, the calculation unit 41a drives the optical zoom at the upper limit optical magnification. The logic unit 31b then generates the inspection target image by downscaling the image corresponding to the output area captured at the upper limit optical magnification that the interface unit 40c can accept by a scaling factor of 1 (essentially without downscaling). In other words, when the calculation unit 41a receives a zoom magnification specification from the user, it calculates the optical magnification of the optical zoom and the scaling factor for downscaling based on the accepted zoom magnification. Then, it drives the zoom optical system based on the calculated optical magnification. 【0078】 Furthermore, the arithmetic unit 41a can receive a change in zoom magnification as a change instruction signal via the interface unit 40c. If the zoom magnification instructed based on the change instruction signal is less than or equal to the predetermined magnification, the arithmetic unit 41a sends a control signal to the image sensor 31 to perform downscaling of the captured image using the scaling magnification calculated by the arithmetic unit 41a, thereby causing downscaling to be performed. On the other hand, if the zoom magnification instructed based on the change instruction signal is greater than the predetermined magnification, a drive signal is sent to the zoom optical system, i.e., the zoom motor 56c, to perform optical zoom. The zoom motor 56c operates in response to the drive signal, and the desired zoom magnification is obtained. 【0079】 As shown in Figure 19, the aspect ratio of an image can be changed during downscaling. FIG. 19A and FIG. 19B show the case where a horizontally oriented area of interest is changed to a vertically oriented area, but the opposite can also be done, where a vertically oriented area of interest is changed to a horizontally oriented area. This change instruction can be made by the user via the pixel count setting area 104 of the user interface screen 100 shown in Figure 11. However, as shown in FIG. 19B, due to the constraints of the shape of the photoelectric conversion unit 31a, it is possible that the area of interest may be located outside the range that can be imaged by the photoelectric conversion unit 31a when the aspect ratio is changed. In this case, the calculation unit 41a recalculates the scaling factor during downscaling to satisfy the aspect ratio as much as possible, and the logic unit 31b generates the inspection target image by downscaling with the recalculated scaling factor. 【0080】 As shown in Figure 20, the number of pixels can be increased or decreased during downscaling based on user settings. Figures 20A, 20B, and 20C show cases where the number of pixels is changed without changing the spatial resolution (scaling ratio). In Figures 20A and 20B, the number of pixels is changed within the range that can be imaged by the photoelectric conversion unit 31a, so the calculation unit 41a calculates a scaling ratio that reflects the user settings, and the logic unit 31b performs downscaling with the calculated scaling ratio to generate the image to be inspected. On the other hand, in Figure 20C, if the user settings are reflected, it will exceed the range that can be imaged by the photoelectric conversion unit 31a, so the calculation unit 41a calculates a scaling ratio that limits the change in the number of pixels without using the user settings. During calculation, the scaling ratio is made to be as close as possible to the user settings. Then, the logic unit 31b performs downscaling with the calculated scaling ratio to generate the image to be inspected. 【0081】 Figures 20D, 20E, and 20F illustrate cases where the number of pixels is changed without changing the imaging field of view. In Figures 20D and 20E, since the change is to a number of pixels greater than or equal to the minimum resolution, the calculation unit 41a calculates a scaling factor that reflects the user's settings, and the logic unit 31b generates the image to be examined by downscaling using the calculated scaling factor. On the other hand, in Figure 20F, since the change is to a number of pixels less than the minimum resolution, the calculation unit 41a calculates a scaling factor that limits the change in the number of pixels without using the user's settings, and the logic unit 31b generates the image to be examined by downscaling using the calculated scaling factor. In other words, the calculation unit 41a is configured to limit the change from the first number of pixels to the second number of pixels based on the user's settings. 【0082】 Furthermore, the interface unit 40c is configured to accept a second zoom instruction to further reduce the output area to a relatively smaller area after the user has given an instruction to change the number of pixels, and a second pan-tilt instruction to further adjust the output area in the X and Y directions. The second zoom instruction can be accepted by the user in the same way as the first pan-tilt instruction. Similarly, the second pan-tilt instruction can be accepted by the user in the same way as the first pan-tilt instruction. 【0083】 When the interface unit 40c receives a second zoom instruction and a second pan-tilt instruction, the calculation unit 41c calculates the scaling factor required to set the captured image corresponding to the output area modified by at least one of the second zoom instruction and the second pan-tilt instruction to a second pixel count within the field of view of the photoelectric conversion unit 31a. The logic unit 31b generates an inspection target image with a second pixel count by downscaling the captured image using the scaling factor calculated by the calculation unit 41c. 【0084】 Figure 21 illustrates an example of generating an inspection target image after rotation, and shows the rotation setting user interface screen 110. The rotation setting user interface screen 110 includes an image display area 111 where the inspection target image corresponding to the output area of the photoelectric conversion unit 31a is displayed, and a rotation angle setting area 112. In the rotation angle setting area 112, it is possible to set the rotation direction and rotation angle of the image, and these settings can be configured by the user using the keyboard 7 or mouse 8. 【0085】 Once the rotation direction and rotation angle are set in the rotation angle setting area 112, the calculation unit 41a rotates the image to be inspected in the set direction by the set angle, while keeping the number of pixels and shape of the image to be inspected fixed. In other words, the calculation unit 41a applies a rotation transformation process of an arbitrary angle to the image to be inspected. This allows the rotated image to be generated and displayed in the image display area 111, so that, for example, if the industrial camera 1 is installed in a tilted direction, the tilt can be corrected in software. 【0086】 Figure 22 shows an example of how downscaling is performed by the processor 41. As shown in this figure, the lens unit is a non-zoom lens that cannot perform optical zoom. The image sensor 31 outputs the image captured by the photoelectric conversion unit 31a to the processor 41 without downscaling. The processor 41 is provided with a downscaling unit 41A, which performs the downscaling described above to generate the image to be inspected. Other processing is the same as when downscaling is performed by the image sensor 31. 【0087】 (Processing of color images) Since the image sensor 31 can generate a color image, the interface unit 40c can accept the specification of an output area, which is the area to be output as a color inspection target image within the field of view of the photoelectric conversion unit 31a. 【0088】 The image sensor 31 has a color filter 31c, which enables the generation of a color image where each color is formed in a predetermined array pattern. Specifically, the array pattern of the color image output by the photoelectric conversion unit 31a is a Bayer array, as shown in Figure 23. In a Bayer array, in addition to the red component (R pixel) and blue component (B pixel), a first green component (Gr pixel) and a second green component (Gb pixel) are arranged in a predetermined array pattern. The array pattern is not limited to a Bayer array and may be other array patterns. 【0089】 Furthermore, the photoelectric conversion unit 31a is configured to generate color inspection target images with different pixel counts. When a color image is generated by the photoelectric conversion unit 31a, the processor 41 performs the aforementioned calculations and image processing on the color inspection target image. In this example, since a color filter 31c is included, a color image can be generated without using a three-chip camera and without lighting up RGB in a time series. 【0090】 The logic unit 31b acquires a color image corresponding to the output area of the field of view of the photoelectric conversion unit 31a, then individually downscales each color of the color image based on the array pattern, and arranges the pixel values of each color after downscaling so that the array pattern of each color matches the array pattern of the color image. This makes it possible to generate a color inspection target image with a smaller number of pixels than the number of pixels in the color image. 【0091】 For example, as shown in Figure 23, the logic unit 31b individually downscales the red component, the first green component adjacent to the red component in the row direction, the blue component, and the second green component adjacent to the blue component in the row direction, all of which are included in the Bayer array of the color image. The logic unit 31b then generates a color inspection target image by arranging the pixel values of each color of the downscaled blue component, the first green component, the red component, and the second green component so that the array pattern of each color matches the array pattern of the Bayer array of the color image. 【0092】 In other words, when a user specifies an area to be output as a color inspection target image, each color in the corresponding color image is individually downscaled based on a predetermined array pattern. The pixel values of each color after downscaling are arranged so that the array pattern of each color matches the array pattern of the color image. This makes it possible to generate a color inspection target image with any number of pixels smaller than the number of pixels in the color image, eliminating the need for additional processing in subsequent image processing by processors or FPGAs due to mismatches in array patterns. 【0093】 To give a specific example, the logic unit 31b is configured to generate a color inspection target image by downscaling each color of the captured color image in a first direction, which is either the X or Y direction, and then downscaling the image obtained by downscaling in the first direction in a second direction, which is the other direction of the X or Y direction. More specifically, as shown in Figure 24, the logic unit 31b generates a color inspection target image by downscaling each color of the captured color image in a first direction, and then downscaling the image obtained by downscaling in the first direction in a second direction. In Figure 24, the Gr pixel is interpolated and downscaled in the first direction, the horizontal direction (X direction), and then interpolated and downscaled in the second direction, the vertical direction (Y direction). Similarly, the R, B, and Gb pixels are interpolated and downscaled in the horizontal direction, and then interpolated and downscaled in the vertical direction, respectively. 【0094】 As shown in Figure 25 for the horizontal direction, when interpolating pixels, the average of the values of two adjacent pixels of the same color is calculated. Furthermore, during downscaling, a weighted average is calculated based on the subpixel size of each pixel in the pre-downscaling image, contained within each pixel of the image to be inspected after downscaling. In Figure 25, α, β, and γ represent the subpixel size when the input pixel size is set to 1. Also, since α and γ can each be set to values less than 1, the scaling factor can be calculated with decimal precision. The same process is performed on other R pixel groups in the image. Although Figure 25 shows the R pixels, the same applies to pixels of other colors. 【0095】 Similarly, the same processing is performed in the vertical direction using the pixels after horizontal downscaling. In other words, the logic unit 31b calculates the pixel value of each pixel in the image to be inspected based on multiple pixels of the same color that exist in the vicinity of the position in the color image before downscaling, corresponding to each pixel in the image to be inspected after downscaling. The logic unit 31b then determines the vicinity of the color image based on the scaling factor of the downscaling. 【0096】 As shown in Figure 26, a low-pass filter can also be applied when processing color images. In this case, the downscaling is performed by considering each pixel of the downscaled image to be inspected as being enlarged by the specified low-pass filter area (LPF area). The low-pass filter area is applied equally to both sides of the downscaled pixel. The low-pass filter area (subpixel size) on each side is calculated by multiplying the reduction due to downscaling by the low-pass filter setting value and then dividing the result by 1 / 2. The low-pass filter setting value must be greater than or equal to 0 and smaller than the value obtained by {3 × (reduction - 1)} / reduction. In Figure 26, α, β, γ, and δ indicate the subpixel size when the size of the input pixel is set to 1. The same processing is also performed on other R pixel groups in the image. Although Figure 26 shows the R pixels, the same applies to pixels of other colors. 【0097】 Furthermore, when the processor 41 receives an instruction from the interface unit 40c to change the number of pixels, it matches the arrangement patterns of each color in the color inspection target image before and after the change in the number of pixels. This allows image processing of the color inspection target image after the change to be performed without changing the settings related to the arrangement patterns of each color in the image processing of the color inspection target image before the change. 【0098】 When the interface unit 40c receives an instruction to change at least one of the position, size, and shape of the output area, the logic unit 31b generates a color inspection target image corresponding to the modified output area, such that the arrangement pattern of each color matches that of the color inspection target image generated before the change in the output area. 【0099】 Furthermore, the logic unit 31b downscales the color image so that the transfer speed of the color inspection target image to the processor 41 is relatively faster compared to the transfer speed of the color image image to the processor 41. That is, as shown in Figure 22, it is also possible to downscale outside the image sensor 31, but in this case, the amount of data in the color image image is large, so the transfer speed to the processor 41 may become a problem. By downscaling the color image image and transferring the color inspection target image to the processor 41 at a speed faster than the transfer speed of the color image image to the processor 41, the processing speed can be increased, enabling image inspection of fast-moving objects. In addition, the transfer speed from the logic unit 31b to the processor 41 can be changed according to the number of pixels in the inspection target image output from the image sensor 31. 【0100】 (Setup flow) As described above, the image inspection system 2 equipped with the industrial camera 1 can perform various processes, and the procedures for these processes can be arbitrarily set as long as they do not result in inconsistencies. Below, an example of a processing procedure will be explained based on a flowchart. 【0101】 Figure 27 is a flowchart showing an example of the processing procedure when inputting the zoom magnification. In step SA1 after startup, the imaging settings are activated. When the imaging settings are activated, the second lens group 22 is moved to the wide-angle side. In step SA2, the interface unit 40c receives the zoom magnification input from the user. When inputting the zoom magnification, the user interface screen 100 shown in Figure 11 is used, and the zoom can be input by operating the zoom adjustment area 101A. As another example, the zoom magnification may also be entered numerically. 【0102】 Step SA3 determines whether the input value (zoom magnification) from Step SA2 is greater than the first zoom value (first zoom magnification). If the result is NO, the process proceeds to Step SA4 to change the downscaling setting. When a trigger signal is input in Step SA5, the process proceeds to Step SA6 to display the image to be inspected. 【0103】 If the result in step SA3 is YES, proceed to step SA7 to determine whether the input value (zoom magnification) in step SA2 is greater than the second zoom value (second zoom magnification). If the result is NO, proceed to step SA8 to fix the downscaling at the default zoom magnification, and any further zoom will be handled by optical zoom in step SA9. Then proceed to step SA5. 【0104】 If the result in step SA7 is YES, then in step SA10 the optical zoom magnification is set to the maximum, the downscaling magnification is set to 1, and the process proceeds to step SA9. 【0105】 Figure 28 is a flowchart showing an example of the processing procedure when specifying the field of view or resolution. In step SB1 after the start, the WD measurement button (not shown) on the user interface is pressed. In step SB2, the WD measurement is performed. In step SB3, the field of view and resolution are calculated based on the internal data pre-stored in the industrial camera 1 and the current focal position information. In step SB4, the user inputs either the X field of view, Y field of view, or spatial resolution via the user interface. In step SB5, the zoom magnification is calculated using the value input in step SB4. In step SB6, it is determined whether the zoom magnification calculated in step SB5 is a configurable zoom magnification. If it is determined to be NO in step SB6, the process will proceed as shown in FIG. 19B in Figure 19 and FIG. 20C and 20F in Figure 20, and the process will proceed to step SB7 to clip to a configurable zoom magnification. If it is determined to be YES in step SB6, the process will proceed to step SB8 and the same procedure as the flow shown in Figure 27 will be executed. 【0106】 Figure 29 is a flowchart showing an example of the pan-tilt processing procedure. In step SC1 after the start, the user adjusts the position up, down, left, and right by operating the field of view position adjustment area 103 on the user interface screen 100 shown in Figure 11. In step SC2, it is determined whether the area adjusted in step SC1 is narrower than the maximum field of view of the image sensor 31. If it is determined to be NO in step SC2, the maximum range is clipped in step SC3. Then, the process proceeds to step SC4 to change the position of the area of interest. If it is determined to be YES in step SC2, the process also proceeds to step SC4. 【0107】 Figure 30 is a flowchart showing an example of the process for changing the aspect ratio. In step SD1 after the start, the user changes the aspect ratio to the desired one by operating the pixel count setting area 104 on the user interface screen 100 shown in Figure 11. In step SD2, it is determined whether the changed pixel area is within the field of view of the image sensor 31 at the same scaling magnification. If it is determined to be NO, the process proceeds to step SD3, where the zoom magnification is changed to match the aspect ratio changed in step SD1. In step SD4, the same procedure as shown in Figure 27 is performed. After that, the process proceeds to step SD5, where the size of the area of interest is changed. If it is determined to be YES in step SD2, the process also proceeds to step SD5. 【0108】 (Function to output installation instructions) The image inspection system 2 has an installation instruction output function that generates and outputs installation instructions used when installing the industrial camera 1 on-site. Figure 31 shows an overview of the installation instruction output function. As mentioned above, the industrial camera 1 and the controller 3 are connected by cable 10, so the images and optical conditions generated by the industrial camera 1 can be acquired by the controller 3. During bench testing, the installation instructions are generated and output using the application AP in the controller 3. Bench testing is conducted by a person in charge of setting conditions with specialized knowledge to determine the installation conditions. Also, the location where bench testing is conducted and the location where the industrial camera 1 is installed are separate. 【0109】 When installing industrial camera 1 on-site, a different person is responsible for camera installation than the person responsible for setting the conditions. This camera installation person often does not have the same level of expertise as the person responsible for setting the conditions. Therefore, in this example, during on-site installation, the image and optical conditions generated by industrial camera 1 are acquired by controller 3 and displayed on a web browser. The camera installation person can install industrial camera 1 while viewing the web browser screen to ensure that the installation conditions of industrial camera 1 match those of the already outputted installation instructions. This allows on-site personnel with limited expertise in setting optical conditions to install industrial camera 1 to match the optical conditions used in desktop testing. 【0110】 The following describes a specific example of the installation instruction output function, along with a user interface. Figure 32 shows a user interface screen 100 for settings that is displayed on monitor 9 before the installation instruction output function is started. This user interface screen 100 is equipped with a setting button 107. The setting button 107 is operated when the generation and output process of the installation instruction is started. When the control unit 5a detects that the setting button 107 has been operated, it starts the generation and output process of the installation instruction. Since the operation of the setting button 107 corresponds to an instruction to create an installation instruction, the control unit 5a is the part that receives the instruction to create an installation instruction. 【0111】 When an instruction to create an installation instruction sheet is received, the utility screen 110 shown in Figure 33 is generated and displayed on the monitor 9. The utility screen 110 displays several icons indicating various functions, including an installation instruction sheet output icon 111. When it is detected that the installation instruction sheet output icon 111 has been operated, the camera selection screen 120 shown in Figure 34 is generated and displayed on the monitor 9. The camera selection screen 120 has a camera ID selection area 121 and a camera model display area 122. The selection area 121 allows selection in a pull-down format, for example, and when the user clicks the selection area 121 with the mouse 8, the industrial cameras 1 connected to the controller 3 are displayed in a list format. When the user selects an industrial camera 1 for which an installation instruction sheet will be generated from the list, the selected industrial camera 1 is identified and its model is displayed in the display area 122. When the OK button 123 on the camera selection screen 120 is operated, it is determined whether or not the zoom of the selected industrial camera 1 is locked. If the zoom of the selected industrial camera 1 is locked, a confirmation window will be displayed on monitor 9 requesting the user's approval to temporarily change the zoom. This is because a wide-angle image is required when creating the installation instructions. If a wide-angle image is not required, the confirmation window does not need to be displayed. 【0112】 When the interface unit 40c receives an instruction to create an installation instruction sheet and the zoom change is approved, the processor 41 controls the lens unit 20 to zoom out, and then controls the industrial camera 1 to generate a reference image with an enlarged field of view. Also, as shown in Figure 35, it generates an installation information display screen 130 that displays the installation information of the selected industrial camera 1 and displays it on the monitor 9. The installation information display screen 130 is provided with an image display area 131 that displays a reference image captured by the selected industrial camera 1. The image display area 131 displays the reference image currently captured by the industrial camera 1. 【0113】 The installation information display screen 130 is provided with a WD display area 132 and a camera angle display area 133. The WD display area 132 displays the WD (working distance), which indicates the installation distance. When the creation of the installation instruction sheet begins, nothing is displayed in the WD display area 132. As described later, after the distance measuring unit 43 performs distance measurement, the installation distance is displayed in the WD display area 132. The camera angle display area 133 displays the camera angle (also called camera posture), which shows the pitch, tilt, roll, and other angles acquired by the acceleration sensor 32. The camera angle displayed in the camera angle display area 133 cannot be overwritten. 【0114】 Furthermore, the installation information display screen 130 includes a list display area 134 for selecting items to be output to the installation instruction sheet. The list display area 134 shows three items: "Installation Information," "Connection Information," and "Web Browser Explanation." The checked items are the ones that will be output to the installation instruction sheet. By default, all items are selected to be output to the installation instruction sheet. 【0115】 The installation information display screen 130 is equipped with an AE button 135 and a distance measurement button 136. When the AE button 135 is operated, the exposure time of the industrial camera 1 is automatically adjusted. When the distance measurement button 136 is operated, the distance measurement unit 43 performs distance measurement and obtains the installation distance. 【0116】 The installation information display screen 130 is equipped with a Trg button 137 and a Live button 138. When the Trg button 137 is pressed once, a trigger signal is input once, and the industrial camera 1 takes one image to generate a reference image of the workpiece W. When the Live button 138 is pressed, trigger signals are input continuously, and the industrial camera 1 takes continuous images to generate reference images of the workpiece W. The reference images are displayed in the image display area 131. 【0117】 The installation information display screen 130 includes a selection area 139 for "Include laser pointer". The selection area 139 allows the user to choose between either having the industrial camera 1 capture an image with the aimer 29 illuminated, or having the industrial camera 1 capture an image with the aimer 29 turned off. If the selection area 139 is checked, the option of having the industrial camera 1 capture an image with the aimer 29 illuminated is selected. On the other hand, if the selection area 139 is not checked, the option of having the industrial camera 1 capture an image with the aimer 29 turned off is selected. 【0118】 When the selection area 139 is checked and the Trg button 137 or Live button 138 is operated, the processor 41 lights up the aimer 29 and then a trigger signal is input, so the workpiece W illuminated by the alignment light is imaged. This generates a reference image that includes the position information of the alignment light illuminating the workpiece W. The black circle indicated by reference numeral 140 in Figure 35 indicates the alignment light. 【0119】 It is conceivable that the actual alignment light may be difficult or impossible to see on the reference image. In such cases, the positional information of where the alignment light should be emitted can be associated with the reference image. For example, since the area of illumination of the alignment light by Aimer 29 is known on the reference image, the position where the alignment light should be emitted can be identified on the reference image. In other words, the alignment light may be displayed in the reference image in a simulated manner at the position where it is expected to be emitted on the workpiece W when Aimer 29 emits light. "Simulated display" means displaying light that approximates the shape and color of the actual alignment light, in a display format that can be recognized as the alignment light by the camera installation operator. The position where the alignment light should be emitted can also be superimposed on the reference image, as indicated by reference numeral 140. 【0120】 When the print button 141 on the installation information display screen 130 is operated, the output unit 42 generates the print window 150 shown in Figure 36 and displays it on the monitor 9. The print window 150 displays a print preview. The print preview includes a reference image of the workpiece W captured by the industrial camera 1. The reference image includes position information of the alignment light that is irradiated onto or to be irradiated onto the workpiece W, as indicated by reference numeral 140. The print preview also includes the angles of the industrial camera 1, such as pitch, tilt, and roll, acquired by the acceleration sensor 32. 【0121】 When the print settings button 151 on the print window 150 is operated, a screen for selecting a printer and setting the number of copies is displayed on the monitor 9. It is also possible to select a PDF file on this screen. After setting the print settings and executing print, if a printer is selected, the output displayed in the print preview is output to the printer via the output unit 42, and the printer performs the printing process. On the other hand, if a PDF file is selected, the output displayed in the print preview is output as a PDF file via the output unit 42 and saved to the storage unit 6, etc. 【0122】 The reference image output from the output unit 42 contains positional information of the alignment light that is or should be irradiated onto the workpiece W, and the document containing this reference image becomes the installation instruction sheet. As mentioned above, the installation instruction sheet may be on paper or as electronic data. 【0123】 Installation instructions can also be output from the industrial camera 1. For example, the above-mentioned information can be stored in the industrial camera 1, and a command signal to output installation instructions can be sent from the controller 3 to the selected industrial camera 1. This allows the installation instructions to be output from the output unit 42 of the selected industrial camera 1. As shown in the lower part of Figure 31, information specific to the connected industrial camera 1 can also be checked via a web browser. Examples of information specific to the industrial camera 1 include the number of pixels and the magnification of the zoom lens. 【0124】 As shown in Figure 36, the installation instructions also include the installation distance measured by the distance measuring unit 43, so the camera installer can install the industrial camera 1 while also considering the installation distance. When installing the industrial camera 1, for example, the distance measuring unit 43 is used to obtain the installation distance between the camera and the workpiece W, and the installation distance is displayed on the main unit display unit 49. This allows the camera installer to install the industrial camera 1 in the appropriate position while also considering the installation distance displayed on the main unit display unit 49. 【0125】 As shown in Figure 36, the installation instructions also include the orientation information of the industrial camera 1 acquired by the acceleration sensor 32, so the camera installer can install the industrial camera 1 while viewing the orientation information. When installing the industrial camera 1, for example, the orientation information acquired by the acceleration sensor 32 is displayed on the main unit display unit 49. This allows the camera installer to install the industrial camera 1 in the appropriate orientation while viewing the orientation information displayed on the main unit display unit 49. 【0126】 Furthermore, the interface unit 40c accepts input from the user as a required specification, either field of view size or pixel resolution. The interface unit 40c can also acquire the zoom magnification specified by the user on the user interface screen 100 shown in Figure 11 as part of the optical conditions. When the zoom magnification is acquired, the pixel resolution is calculated taking into account the zoom magnification specified by the user, and the field of view size or pixel resolution is acquired based on the specified zoom magnification, the installation distance, and the camera parameters. When the interface unit 40c acquires the required specification, the calculation unit 41a calculates a zoom magnification that satisfies the required specification at a predetermined installation distance. It also acquires a reference image at the predetermined installation distance. Subsequently, the output unit 42 outputs the predetermined installation distance used to calculate the zoom magnification that satisfies the required specification as the installation distance shown in the installation instructions, and outputs the reference image captured at the predetermined installation distance as the reference image for the installation instructions. 【0127】 If the industrial camera 1 is connected via a cable 10 in which multiple wires are bundled together, the installation instructions may include information about the wiring (connection information) that makes up the cable 10. Figure 37 shows a display screen 160 when connection information is displayed. The display screen 160 is provided with a connection information display area 161. The connection information display area 161 displays the model number of the controller 3 and the model number of the industrial camera 1, as well as the pin configuration of the connector of the cable 10 used for the connection and the function of each pin. Information other than the model number of the controller 3 and industrial camera 1 can also be displayed in the connection information display area 161. 【0128】 The embodiments described above are merely illustrative in all respects and should not be interpreted restrictively. Furthermore, any modifications or changes that fall within the equivalent scope of the claims are all within the scope of the present invention. [Industrial applicability] 【0129】 As described above, the industrial camera according to the present invention can be used to generate inspection target images for inspecting various objects. [Explanation of symbols] 【0130】 1 Industrial Camera 20 Lens Units 29 Aimer 31 Image Sensor 32 Accelerometer 40c Interface Section 41 processors 41a Arithmetic unit 43 Ranging section 49 Main unit display
Claims
[Claim 1] An industrial camera that captures an image of an object to be inspected and generates an image of the object to be inspected, An imaging unit for capturing images of the object to be inspected and generating images of the object to be inspected, An aimer that shines a positioning light towards the object to be inspected, The system includes an output unit that outputs a reference image of the object to be inspected captured by the imaging unit during a bench test, and an output unit that outputs an installation instruction sheet including positional information of the alignment light that was irradiated onto or is to be irradiated onto the object to be inspected. An industrial camera characterized in that, when the industrial camera is installed, the aimer is configured to illuminate the object to be inspected with the alignment light. [Claim 2] In the industrial camera described in claim 1, A distance measuring unit for measuring the distance between the object to be inspected and the said object, The system further includes a main unit display unit that displays the distance measured by the distance measuring unit, The installation instructions output by the output unit include the distance measured by the distance measuring unit. An industrial camera characterized in that, when the industrial camera is installed, the main unit display unit can display the distance between it and the object to be inspected. [Claim 3] In the industrial camera described in claim 1, An acceleration sensor that acquires attitude information of the aforementioned industrial camera, The system further includes a main unit display unit that displays the aforementioned posture information, The mounting instructions output by the output unit include the attitude information acquired by the acceleration sensor. An industrial camera characterized in that, when the industrial camera is installed, the main unit display unit can display the attitude information. [Claim 4] In the industrial camera described in claim 1, An industrial camera characterized in that the alignment light is displayed on the reference image in a simulated position where it is assumed to be illuminated onto the object to be inspected when the aimer emits light. [Claim 5] In the industrial camera described in claim 1, Zoom lens and, A processor that controls the zoom lens and the imaging unit, The system further includes an interface unit that receives instructions for creating the aforementioned installation instructions, The industrial camera is characterized in that, when the interface unit receives an instruction to create the mounting instructions, the processor controls the zoom lens to zoom out, and then controls the imaging unit to generate a reference image with an enlarged field of view. [Claim 6] In the industrial camera described in claim 1, The aforementioned industrial camera is configured to be zoomable, An interface unit that accepts input from the user as a required specification, such as field of view size or pixel resolution, The system further comprises a calculation unit that calculates a zoom magnification that satisfies the required specifications at a predetermined installation distance, The output unit outputs the predetermined installation distance used to calculate the zoom magnification that satisfies the required specifications as the distance, and outputs a reference image taken at the predetermined installation distance as a reference image for the installation instructions, in an industrial camera. [Claim 7] An image inspection apparatus comprising: an imaging unit for capturing an image of an object to be inspected and generating an image of the object to be inspected; an aimer for irradiating the object to be inspected with alignment light; and an output unit for outputting an installation instruction sheet including a reference image of the object to be inspected captured by the imaging unit during a bench test and positional information of the alignment light that has been or should be irradiated onto the object to be inspected; and an image inspection apparatus to which a plurality of industrial cameras can be connected when installed, configured so that the aimer can irradiate the object to be inspected with the alignment light, An image inspection device characterized by being configured to allow selection of an industrial camera from among the connected plurality of industrial cameras to output the installation instructions, and sending an instruction signal to the selected industrial camera to output the installation instructions. [Claim 8] In the image inspection apparatus according to claim 7, An image inspection device characterized in that it is configured to allow the user to check information specific to the connected industrial camera via a web browser. [Claim 9] In the image inspection apparatus according to claim 7, The aforementioned industrial camera is connected via a cable in which multiple wires are bundled together. An image inspection device characterized in that information about the wiring constituting the cable is included in the installation instructions.