Camera device, image processing method, and program
The camera device uses structured illumination and multiple imaging units to overcome background texture issues, enabling precise distance calculation by processing images with varied structured light, improving accuracy in complex environments.
Patent Information
- Application Number
- JP2023044379
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2024-10-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing imaging devices struggle to accurately calculate the distance to an object when the background texture is poor, leading to difficulties in precise object recognition.
A camera device employing structured illumination that irradiates a target object with structured light, utilizing two imaging units positioned differently to capture images with structured light of varying wavelengths or polarization angles, and a control section to process these images for precise distance calculation.
Enables high-precision distance calculation to objects by capturing and processing images with structured light of different wavelengths or polarization angles, enhancing accuracy even in complex environments.
Smart Images

Figure 2024134193000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a camera device, an image processing method, and a program. [Background technology]
[0002] Patent Document 1 discloses an image processing device having a first lighting device that irradiates a first light having a first wavelength, a second lighting device that irradiates a second light having a second wavelength different from the first wavelength, and an imaging device that images an object. The imaging device images the object while irradiating the object with the first light from the first lighting device and the second light from the second lighting device. The image processing device generates a grayscale image made up of pixels imaged through a first optical filter that transmits the first wavelength, and generates a distance image including pixels imaged through a second optical filter that transmits the second wavelength. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2020-193867 A Summary of the Invention [Problem to be solved by the invention]
[0004] The imaging device described in Patent Document 1 can stably and quickly perform image inspections such as determining whether a part is good or bad, even in an environment with a complex background. On the other hand, the imaging device described in Patent Document 1 has a problem in that it is difficult to accurately recognize the distance to an object when the background texture is poor.
[0005] The present invention has been made in consideration of the above-mentioned circumstances, and has an object to provide a camera device that is capable of calculating the distance to an object with high accuracy. [Means for solving the problem]
[0006] In order to solve the above-mentioned problems, a camera device according to the present invention includes a structured illumination that irradiates a target object with structured light, a first imaging unit that images an imaging area including the target object, a second imaging unit that images the imaging area from a position different from that of the first imaging unit, and a control unit that controls the structured illumination, the first imaging unit, and the second imaging unit, wherein the control unit executes a first imaging process of causing each of the first imaging unit and the second imaging unit to capture a first image of the imaging area while the structured illumination is irradiated with first structured light, a second imaging process of causing each of the first imaging unit and the second imaging unit to capture a second image of the imaging area while the structured illumination is irradiated with second structured light having a spatial distribution different from that of the first structured light, and a calculation process of calculating distance information to the target object using the first image and the second image. Effect of the Invention
[0007] According to the present invention, it is possible to obtain a camera device capable of calculating the distance to an object with high accuracy. Note that problems, configurations, and effects other than those described above will become apparent from the following description of the embodiments. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram of a robot control system. [Diagram 2] 1 is a hardware configuration diagram of a camera device according to a first embodiment. [Diagram 3] 1 is a flowchart of a depth map generation process 1. [Figure 4] FIG. 13 is a diagram showing an image of generating a depth map. [Diagram 5] 13 is a flowchart of a wavelength setting process. [Figure 6] 13 is an example of a wavelength selection screen in the wavelength setting process. [Figure 7] FIG. 2 is a hardware configuration diagram of a camera device according to a first modified example of the first embodiment. [Figure 8] FIG. 11 is a hardware configuration diagram of a camera device according to a second modified example of the first embodiment. [Figure 9] 13 is a flowchart of a depth map generation process 2. [Figure 10] 13 is an example of a wavelength selection screen in depth map generation process 2. [Figure 11] 13 is a flowchart of a depth map generation process 3. [Figure 12] FIG. 13 is an image diagram of depth map generation process 3. [Figure 13] FIG. 13 is a hardware configuration diagram of a camera device according to a fourth embodiment. [Figure 14] 13 is a flowchart of a depth map generation process 4. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] An embodiment of the invention will be described below with reference to the drawings. This embodiment realizes a highly versatile camera device, which contributes to "9. Promote inclusive and sustainable industry, innovation and infrastructure" of the Sustainable Development Goals (SDGs) advocated by the United Nations.
[0010] [Outline of Robot Control System 1] Fig. 1 is a block diagram of a robot control system 1. As shown in Fig. 1, the robot control system 1 (system) includes at least a camera device 10 and a robot vision controller 2. The robot control system 1 may further include a user terminal 3 that functions as an input / output interface with a user. The robot control system 1 may further include a robot 4 (work machine) to be controlled. The camera device 10 and the robot vision controller 2, the camera device 10 and the user terminal 3, and the robot vision controller 2 and the robot 4 are connected so as to enable input and output of data or signals between each other.
[0011] The robot control system 1 is disposed in a production facility such as a factory. The robot control system 1 controls, for example, a robot 4 that mounts components at specified positions on a workpiece transported on a belt conveyor disposed in the production facility. The robot 4 includes, for example, a robot controller 5 that controls the operation of the robot 4 under the control of a robot vision controller 2, a robot arm 6 that moves between the workpiece and a tray on which the components are placed, and an end effector 7 that is attached to the tip of the robot arm 6 and grips the components.
[0012] The use cases of the robot control system 1 according to this embodiment are not limited to the above-mentioned mounting of parts, and may be used for attaching labels to workpieces, driving screws into workpieces, part assembly, part processing, welding, painting, bonding, etc. The robot control system 1 can also be applied to work processes in logistics lines (carton transport, sorting of items, etc.), work processes in food factories (plating prepared foods, etc.), work processes of harvesting robots (fruit thinning, etc.), and work processes of medical and experimental robots (cultivation, synthesis, etc.). The robot 4 according to this embodiment may be used as a human-collaborative robot that performs work in collaboration with humans.
[0013] The camera device 10 is a device that generates parallax images captured from two different viewpoints. The camera device 10 is attached to a position where it can capture an image of the robot arm 6, for example, at the tip of the robot arm 6 or by being hung from the ceiling. The camera device 10 captures an image of an object located in the moving direction of the robot arm 6 to generate a parallax image. The camera device 10 calculates distance information indicating the distance to the object located in the moving direction of the robot arm 6 based on the generated parallax image to generate a depth map. The camera device 10 then outputs the generated depth map to the robot vision controller 2. Note that the "object" refers to any object (for example, a wall, floor, ceiling, target, obstacle, surrounding object, person, etc.) that exists within the imaging range of the camera device 10. Note that the object does not refer to a single object, but is a collective term for multiple objects that exist within the imaging range of the camera device 10.
[0014] The depth map is, for example, a two-dimensional array indicating the distance to each object in an image captured by the camera device 10. More specifically, the depth map is a collection of distance information indicating the distance from the camera device 10 for each pixel in the image captured by the camera device 10. That is, the distance information corresponds to information indicating the distance from the camera device 10 to an object in the image captured by the camera device 10 for each pixel included in the image captured by the camera device 10. More specifically, the distance information indicates the distance from a point (typically, the midpoint) on a line segment connecting the image sensors 112 and 122 to the object. The depth map is generated by calculating the distance information of each pixel based on the parallax image captured by the camera device 10 and mapping the calculated distance information to a two-dimensional array. A method for generating a depth map is already well known, so a detailed description will be omitted. However, it is not necessary to edit the calculated distance information into the form of a depth map and output it.
[0015] The robot vision controller 2 executes position estimation and obstacle identification based on the depth map acquired from the camera device 10. Position estimation is a process of estimating the position of the robot arm 6 in the surrounding environment based on the depth map. Obstacle identification is a process of identifying obstacles that may impede the movement of the robot arm 6. The robot vision controller 2 then transmits the results of position estimation and obstacle identification to the robot controller 5. The robot controller 5 causes the robot arm 6 to reach the target position while avoiding the obstacles based on the results of position estimation and obstacle identification acquired from the robot vision controller 2.
[0016] The user terminal 3 includes a display device (e.g., a display) that outputs (displays) information to a user, and an operation device (e.g., a keyboard, a pointing device, a touch panel) that accepts operations (instructions) from the user. The user terminal 3 is realized, for example, by a PC (Personal Computer), a tablet terminal, or the like.
[0017] [First embodiment] [Hardware configuration of camera device 10] 2 is a hardware configuration diagram of the camera device 10 according to the first embodiment. As shown in FIG. 2, the camera device 10 mainly includes imaging units 11 and 12, a structured illumination unit 13, an illumination control unit 14, and an SoC 15.
[0018] The imaging unit 11 (first imaging unit) is a camera unit that integrates an optical lens 111 and an image sensor 112. The optical lens 111 collects light from outside the camera device 10 and makes it incident on the image sensor 112. The image sensor 112 photoelectrically converts the light collected by the optical lens 111 and outputs image data to the memory 151. The image sensor 112 is, for example, a complementary metal-oxide-semiconductor (CMOS) or a charge-coupled device (CCD).
[0019] The imaging unit 12 (second imaging unit) includes an optical lens 121 and an image sensor 122. The configuration of the imaging unit 12 is the same as that of the imaging unit 11, so a repeated description will be omitted. The imaging units 11 and 12 are exposed on the surface of the housing of the camera device 10. The imaging units 11 and 12 are arranged at a predetermined interval on the same surface of the camera device 10. That is, the imaging units 11 and 12 capture images of imaging areas including an object from different positions. The imaging areas of the imaging units 11 and 12 at least partially overlap each other. In this specification, the term "imaging area" refers to the overlapping areas of the imaging areas of the imaging units 11 and 12.
[0020] The structured illumination 13 is a projector that emits structured light. The structured light of the structured illumination 13 refers to light having a shade of a predetermined illumination pattern (for example, a circular or polygonal dot pattern, a stripe pattern). The arrangement, density, and size of the dots, the spacing between stripes, and the thickness, etc. do not necessarily need to be uniform. The structured illumination 13 emits the structured light within the imaging area (angle of view) of the imaging units 11 and 12. The wavelength range of the light output by the structured illumination 13 overlaps with the sensitivity areas of the image sensors 112 and 122.
[0021] The structured lighting 13 according to the first embodiment includes a first lighting section 131 that irradiates a first structured light and a second lighting section 132 that irradiates a second structured light. The first structured light and the second structured light are structured lights having different spatial distributions. The spatial distribution is a general term for the spatial distribution or shape of the waveform of light (e.g., the shape of the pattern of the irradiated light, the wavelength of light, the polarization angle, the amplitude, the phase, etc.). In the present disclosure, a change in the shape of the pattern of the irradiated light in time series is also an example of structured light having different spatial distributions. In the first embodiment, an example of irradiating the first structured light and the second structured light having different "wavelengths of light", which is an example of a spatial component, will be described.
[0022] The illumination control unit 14 causes the structured illumination 13 to emit structured light under the control of the SoC 15. More specifically, the illumination control unit 14 sets the wavelengths of the first structured light and the second structured light. The illumination control unit 14 also controls the timing of turning on and off the first illumination unit 131 and the second illumination unit 132. The processing of the illumination control unit 14 may be realized by the SoC 15 (more specifically, the CPU 152). The illumination control unit 14 and the SoC 15 are examples of a control unit.
[0023] The SoC (System-On-a-Chip) 15 is an integrated circuit product in which various electronic components are integrated on a single chip that is made up of an integrated circuit. The SoC 15 includes a memory 151, a CPU 152, an ISP 153, an AI processing unit 154, and an external interface 155. In FIG. 2, the interface is conveniently indicated as "I / F."
[0024] The memory 151 includes at least a RAM (Random Access Memory) and a ROM (Read Only Memory). The memory 151 temporarily stores programs and control data required for executing the operations of the camera device 10, and further stores data or information generated during the operation of each part of the camera device 10. The RAM is, for example, a work memory used during the operation of each part of the camera device 10. The ROM stores and holds, for example, programs and control data for controlling each part of the camera device 10 in advance.
[0025] The CPU 152 is a processor that controls the overall operation of the camera device 10. The CPU 152 performs control processing for managing the operations of each part of the camera device 10, input / output processing of data between each part of the camera device 10, calculation processing of data, and storage processing of data. The CPU 152 operates according to the program and control data stored in the memory 151. The CPU 152 uses the memory 151 during operation, and transfers data generated or acquired by the CPU 152 to the memory 151 for temporary storage.
[0026] The ISP (Image Signal Processor) 123 is a processor that executes various types of image processing performed within the camera device 10. The ISP 153 reads image data from the memory 151 and performs various types of image processing using the read image data. The ISP 153 uses the memory 151 during operation, and transfers data or information generated or acquired by the ISP 153 to the memory 151 for temporary storage.
[0027] The AI processing unit 154 is configured using, for example, a GPU (Graphics Processing Unit) and a memory. Note that the AI processing unit 154 may include a DSP (Digital Signal Processor) instead of or in addition to the GPU.
[0028] The external interface 155 is an interface for transmitting and receiving various data between the robot vision controller 2 and the user terminal 3. That is, the external interface 155 transmits data acquired from the CPU 152 to the robot vision controller 2 or the user terminal 3, and transmits data acquired from the robot vision controller 2 or the user terminal 3 to the CPU 152.
[0029] [Depth map generation process 1] With reference to FIG. 3 and FIG. 4, a depth map generation process 1 executed by the camera device 10 according to the first embodiment will be described. FIG. 3 is a flowchart of the depth map generation process 1. FIG. 4 is a diagram showing an image of generating a depth map. Hereinafter, an image captured by the imaging unit 11 will be referred to as a "left image", and an image captured by the imaging unit 12 will be referred to as a "right image". In addition, the wavelength of the first structured light irradiated by the first illumination unit 131 will be referred to as a "first wavelength (W1)", and the wavelength of the second structured light irradiated by the second illumination unit 132 will be referred to as a "second wavelength (W2)". That is, W1 ≠ W2. It is assumed that W1 and W2 are stored in advance in the memory 151.
[0030] First, the illumination control unit 14 causes the first illumination unit 131 to irradiate the first structured light of the first wavelength W1 at time t1 (S11). Furthermore, the CPU 152 causes each of the imaging units 11 and 12 to capture a first image of the imaging area while the first illumination unit 131 is irradiated with the first structured light (S12). As a result, the imaging unit 11 generates a first left image, and the imaging unit 12 generates a first right image. The first left image and the first right image are images of an object irradiated with the first structured light. Furthermore, the first left image and the first right image are images having parallax. Furthermore, the first left image and the first right image are images captured simultaneously (at time t1). The processes of steps S11 and S12 are an example of a first imaging process (first imaging step).
[0031] Next, the illumination control unit 14 turns off the first illumination unit 131 and waits for a very short time Δta (S13). Then, at time t2 after waiting for the very short time Δta, the illumination control unit 14 causes the second illumination unit 132 to irradiate the second structured light of the second wavelength W2 (S14). Furthermore, the CPU 152 causes each of the imaging units 11 and 12 to capture a second image of the imaging area while the second illumination unit 132 is irradiated with the second structured light (S15). As a result, the imaging unit 11 generates a second left image, and the imaging unit 12 generates a second right image. The second left image and the second right image are images of an object irradiated with the second structured light. Furthermore, the second left image and the second right image are images having parallax. Furthermore, the second left image and the second right image are images captured simultaneously (at time t2). The processes of steps S13 and S14 are an example of a second imaging process (second imaging step).
[0032] Next, the illumination control unit 14 turns off the second illumination unit 132. The ISP 153 also generates a composite left image by synthesizing the first left image and the second left image, and generates a composite right image by synthesizing the first right image and the second right image (S16). As an example, the ISP 153 may generate the composite left image by simply adding up pixel values of corresponding pixels in the first left image and the second left image. As another example, the ISP 153 may generate the composite left image by weighting and adding up pixel values of corresponding pixels in the first left image and the second left image. The weighting coefficients of the first left image and the second left image are assumed to be predetermined. The method of synthesizing the first right image and the second right image is similar.
[0033] Next, the ISP 153 calculates distance information for each pixel using the composite left image and the composite right image generated in step S16, and generates a depth map (S17). Since the process of generating a depth map is already known, a detailed description will be omitted. Then, the CPU 152 transmits the depth map generated by the ISP 153 to the robot vision controller 2 through the external interface 155. The process of step S17 is an example of a calculation process (calculation step).
[0034] Next, the CPU 152 waits for an infinitesimal time Δtb (S18) and executes the processes from step S11 onwards again. The infinitesimal times Δta and Δtb may be the same or different. The camera device 10 then repeatedly executes the processes from steps S11 to S18 at a predetermined frame rate. For example, if the frame rate is 60 fps, the processes from steps S11 to S18 are repeated at intervals of 1 / 60 sec.
[0035] [Wavelength setting process] A process for setting the first wavelength W1 and the second wavelength W2 used in the depth map generation process 1 will be described with reference to Figs. 5 and 6. Fig. 5 is a flowchart of the wavelength setting process. Fig. 6 is an example of a wavelength selection screen in the wavelength setting process. The wavelength setting process is a process for changing the wavelength of the structured light to capture an image of the object WK, and setting the wavelengths with a large number of pixels that can be determined to be at the same position in the object WK as the first wavelength W1 and the second wavelength. The camera device 10 executes the wavelength setting process shown in Fig. 5, for example, as a calibration before executing the depth map generation process 1. For this reason, it is desirable to execute the wavelength setting process in an environment close to the execution environment of the depth map generation process 1 (for example, the same equipment, the same lighting environment).
[0036] First, the CPU 152 initializes a variable i (i=1). The variable i is a variable for identifying a wavelength candidate (S21). Next, the CPU 152 sets a wavelength W(i) (S22). In the example of FIG. 6, the wavelength W(i)=400 nm. Next, the CPU 152 causes the imaging units 11 and 12 to capture an imaging area including the object WK while irradiating the structured illumination 13 with structured light of wavelength W(i) (S23). This generates a left image and a right image having parallax (i.e., parallax images). The process of step S23 is an example of an imaging process (imaging step).
[0037] Next, the AI processing unit 154 identifies an area in the left image and the right image captured in step S23 in which the object WK appears (hereinafter, referred to as the "detection area") (S24). The AI processing unit 154 may identify the detection area, for example, by pattern matching the image of the object WK stored in advance with the left image and the right image. The process of step S23 is already known, so a detailed description will be omitted.
[0038] Next, ISP 153 calculates the number of pixels that can be determined to be at the same position within the detection areas of the left and right images (hereinafter referred to as the "parallax number N") (S25). The process of determining the same position within a pair of parallax images is a process that is executed when calculating distance information. However, there is a possibility that parts that are in shadow or parts that are blown out may not be determined to be at the same position within the detection area. The process of step S25 is an example of a calculation process (calculation step).
[0039] Next, the CPU 152 stores the wavelength W(i)=400 nm set in step S22, the image (left image or right image) captured in step S23, and the parallax number N calculated in step S25 in the memory 151 and displays them on the user terminal 3 (S26). As a result, as shown in FIG. 6, an upper left area A1 is added to the wavelength selection screen displayed on the display of the user terminal 3. Note that the parallax number N may be displayed as an absolute value of pixels determined to be in the same position, or may be displayed as a percentage when the number of pixels in the detection area is set to 100. The process of step S26 is an example of a display process (display step).
[0040] Next, CPU 152 adds 1 to variable i (S28) until the first wavelength W1 and the second wavelength W2 are selected by the user of user terminal 3 (S27: No), and executes the processes of steps S22 to S26 again. That is, CPU 152 repeatedly executes the processes of steps S22 to S26 while changing the wavelength of the structured light by a predetermined fluctuation width ΔW1. For example, when the processes of steps S22 to S26 are repeated four times with wavelength W(1)=400 nm, wavelength W(2)=450 nm, wavelength W(3)=500 nm, and wavelength W(4)=550 nm, the wavelength selection screen will be as shown in FIG. 6. In this case, the fluctuation width ΔW1=50 nm.
[0041] The wavelength selection screen includes areas A1, A2, A3, and A4 in which the wavelength W(i) corresponding to the variable i=1, 2, 3, and 4, the parallax number N, and a set of images are displayed, as well as a "Set" button and a "Next Candidate" button. Each of the areas A1 to A4 includes a check box. The parallax number N is different for each wavelength W(i). That is, the wavelengths at which it is easy to determine the same position (large number of parallaxes) and the wavelengths at which it is difficult to determine the same position (small number of parallaxes) in a pair of parallax images vary depending on the environment in which the camera device 10 is installed.
[0042] Then, when the [Next Candidate] button is pressed (S27: No), the CPU 152 executes the processes from step S28 onwards again. On the other hand, when two of the check boxes in the areas A1 to A4 are selected and the [Set] button is pressed (S27: Yes), the CPU 152 sets the two wavelengths corresponding to the selected check boxes as the first wavelength W1 and the second wavelength W2, and stores them in the memory 151 (S29). The process of step S29 is an example of a setting process (setting step).
[0043] In the example of FIG. 6, the first wavelength W1=400 nm and the second wavelength W2=550 nm. As an example, the user of the user terminal 3 may select the wavelength (550 nm) with the largest number of parallaxes and the wavelength (400 nm) with the second largest number of parallaxes. As another example, when the second largest number of parallaxes and the third largest number of parallaxes are close to each other, the user may select a wavelength away from the wavelength with the largest number of parallaxes. Furthermore, the parallax number of the selected wavelength may be used as a weighting factor when synthesizing the images in step S16 of FIG. 3. In the example of FIG. 6, the weighting factor of the first image is 70 / 160, and the weighting factor of the second image is 90 / 160.
[0044] [Effects of the first embodiment] According to the first embodiment, since the parallax images are captured while irradiating the structured light of the multiple wavelengths W1 and W2, the distance to the object can be calculated with high accuracy compared to the case where the parallax images are captured using only the white structured light. Note that the number of wavelengths of the structured light in the depth map generation process 1 is not limited to two, and may be three or more.
[0045] According to the first embodiment, the wavelength setting process is executed prior to the depth map generation process 1, so that the wavelengths W1 and W2 can be set according to the execution environment of the depth map generation process 1. This allows the distance to the object to be calculated with higher accuracy. In the wavelength setting process, instead of having the user select the wavelengths W1 and W2, the CPU 152 may automatically set the wavelength with the largest number of parallaxes and the wavelength with the second largest number of parallaxes to the wavelengths W1 and W2.
[0046] In the first embodiment, an example has been described in which the second structured light of the first wavelength W1 is irradiated from the first illumination unit 131 and the second structured light of the second wavelength W2 is irradiated from the second illumination unit 132. However, the specific structure of the structured illumination 13 is not limited to the example of FIG. 2.
[0047] [Modification of the first embodiment] Structured illumination devices 13A and 13B capable of emitting first structured light and second structured light will be described with reference to Fig. 7 and Fig. 8. Fig. 7 is a hardware configuration diagram of a camera device 10A according to a first modified example of the first embodiment. Fig. 8 is a hardware configuration diagram of a camera device 10B according to a second modified example of the first embodiment. Note that a detailed description of commonalities with Fig. 2 will be omitted, and differences will be mainly described.
[0048] 7, structured illumination 13A according to the first modification includes illumination unit 133 and wavelength changer 134. Illumination unit 133 irradiates (outputs) white structured light (i.e., a mixture of light of multiple wavelengths). Wavelength changer 134 is disposed on the optical path of the structured light irradiated from illumination unit 133, and changes the wavelength of the structured light to be passed.
[0049] As an example, the wavelength changing unit 134 includes a prism disposed on the optical path of the structured light and a rotation drive unit that rotates the prism. The wavelength changing unit 134 may rotate the prism in accordance with a control unit of the illumination control unit 14 to a first angle at which only the first structured light of the first wavelength W1 passes and a second angle at which only the second structured light of the second wavelength W2 passes.
[0050] As another example, the wavelength changing unit 134 may include a liquid lens disposed on the optical path of the structured light and a voltage control unit that applies a voltage to the liquid lens. The wavelength changing unit 134 may change the refractive index of the liquid lens between a first state in which only the first structured light of the first wavelength W1 passes and a second state in which only the second structured light of the second wavelength W2 passes by changing the voltage applied to the liquid lens in accordance with the control unit of the illumination control unit 14.
[0051] 8, the structured illumination 13B according to the second modification may include a light-emitting element that switches the wavelength of the structured light in response to a voltage applied from an illumination control unit 14. As the light-emitting element, for example, a VCSEL (Vertical Cavity Surface Emitting Laser) or the like may be adopted. In addition, the light-emitting element may be manufactured by MEMS (Micro Electro Mechanical Systems) technology.
[0052] [Second embodiment] [Depth map generation process 2] The depth map generation process 2 according to the second embodiment will be described with reference to Figs. 9 and 10. Fig. 9 is a flowchart of the depth map generation process 2. Fig. 10 is an example of a wavelength selection screen in the depth map generation process 2. The depth map generation process 2 is a process for finely adjusting the first wavelength W1 and the second wavelength W3 in the process of repeatedly generating a depth map. In the following, a detailed description of the points in common with the first embodiment will be omitted, and the differences will be mainly described. The configuration of the camera device 10 according to the second embodiment is the same as that of the first embodiment. Also, the processes of steps S11 to S18 in Fig. 9 are the same as those of the first embodiment.
[0053] After executing the processes of steps S11 to S18, the AI processing unit 154 identifies the detection area in the first left image and the first right image captured in step S12 and the detection area in the second left image and the second right image captured in step S15 (S31). The process of identifying the detection area is the same as step S24 in FIG. 5.
[0054] Next, the ISP 153 calculates a parallax number N1 within the detection area of each of the first left image and the first right image, and calculates a parallax number N2 within the detection area of each of the second left image and the second right image (S32). The process of calculating the parallax numbers N1 and N2 is the same as step S25 in Fig. 5. The process of step S32 is an example of a calculation process (calculation step).
[0055] Next, CPU 152 stores in memory 151 the first wavelength W1=400 nm of the first structured light irradiated in step S11, the first image (first left image or first right image) captured in step S12, and the parallax number N1 calculated in step S32, and displays them on user terminal 3 (S33). As a result, an upper left area B1 is added to the wavelength selection screen displayed on the display of user terminal 3, as shown in FIG.
[0056] Similarly, CPU 152 stores in memory 151 the second wavelength W2=550 nm of the second structured light irradiated in step S14, the second image (second left image or second right image) captured in step S15, and the parallax number N2 calculated in step S32, and also displays them on user terminal 3 (S33). As a result, as shown in Fig. 10, an upper right area C1 is added to the wavelength selection screen displayed on the display of user terminal 3. The process of step S33 is an example of a display process (display step).
[0057] Next, the CPU 152 shifts the first wavelength W1 and the second wavelength W2 by the minute wavelength ΔW2 (S35) until the first wavelength W1 and the second wavelength W2 are updated by the user of the user terminal 3 (S34: No), and executes the processes of steps S11 to S18 and S31 to S33 again. Note that the minute wavelength ΔW2 is smaller than the fluctuation width ΔW1 in step S22 of FIG. 5. If the first wavelength W1=400 nm and the second wavelength W2=550 nm in the first process, the first wavelength W1=410 nm and the second wavelength W2=560 nm in the second process, and the first wavelength W1=390 nm and the second wavelength W2=540 nm in the third process, the wavelength selection screen will be as shown in FIG. 10. In this case, the minute wavelength ΔW2=±10 nm.
[0058] The wavelength selection screen includes areas B1, B2, and B3 in which a first wavelength W1, a parallax number N1, and a set of first images corresponding to each process (S11 to S18, S31 to S33) are displayed, areas C1, C2, and C3 in which a second wavelength W2, a parallax number N2, and a set of second images corresponding to each process (S11 to S18, S31 to S33) are displayed, an [Update] button, and a [Next Candidate] button. Each of areas B1 to B3 and C1 to C3 includes a check box.
[0059] Then, when the [Next Candidate] button is pressed (S34: No), the CPU 152 executes the processes from step S35 onwards. On the other hand, when the CPU 152 selects one of the check boxes in the areas B1 to B3 and one of the check boxes in the areas C1 to C3 and presses the [Update] button (S34: Yes), the CPU 152 updates the two wavelengths corresponding to the selected check boxes as the first wavelength W1 and the second wavelength W2, and stores them in the memory 151 (S36). The process of step S36 is an example of an update process (update step).
[0060] 10, the first wavelength W1 is updated to 390 nm, and the second wavelength W2 is updated to 550 nm. After the [Update] button is pressed, the CPU 152 may continue the processes of steps S11 to S18 (i.e., depth map generation process 1) using the updated first wavelength W1 and second wavelength W2 without executing the processes of steps S31 to S35. Note that, although an example in which the first wavelength W1 and the second wavelength W2 are updated simultaneously has been described in FIGS. 9 and 10, the first wavelength W1 and the second wavelength W2 may be updated individually.
[0061] [Effects of the second embodiment] According to the second embodiment, the first wavelength W1 and the second wavelength W2 are updated (fine-tuned) during the depth map generation process 2 (in other words, during the process of moving the robot arm 6 toward the target position). This allows the first wavelength W1 and the second wavelength W2 to be optimized in accordance with changes in the execution environment of the depth map generation process 2 (for example, ON / OFF of lighting). As a result, the distance to the target object can be calculated with even higher accuracy. Note that, as in the wavelength setting process, instead of having the user select the wavelengths W1 and W2, the CPU 152 may automatically set the wavelength with the largest parallax number N1 as the first wavelength W1 and the wavelength with the largest parallax number N2 as the second wavelength W2.
[0062] [Third embodiment] [Depth map generation process 3] The depth map generation process 3 according to the third embodiment will be described with reference to Figs. 11 and 12. Fig. 11 is a flowchart of the depth map generation process 3. Fig. 12 is an image diagram of the depth map generation process 3. The depth map generation process 3 is a process for adjusting (changing) the density of the irradiation figure contained in the structured light in the process of repeatedly generating a depth map. In the following, a detailed description of the points in common with the first embodiment will be omitted, and the differences will be mainly described. The configuration of the camera device 10 according to the third embodiment is the same as that of the first embodiment. Also, the processes of steps S11 to S18 in Fig. 11 are the same as those of the first embodiment.
[0063] The ISP 153 identifies the size of the object WK based on the depth map (distance information) generated in the current step S17 and the first image generated in the current step S12 or the second image generated in step S15 (S41). More specifically, the ISP 153 identifies the length Lx in the x direction (left-right direction) and the length Ly in the y direction (up-down direction) of the object WK captured in the image, as shown in Fig. 12. The x direction and the y direction may be mutually orthogonal. The process of step S41 is an example of a specification process (specification step).
[0064] Next, the CPU 152 determines whether the smaller of the lengths Lx and Ly specified in step S41 (Lx in the example of FIG. 12) is equal to or greater than a predetermined threshold value Lth (S42). If the size (Lx) of the object WK is less than the threshold value Lth (S42: No), the CPU 152 increases the density of the projection figure (S43). On the other hand, if the size (Lx) of the object WK is equal to or greater than the threshold value Lth (S42: Yes), the CPU 152 decreases the density of the projection figure (S44). The processes of steps S42 to S44 are an example of a change process (change step).
[0065] Then, in the next steps S11 and S14, the CPU 152 irradiates the structured light including the irradiation figure with the changed density toward the object. That is, the ISP 153 identifies the size of the object WK based on the distance information calculated in the current step S17 and the images captured in the current steps S12 and S15 (S41). The CPU 152 also changes the density of the irradiation figure according to the identified size of the object WK (S42 to S44), and further, in the next steps S11 and S14, the CPU 152 causes the structured illumination 13 to irradiate the structured light including the irradiation figure with the changed density.
[0066] As a result, in the process of repeating the processes of steps S11 to S18 and S41 to S44, the density of the illuminated figure is high in the early stages (i.e., when the distance from the camera device 10 to the object WK is far) (S42: No → S43), and the density of the illuminated figure decreases midway (i.e., when the distance from the camera device 10 to the object WK becomes closer) (S42: Yes → S44). Note that when the illuminated figure is a stripe pattern, "density" refers to the width and spacing of the stripes, as shown in FIG. 12. Also, when the illuminated figure is a dot pattern, "density" refers to the number of dots per unit area.
[0067] [Effects of the third embodiment] According to the third embodiment, the density of the projection figure is changed according to the size of the object WK, so that the projection figure is appropriately projected onto the object WK. More specifically, by increasing the projection figure density when the object WK is far away, it is possible to prevent the object WK from being located between adjacent projection figures and the projection figure is not possible. On the other hand, by decreasing the projection figure density when the object WK is close, it is possible to prevent the contour line and the projection figure from being indistinguishable in a complicated portion of the contour line. As a result, it is possible to calculate the distance to the object with even higher accuracy. The variation of the projection figure density is not limited to two stages as in FIG. 11 and FIG. 12, but may be three or more stages.
[0068] [Fourth embodiment] A camera device 10C and depth map generation processing 4 according to the fourth embodiment will be described with reference to Fig. 13 and Fig. 14. Fig. 13 is a hardware configuration diagram of the camera device 10C according to the fourth embodiment. Fig. 14 is a flowchart of depth map generation processing 4. Below, a detailed description of commonalities with the first embodiment will be omitted, and differences will be mainly described.
[0069] [Hardware configuration diagram of camera device 10C] 13, the camera device 10C according to the fourth embodiment includes an illumination-side polarizing section 16 (first polarizing section) and a camera-side polarizing section 17 (second polarizing section). The structured illumination 13 according to the fourth embodiment irradiates the object WK with white structured light (i.e., a mixture of multiple wavelengths). Meanwhile, the other configuration of the camera device 10C is the same as that of the first embodiment.
[0070] The illumination-side polarizing section 16 is disposed on the optical path of the structured light irradiated from the structured illumination 13. The illumination-side polarizing section 16 can take a first state in which it selectively transmits light of a specific polarization angle (e.g., light of a first polarization angle) from the structured light irradiated from the structured illumination 13 and blocks light of other polarization angles (e.g., light of a second polarization angle). The illumination-side polarizing section 16 can take a second state in which it selectively transmits light of a specific polarization angle (e.g., light of a second polarization angle) from the structured light irradiated from the structured illumination 13 and blocks light of other polarization angles (e.g., light of a first polarization angle). The illumination-side polarizing section 16 is configured to be able to switch the polarization angle of transmission, that is, to be able to switch between the first state and the second state, under the control of the illumination control section 14. For example, the illumination-side polarizing section 16 corresponds to an optical filter whose polarization angle can be electrically changed on a frame-by-frame basis.
[0071] The camera side polarizing section 17 is disposed on the optical path of light incident on the imaging sections 11 and 12. The camera side polarizing section 17 can take a first state in which it selectively transmits light of a specific polarization angle (for example, light of a first polarization angle) among the light incident on the imaging sections 11 and 12 and blocks light of other polarization angles (for example, light of a second polarization angle). The camera side polarizing section 17 can take a second state in which it selectively transmits light of a specific polarization angle (for example, light of a second polarization angle) among the light incident on the imaging sections 11 and 12 and blocks light of other polarization angles (for example, light of a first polarization angle). The camera side polarizing section 17 is further configured to be able to switch the polarization angle of transmission, that is, to be able to switch between the first state and the second state, under the control of the CPU 152. For example, the camera side polarizing unit 17 corresponds to a filter with a different polarization angle that is provided for each pixel of a unit pixel region in an image sensor having 4 or 16 unit pixel regions on the light incident surface, or an optical filter whose polarization angle can be electrically changed on a frame-by-frame basis.
[0072] The illumination side polarizing section 16 and the camera side polarizing section 17 are each composed of, for example, a known polarizing filter and a rotation drive section that rotates the polarizing filter. It is preferable that the illumination side polarizing section 16 and the camera side polarizing section 17 are configured so that the polarization angles of transmitted light can be switched synchronously with each other.
[0073] [Depth map generation process 4] In depth map generation process 4, steps S51 and S54 are executed instead of steps S11 and S14 of depth map generation process 1. On the other hand, steps S12, S13, and S15 to S18 of depth map generation process 4 are common to depth map generation process 1.
[0074] In step S51, CPU 152 sets the polarization angle at which illumination-side polarizer 16 and camera-side polarizer 17 transmit to a first polarization angle θ1. As a result, when structured illumination 13 is turned on, only the first structured light at the first polarization angle θ1 is irradiated onto object WK. Then, CPU 152 causes imaging units 11 and 12 to capture a first image of the imaging area (S12) in a state in which structured illumination 13 is irradiated with the first structured light at the first polarization angle θ1 (S51).
[0075] Furthermore, in step S54, CPU 152 sets the polarization angle at which illumination-side polarizer 16 and camera-side polarizer 17 transmit to a second polarization angle θ2 different from the first polarization angle θ1. As a result, when structured illumination 13 is turned on, only the second structured light at the second polarization angle θ2 is irradiated onto object WK. Then, CPU 152 causes imaging units 11 and 12 to capture a second image of the imaging area (S15) in a state in which structured illumination 13 is irradiated with the second structured light at the second polarization angle θ2 (S52).
[0076] [Effects of the fourth embodiment] According to the fourth embodiment, parallax images are captured while irradiating structured light with a plurality of polarization angles θ1 and θ2, so that the object WK can be properly imaged even when the object WK is covered with transparent vinyl, for example. In addition, by arranging the polarizing units 16 and 17 on both the optical path of the structured light irradiated from the structured illumination 13 and the optical path of the light incident on the imaging units 11 and 12, it is possible to prevent unnecessary light from reaching the image sensors 112 and 122. As a result, the distance to the object can be calculated with even higher accuracy.
[0077] 5 (i.e., polarization angle setting process) by replacing "wavelength" with "polarization angle" prior to the depth map generation process 4, the CPU 152 can set the first polarization angle θ1 and the second polarization angle θ2. This makes it possible to set the polarization angles θ1 and θ2 according to the execution environment of the depth map generation process 4.
[0078] 9 by replacing "wavelength" with "polarization angle" in the depth map generation process 4, the CPU 152 can update (fine-tune) the first polarization angle θ1 and the second polarization angle θ2. This makes it possible to optimize the polarization angles θ1 and θ2 in accordance with changes in the execution environment of the depth map generation process 4 (for example, turning on / off a light).
[0079] [Other embodiments] The first to fourth embodiments can be combined in any combination without departing from the spirit of the present invention.
[0080] Furthermore, the division of roles between the SoC 15 and the robot vision controller 2 is not limited to the above example. That is, a part or all of the processing of the SoC 15 may be executed by the robot vision controller 2. Furthermore, a part or all of the processing of the robot vision controller 2 may be executed by the SoC 15.
[0081] Furthermore, a part or all of the means realized by the program can be realized by hardware such as an integrated circuit. Furthermore, the program may be provided by being recorded on a non-transitory recording medium that can be read by a computer. Examples of the recording medium include a hard disk, an SD card, a DVD, and a server on the Internet.
[0082] Although various embodiments have been described above with reference to the drawings, it goes without saying that the present disclosure is not limited to such examples. It is clear that a person skilled in the art can conceive of various modifications, corrections, substitutions, additions, deletions, and equivalents within the scope of the claims, and it is understood that these also naturally belong to the technical scope of the present disclosure. In addition, the components in the various embodiments described above may be arbitrarily combined within the scope of the invention. [Industrial Applicability]
[0083] The present disclosure is useful as a camera device capable of calculating the distance to an object with high accuracy. [Explanation of symbols]
[0084] 1. Robot Control System 2 Robot Vision Controller 3. User terminal 4. Robot 5 Robot Controller 6. Robot Arm 7 End Effector 10, 10A, 10B, 10C Camera equipment 11,12 Imaging unit 13,13A,13B Structured lighting 14 Lighting control unit 16 Lighting side polarizing unit 17 Camera side polarizing unit 111,121 Optical lenses 112,122 Image Sensor 131 First Lighting Section 132 Second Lighting Section 133 Lighting Department 134 Wavelength change unit 151 Memory 152 CPU 154 AI Processing Unit 155 External Interface
Claims
1. Structured illumination for irradiating an object with structured light; A first imaging unit that captures an imaging area including the object; A second imaging unit that captures an image of the imaging area from a position different from that of the first imaging unit; a control unit that controls the structured illumination, the first imaging unit, and the second imaging unit, The control unit is a first imaging process of causing each of the first imaging unit and the second imaging unit to capture a first image of the imaging area in a state in which the structured illumination is irradiated with a first structured light; a second imaging process for causing each of the first imaging unit and the second imaging unit to capture a second image of the imaging area in a state in which the structured illumination is irradiated with second structured light having a spatial distribution different from that of the first structured light; and performing a calculation process to calculate distance information to the object using the first image and the second image.
2. The control unit is In the first imaging process, the structured illumination is irradiated with the first structured light having a first wavelength; The camera device according to claim 1 , wherein in the second imaging process, the structured illumination is irradiated with the second structured light having a second wavelength different from the first wavelength.
3. The structured illumination includes: A first illumination unit that irradiates the first structured light; The camera device according to claim 2 , further comprising: a second illumination unit that irradiates the second structured light.
4. The structured illumination includes: An illumination unit that emits white structured light; The camera device according to claim 2 , further comprising: a wavelength changing unit that changes a wavelength of the structured light irradiated from the illumination unit.
5. The camera device according to claim 4 , wherein the wavelength changing unit includes a prism or a liquid lens.
6. The camera device according to claim 2 , wherein the structured illumination includes a light-emitting element that switches the wavelength of the structured light in response to a voltage applied from the control unit.
7. The control unit is In the first imaging process, the first structured light having a first polarization angle is irradiated onto the structured illumination; The camera device according to claim 1 , wherein in the second imaging process, the structured illumination is irradiated with the second structured light having a second polarization angle different from the first polarization angle.
8. a first polarizing unit that is arranged on an optical path of structured light irradiated from the structured illumination and is switchable between a first state in which one of the light at the first polarization angle or the light at the second polarization angle is selectively transmitted and the other of the light at the first polarization angle or the light at the second polarization angle is blocked, and a second state in which the other of the light at the first polarization angle or the light at the second polarization angle is selectively transmitted and the one of the light at the first polarization angle or the light at the second polarization angle is blocked; The camera device according to claim 7 , further comprising: a second polarizing section arranged on an optical path of light incident on the first imaging section and the second imaging section, and switchable between the first state and the second state.
9. The control unit is an imaging process in which the first imaging unit and the second imaging unit capture images of the imaging area in a state in which the structured illumination is irradiated with structured light set to a predetermined spatial distribution; A calculation process of calculating the number of pixels that can be determined to be at the same position of the object in the pair of images captured in the imaging process; a display process for displaying the spatial distribution of the structured light irradiated in the imaging process and the number of pixels calculated in the calculation process on a display device in association with each other, while changing the spatial distribution of the structured light; The camera device according to claim 1 , further comprising: a setting process for setting a spatial distribution selected from a plurality of spatial distributions displayed on the display device as the spatial distribution of the first structured light and the second structured light.
10. The camera device of claim 9 , wherein the control unit includes an AI processing unit that identifies a region of the object within an image.
11. The control unit is changing a spatial distribution of the first structured light every time the first imaging process is performed; A calculation process of calculating a number of pixels that can be determined to be at the same position of the object in a pair of images captured in the first imaging process; a display process for displaying, on a display device, a spatial distribution of the structured light irradiated in the first imaging process and the number of pixels calculated in the calculation process in association with each other, every time the first imaging process is executed; 2. The camera device according to claim 1, further comprising: an update process for updating a spatial distribution selected from the plurality of spatial distributions displayed on the display device as the spatial distribution of the first structured light to be irradiated in a next first imaging process.
12. The control unit is a process of determining a size of the object based on the distance information calculated in the current calculation process and an image captured in the current first imaging process or the previous second imaging process; A change process is executed to change the density of the irradiation figure included in the structured light according to the size of the object identified in the identification process; The camera device according to claim 1 , wherein in a next first imaging process and a next second imaging process, the structured illumination is caused to irradiate the structured light including the irradiation pattern having a density changed in the change process.
13. a first imaging step of imaging an imaging region including the object from two different viewpoints while irradiating the object with first structured light; a second imaging step of imaging the imaging area from the two viewpoints while irradiating the object with second structured light having a spatial distribution different from that of the first structured light; a calculation step of calculating distance information to the object using the images captured in the first imaging step and the second imaging step.
14. Structured illumination for irradiating an object with structured light; A first imaging unit that captures an imaging area including the object; A program for a camera device including a second imaging unit that captures an image of the imaging area from a position different from that of the first imaging unit, a first imaging process of causing each of the first imaging unit and the second imaging unit to capture a first image of the imaging area in a state in which the structured illumination is irradiated with a first structured light; a second imaging process for causing each of the first imaging unit and the second imaging unit to capture a second image of the imaging area in a state in which the structured illumination is irradiated with second structured light having a spatial distribution different from that of the first structured light; A calculation process that calculates distance information to the object using the first image and the second image, and a program that is executed by the camera device.
Citation Information
Patent Citations
Image processing device, control method, control program, and computer-readable recording medium
JP2020193867A
