Shooting condition adjustment device, shooting condition adjustment method, and program
The system adjusts camera settings to uniform brightness across multiple images using one-dimensional histograms, addressing the challenge of varying brightness in complex objects like car bodies, enabling efficient defect detection.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- KONICA MINOLTA INC
- Filing Date
- 2022-07-08
- Publication Date
- 2026-05-26
AI Technical Summary
Existing techniques for inspecting complex three-dimensional objects like car bodies require optimizing shooting conditions for each of the approximately 1000 images taken, which is cumbersome and impractical due to varying brightness distributions, and methods for uniform objects do not account for changing conditions with each shot.
A system that adjusts camera settings to uniform brightness distribution across multiple images by creating and displaying one-dimensional histograms, allowing for quick evaluation of brightness changes and optimizing shooting conditions.
Enables uniform brightness across images without needing to check each binarized image, facilitating quick detection of defects and simplifying the inspection process.
Smart Images

Figure 0007865336000011 
Figure 0007865336000012 
Figure 0007865336000013
Abstract
Description
[Technical Field]
[0001] This invention relates to a shooting condition adjustment device, a shooting condition adjustment method, and a program for adjusting the shooting conditions of multiple images obtained by photographing a workpiece illuminated by a lighting device with a camera while relatively moving at least one of the lighting device and a camera with respect to a workpiece such as a car body. [Background technology]
[0002] For example, there is a known technique for inspecting surface defects on a workpiece, such as a car body, by moving at least one of the lighting device and a camera relative to the workpiece, and then photographing the workpiece illuminated by the lighting device with the camera.
[0003] In this case, approximately 1000 images are taken, but because the vehicle body has a complex three-dimensional shape, the brightness distribution of the images changes slightly with each shot. Therefore, optimization of the shooting conditions for each shot is required.
[0004] To verify the effectiveness of optimizing shooting conditions, it is helpful to examine the binarized image resulting from image processing for each captured image.
[0005] Patent Document 1 describes creating a histogram for each image and using the average brightness value of the two peaks corresponding to the bright and dark areas as the threshold for the binarization level.
[0006] Furthermore, Patent Document 2 discloses controlling the exposure time according to the characteristic information of the substrate, and Patent Document 3 discloses controlling the exposure time according to the reflectance of the target for imaging. [Prior art documents] [Patent Documents]
[0007] [Patent Document 1] Japanese Patent Application Publication No. 05-164703 [Patent Document 2] Japanese Patent Publication No. 2009-281835 [Patent Document 3] Japanese Patent Publication No. 2005-24271 [Overview of the project] [Problems that the invention aims to solve]
[0008] However, the technology described in Patent Document 1 requires checking the binarized image for each individual image, making it difficult to check the binarized image for each of the approximately 1000 images, as is done in vehicle defect inspection.
[0009] Furthermore, Patent Documents 2 and 3 describe a situation where the object to be measured is uniform, such as a substrate, rather than a three-dimensional shape like a car body, and only one image of the substrate needs to be taken. For this reason, only one exposure time needs to be set for each substrate, and verification is easy. However, when photographing complex shapes such as car bodies, the optimal values of the shooting conditions gradually change with each shot, making it impossible to apply the techniques of Patent Documents 2 and 3.
[0010] This invention has been made in view of the above technical background, and aims to provide a shooting condition adjustment device, a shooting condition adjustment method, and a program that eliminate the need to check the binarized image for each of the multiple captured images when photographing a workpiece illuminated by a lighting device with a camera while moving at least one of the lighting device and the camera relative to a workpiece such as a vehicle body. [Means for solving the problem]
[0011] The above objectives will be achieved by the following means. (1) Acquisition means for acquiring multiple captured images when a workpiece illuminated by the illumination device is photographed by the camera while moving at least one of the illumination device and the camera relative to the workpiece, An adjustment means for adjusting the shooting conditions of the camera so that the brightness distribution of each of the multiple images acquired by the acquisition means is uniform, A creation means for creating multiple one-dimensional histograms, which are created by taking images under at least one of the shooting conditions before adjustment and the shooting conditions after adjustment, and for each of the multiple images taken by the acquisition means, displaying the frequency of the histogram showing the brightness distribution of the captured image in a one-dimensional manner in the direction of the histogram class using a parameter that can distinguish the magnitude of the frequency, An output means that outputs display data such that multiple one-dimensional histograms created by the creation means are displayed side by side, An imaging condition adjustment device comprising the following. (2) The imaging condition adjustment device according to item (1) above, wherein the imaging conditions include the exposure time of the camera. (3) The imaging condition adjustment device according to item (1) above, wherein the imaging conditions include the gain of the camera. (4) The imaging condition adjustment device according to any one of items (1) to (3) above, wherein the adjustment means adjusts the imaging conditions so that the maximum light amount in the dark region in the captured image becomes a constant value, or the minimum light amount in the light band becomes a constant value, or the intermediate light amount between the maximum light amount in the dark region and the minimum light amount in the light band becomes a constant value. (5) The adjustment means adjusts the imaging conditions so that the maximum light amount in the light band in the captured image does not exceed the upper limit value, as described in the previous item 1 The imaging condition adjustment device described above. ( 6 ) The parameter is color separation, as described in the previous item 1 The imaging condition adjustment device described above. ( 7 ) The parameter is gradation, as described in the previous item 1 The imaging condition adjustment device described above. ( 8 ) The display data is display data in which the one-dimensional histograms are arranged side by side, as described in the previous item 1 The imaging condition adjustment device described above. ( 9 ) The display data is display data in which a one-dimensional histogram with intermediate captured images thinned out is displayed, as described in the previous item 1 The imaging condition adjustment device described above. ( 10 ) The imaging condition adjustment device according to the previous item, wherein the imaging conditions in the thinned-out frames are diverted from the imaging conditions obtained from the used frames before and after them. 9 The imaging condition adjustment device described above. ( 11 ) An acquisition step of acquiring a plurality of captured images when the work illuminated by the illumination device is captured by the camera while relatively moving at least one of the illumination device and the camera with respect to the work, and <e An adjustment step is to adjust the shooting conditions of the camera so that the brightness distribution of each of the multiple images acquired in the acquisition step is uniform. A creation step involves creating multiple one-dimensional histograms, each of which is obtained in the acquisition step by taking images under at least one of the shooting conditions before adjustment and the shooting conditions after adjustment, and for each of the multiple images taken in the acquisition step, the frequency of the histogram showing the brightness distribution of the captured images is displayed one-dimensionally in the direction of the histogram class using a parameter that can distinguish the magnitude of the frequency. An output step outputs display data so that multiple one-dimensional histograms created in the above creation step are displayed side by side. A method for adjusting shooting conditions, including the following. ( 12 The aforementioned shooting conditions include the exposure time of the camera. 11 The method for adjusting shooting conditions as described. ( 13 The aforementioned shooting conditions include the gain of the camera. 11 The method for adjusting shooting conditions as described. ( 14 ) In the adjustment step, the shooting conditions are adjusted so that the maximum light intensity in the dark region of the captured image is constant, or the minimum light intensity in the light band is constant, or the intermediate light intensity between the maximum light intensity in the dark region and the minimum light intensity in the light band is constant. 11 ~ 13 The shooting condition adjustment method described in one of the following. ( 15 ) In the adjustment step, the shooting conditions are adjusted so that the maximum amount of light in the light band in the captured image does not exceed the upper limit. 11 The method for adjusting shooting conditions as described. ( 16 The above parameters are color-coded as described in the previous section. 11 The method for adjusting shooting conditions as described. ( 17 ) The above parameter is a gradient (as described in the previous paragraph) 11 The method for adjusting shooting conditions as described. ( 18 The aforementioned display data is the display data in which the one-dimensional histograms are displayed side by side. 11 The method for adjusting shooting conditions as described. ( 19 The aforementioned display data is a display data in which a one-dimensional histogram is displayed with intermediate captured images removed. 11 The method for adjusting the shooting conditions as described. ( 20The shooting conditions for the thinned-out frames are reused from the shooting conditions obtained for the frames used before and after them. 19 The method for adjusting shooting conditions as described. ( 21 ) Previous section 11 A program that causes a computer to execute the shooting condition adjustment method described above. [Effects of the Invention]
[0012] The preceding paragraph (1) and ( 11 According to the invention described above, while moving at least one of the lighting device and the camera relative to the workpiece, multiple images are acquired when the workpiece illuminated by the lighting device is photographed by the camera. Furthermore, the shooting conditions of the camera are adjusted so that the brightness distribution of each acquired image is uniform. As a result, the brightness does not change significantly from image to image, and there is no need to check the binarized image for each individual image. Furthermore, for each of the multiple images captured by the camera, multiple one-dimensional histograms are created, each displaying the frequency of the histogram showing the brightness distribution of the captured images in a one-dimensional manner in the direction of the histogram's class, using parameters that can distinguish between large and small frequencies. The output data is then displayed so that the multiple one-dimensional histograms are shown side by side, allowing the brightness distribution of the multiple captured images to be grasped at a glance from the output data.
[0013] The preceding paragraph (2) and ( 12 According to the invention described above, the exposure time of the camera is adjusted so that the brightness distribution of the image is uniform.
[0014] The preceding paragraph (3) and ( 13 According to the invention described in ( ), the camera gain is adjusted so that the brightness distribution of the image is uniform.
[0015] The preceding paragraph (4) and ( 14 According to the invention described above, the shooting conditions are adjusted so that the maximum light intensity in the dark region of the captured image is constant, or the minimum light intensity in the light band is constant, or the intermediate light intensity between the maximum light intensity in the dark region and the minimum light intensity in the light band is constant.
[0016] The preceding paragraph (5) and ( 15According to the invention described above, the shooting conditions are adjusted so that the maximum light intensity of the light band in the captured image does not exceed the upper limit.
[0018] Previous item ( 6 ) and ( 16 According to the invention described in ( ), multiple one-dimensional histograms, in which the frequencies are color-coded, can be displayed side by side.
[0019] Previous item ( 7 ) and ( 17 According to the invention described above, multiple one-dimensional histograms, in which the frequency is displayed in a gradient, can be displayed side by side.
[0020] Previous item ( 8 ) and ( 18 According to the invention described in ( ), one-dimensional histograms of multiple captured images can be displayed side by side.
[0021] Previous item ( 9 ) and ( 19 According to the invention described above, while it takes time to open and process all the frames, by opening and processing a subset of the images and then displaying them, the images can be displayed in a short amount of time.
[0022] Previous item ( 10 ) and ( 20 According to the invention described above, the shooting conditions for the thinned-out frames are reused from the shooting conditions obtained for the frames used before and after them, thus simplifying the process of adjusting the shooting conditions.
[0023] Previous item ( 21According to the invention described above, while moving at least one of the lighting device and the camera relative to the workpiece, multiple images are acquired when the workpiece illuminated by the lighting device is photographed by the camera, and the computer is made to perform a process to adjust the shooting conditions of the camera for each of the acquired multiple images so that the brightness distribution of the images is uniform. [Brief explanation of the drawing]
[0024] [Figure 1] This is a schematic diagram of a shooting system using data processing according to one embodiment of the present invention. [Figure 2] (A) to (F) are images taken when the vehicle was moved and continuously photographed with a camera. [Figure 3] This shows the position of the vehicle and the corresponding image when the photograph was taken under uniform exposure conditions. (A) to (C) are the photographs, and (D) is an image of the vehicle. [Figure 4] (A) to (C) are binarized images obtained by applying a binarization process to each of the captured images in Figure 3(A) to (C) with a constant binarization threshold. [Figure 5] (A) to (C) show images taken with adjusted shooting conditions, and (D) is an image of the vehicle body. [Figure 6] (A) to (C) are binarized images obtained from the respective captured images in Figure 5(A) to (C). [Figure 7] This is a single image captured by a camera. [Figure 8] Figure 7 shows the histogram of the captured images. [Figure 9] This is an explanatory diagram for displaying histogram frequencies using different colors. [Figure 10] This is an explanatory diagram for displaying histogram frequencies using a gradient. [Figure 11] This figure shows a one-dimensional histogram created by displaying the frequency of the histogram in different colors. [Figure 12]This is an explanatory diagram showing how multiple one-dimensional histograms, obtained by downsampling images, are displayed side by side. [Figure 13] This figure shows an example of a histogram of captured images. [Figure 14] This is an explanatory diagram showing a display of one-dimensional histograms for all captured images before adjusting the shooting conditions. [Figure 15] This graph shows the exposure time for each shot when the exposure time is adjusted so that the brightness distribution of the captured image is uniform. [Figure 16] This is an explanatory diagram showing a one-dimensional histogram of all captured images after adjusting the shooting conditions, displayed in the order in which they were taken. [Figure 17] (A) shows the original image under certain shooting conditions, and (B) shows the image under different shooting conditions for obtaining the histogram. [Figure 18] This figure shows another example of a histogram of a captured image. [Figure 19] This figure shows another example of a histogram of a captured image. [Modes for carrying out the invention]
[0025] Hereinafter, embodiments of this invention will be described based on the drawings.
[0026] Figure 1 is a schematic diagram of a shooting system using a shooting condition adjustment device according to one embodiment of the present invention. This shooting system is used to inspect the surface of a car body 100, which is a workpiece, for the presence or absence of concave or convex defects. The shooting system comprises a light source 1 as an illumination device, a camera 2 equipped with an image sensor having a large number of pixels, and a data processing device 3, which is a shooting condition adjustment device that processes images captured by the camera 2. With the car body 100 illuminated by illumination light from the light source 1, the camera 2 continuously captures multiple frames (for example, about 1000 images) while at least one of the light source 1 and the camera 2 is moved relative to the car body 100. Note that "moving relative to" means that both the light source 1 and the camera 2 may be fixed and the car body 100 may be moved, or the car body 100 may be fixed and one or both of the light source 1 and the camera 2 may be moved, or at least one of the light source 1 and the camera 2 and the car body 100 may be moved with a difference in speed. In this embodiment, both the light source 1 and the camera 2 are fixed, and the vehicle body 100 is moved in the direction of arrow F.
[0027] In this embodiment, the data processing device 3 is comprised of a personal computer (PC). The data processing device 3 operates by a processor such as a CPU operating according to an operating program stored in a memory unit (not shown). Functionally, it comprises an image acquisition unit 31, a histogram creation unit 32, a one-dimensional histogram creation unit 33, a data output unit 34, a shooting condition adjustment unit 36, and a display device 35 which is a display.
[0028] The image acquisition unit 31 acquires images captured continuously by the camera 2, the histogram creation unit 32 creates a histogram for each captured image, the one-dimensional histogram creation unit 33 creates a one-dimensional histogram, the data output unit 34 creates display data for displaying the created one-dimensional histograms side by side and outputs the display data to the display device 35 or an external printer 4, and the shooting condition adjustment unit 36 adjusts the shooting conditions by the camera 2, but these processes will be described later.
[0029] Figures 2(A) to (F) show images captured by camera 2 while the vehicle body 100 is moving. These images are output from camera 2 and acquired by the image acquisition unit 31 of the data processing device 3. As the vehicle body 100 moves, the light band 10 of the light source 1 reflected on the vehicle body 100 is detected on the captured image, and defective images within the light band 10 are detected. As the vehicle body 100 moves, the position of the light band 10 in the captured image also gradually moves.
[0030] Because the vehicle body 100 has a complex three-dimensional shape, the brightness of the light band 10 that appears in the captured image differs from image to image. Therefore, when creating a binarized image to detect the light band 10, if the binarization threshold is kept constant, the light band 10 cannot be properly detected in the binarized image in captured images where the light band 10 appears dark. On the other hand, the light band 10 can be correctly detected in the binarized image in captured images where the light band 10 appears bright.
[0031] Figure 3 shows the position of the vehicle body 100 and the corresponding images when photography was performed under uniform exposure conditions. (A) to (C) are the captured images, and (D) is an image of the vehicle body 100.
[0032] Image 21a in Figure 3(A) is a photograph of the front of the vehicle body 100, as shown in Figure 3(D); image 21b in Figure 3(B) is a photograph of the area near the center of the vehicle body 100; and image 21c in Figure 3(C) is a photograph of the rear of the vehicle body 100. In all of these photographs, the light band 10 is visible, but it can be seen that the brightness of the light band 10 in the photograph differs depending on the position of the vehicle body 100 during the photograph.
[0033] Figures 4(A) to 4(C) show the binarized images 22a to 22c obtained when each of the captured images 21a to 21c in Figures 3(A) to 3(C) is binarized with a constant binarization threshold. It can be seen that when the light band image is dark, as in the captured image 21a in Figure 3(A) and the captured image 21c in Figure 3(C), the light band 10 cannot be detected properly, as in the binarized image 22a in Figure 4(A) and the binarized image 22c in Figure 4(C).
[0034] By adjusting the shooting conditions of camera 2 for each shot so that the brightness of the light band 10 in the captured image is the same in every image, a correctly binarized image can be obtained from any captured image.
[0035] Figures 5(A) to (C) show images 23a to 23c taken with adjusted shooting conditions, and (D) is an image of the vehicle body 100. The shooting positions for images 23a to 23c are the same as in Figure 3. In this example, the exposure time is set longer for the front image 23a and the rear image 23c of the vehicle body 100. By adjusting the exposure time for each shot, the brightness of the light band 10 can be made uniform in all images. Figures 6(A) to (C) show the binarized images 24a to 24c obtained from the images in Figures 5(A) to (C).
[0036] If the shooting conditions can be set so that the brightness of the light band 10 is uniform in all captured images, then a correct binarized image can be obtained for all captured images, even if a constant binarization threshold is used.
[0037] However, for inspection targets with complex shapes like vehicle body 100, the brightness distribution of each image differs, making it impossible to grasp the overall brightness distribution across all images at a glance. Therefore, being able to grasp it at a glance would be extremely useful.
[0038] Furthermore, if the shooting conditions are changed for each shot, being able to see at a glance how the brightness distribution of all captured images has changed allows for a quick determination of whether a correct binarized image can be obtained from all captured images.
[0039] This embodiment makes it possible to quickly grasp the effect of adjustments when adjusting the shooting conditions for a workpiece such as a car body 100, where the brightness differs each time it is photographed.
[0040] Next, this embodiment will be described in detail.
[0041] Figure 7 shows a single captured image 25 taken by camera 2 and acquired by image acquisition unit 31 of data processing device 3. The black areas 11 are dark regions, and the bright streaky areas are light bands 10. Generally, a histogram like the one in Figure 8 is used to show the brightness distribution of an image. The horizontal axis of the histogram represents the class, which in this embodiment represents the pixel value of the captured image. The vertical axis represents the frequency, which in this embodiment is the number of pixels in the captured image that have that pixel value. Figure 8 is the histogram of the captured image 25 from Figure 7, created by the histogram generation unit 32. In the histogram of Figure 8, the peak near the pixel value of zero represents the dark region 11, and the peak near the pixel value of 50 represents the light band 10. As can be seen from Figure 8, there is a peak in the histogram near the pixel value of 50 that is due to the light band 10, and a peak near the pixel value of 0 that is due to the dark region 11.
[0042] In the case of the histogram shown in Figure 8, the brightness distribution of a particular image 25 can be seen, but since approximately 1000 images are taken during the inspection of surface defects on the vehicle body 100, it is not possible to check the histogram of every single image.
[0043] Therefore, the one-dimensional histogram creation unit 33 converts the histogram to one dimension to create a one-dimensional histogram. One-dimensional conversion is performed using a parameter that can distinguish the magnitude of the histogram frequencies, which represent the distribution of brightness. In this embodiment, the case where this parameter is color-coded is described. In other words, the histogram frequencies are displayed in color. In the following description, displaying the histogram frequencies in color is also called pseudo-color display.
[0044] As shown in Figure 9, pseudo-color display is achieved by displaying values (frequency) in colors assigned to each value magnitude: red for large values, green for medium values, and blue for small values.
[0045] Note that the parameters may not be color-coded, but rather represented by a monochrome or other gradient, as shown in Figure 10. In this case, for example, a lighter color may be used for larger values (frequency), and a darker color for smaller values, and the parameters may be displayed using the density assigned to each value magnitude. However, this embodiment will describe the case where the parameters are color-coded.
[0046] When the histogram in Figure 8 is displayed in pseudocolor according to the magnitude of the values (frequency), it becomes as shown in Figure 11. The horizontal axis represents the pixel values, which are the classes, and the parameters are displayed in the direction of the pixel values. In this way, by displaying the histogram in pseudocolor, the brightness distribution information, which was displayed in two dimensions in the histogram in Figure 8, can be displayed in one dimension as shown in Figure 11. In this embodiment, the histogram displayed in one dimension as shown in Figure 11 is called a one-dimensional histogram 5.
[0047] A one-dimensional histogram 5 is created for each captured image. After creation, the horizontally oriented, rectangular one-dimensional histogram 5 is rotated vertically, and the one-dimensional histogram 5 is arranged so that the horizontal axis is the frame number (image number) and the vertical axis is the pixel value. This allows for the simultaneous display of one-dimensional histogram 5 for multiple captured images, as shown in Figures 12, 14, or 16. The labels on the horizontal axis, "Frame No.", and vertical axis, "Pixel Value," as well as the scale, may also be displayed.
[0048] This type of display allows for a quick visual recognition of how the brightness of the light band 10 and dark areas 11 changes with each captured frame. Figures 14 and 16 show the one-dimensional histograms 5 of all captured images densely arranged, while Figure 12 shows the one-dimensional histograms 5 of intermediate captured images spaced apart, by regularly or irregularly thinning out the histograms 5 of intermediate images. The display in Figure 12 has the advantage of reducing image loading and processing time by thinning out the number of frames, while the displays in Figures 14 and 16 have the advantage of allowing recognition of the brightness of all captured images.
[0049] The display of the one-dimensional histogram group as shown in Figures 12 and 14 may be performed by printing onto a recording medium 6 such as paper using the printer 4 shown in Figure 1, in which case the recording medium 6 becomes the display object for the one-dimensional histogram group. Alternatively, the one-dimensional histogram group may be displayed on the screen of the display device 35, in which case the display device 35 becomes the display object for the one-dimensional histogram group.
[0050] For printing on the recording medium 6 or displaying on the display device 34, the display data output unit 34 creates display data such that the one-dimensional histograms 5 of all captured images are displayed side by side, or the one-dimensional histograms 5 of intermediate captured images are thinned out and displayed with gaps in between. This display data is output to the image forming apparatus, namely the printer 4 or the display device 35, which then prints onto the recording medium 6 or displays on the display device 35. The display data may be created in PDF (Portable Document Format) or other file formats. The display data output unit 34 may also transmit the display data to other display devices via a network and display it on those devices.
[0051] Next, we will explain the process performed by the shooting condition adjustment unit 36 to adjust the shooting conditions so that the brightness distribution of each captured image becomes uniform.
[0052] As shown in Figure 13, the maximum pixel value of the dark region 11 in the histogram created for each captured image is P1 dark The maximum pixel value of the light band 10 is P1 light Therefore, the maximum pixel value of the dark region in the histogram of the i-th captured frame is P1 dark (i) and the maximum pixel value P1 of the optical band light Find (i).
[0053] The output value of each pixel of the image sensor in camera 2, PixelValue, is expressed by the following equation (1), using the amount of light L incident on the pixel, the exposure time, the gain of the pixel signal amplification circuit, and the γ value (γ). In equation (1), a is a coefficient.
[0054]
number
[0055] The shooting conditions when taking a picture with camera 2, namely the gain, exposure time, and γ value, are (Gain1, ExposureTime1, γ1). If the pixel value at that time is P1, then P1 is expressed by the following equation (2).
[0056]
number
[0057] When the shooting conditions are changed to (Gain2, ExposureTime2, γ2), the pixel value P2 when the same amount of light L is incident on the pixel is expressed by the following equation (3).
[0058]
number
[0059] P1 for each shooting dark (i) is a constant value P2 dark Determine the shooting conditions (Gain2, ExposureTime2, γ2) for each shot so that the result is as follows.
[0060] You can either keep Gain2 constant and change the exposure time (ExposureTime2) for each shot, or you can keep ExposureTime2 constant and change the gain (Gain2) for each shot. You could also adjust the light intensity (L) by adjusting the brightness of light source 1, but this would make the adjustment more complicated, so it is better to change either the exposure time (ExposureTime2) or the gain (Gain2).
[0061] If you want to change the exposure time for each shot, set the exposure time to ExposureTime2(i) as shown in equation (4) below.
[0062]
number
[0063] When changing the gain for each shot, set it to the gain Gain2(i) as shown in equation (5).
[0064]
Equation
[0065] Since it is easier to set finely by changing the exposure time, an example of changing the exposure time for each shot will be described below.
[0066] Also, it is good to adjust the shooting conditions so that the maximum pixel value P2 of the light band light in the new shooting conditions does not exceed a certain upper limit. The maximum pixel value P2 of the light band light can be obtained from P1 light using equation (6) described later.
[0067] Fig. 14 shows the one-dimensional histogram of all the captured images when a certain vehicle body 10 is captured by the camera 2 without adjusting the shooting conditions. It can be seen from Fig. 14 that if the shooting conditions are not adjusted, the brightness of each captured image is not uniform and varies greatly.
[0068] Fig. 15 shows the exposure time for each shot obtained by the above equation (4) so that P1 dark (i) becomes a constant value P2 dark .
[0069] The pixel value P2 obtained when the shooting conditions are changed from (Gain1, ExposureTime1, γ1) to (Gain2, ExposureTime2, γ2) is calculated by equation (6).
[0070]
Equation
[0071] Using equation (6) above, we obtain a one-dimensional histogram for each captured image when the shooting conditions are (Gain2, ExposureTime2, γ2). Arranging the one-dimensional histograms for all captured images in the order they were taken results in Figure 16. This allows us to see at a glance how the brightness distribution of all captured images changes when the shooting conditions are changed.
[0072] Alternatively, the histogram for the shooting conditions (Gain2, ExposureTime2, γ2) can be obtained by first converting the original image with the shooting conditions (Gain1, ExposureTime1, γ1) shown in Figure 17(a) to the image with the shooting conditions (Gain2, ExposureTime2, γ2) shown in Figure 17(b).
[0073] Alternatively, the histogram of the image obtained under the new exposure conditions can be obtained simply by transforming the horizontal axis values (PixelValue) of the original image's histogram using equation (6).
[0074] With a brightness distribution like that shown in Figure 17, the maximum light intensity in the dark region 11 is constant across all captured images, making it immediately clear that the binarized image can be correctly calculated using a common binarization threshold across all captured images.
[0075] In the above explanation, P1 dark (i) is a constant value P2 dark The shooting conditions (Gain2, ExposureTime2, γ2) for each shot were determined to achieve this, but it is also acceptable to control the settings so that the minimum light intensity in light band 10 remains constant.
[0076] That is, as shown in Figure 18, the minimum pixel value P1 of the light band of the i-th frame is obtained from the histogram obtained for each shooting. light_min (i) and the maximum pixel value P1 of the optical band light_max Find (i).
[0077] For each shot, the minimum pixel value of the optical band P1 light_min (i) is a constant value P2 light_minDetermine the shooting conditions (Gain2, ExposureTime2, γ2) for each shot so that the result is as follows.
[0078] You can keep Gain2 constant and change ExposureTime2 for each frame, or you can keep ExposureTime2 constant and change Gain2 for each shot.
[0079] If you want to change the exposure time for each shot, set the exposure time to ExposureTime2(i) as shown in equation (7).
[0080]
number
[0081] If you want to change the gain for each shot, set the gain to Gain2(i) as shown in equation (8).
[0082]
number
[0083] Furthermore, the maximum pixel value P2 of the optical band under new shooting conditions. light_max However, it's best to adjust the shooting conditions so that they don't exceed a certain upper limit. P2 light_max Using equation (6), P1 light_max It can be calculated from this.
[0084] Alternatively, the system may be controlled so that the midpoint between the maximum light intensity in the dark region and the minimum light intensity in the light band remains constant.
[0085] That is, as shown in Figure 19, the midpoint P1 between the minimum pixel value in the light band and the maximum pixel value in the dark area of the i-th frame. thres (i) and the maximum pixel value P1 of the optical band light Find (i).
[0086] P1 for each shooting thres (i) is a constant value P2 thresDetermine the shooting conditions (Gain2, ExposureTime2, γ2) for each shot so that the result is as follows.
[0087] You can keep Gain2 constant and change ExposureTime2 for each frame, or you can keep ExposureTime2 constant and change Gain2 for each shot. If you want to change the exposure time for each shot, set the exposure time to ExposureTime2(i) as shown in equation (9).
[0088]
number
[0089] If you want to change the gain for each shot, set the gain to Gain2(i) as shown in equation (10).
[0090]
number
[0091] Furthermore, the maximum pixel value P2 of the optical band under new shooting conditions. light However, it's best to adjust the shooting conditions so that they don't exceed a certain upper limit. P2 light Using equation (6), P1 light It can be calculated from this.
[0092] As described above, in this embodiment, the brightness distribution of all captured images can be visualized using a display unit that arranges one-dimensional histograms 5, and the effect of adjusting and optimizing the shooting conditions can be evaluated at a glance.
[0093] When processing images by downsampling, it is advisable to reuse the shooting condition values obtained from the preceding and succeeding frames that were used for the unused frames. For example, if the shooting conditions were calculated using frames 1, 6, 11, 16, ..., the shooting conditions for frames 2 through 5 should be the same as those obtained using frame 1, and the shooting conditions for frames 7 through 10 should be the same as those obtained using frame 6.
[0094] This application is accompanied by a priority claim from Japanese Patent Application No. 2021-122664, filed on July 27, 2021, and the disclosures thereof constitute a part of this application. [Industrial applicability]
[0095] The present invention can be used to adjust the shooting conditions of multiple images obtained by photographing a workpiece illuminated by a lighting device with a camera while relatively moving at least one of the lighting device and the camera with respect to a workpiece such as a vehicle body. [Explanation of symbols]
[0096] 1 Light source (lighting device) 2 cameras 3. Data processing device (shooting condition adjustment device) 31 Image acquisition unit 32 Histogram Creation Section 33 One-Dimensional Histogram Creation Section 34 Data Output Section 35 Display device (display body) 36 Shooting Condition Adjustment Unit 4 Printers 5. One-dimensional histogram 6. Recording medium (display) 10 Light bands 11 Dark region
Claims
1. Acquisition means for acquiring multiple captured images when a workpiece illuminated by the illumination device is photographed by the camera while moving at least one of the illumination device and the camera relative to the workpiece, An adjustment means for adjusting the shooting conditions of the camera so that the brightness distribution of each of the multiple images acquired by the acquisition means is uniform, A creation means for creating multiple one-dimensional histograms, which are created by taking images under at least one of the shooting conditions before adjustment and the shooting conditions after adjustment, and for each of the multiple images taken by the acquisition means, displaying the frequency of the histogram showing the brightness distribution of the captured image in a one-dimensional manner in the direction of the histogram class using a parameter that can distinguish the magnitude of the frequency, An output means that outputs display data such that multiple one-dimensional histograms created by the creation means are displayed side by side, A shooting condition adjustment device equipped with the following features.
2. The shooting condition adjustment device according to claim 1, wherein the shooting conditions include the exposure time of the camera.
3. The shooting condition adjustment device according to claim 1, wherein the shooting conditions include the gain of the camera.
4. The shooting condition adjustment device according to any one of claims 1 to 3, wherein the adjustment means adjusts the shooting conditions so that the maximum light intensity in the dark region of the captured image becomes a constant value, or the minimum light intensity in the light band becomes a constant value, or the intermediate light intensity between the maximum light intensity in the dark region and the minimum light intensity in the light band becomes a constant value.
5. The shooting condition adjustment device according to claim 1, wherein the adjustment means adjusts the shooting conditions so that the maximum amount of light in the light band in the captured image does not exceed an upper limit.
6. The shooting condition adjustment device according to claim 1, wherein the parameters are color-coded.
7. The shooting condition adjustment device according to claim 1, wherein the parameter is a gradient.
8. The shooting condition adjustment device according to claim 1, wherein the display data is display data in which the one-dimensional histograms are displayed side by side.
9. The shooting condition adjustment device according to claim 1, wherein the display data is display data that shows a one-dimensional histogram from which intermediate captured images have been downsampled.
10. The shooting condition adjustment device according to claim 9, wherein the shooting conditions in the thinned-out frames are reused from the shooting conditions obtained in the frames used before and after them.
11. The acquisition step involves acquiring multiple captured images when the workpiece illuminated by the lighting device is photographed by the camera while moving at least one of the lighting device and the camera relative to the workpiece, An adjustment step is to adjust the shooting conditions of the camera so that the brightness distribution of each of the multiple images acquired in the acquisition step is uniform. A creation step involves creating multiple one-dimensional histograms, each of which is obtained in the acquisition step by taking images under at least one of the shooting conditions before adjustment and the shooting conditions after adjustment, and for each of the multiple images taken in the acquisition step, the frequency of the histogram showing the brightness distribution of the captured images is displayed one-dimensionally in the direction of the histogram class using a parameter that can distinguish the magnitude of the frequency. An output step outputs display data such that multiple one-dimensional histograms created in the above creation step are displayed side by side. A method for adjusting shooting conditions, including the following.
12. The shooting condition adjustment method according to claim 11, wherein the shooting conditions include the exposure time of the camera.
13. The shooting condition adjustment method according to claim 11, wherein the shooting conditions include the gain of the camera.
14. The method for adjusting shooting conditions according to any one of claims 11 to 13, wherein the adjustment step adjusts the shooting conditions so that the maximum light intensity in the dark region of the captured image becomes a constant value, or the minimum light intensity in the light band becomes a constant value, or the intermediate light intensity between the maximum light intensity in the dark region and the minimum light intensity in the light band becomes a constant value.
15. The method for adjusting shooting conditions according to claim 11, wherein the shooting conditions are adjusted in the adjustment step so that the maximum amount of light in the light band in the captured image does not exceed the upper limit.
16. The method for adjusting shooting conditions according to claim 11, wherein the parameters are color-coded.
17. The method for adjusting shooting conditions according to claim 11, wherein the parameter is a gradient.
18. The method for adjusting shooting conditions according to claim 11, wherein the display data is display data in which the one-dimensional histograms are displayed side by side.
19. The method for adjusting shooting conditions according to claim 11, wherein the display data is display data that shows a one-dimensional histogram from which intermediate captured images have been thinned out.
20. The shooting condition adjustment method according to claim 19, wherein the shooting conditions in the thinned-out frames are reused from the shooting conditions obtained in the frames used before and after them.
21. A program for causing a computer to execute the shooting condition adjustment method described in claim 11.