Exposure control method based on multi-frame image synthesis and exposure device thereof
Through multi-frame image synthesis technology, exposure parameters are adjusted according to the diffuse reflectance of different areas, which solves the problem that laser measurement accuracy is affected by the reflectivity of the object surface, and achieves higher exposure parameter adjustment speed and measurement accuracy.
Patent Information
- Application Number
- CN202410593894.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-08-16
AI Technical Summary
Due to the difference in diffuse reflectance of different object surfaces, laser measurement accuracy is affected. Traditional fixed exposure parameters lead to a decrease in measurement accuracy, especially in high-speed situations where it is difficult to achieve high-precision displacement measurement.
Using an exposure control method based on multi-frame image synthesis, the ideal exposure parameters of each area are obtained by dividing multiple areas, performing partition exposure and multi-frame image synthesis, and calculating the ideal exposure parameters of each column, which is suitable for laser displacement sensors and laser contour scanning instrument.
It improves the adjustment speed and measurement accuracy of exposure parameters, enhances the detection and application capabilities of the product in high-speed situations, and avoids the problem of local overexposure or underexposure.
Smart Images

Figure CN118509727A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of high-precision detection technology, and in particular to an exposure control method based on multi-frame image synthesis and an exposure device thereof. Background Art
[0002] At present, laser displacement sensors and laser profile sensors generally use the principle of triangular reflection method, that is, the laser beam emitted by the laser diode is irradiated to the surface of the object to be measured, and the light reflected back slowly passes through a group of lenses and is projected onto the photosensitive element matrix. Depending on the distance between the surface of the object to be measured and the laser light source, the imaging position on the photosensitive element matrix will also be different. By calculating the center of the imaging spot on the photosensitive element matrix, the surface displacement of the object to be measured can be confirmed.
[0003] Since the diffuse reflectivity of the surfaces of different objects varies greatly, under the same laser power and exposure settings, the light intensity received by the CMOS (Complementary Metal Oxide Semiconductor, CMOS) camera when measuring different objects is also very different, which greatly affects the laser measurement accuracy. Summary of the invention
[0004] The present invention provides an exposure control method based on multi-frame image synthesis. By dividing into multiple areas, ideal exposure parameters can be calculated for each column. Multiple frames are exposed separately according to the exposure effect, and multi-frame synthesis is performed. The method is suitable for laser displacement sensors and laser profile scanners, and the adjustment speed of exposure parameters is improved.
[0005] In a first aspect, the present application provides an exposure control method based on multi-frame image synthesis, which is used to control the exposure parameters of a camera sensor, wherein the photosensitive surface of the camera sensor includes X*Y pixels, where X and Y are positive integers, and the exposure control method includes:
[0006] The control system exposes the object to be tested according to m+1 different exposure parameters respectively, and the camera sensor obtains m+1 exposure images respectively; m>2, m is an integer;
[0007] The data processing system divides the photosensitive surface into m detection areas, and obtains overexposure frames and underexposure frames of the m detection areas according to m+1 exposure images;
[0008] The control system uses the over-exposure frame and the under-exposure frame corresponding to the detection area as boundaries, and sets m exposure detection frames, corresponding to m exposure detection parameters;
[0009] The control system exposes the detection area row by row using a rolling exposure method according to the exposure detection parameters corresponding to the m detection areas, and the camera sensor obtains detection images corresponding to the m detection areas respectively; wherein the exposure detection parameters of each detection area in each row are different;
[0010] The data processing system obtains the exposure parameters of the kth row in the detection image that meet the ideal exposure grayscale range, and determines that the exposure parameters of the kth row are the ideal exposure parameters of the detection area; k>2, k is an integer;
[0011] The control system exposes the detection area according to the ideal exposure parameters corresponding to the m detection areas, and the camera sensor obtains the exposure images corresponding to the m detection areas;
[0012] The data processing system calculates the center points of the exposure images corresponding to the m detection areas, performs multi-frame synthesis on the center points of the exposure images of the m detection areas, and obtains the moving distance of the object to be detected.
[0013] Optionally, the data processing system divides the photosensitive surface into m detection areas, including:
[0014] The data processing system divides the photosensitive surface into m continuous detection areas along the X-axis direction; wherein the number of pixels in the m detection areas is the same or different.
[0015] Optionally, the photosensitive surface is divided into m detection areas, including:
[0016] The data processing system divides the photosensitive surface into m detection areas according to the preset gray value range and the gray value size of the pixels of the exposure image;
[0017] The pixels that meet the preset gray value range fall within the same detection area.
[0018] Optionally, the exposure detection parameter is set as follows:
[0019] The exposure parameter Q of the exposure biased frame M The ratio of the maximum exposure power Pmax is used as the row exposure time T = Q for each row in the exposure detection frame. M / P max ;
[0020] The exposure power of each row in the exposure detection frame is set to increase linearly, and the exposure power of the kth row satisfies the following formula:
[0021]
[0022]
[0023]
[0024]
[0025] T frame =(n-1)t σ +T; 1≤k≤n, n is the number of exposure rows;
[0026] is the starting exposure power of the kth row within the row exposure time T, is the ending exposure power of the kth row within the row exposure time T; is the average exposure power of the kth row; Q (k) is the exposure parameter of the kth row of the exposure detection frame; T frame is the frame exposure time of the exposure detection frame; p is the detection exposure power; tσ is the time interval between adjacent exposure rows; G is the gain of the camera sensor.
[0027] Optionally, determining the exposure parameter of the kth row as the ideal exposure parameter of the detection area includes:
[0028] Recording the grayscale values of all pixels in the detection area in the under-exposure frame, normalizing the grayscale values of all pixels to obtain a grayscale value normalized value N(k) of the under-exposure frame;
[0029] Get the gray value G of each pixel of the exposure detection image of the detection area x (k);
[0030] The gray value G of the exposure detection image x The ratio of (k) to the normalized grayscale value N(k) of the frame with less exposure is taken as the expected grayscale value G x (k) / N(k);
[0031] When the expected gray value G x (k) / N(k) determines the average exposure parameter G of the kth row within the ideal exposure grayscale range. x (k) is the ideal exposure parameter Q(ki) of the detection area; wherein i is an integer.
[0032] Optionally, m+1 different exposure parameters are used to expose the object to be tested respectively, and m+1 exposure images are obtained, including:
[0033] The binary method is used to adjust m+1 exposure parameters that increase in sequence to expose the object to be tested, and m+1 exposure images are obtained.
[0034] Optionally, the exposure parameter of the frame with a larger exposure is twice the exposure parameter of the frame with a smaller exposure.
[0035] Optionally, the maximum exposure adjustment frame number R of the exposure detection frame is The value of is rounded up;
[0036] Among them, Q max is the maximum exposure parameter, Q min is the minimum exposure parameter.
[0037] Optionally, the ideal exposure parameter is between the exposure parameter of the frame with a larger exposure and the exposure parameter of the frame with a smaller exposure.
[0038] In a second aspect, an embodiment of the present application further provides an exposure device based on multi-frame image synthesis, which is used to implement any one of the exposure control methods provided in the first aspect, wherein the exposure device includes an exposure light source, an illumination lens, an imaging lens, a camera sensor with multi-frame image synthesis, a control system, and a data processing system;
[0039] The control system is electrically connected to the camera sensor and the data processing system respectively; the exposure light source and the camera sensor are electrically connected to the data processing system;
[0040] The illumination lens is located on the exposure light path of the exposure light source, and the imaging lens is located on the photosensitive front end surface of the camera sensor.
[0041] In summary, the exposure control method based on multi-frame image synthesis provided in the embodiment of the present application can achieve the effect of regional enhancement by dividing multiple regions and finding the ideal exposure parameters of the region. At the same time, for regions with particularly large differences in exposure parameters, multiple frames are exposed separately according to the exposure effect, and multi-frame synthesis is performed. Compared with the traditional multi-frame HDR algorithm with fixed exposure parameters, since the ideal exposure parameters can be calculated for each column, the adjustment is more precise, which is suitable for laser displacement sensors and laser profile scanners, improves the adjustment speed of the exposure parameters, and enhances the detection application of the product in high-speed occasions. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic diagram of an exposure device based on multi-frame image synthesis provided by the present application;
[0043] Figure 2 It is a flow chart of an exposure control method based on multi-frame image synthesis provided by the present application;
[0044] Figure 3 This application provides a schematic diagram of dividing the photosensitive surface of a camera sensor;
[0045] Figure 4 yes Figure 2 Schematic diagram of the exposure process of the exposure control method.
[0046] Figure 5 is based on Figure 3Schematic diagram of 5-frame exposure images obtained by photosensitivity division;
[0047] Figure 6 yes Figure 3 Schematic diagram of 4 frames of exposure detection images obtained within the exposure parameter range;
[0048] Figure 7 is based on Figure 6 Schematic diagram of 4 exposure images and their composite image obtained by using ideal exposure parameters;
[0049] Figure 8 is based on Figure 1-Figure 7 Flow chart of a laser displacement (contour) sensor ranging method based on multi-frame image synthesis;
[0050] Fig. 9 It is a schematic diagram of the division of the photosensitive surface of another camera sensor provided by the present application;
[0051] Fig.10 It is a flow chart of the method for setting exposure detection parameters provided in this application. DETAILED DESCRIPTION
[0052] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It will be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings. It is obvious to those skilled in the art that various modifications and changes can be made in the present invention without departing from the spirit or scope of the present invention. Therefore, the present invention is intended to cover modifications and changes of the present invention that fall within the scope of the corresponding claims (technical solutions for protection) and their equivalents. It should be noted that the implementation methods provided in the embodiments of the present invention can be combined with each other without contradiction.
[0053] Figure 1 is a schematic diagram of an exposure device based on multi-frame image synthesis provided by the present application. The embodiment of the present application provides an exposure device based on multi-frame image synthesis. The exposure device adopts the principle of triangular reflection method measurement. Figure 1 As shown, the exposure device 100 includes an exposure light source 10, an illumination lens 20, an imaging lens 30, a camera sensor 40 with a multi-frame image synthesis function, a control system (not shown in the figure) and a data processing system 50; the control system is electrically connected to the exposure light source 10, the camera sensor 40 and the data processing system 50 respectively; the exposure light source 10 and the camera sensor 40 are electrically connected to the data processing system 50; the illumination lens 20 is located on the exposure light path of the exposure light source 10, and the imaging lens 30 is located on the photosensitive front end surface of the camera sensor 40.
[0054] Specifically, Figure 1 As shown, the exposure light source 10 may be a laser light source for emitting an exposure light beam, and the exposure light source 10 may be a point laser or a line laser. Exemplarily, a point light source or a line light source in the visible light range may be used.
[0055] The illumination lens 20 is used to focus the exposure light beam.
[0056] The camera sensor 40 may be a CMOS (Complementary Metal Oxide Semiconductor) camera or a CCD (Charge Coupled Device) camera with a rolling shutter exposure function and a multi-frame synthesis function. The photosensitive surface of the camera sensor 40 includes X*Y pixels, where X and Y are positive integers. Exemplarily, the photosensitive surface of the camera sensor 40 is composed of 2024×2024 pixels.
[0057] The imaging lens 30 is located at the front end of the photosensitive surface of the camera sensor 40, and is used to converge the exposure light beam reflected by the object to be measured. The photosensitive surface of the camera sensor 40 is used to receive the exposure light beam reflected by the object to be measured. The data processing system 50 processes the exposure image obtained by the camera sensor 40, and analyzes and confirms the moving distance of the object to be measured. The control system is used to control the opening and closing of the exposure light source 10, the exposure and closing of the camera sensor 40, and the starting and closing of the image processing of the data processing system 50.
[0058] The present application adopts rolling shutter exposure to generate a single-frame exposure image of the object under test. Depending on the distance between the surface of the object under test and the laser light source, the imaging position on the photosensitive element matrix will also be different.
[0059] Among them, rolling shutter exposure adopts a row-by-row scanning and exposure method. When all pixels in the previous row are exposed at the same time, all pixels in the next row are exposed at the same time until all rows are exposed. It has low cost and low noise, and is suitable for precision detection requirements with low noise requirements.
[0060] The multi-frame synthesis function uses High Dynamic Range Imaging (HDRI or HDR) technology, which is a set of technologies used in computer graphics and film photography to achieve a larger exposure dynamic range (i.e., a larger difference between light and dark) than ordinary digital image technology. The purpose of high dynamic range imaging is to correctly represent a wide range of brightness in the real world, from direct sunlight to the darkest shadow.
[0061] For example, Figure 1As shown, when the surface of the object to be measured moves from point A to point B by x, the displacement of the image point on the photosensitive surface of the camera sensor 40 is x', a is the distance from the imaging lens 30 to the object to be measured (object distance), b is the distance from the main surface after receiving to the center of the imaging surface (generally the focal length f), θ is the angle between the optical axis of the exposure beam and the imaging lens 30, D is the distance from the exposure beam to the center of the exposure beam, and the focal length of the imaging lens 30 is f; the camera sensor 40 transmits the acquired exposure image information to the data processing system 50, and the data processing system 50 can confirm the surface displacement of the object to be measured by calculating the center of the imaging spot on the photosensitive element matrix.
[0062] Based on the same inventive concept, the present invention proposes an exposure control method based on multi-frame image synthesis in view of one or more of the above-mentioned problems existing in the prior art. The embodiment of the present application provides an exposure control method based on multi-frame image synthesis, which adopts the exposure device provided in the above embodiment to obtain the ideal exposure parameters of each column of the exposure image during the process of measuring the low-speed displacement of the object, thereby greatly improving the exposure accuracy and the displacement measurement accuracy.
[0063] Since the surface of the object being measured is usually uneven and has different reflectivity, when the same exposure parameters are used to perform full exposure ranging, there will be problems such as local overexposure and local underexposure, which will affect the measurement accuracy.
[0064] Based on this, an exposure control method based on multi-frame image synthesis is provided in an embodiment of the present application. The ideal exposure parameters of each area are obtained by dividing the area, and then the area is exposed according to the ideal exposure parameters of each area. The multi-frame exposure images of the area are synthesized to finally obtain the moving distance of the object to be measured. Figure 2 It is a flow chart of an exposure control method based on multi-frame image synthesis provided by the present application; Figure 3 This application provides a schematic diagram of dividing the photosensitive surface of a camera sensor; Figure 4 yes Figure 2 Schematic diagram of exposure process of the exposure control method; Figure 5 is based on Figure 3 Schematic diagram of 5-frame exposure images obtained by photosensitivity division; Figure 6 yes Figure 3 Schematic diagram of 4 frames of exposure detection images obtained within the exposure parameter range; Figure 7 is based on Figure 6 Schematic diagram of 4 exposure images and their composite images obtained by the ideal exposure parameters. Figure 4 The horizontal axis is time, and the vertical axis is exposure power. Figure 1 and- Figure 7 As shown, the exposure control method provided in the embodiment of the present application includes:
[0065] S101 . The control system exposes the object to be measured according to m+1 different exposure parameters respectively, and the camera sensor obtains m+1 exposure images respectively.
[0066] Exemplarily, the exposure parameter Q of the marking exposure device ranges from 0 to 100. Figure 3 As shown, taking the photosensitive surface as 2024×2024 pixels as an example, the photosensitive surface is divided into 4 parts.
[0067] For example, before measuring the object to be measured, five exposure parameters are preset, namely Q(15), Q(25), Q(50), Q(75), and Q(100). Figure 1 and Figure 6 As shown, the control system of the exposure device exposes the object to be tested in sequence according to the five exposure parameters, and the camera sensor 40 collects and generates five exposure images R(15), R(25), R(50), R(75), and R(100) corresponding to Q(15), Q(25), Q(50), Q(75), and Q(100). The exposure image information is transmitted to the data processing system 50, and the data processing system 50 performs image processing on the five exposure images acquired by the camera sensor 40.
[0068] S102: The data processing system divides the photosensitive surface into m detection areas, and obtains over-exposure frames and under-exposure frames of the m detection areas according to m+1 exposure images.
[0069] Specifically, the data processing system 50 divides the photosensitive surface of the camera sensor 40 into four detection areas based on four exposure ranges of Q(15) to Q(25), Q(25) to Q(50), Q(50) to Q(75), and Q(75) to Q(100), such as Figure 5 As shown in the X1, X2, X3, and X4 detection areas, the four detection areas have five groups of exposure images in the exposure images R(15), R(25), R(50), R(75), and R(100), respectively. The data processing system 50 obtains the over-exposure frames and under-exposure frames of the four detection areas in Q(15) to Q(25), Q(25) to Q(50), Q(50) to Q(75), and Q(75) to Q(100) according to the exposure effect of each detection area in the five groups of exposure images.
[0070] The overexposed frame means that the image is overexposed under the exposure parameters of the overexposed frame; the underexposed frame means that the image is underexposed under the exposure parameters of the underexposed frame.
[0071] Exemplary, combined Figure 3As shown in A3, for the X1 detection area, when the exposure parameter is Q(75), the area is overexposed, R(75) is the overexposure frame of the detection area, and the corresponding exposure parameter is Q(75); when the exposure parameter is Q(15), the area is underexposed, R(15) is the underexposure frame of the detection area, and the corresponding exposure parameter is Q(15).
[0072] For the X2 detection area, when the exposure parameter is Q(100), the area is overexposed, R(100) is the overexposure frame of the detection area, and the corresponding exposure parameter is Q(100); when the exposure parameter is Q(25), the area is underexposed, R(25) is the underexposure frame of the detection area, and the corresponding exposure parameter is Q(15).
[0073] Similarly, the over-exposure frames and under-exposure frames in the X3 detection area and their corresponding exposure parameters are Q(50) and Q(100); the over-exposure frames and under-exposure frames in the X4 detection area and their corresponding exposure parameters are Q(25) and Q(75).
[0074] S103 , the control system sets m exposure detection frames corresponding to m exposure detection parameters, respectively, with the over-exposure frame and the under-exposure frame corresponding to the detection area as boundaries.
[0075] S104 , the control system exposes the detection area row by row using rolling exposure according to the exposure detection parameters corresponding to the m detection areas, and the camera sensor obtains detection images corresponding to the m detection areas respectively.
[0076] The exposure detection parameters of each row in each detection area are set gradually.
[0077] Exemplary, combined Figure 1 , Figure 3 , Figure 4 and Figure 5 As shown, taking the X1 detection area as an example, an exposure detection frame is added to the X1 detection area, and the exposure parameters of the exposure detection frame are between Q(15) and Q(75), and in the process of rolling exposure, the exposure parameters of 1 to n rows are gradually set, such as n=2048. The control system controls the exposure light source 10, the camera sensor 40 and the data processing system 50 to turn on, and the exposure starts. The camera sensor 40 uses the rolling exposure method to expose the X1 detection area line by line, and obtains the detection image R(X1) corresponding to the X1 detection area, as shown in FIG. Figure 6 shown.
[0078] Combination Figure 1 , Figure 3 , Figure 4 and Figure 5As shown, taking the X2 detection area as an example, an exposure detection frame is added to the X2 detection area, and the exposure parameters of the exposure detection frame are between Q(25) and Q(100), and in the process of rolling exposure, the exposure parameters of rows 1 to n are gradually set, such as n=2048. Figure 4 As shown, the control system controls the exposure light source 10, the camera sensor 40 and the data processing system 50 to start, and the exposure starts. The camera sensor 40 uses rolling exposure to expose the X2 detection area line by line, and obtains the detection image R (X2) corresponding to the X2 detection area, as shown in FIG. Figure 6 shown.
[0079] Similarly, the exposure parameters of the exposure detection frames added in the X3 detection area are between Q(50) and Q(100), and the exposure parameters of the exposure detection frames added in the X4 detection area are between Q(25) and Q(75). During the rolling exposure process, the exposure parameters of rows 1 to n are gradually set, such as n=2048. The detection images R(X3) corresponding to the X3 detection area and R(X4) corresponding to the X4 detection area are obtained respectively, as shown in Figure 6 shown.
[0080] S105. The data processing system obtains the exposure parameters of the kth row in the detection image that meet the ideal exposure grayscale range, and determines that the exposure parameters of the kth row are the ideal exposure parameters of the detection area.
[0081] Specifically, Figure 7 As shown, taking the X1 detection area as an example, the data processing system 50 determines the exposure effect of each row according to the average grayscale value of pixels in rows 0 to n in the exposure image R(X1) obtained from the X1 detection area. When the average grayscale value of pixels in the kth row falls within the preset grayscale value range, the exposure parameter corresponding to the row is determined to be the ideal exposure parameter Q(X1) of the X1 detection area.
[0082] like Figure 7 As shown, taking the X2 detection area as an example, the data processing system 50 determines the exposure effect of each row according to the average grayscale value of pixels in rows 0 to n in the exposure image R(X2) obtained from the X2 detection area. When the average grayscale value of pixels in the kth row falls within the preset grayscale value range, the exposure parameter corresponding to the row is determined to be the ideal exposure parameter Q(X2) of the X2 detection area.
[0083] And so on, such as Figure 7 As shown, the pixel grayscale values of each row in the detection image R(X3) and the detection image R(X4) are analyzed respectively to determine the ideal exposure parameter Q(X3) of the detection image R(X3) and the ideal exposure parameter Q(X4) of the detection image R(X4).
[0084] S106. The control system exposes the m detection areas according to the ideal exposure parameters corresponding to the m detection areas, and the camera sensor obtains exposure images corresponding to the m detection areas.
[0085] Specifically, refer to Figure 7 As shown, the control system performs rolling exposure on the X1 detection area, X2 detection area, X3 detection area, and X4 detection area according to the obtained 4 sets of ideal exposure parameters Q(X1), Q(X2), Q(X3), and Q(X4), respectively, and obtains 4 sets of exposure images R(X1'), R(X2'), R(X3'), and R(X4'), respectively.
[0086] S107, the data processing system calculates the center points of the exposure images corresponding to the m detection areas, performs multi-frame synthesis on the center points of the exposure images of the m detection areas, and obtains the moving distance of the object to be detected.
[0087] Specifically, the data processing system 50 calculates the center points of the exposure images R(X1'), R(X2'), R(X3'), and R(X4'), respectively, and uses multi-frame HDR technology to synthesize the four groups of exposure images into one group of exposure images R(X1'-X4'), thereby obtaining the moving distance of the object under test.
[0088] Exemplarily, taking the ranging of the laser displacement (contour) sensor as an example, its principle is to confirm the surface displacement of the object to be measured according to the center of the imaging spot on the photosensitive element matrix. Therefore, the partitioning provided in the embodiment of the present application is used to obtain the ideal exposure parameter Q. After exposing each detection area with the ideal exposure parameter Q, multiple frames of exposure images are obtained, and then the multiple frames of exposure images are synthesized to obtain high-quality imaging, confirm the surface displacement of the object to be measured, and improve the measurement accuracy, thereby avoiding the deformation of the spot caused by underexposure or overexposure, which in turn leads to a loss of measurement accuracy.
[0089] Figure 8 is based on Figure 1-Figure 7 Flowchart of a laser displacement (contour) sensor ranging method based on multi-frame image synthesis.
[0090] As an example, Figure 8 As shown, when using a laser displacement (contour) sensor to measure distance, for an object where both a high-reflectivity position and a low-reflectivity position exist, the multiple (synthetic) mode provided by the above embodiment can be used. In the multiple (synthetic) mode, image processing is performed in the following order.
[0091] Step 1: Use "dim" shooting to adjust the laser light amount and exposure time, measure only the position with high reflectivity, determine the contour data that can detect the gray value peak position, and obtain the contour graph (1).
[0092] Step 2: Increase the shooting brightness, adjust the laser light amount and exposure time, determine the contour data of the newly detected gray value peak position, and obtain the contour graph (2).
[0093] Step 3: without changing the contour data determined in step 1, adjust the laser light intensity and exposure time, and repeatedly perform steps 1 and 2 to determine the contour data and obtain the contour graph (3).
[0094] in, Figure 8 In the middle contour figures (1)-(3), the solid lines are contour data with the gray value peak detected; the dotted lines are contour data with no gray value peak detected.
[0095] Step 4: Use multi-frame HDR technology to synthesize the contour graphic (1), the contour graphic (2) and the contour graphic (3) into a frame of contour graphic (4), synthesize a clear contour image of the object, and finally obtain the moving distance.
[0096] In summary, the exposure control method based on multi-frame image synthesis provided in the embodiment of the present application can achieve the effect of regional enhancement by dividing multiple regions and finding the ideal exposure parameters of the region. At the same time, for regions with particularly large differences in exposure parameters, multiple frames are exposed separately according to the exposure effect, and multi-frame synthesis is performed. Compared with the traditional multi-frame HDR algorithm with fixed exposure parameters, since the ideal exposure parameters can be calculated for each column, the adjustment is more precise, which is suitable for laser displacement sensors and laser profile scanners, and is beneficial to improving the adjustment speed of the exposure parameters and enhancing the detection application of the product in high-speed occasions.
[0097] Furthermore, in step S102, there are many ways to divide the photosensitive surface.
[0098] In some embodiments, continue to refer to Figure 3 As shown, according to the area division, the data processing system divides the photosensitive surface into m continuous detection areas along the X-axis direction.
[0099] The number of pixels in the m detection areas may be the same or different.
[0100] Specifically, Figure 3 As shown, the number of pixels in the X1 detection area, the X2 detection area, the X3 detection area, and the X4 detection area may be the same or different.
[0101] Fig. 9 This is a schematic diagram of the division of the photosensitive surface of another camera sensor provided in this application.
[0102] In some embodiments, Fig. 9As shown, if divided according to the range of pixel grayscale values, the data processing system divides the photosensitive surface into m detection areas according to the preset grayscale value range and the grayscale value size of the pixels of the exposure image.
[0103] The pixels that meet the preset gray value range fall within the same detection area.
[0104] Specifically, taking the grayscale value range of 0-100 as an example, the data processing system extracts the exposure image of the previous period and sets four preset grayscale value ranges according to the grayscale values of 0-25, 25-50, 50-75, and 75-100.
[0105] If the grayscale value falls within the range of 0 to 25, the area where the pixels are located is the X1 detection area; the area where the grayscale value falls within the range of 25 to 50 is the X2 detection area; the area where the pixels are located within the range of 50 to 75 is the X3 detection area; the area where the pixels are located within the range of 75 to 100 is the X4 detection area.
[0106] Fig.10 is a flow chart of the method for setting the exposure detection parameters provided by the present application, such as Fig.10 As shown in the figure, the method for setting the exposure detection parameters is as follows:
[0107] S201, setting the exposure parameter Q of the larger frame M The ratio of the maximum exposure power P max As the exposure time T = Q for each row in the exposure detection frame M / P max .
[0108] Specific, combined Figure 4 As shown, the row exposure time T of rolling shutter exposure is set to Q M / Pmax;Q M is the exposure parameter for exposing the larger frame M, P max is the maximum exposure power of the exposure light source.
[0109] Wherein, exposure parameter Q=laser power P*exposure time T*camera sensor (CMOS) gain G.
[0110] S202: setting the exposure power of each row in the exposure detection frame to increase linearly.
[0111] Among them, the exposure power of the kth row satisfies the following formula:
[0112]
[0113]
[0114]
[0115]
[0116] T frame =(n-1)t σ +T, (1.5); 1≤k≤n, n is the number of exposure rows;
[0117] is the starting exposure power of the kth row within the row exposure time T, is the ending exposure power of the kth row within the row exposure time T; is the average exposure power of the kth row; Q (k) is the exposure parameter of the kth row of the exposure detection frame; T frame is the frame exposure time of the exposure detection frame; p is the detection exposure power; tσ is the time interval between adjacent exposure rows; G is the gain of the camera sensor.
[0118] Specifically, refer to Figure 4 As shown, the number of rows exposed line by line in one frame of rolling shutter exposure is n, the exposure time of each row is T, and the starting exposure power of the kth row within the row exposure time T is The final exposure power of the kth row within the row exposure time T is
[0119] For example, k=1, row 1:
[0120] Initial exposure power
[0121] End exposure power
[0122] Average exposure power
[0123] Exposure parameters for exposure detection frames
[0124] k=2, row 2:
[0125] Initial exposure power
[0126] End exposure power
[0127] Average exposure power
[0128] Exposure parameters for exposure detection frames
[0129] By analogy, the exposure parameters of n rows of rolling exposure are obtained, such as the exposure parameters of the kth row, ..., the n-1th row, and the nth row.
[0130] After the control system has finished setting the exposure detection parameters corresponding to the m detection areas, steps S104 to S107 of the above embodiment are executed in sequence.
[0131] In step S105, taking the exposure of the X1 detection area as an example, the control system of the exposure device exposes row by row according to the exposure detection parameter of the X1 detection area, and the camera sensor 40 transmits the exposure image information to the data processing system 50. The data processing system 50 searches for exposure rows that meet the ideal exposure grayscale range in the exposure detection image according to the preset ideal exposure grayscale range. Exemplarily, the ideal exposure is the kth row, and the exposure parameter Q(k) of the kth row is determined as the ideal exposure parameter Q(ki) of the Kth frame.
[0132] The control system controls the exposure light source 10 and the camera sensor 40 to expose the detection area according to the exposure power and exposure time of the ideal exposure parameter Q(ki). The camera sensor 40 uses rolling exposure to generate an exposure image of the detection area. The data processing system 50 synthesizes and analyzes the exposure image of the detection area to obtain the moving distance of the object under test.
[0133] Based on the above embodiment, the ideal exposure parameter Q(ki) can be obtained by the following steps, such as:
[0134] Step S1, the data processing system records the grayscale values of all pixels in the detection area in the under-exposure frame, normalizes the grayscale values of all pixels, and obtains the grayscale value normalization value N(k) of the under-exposure frame.
[0135] Exemplary, combined Figure 6 As shown, taking the ideal exposure parameter Q(ki) of the X1 detection area as an example, the under-exposure frame R(15) of the X1 detection area is selected, and the grayscale values of the pixels in rows 1 to n in the X1 detection area are G N (1) G N (2), ..., G N (k), ... G N (n), normalize the grayscale values of all pixels to obtain the grayscale normalization value N(k) = 100% G N (k) / (G sat ).
[0136] Among them, G sat is the pixel grayscale saturation value.
[0137] For example, k=1, N(1)=100%G N (1) / G sat ;
[0138] k=2,N(2)=100%G N (2) / G sat ;
[0139] And so on.
[0140] Step S2: Obtain the grayscale value G of each pixel in the exposure detection image of the detection area X (k).
[0141] For example, the grayscale values of the pixels in rows 1 to n in the detection area of the exposure detection image are G X (1) G X (2), ..., G X (k), ... G X (n).
[0142] Step S3: Expose the gray value G of the detected image X The ratio of (k) to the normalized brightness value N(k) of the frame with less exposure is taken as the expected grayscale value G X (k) / N(k).
[0143] Combined with the grayscale normalization N(k) of the pixel in the under-exposure frame R(15), the grayscale value G of the exposure detection image is calculated. X The ratio of (k) to the normalized brightness value N(k) of the frame R(15) with low exposure, where k=1, G X (1) / N(1); k = 2, G X (2) / N(2); ..., k = n, G X (n) / N(n).
[0144] Step S4: When the expected gray value G X (k) / N(k) determines the average exposure parameter Q of the kth row within the ideal exposure grayscale range. (k) is the ideal exposure parameter Q(ki) of the detection area, where i is an integer.
[0145] Specifically, according to the exposure effect, detection accuracy, etc. of the exposure image, an ideal grayscale value range is pre-set. For example, the ideal grayscale value is 80% to 85% of the saturation value. When the grayscale value G obtained in the kth row of the exposure detection image is X The ratio G of (k) to the normalized brightness value N(k) of the frame with less exposure X (k) / N(k) is within the ideal grayscale value range, and the exposure parameter Q of the kth row is determined. (k) is the ideal exposure parameter Q(ki) of the X1 detection area, that is, the system adjusts the exposure parameter of the X1 detection area to Q (k) =p avg T frame G.
[0146] In the same way, the ideal exposure parameters Q(ki) in the X2 detection area, the X3 detection area, and the X4 detection area are obtained.
[0147] Based on the above embodiment, the ideal exposure parameter is between the exposure parameter of the frame with larger exposure and the exposure parameter of the frame with smaller exposure.
[0148] Specifically, the exposure effect of the exposure image obtained by exposure using ideal exposure parameters should be between underexposure and overexposure.
[0149] Based on the above embodiments, Figure 4 As shown in formulas (1.1)-(1.4), the detected exposure power P is the maximum exposure power P max Such a selection is conducive to achieving the power linearity of the exposure light source 30, realizing fine adjustment of the exposure power, and improving the exposure accuracy.
[0150] On the basis of the above embodiment, in step S101, the binary method may be used to adjust m+1 exposure parameters that increase in sequence to expose the object to be tested, and obtain m+1 exposure images.
[0151] Specifically, when m=4, m+1=5 frames are recorded, namely the K-1th frame, the Kth frame, the K+1th frame, the K+2th frame, and the K+3th frame. The exposure parameter of the K-1th frame is Q (k-1) , the exposure parameter of the Kth frame is Q (k) , the exposure parameter of the K+1th frame is Q (k+1) , the exposure parameter of the K+2th frame is Q (k+2) , the exposure parameter of the K+3th frame is Q (k+3) , the size relationship is:
[0152] 2Q (k-1) =Q (k) ;2Q (k) =Q (k+1) ;2Q (k+1) =Q (k+2) ;2Q (k+2) =Q (k+3) .
[0153] Based on the above embodiment, the maximum exposure adjustment frame number R of the exposure detection frame is: The value of is rounded up to an integer.
[0154] Among them, Q max is the maximum exposure parameter, Q min is the minimum exposure parameter,
[0155] In some embodiments, the formula
[0156] In some embodiments, the formula
[0157] By adopting the above formula of rounding upwards, the maximum number of exposure adjustment frames of the pre-increased exposure detection frames can be calculated in advance as a reference for exposure adjustment, thereby improving the efficiency of exposure adjustment.
[0158] On the basis of the above embodiment, the selection rule of the over-exposure frame and the under-exposure frame may be based on the exposure parameter of the over-exposure frame being twice the exposure parameter of the under-exposure frame.
[0159] Specifically, setting the exposure parameter of the overexposed image to twice that of the underexposed image can reduce the number of exposure detection frames. An ideal exposure parameter can be obtained using one exposure detection frame, which is beneficial to improving the speed of exposure adjustment.
[0160] On the basis of the above embodiment, in step S106, the control system exposes the detection area according to the ideal exposure parameters corresponding to the m detection areas, including:
[0161] The control system distributes the ideal exposure parameters to the laser power, exposure time, and gain of the camera sensor.
[0162] The allocation ratio is such that the laser power is greater than the exposure time, and the exposure time is greater than the gain.
[0163] Specifically, in some embodiments, the value of the ideal exposure parameter Q(ki) is distributed to the laser power P, the exposure time T, and the CMOS gain G, and the gain of the camera sensor is selected to be as small as possible.
[0164] In some embodiments, when the moving speed of the object is relatively low, the exposure time T is increased to ensure clear low-speed video recording.
[0165] In some embodiments, when the moving speed of the object is relatively high, the exposure power P is increased and the exposure time T is reduced to meet the requirements of high-speed and clear video recording.
[0166] In some embodiments, the preset range of the maximum values of the m detection areas is an area within a range of 10% to 25% of the total diameter of the exposure light band, with the maximum value of the exposure light band as the center.
[0167] Exemplarily, a circular area with a maximum value of the exposure light band as the center and a radius of 13% of the total diameter of the exposure light band is used as the detection area. There is no need to calculate all pixel information of the camera sensor 40, which is beneficial to reducing the amount of data calculation and improving the calculation effect.
[0168] In summary, the exposure control method based on multi-frame image synthesis provided by the present application can achieve the effect of regional enhancement by dividing multiple areas and finding the ideal exposure parameters of the area. At the same time, for areas with particularly large differences in exposure parameters, multiple frames are exposed separately according to the exposure effect, and multi-frame synthesis is performed. By calculating the ideal exposure parameters for each column, the adjustment is more precise, which is suitable for laser displacement sensors and laser profile scanners, improves the adjustment speed of the exposure parameters, and enhances the detection application of the product in high-speed occasions.
[0169] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, combinations and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An exposure control method based on multi-frame image synthesis, used to control the exposure parameters of a camera sensor, wherein the photosensitive surface of the camera sensor includes X*Y pixels, X and Y are positive integers, characterized in that: The exposure control method comprises: The control system exposes the object to be tested according to m+1 different exposure parameters respectively, and the camera sensor obtains m+1 exposure images respectively; m>2, m is an integer; The data processing system divides the photosensitive surface into m detection areas, and obtains overexposure frames and underexposure frames of the m detection areas according to m+1 exposure images; The control system uses the over-exposure frame and the under-exposure frame corresponding to the detection area as boundaries, and sets m exposure detection frames, corresponding to m exposure detection parameters; The control system exposes the detection area row by row using a rolling exposure method according to the exposure detection parameters corresponding to the m detection areas, and the camera sensor obtains detection images corresponding to the m detection areas respectively; wherein the exposure detection parameters of each detection area in each row are different; The data processing system obtains the exposure parameters of the kth row in the detection image that meet the ideal exposure grayscale range, and determines that the exposure parameters of the kth row are the ideal exposure parameters of the detection area; k>2, k is an integer; The control system exposes the detection area according to the ideal exposure parameters corresponding to the m detection areas, and the camera sensor obtains the exposure images corresponding to the m detection areas; The data processing system calculates the center points of the exposure images corresponding to the m detection areas, performs multi-frame synthesis on the center points of the exposure images of the m detection areas, and obtains the moving distance of the object to be detected.
2. The exposure control method according to claim 1, characterized in that: The data processing system divides the photosensitive surface into m detection areas, including: The data processing system divides the photosensitive surface into m continuous detection areas along the X-axis direction; wherein the number of pixels in the m detection areas is the same or different.
3. The exposure control method according to claim 1, characterized in that: The photosensitive surface is divided into m detection areas, including: The data processing system divides the photosensitive surface into m detection areas according to the preset gray value range and the gray value size of the pixels of the exposure image; The pixels that meet the preset gray value range fall within the same detection area.
4. The exposure control method according to claim 1, characterized in that: The exposure detection parameter setting method is: The exposure parameter Q of the exposure biased frame M The ratio of the maximum exposure power Pmax is used as the row exposure time T = Q for each row in the exposure detection frame. M / P max ; The exposure power of each row in the exposure detection frame is set to increase linearly, and the exposure power of the kth row satisfies the following formula: T frame =(n-1)t σ +T; 1≤k≤n, n is the number of exposure rows; is the starting exposure power of the kth row within the row exposure time T, is the ending exposure power of the kth row within the row exposure time T; is the average exposure power of the kth row; Q (k) is the exposure parameter of the kth row of the exposure detection frame; T frame is the frame exposure time of the exposure detection frame; p is the detection exposure power; tσ is the time interval between adjacent exposure rows; G is the gain of the camera sensor.
5. The exposure control method according to claim 4, characterized in that: Determining the exposure parameters of the kth row as the ideal exposure parameters of the detection area includes: Recording the grayscale values of all pixels in the detection area in the under-exposure frame, normalizing the grayscale values of all pixels to obtain a grayscale value normalized value N(k) of the under-exposure frame; Get the gray value G of each pixel of the exposure detection image of the detection area x (k); The gray value G of the exposure detection image x The ratio of (k) to the normalized grayscale value N(k) of the frame with less exposure is taken as the expected grayscale value G x (k) / N(k); When the expected gray value G x (k) / N(k) determines the average exposure parameter G of the kth row within the ideal exposure grayscale range. x (k) is the ideal exposure parameter Q(ki) of the detection area; wherein i is an integer.
6. The exposure control method according to claim 4, characterized in that: The object to be tested is exposed using m+1 different exposure parameters to obtain m+1 exposure images, including: The binary method is used to adjust m+1 exposure parameters that increase in sequence to expose the object to be tested, and m+1 exposure images are obtained.
7. The exposure control method according to claim 1, characterized in that: The exposure parameter of the frame with a larger exposure is twice the exposure parameter of the frame with a smaller exposure.
8. The exposure control method according to claim 1, characterized in that: The maximum exposure adjustment frame number R of the exposure detection frame is: The value of is rounded up; Among them, Q max is the maximum exposure parameter, Q min is the minimum exposure parameter.
9. The exposure control method according to claim 1, characterized in that: The ideal exposure parameter is between the exposure parameter of the frame with a larger exposure and the exposure parameter of the frame with a smaller exposure.
10. An exposure device based on multi-frame image synthesis, used to implement the exposure control method according to any one of claims 1 to 9, characterized in that: The exposure device includes an exposure light source, an illumination lens, an imaging lens, a camera sensor with multi-frame image synthesis, a control system and a data processing system; The control system is electrically connected to the camera sensor and the data processing system respectively; the exposure light source and the camera sensor are electrically connected to the data processing system; The illumination lens is located on the exposure light path of the exposure light source, and the imaging lens is located on the photosensitive front end surface of the camera sensor.
