Image acquisition method, device and equipment
By dividing the sensor pixel rows into segmented intervals and synchronously driving the motor, the problem of camera depth-of-field limitation is solved, achieving a super depth-of-field effect and ensuring that clear images can be captured from any position of the target object.
Patent Information
- Application Number
- CN202410552787.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2025-11-07
AI Technical Summary
Due to the limitations of the camera's installation angle, a clear image cannot be captured when the target object is beyond the depth of field, and a clear image cannot be obtained for target objects at the boundaries of the field of view.
By dividing the pixel rows of the sensor into multiple segmented intervals, and controlling the motor to move to the corresponding focal position within each segmented interval while simultaneously performing exposure, synchronous driving of the sensor and motor is achieved, ensuring that each row of pixels is exposed at the focal position corresponding to the scene depth.
It achieves a super depth-of-field effect where the entire depth of the image is clear, enabling the acquisition of a clear full-depth-of-field image of the target object, expanding the acquisition range of the target object, and improving image clarity.
Smart Images

Figure CN120916047A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to an image acquisition method, device and equipment. BACKGROUND
[0002] Depth of field (DOF) refers to the distance range of the front and back of the subject that can be measured by the camera lens to obtain a clear image. After focusing is completed, the distance of the clear image presented in the front and back range of the focus point is called the depth of field. The lens aperture, lens focal length, distance from the focus plane to the subject, etc. are important factors affecting the depth of field.
[0003] When a camera captures a target object (such as a human object or a vehicle object), due to the limitation of the depth of field, the target object beyond the depth of field range is not clear. For example, when the target object is beyond the depth of field range, a clear image of the target object cannot be collected. Due to the limitation of the camera installation angle, a clear image of all target objects within the field of view cannot be obtained. For example, due to the limitation of the camera installation angle, when the target object is at the boundary of the field of view, a clear image of the target object cannot be collected. SUMMARY
[0004] The present application provides an image acquisition method, which comprises:
[0005] Based on the starting focus point corresponding to the acquired minimum pixel row, the motor is moved to the starting position corresponding to the starting focus point; and a synchronous starting time is determined based on the minimum pixel row and a one-row scanning time length.
[0006] All pixel rows between the minimum pixel row and the acquired maximum pixel row are divided into m segmented intervals, m being a positive integer; for each segmented interval, an exposure time length corresponding to the segmented interval is determined, a travel step length corresponding to the segmented interval is determined based on the focus points corresponding to the adjacent two rows of the segmented interval, and the travel step length represents that the motor is moved by one row of scanning time length; and the motor is moved by the travel step length.
[0007] The sensor is controlled to expose the minimum pixel row starting from the synchronous starting time; for each segmented interval, the sensor is controlled to expose each pixel row of the segmented interval in turn within the exposure time length corresponding to the segmented interval, until the exposure of the maximum pixel row is completed to obtain a current frame image.
[0008] The motor is controlled to move from the starting position starting from the synchronous starting time; for each segmented interval, the motor is controlled to move by the travel step length corresponding to the segmented interval within the exposure time length corresponding to the segmented interval, until the motor is moved to the ending position corresponding to the ending focus point corresponding to the maximum pixel row.
[0009] The present application provides an image acquisition device, which comprises:
[0010] a control module configured to move the motor to a starting position corresponding to a starting focal point corresponding to the minimum pixel row;
[0011] a determination module configured to determine a synchronous starting time based on the minimum pixel row and a row scanning time length;
[0012] the determination module is configured to divide all pixel rows between the minimum pixel row and a maximum pixel row obtained into m segmented intervals, for each segmented interval, determine an exposure time length corresponding to the segmented interval, determine a travel step length corresponding to the segmented interval based on focal points corresponding to two adjacent rows of the segmented interval, and the travel step length represents a row scanning time length per interval, and move the motor according to the travel step length;
[0013] the control module is configured to control the sensor to expose the minimum pixel row from the synchronous starting time, for each segmented interval, control the sensor to sequentially expose each pixel row of the segmented interval within the exposure time length corresponding to the segmented interval, until the exposure of the maximum pixel row is completed to obtain a current frame image, control the motor to move from the starting position from the synchronous starting time, for each segmented interval, control the motor to move using the travel step length corresponding to the segmented interval within the exposure time length corresponding to the segmented interval, until the motor is moved to an ending position corresponding to an ending focal point corresponding to the maximum pixel row.
[0014] The application provides a camera device, comprising:
[0015] a processor configured to move the motor to a starting position corresponding to a starting focal point corresponding to the minimum pixel row based on the starting focal point, determine a synchronous starting time based on the minimum pixel row and a row scanning time length, divide all pixel rows between the minimum pixel row and a maximum pixel row obtained into m segmented intervals, m being a positive integer, for each segmented interval, determine an exposure time length corresponding to the segmented interval, determine a travel step length corresponding to the segmented interval based on focal points corresponding to two adjacent rows of the segmented interval, and the travel step length represents a row scanning time length per interval, and move the motor according to the travel step length;
[0016] a sensor configured to expose the minimum pixel row from the synchronous starting time, for each segmented interval, sequentially expose each pixel row of the segmented interval within the exposure time length corresponding to the segmented interval, until the exposure of the maximum pixel row is completed to obtain a current frame image;
[0017] a motor, used to move from the starting position from the synchronization starting moment; for each segment interval, in the exposure duration corresponding to the segment interval, the motor is moved by the stroke step corresponding to the segment interval until the motor is moved to the end position corresponding to the end focus point corresponding to the maximum pixel row.
[0018] From the above technical solutions, in the embodiment of the present application, when any row of pixels of the sensor (Sensor) is exposed, the motor is at the focus position corresponding to the scene depth of the row of pixels, thereby ensuring that the image produced after the row of pixels is exposed is clear. In this way, by solving the matching synchronization of the rolling shutter exposure process of all pixel rows and the synchronous driving of the motor, the super depth of field effect of ensuring that the entire depth of the picture is clear can be achieved, thereby achieving the super depth of field effect, achieving the full depth of field of the target object, fully utilizing the field of view of the picture, and making the acquisition range of the target object larger, thereby improving the image clarity. For example, when the target object exceeds the depth of field range, a clear image of the target object can also be acquired. When the target object is at the boundary of the field of view, a clear image of the target object can also be acquired. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the description of the embodiments of the present application or the prior art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings of the embodiments of the present application.
[0020] Figure 1 is a flowchart of an image acquisition method in an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of an application scene of the acquired image in an embodiment of the present application;
[0022] Figure 3 is a flowchart of rolling shutter exposure in an embodiment of the present application;
[0023] Figure 4 is a synchronization diagram of the focusing process and the pixel row exposure process in an embodiment of the present application;
[0024] Figure 5 is a synchronization timing diagram of the focusing process and the pixel row exposure process in an embodiment of the present application;
[0025] Figure 6 is a synchronization diagram of the focusing process and the pixel row exposure process in an embodiment of the present application;
[0026] Figure 7 is a structural schematic diagram of an image acquisition device in an embodiment of the present application;
[0027] Figure 8 is a hardware structure diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The terminology used in the embodiments of the present application is merely for the purpose of describing particular embodiments and is not intended to be limiting of the present application. As used in the present application and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or", as used herein, refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0029] It should be understood that, although the terms first, second, third, etc. can be employed in describing various information, these information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information of the same type. For example, a first information can also be referred to as a second information, and similarly, a second information can also be referred to as a first information, without departing from the scope of the present application. Depending on the context, the word "if" can be interpreted to mean "when" or "in response to determining" as well.
[0030] An image acquisition method is proposed in the embodiments of the present application, which can be applied to a camera device (also referred to as a camera device), as shown in Figure 1 The method includes the following steps:
[0031] In step 101, the motor is moved to a starting position corresponding to a starting focal point based on the starting focal point corresponding to the acquired minimum pixel row; and a synchronous starting moment is determined based on the minimum pixel row and a one-row scanning time length.
[0032] In step 102, all pixel rows between the minimum pixel row and the acquired maximum pixel row are divided into m segmented intervals, m being a positive integer; for each segmented interval, an exposure time length corresponding to the segmented interval is determined, a travel step length corresponding to the segmented interval is determined based on focal points corresponding to adjacent two rows of the segmented interval, and the motor is moved according to the travel step length, which represents a one-row scanning time length.
[0033] In step 103, the sensor is controlled to expose the minimum pixel row from the synchronous starting moment; for each segmented interval, the sensor is controlled to expose each pixel row of the segmented interval in turn within the exposure time length corresponding to the segmented interval, until the exposure of the maximum pixel row is completed to obtain a current frame image.
[0034] Step 104, control the motor to move from the starting position from the synchronization starting time; for each sub-interval, in the exposure duration corresponding to the sub-interval, control the motor to move using the stroke step corresponding to the sub-interval until the motor is moved to the end position corresponding to the end focus point corresponding to the maximum pixel row.
[0035] For example, before moving the motor to the starting position corresponding to the starting focus point based on the acquired minimum pixel row, the minimum pixel row can also be acquired based on the configured minimum longitudinal pixel coordinate of the target object and the size of the rolling shutter window supported by the sensor; wherein the minimum longitudinal pixel coordinate represents the longitudinal center pixel coordinate of the first window of the target object appearing in the picture, and the size of the rolling shutter window represents the pixel row occupied by the rolling shutter window. Wherein, if the minimum pixel row is the minimum longitudinal pixel coordinate y1, and if the minimum pixel row is half of the size of the rolling shutter window SHS.
[0036] In addition, the maximum pixel row can also be acquired based on the configured maximum longitudinal pixel coordinate of the target object; wherein the maximum longitudinal pixel coordinate represents the longitudinal center pixel coordinate of the second window of the target object appearing in the picture; wherein the maximum pixel row can be the maximum longitudinal pixel coordinate. The first window is the window close to the starting row position of the image, and the second window is the window close to the end row position of the image.
[0037] For example, determining the synchronization starting time based on the minimum pixel row and the one-row scanning duration can include but is not limited to: the synchronization starting time can be determined using the following formula: t0=t'+y min *T 1H ; wherein t0 can represent the synchronization starting time, t' can represent the time when the exposure starting interrupt of the current frame image is received, y min can represent the minimum pixel row, and T 1H can represent the one-row scanning duration.
[0038] For the one-row scanning duration T 1H , the one-row scanning duration can be determined using the following formula: Wherein vmax can represent the total number of rows of the sensor, and frame can represent the frame rate of the sensor.
[0039] For example, determining the exposure duration corresponding to the sub-interval can include but is not limited to: the exposure duration can be determined using the following formula: DT i =(p i -p i-1 )*T 1H ; wherein DT i represents the exposure duration corresponding to the i-th sub-interval, and i takes a value in the range of 1-m, pi-1 represents the first pixel row of the i-th segment interval, p i represents the last pixel row of the i-th segment interval, T 1H represents a row scanning duration.
[0040] For example, determining the focus points corresponding to the adjacent two pixel rows of the segment interval based on the slope parameter and the intercept parameter corresponding to the segment interval can include but is not limited to: determining the focus points corresponding to the adjacent two pixel rows of the segment interval based on the slope parameter and the intercept parameter corresponding to the segment interval, determining the motor positions corresponding to the focus points of the adjacent two pixel rows, and determining the stroke step length corresponding to the segment interval based on the difference between the two determined motor positions; wherein the stroke step length represents the movement of the motor by the stroke step length every interval of the row scanning duration. For example, the stroke step length corresponding to the segment interval refers to the stroke step length between the adjacent two pixel rows in the segment interval, indicating that the stroke step length is for the adjacent two pixel rows of the segment interval.
[0041] For example, determining the focus points corresponding to the adjacent two pixel rows of the segment interval based on the slope parameter and the intercept parameter corresponding to the segment interval can include but is not limited to: for each pixel row, the focus point corresponding to the pixel row can be determined by the following formula: F'(n) = ki*n + bi; wherein F'(n) can represent the focus point corresponding to the n-th pixel row, ki can represent the slope parameter corresponding to the i-th segment interval, and i can have a value range of 1-m, and bi can represent the intercept parameter corresponding to the i-th segment interval.
[0042] For example, before determining the focus points corresponding to the adjacent two pixel rows of the segment interval based on the slope parameter and the intercept parameter corresponding to the segment interval, the slope parameter and the intercept parameter corresponding to the segment interval can be calibrated by the following steps: selecting a first pixel row and a second pixel row from all the pixel rows of the segment interval; focusing on the first pixel row to obtain a first focus point, and focusing on the second pixel row to obtain a second focus point; wherein the first pixel row in the image satisfies the preset sharpness condition when the motor moves to the motor position corresponding to the first focus point; the second pixel row in the image satisfies the preset sharpness condition when the motor moves to the motor position corresponding to the second focus point; and determining the slope parameter and the intercept parameter corresponding to the segment interval based on the first pixel row, the second pixel row, the first focus point, and the second focus point.
[0043] For example, determining the slope parameter and the intercept parameter corresponding to the segment interval based on the first pixel row, the second pixel row, the first focus point, and the second focus point can include but is not limited to: determining the slope parameter and the intercept parameter corresponding to the segment interval by the following formula: wherein k can represent a slope parameter corresponding to the segmented interval, b can represent an intercept parameter corresponding to the segmented interval, F0 can represent a first focal point, F1 can represent a second focal point, y s may represent a first pixel row, y f may represent a second pixel row.
[0044] Exemplarily, after moving the motor to an end position corresponding to an end focal point corresponding to a maximum pixel row, after receiving an exposure end interrupt of a current frame image, moving the motor to a start position corresponding to a start focal point corresponding to a minimum pixel row within a target running duration; wherein the target running duration is determined in the following manner: DT r = (vblank) * T 1H -△T; DT r represents the target running duration, vblank represents a total number of blanking lines configured for the sensor, T 1H represents a one-line scanning duration, and△T represents a configured margin duration.
[0045] As can be seen from the above technical solutions, in the embodiments of the present application, when any one row of pixels of the sensor (Sensor) is exposed, the motor is at the focal position of the scene depth corresponding to the row of pixels, so as to ensure that the image produced after the row of pixels is exposed is clear. In this way, by solving the matching synchronization of the rolling shutter exposure process of all pixel rows and the synchronous driving of the motor, the super depth of field effect of ensuring that the entire depth of the picture is clear can be achieved, so that the super depth of field effect can be achieved, the panoramic depth of the target object is clear, the field of view of the picture is fully utilized, the acquisition range of the target object is larger, and the image clarity can be improved. For example, when the target object exceeds the depth of field range, a clear image of the target object can also be acquired. When the target object is at the boundary of the field of view range, a clear image of the target object can also be acquired.
[0046] The above technical solutions of the embodiments of the present application will be described in combination with specific application scenarios.
[0047] When a camera (camera) shoots a target object (such as a human object or a vehicle object), due to the depth of field limitation, the target object exceeding the depth of field range is not clear. For example, when the target object exceeds the depth of field range, a clear image of the target object cannot be acquired. Due to the limitation of the camera installation angle, clear images of all target objects within the field of view range cannot be obtained. For example, due to the limitation of the camera installation angle, when the target object is at the boundary of the field of view range, a clear image of the target object cannot be acquired.
[0048] Referring to Figure 2As shown, it is a schematic diagram of an application scenario of acquiring images by a camera. Due to the limitation of the camera installation angle, when acquiring images by the camera, only the target objects in a small scene depth range are clear, and this scene depth range may only account for about 50% of the entire picture depth, and clear images of all target objects cannot be obtained. For example, when the target objects are at the boundary of the field of view range, such as for the target objects far away from the camera, clear images of the target objects cannot be obtained.
[0049] In view of the above finding, an image acquisition method is proposed in the embodiments of the present application, which can ensure that the target objects at all positions of the entire picture are clear by introducing the super depth of field technology. For example, when the target objects are at the boundary of the field of view range, such as for the target objects far away from the camera, clear images of the target objects can also be obtained, i.e., clear images of all target objects can be obtained. Super depth of field means that the picture taken by the camera is not affected by the distance of the target objects, and the target objects at all distances are clear.
[0050] Before introducing the image acquisition method of the present embodiment, the imaging process of the camera is introduced.
[0051] The total number of rows of the sensor (i.e., image sensor, denoted as Sensor) of the camera is set as vmax (such as 1000 rows), the effective rows (vout rows) of the Sensor are set as vout, the blanking rows (vblanking rows) of the Sensor are set as vblank, and the frame rate of the camera is set as frame. The driving of the lens focusing motor (i.e., lens zoom, indicating the focusing motor in the lens assembly, the magnification Z refers to the position of the lens focusing motor, and the magnification Z can control the zoom of the lens) can realize arbitrary speed control within a certain speed range.
[0052] The exposure mode of the Sensor is rolling shutter exposure, and the flowchart of the rolling shutter exposure can be seen from FIG. 1A. Figure 3 Of course, Figure 3 It is only an example of the Sensor rolling shutter exposure, and no limitation is made thereto. The Sensor rolling shutter exposure is performed by rolling scanning by rows, the effective rows are scanned first, and then the blanking rows are scanned, and after the scanning of the last row is completed, a frame of image is output. In the Sensor rolling shutter exposure process, a hardware interrupt is triggered when the scanning of the first row of effective rows is completed, and this hardware interrupt is denoted as FS, and the hardware interrupt FS indicates the beginning of the exposure of the effective rows (actually the exposure has started before this time), i.e., the hardware interrupt FS is generated when the scanning of the first row of effective rows is completed. In the Sensor rolling shutter exposure process, a hardware interrupt is triggered when the scanning of the last row of effective rows is completed, and this hardware interrupt is denoted as FE, and the hardware interrupt FE indicates the end of the exposure of the effective rows.
[0053] In the Sensor rolling shutter exposure process, a rolling shutter window can be set, and the size of the rolling shutter window can be set as SHS, that is, SHS represents the size of the rolling shutter window, and the size of the rolling shutter window represents the pixel rows occupied by the rolling shutter window. The unit of SHS is pixel row, which can represent the physical row count unit of pixels or the time T experienced by the physical exposure window moving (scanning) one pixel row 1H .
[0054] The process of rolling shutter exposure can be seen from Figure 3 It is assumed that the current frame is the nth frame exposure, when the rolling shutter window is located at position ①, it means that the first row of pixels starts to be exposed, and then the rolling shutter window scans down row by row, and it takes T 1H to move one row. When the rolling shutter window moves out of the first row, the current frame exposure start interrupt FS(n) is triggered, that is, the hardware interrupt FS, and actually the first row of pixels has completed exposure at this time.
[0055] Each row of pixels is scanned SHS times by the rolling shutter window, and the exposure time of each row of pixels is T shs . The same is true for the exposure process of each row, and the exposure time is T shs .
[0056] It is assumed that SHS = 8, when the rolling shutter window is located at position ②, it means that the current 4th row of pixels has just completed exposure, and the 12th row of pixels has just started exposure. When the rolling shutter window is located at position ③, it means that the exposure of the current 800th row of pixels is about to be completed, and the exposure process of all valid rows is about to end.
[0057] After the exposure of the last row of valid rows is completed, the nth frame exposure termination interrupt FE(n) is generated, that is, the hardware interrupt FE, which indicates that the exposure of the valid rows is completed, and the rolling shutter window is about to enter the blank row scanning.
[0058] When the rolling shutter window is located at position ④, it means that the last row of blank rows is about to complete scanning, and the first row of pixels of the next frame (n+1 frame) picture is being scanned for the 7th time by the rolling shutter window.
[0059] In the above process, T 1H can represent the row scanning time, that is, when the rolling shutter window scans down row by row, it takes T 1H to move one row, and the calculation method of the row scanning time T 1H can be seen from formula (1), of course, formula (1) is only an example, and the calculation method of the row scanning time T 1H is not limited.
[0060]
[0061] In formula (1), vmax can represent the total number of rows of the Sensor, that is, the total number of rows scanned by the Sensor when imaging, such as 1000 rows, etc. frame can represent the frame rate of the Sensor, that is, the frame rate of the camera.
[0062] In the above process, T shs may represent the exposure time of each row of pixels, since each row of pixels will be scanned by the rolling shutter window SHS times, and the row scanning time is T 1H Therefore, the exposure time T shs of each row of pixels can be calculated as shown in formula (2), of course, formula (2) is only an example.
[0063] T shs = SHS*T 1H Formula (2)
[0064] According to the process and characteristics of the rolling shutter exposure, the exposure start time of each row of pixels of the Sensor and the exposure end time of each row of pixels of the Sensor can be obtained, as shown in Table 1. FS(n) represents the generation time of the hardware interrupt FS, T shs represents the exposure time T shs of each row of pixels, and T 1H represents the row scanning time.
[0065] Table 1
[0066]
[0067] In the above application scenario, in order to achieve super depth of field, it is necessary to satisfy that the entire depth of the picture is clear. According to the straight-line propagation characteristics of light, each row of pixels of the Sensor picture will correspond to a certain depth of the scene being photographed, so when any row of pixels of the Sensor is exposed, as long as the lens focusing motor (lens focus, that is, the focusing motor in the lens assembly, the focus point F refers to the position of the lens focusing motor, which is used to control the focus point of the lens to make the image clear) is at the focus point position of the scene depth corresponding to the row of pixels, the image after the row of pixels is exposed can be ensured to be clear. According to this method, if the rolling shutter exposure process of all pixel rows is matched and synchronized with the synchronous driving of the motor, the super depth of field effect that the entire depth of the picture is clear can be achieved.
[0068] The image acquisition method in the embodiment of the application can achieve super depth of field by using the following process.
[0069] First, determine the pixel row range that needs to be matched and synchronized, which includes the minimum pixel row and the maximum pixel row, that is, the pixel rows between the minimum pixel row and the maximum pixel row are the pixel rows that need to be synchronized.
[0070] Exemplarily, taking picture vertical pixel line as the measurement unit, the target object can be located in any line of the picture, but for the picture integrity, the pixel line range occupied by the target object itself (i.e. the matching synchronization pixel line range) needs to be considered. Since the target object is located at different depths of the picture, the pixel line range occupied by the target object is different in size, therefore, the average value of the pixel line range occupied by the target object in the vertical direction at different depths is taken as the pixel range size occupied by the target object, and is set as D. In order to achieve more accurate matching effect, the focus needs to be matched with the center of the target object as the reference.
[0071] On this basis, the minimum pixel line can be obtained based on the minimum vertical pixel coordinate of the configured target object and the size of the rolling shutter window supported by the sensor, and the maximum pixel line can be obtained based on the maximum vertical pixel coordinate of the configured target object, and then the pixel line range is determined based on the minimum pixel line and the maximum pixel line.
[0072] For example, the minimum pixel line can be determined by formula (3), and the maximum pixel line can be determined by formula (4), and of course, formula (3) and formula (4) are only examples, and the determination method is not limited.
[0073]
[0074] In formula (3) and formula (4), y1 represents the minimum vertical pixel coordinate of the configured target object, and the minimum vertical pixel coordinate represents the vertical center pixel coordinate of the first window of the target object appearing in the picture, which can be configured according to experience. For example, the vertical minimum center pixel coordinate of the target object that can be collected in the collection range of the camera can be y1. y2 represents the maximum vertical pixel coordinate of the configured target object, and the maximum vertical pixel coordinate represents the vertical center pixel coordinate of the second window of the target object appearing in the picture, which can be configured according to experience. For example, the vertical maximum center pixel coordinate of the target object that can be collected in the collection range of the camera can be y2. For example, the first window is the window close to the starting line position of the image, and the second window is the window close to the ending line position of the image.
[0075] y min represents the minimum pixel line, y max represents the maximum pixel line, y1, y2 represents the collection range of the camera, therefore, no matter how large the collection range of the camera is, the matching synchronization pixel line range, i.e. the pixel line range that needs to be matched with the focus and exposure synchronization, [y min , y max ] can be calculated.
[0076] SHS represents the size of the rolling shutter window, and the size of the rolling shutter window represents the pixel line occupied by the rolling shutter window.
[0077] From formula (3) and formula (4), y1 needs to be greater than or equal to y2 needs to be less than or equal to D represents the pixel range size occupied by the target object, which is the average value of the pixel row range size of the target object in different depths, and vout represents the effective row of the Sensor.
[0078] From formula (3), if the minimum pixel row y min is the minimum longitudinal pixel coordinate y1, if the minimum pixel row y min is half of the size of the rolling shutter window SHS
[0079] From formula (4), the maximum pixel row y max may be the maximum longitudinal pixel coordinate y2.
[0080] Second, the matching mapping of the picture depth corresponding focus and the pixel row, that is, the mapping of the pixel row and the focus.
[0081] Referring to FIG. 1, it is assumed that the center of a target object with a height of H corresponds to the nth row of the target surface of the Sensor, and the mapping relationship of the depth information of the physical scene corresponding to the row of pixels is L(n), and the mapping relationship with the focus is F(L(n)), and is recorded as F'(n). F'(n) is a nonlinear relationship: F'(n) = F(L(n)). F'(n) is related to the installation height, the pitch angle, etc., and has great randomness, so it is difficult to directly obtain the accurate mapping relationship. Figure 2 Considering that the lens itself has certain depth-of-field characteristics, such as
[0082] the range framed by the dashed line in FIG. 2, as the picture depth becomes larger, the depth-of-field characteristics of the lens become better (not necessarily linearly larger as described in FIG. 1), so the mapping relationship of the pixel row and the focus can be approximated as a linear relationship, as shown in formula (5). Figure 2 Figure 2
[0083] F'(n) = F(L(n)) ≈ k*n + b formula (5)
[0084] In formula (5), F'(n) can represent the focus corresponding to the nth pixel row, k can represent the slope parameter, n can represent the nth pixel row, such as 1, 2, 3, etc., and b can represent the intercept parameter.
[0085] According to the approximate relationship, the focus F0 at the y min position and the focus F1 at the y max position can be obtained by actual calibration, and two calibration point information (y min , F0) and (y max , F1). Assuming that there are totally 800 pixel rows in the pixel row range, y min may be 10, y max may be 810. F0 represents the focus when the pixel row y min is clear, and F1 represents the focus when the pixel row y max is clear, which can be calibrated in advance.
[0086] After substituting the calibration point information (y min , F0) and (y max , F1) into the formula (5), the slope parameter k and the intercept parameter b can be obtained, for example, the slope parameter k and the intercept parameter b can be determined according to the following formula (6), and of course, the formula (6) is only an example, and the determination manner is not limited.
[0087]
[0088] After the slope parameter k and the intercept parameter b are obtained, the slope parameter k and the intercept parameter b can be substituted into the formula (5), so that for each pixel row, the focus corresponding to the pixel row can be obtained based on the formula (5). For example, if the pixel row is the 100th pixel row in the pixel row range, the value of n is set to 100, and after the value of n is substituted into the formula (5), F'(n) is the focus corresponding to the pixel row. Obviously, based on the formula (5), the focus F corresponding to any row in the range of [y min , y max ] can be calculated.
[0089] In a possible implementation, in the application process of the camera, the collection scene faced by the camera, the lens parameter, the magnification, the installation height, and the installation angle and other parameters can be quite different, and it is difficult to meet the clarity requirement when two-point calibration is used, so the pixel row range [y min , y max ] can be segmented and calibrated, and the method of multi-segment linear approximation fitting the nonlinear relationship can be used to solve the problem of large error.
[0090] For example, the pixel row range [y min , y max ] can be divided into m segment intervals, m can be a positive integer greater than 1, and the focus corresponding to the pixel row in each segment interval can be determined. For example, the mapping relationship between the pixel row and the focus is shown in the formula (7).
[0091]
[0092] In the formula (7), F'(n) can represent the focus corresponding to the nth pixel row, ki can represent the slope parameter corresponding to the ith segment interval, bi can represent the intercept parameter corresponding to the ith segment interval, and the value range of i can be 1-m. For example, if the value of i is 1, k1 represents the slope parameter corresponding to the first segment interval, b1 represents the intercept parameter corresponding to the first segment interval, and the value range of n is [p1, p2], p1 is the smallest pixel row y min , and p2 can be configured according to experience, and p2 is greater than y min and less than y max .
[0093] If the value of i is 2, k2 represents the slope parameter corresponding to the second segment interval, b2 represents the intercept parameter corresponding to the second segment interval, and the value range of n is [p2, p3], and so on.
[0094] For example, two calibration point information (p1, F0) and (p2, F1) can be obtained by actually calibrating the focus F0 of the p1 position and the focus F1 of the p2 position. F0 represents the focus when the pixel row p1 is clear, and F1 represents the focus when the pixel row p2 is clear. After substituting the calibration point information (p1, F0) and (p2, F1) into the formula (7), the slope parameter k1 and the intercept parameter b1 can be obtained. The determination method of the slope parameter k1 and the intercept parameter b1 can be referred to the formula (6). Two calibration point information (p2, F1) and (p3, F2) can be obtained by actually calibrating the focus F1 of the p2 position and the focus F2 of the p3 position. After substituting the calibration point information (p2, F1) and (p3, F2) into the formula (7), the slope parameter k2 and the intercept parameter b2 can be obtained, and so on.
[0095] Obviously, for each segment interval, the slope parameter ki and the intercept parameter bi corresponding to the segment interval can be obtained. The slope parameter ki and the intercept parameter bi can be substituted into the formula (7), so that for each pixel row in the range of [y min , y max ], the focus F corresponding to the pixel row can be obtained based on the formula (7).
[0096] For example, assuming that the m segment intervals are 3 segment intervals, the focus of 4 pixel row positions needs to be calibrated, and (p1, F0), (p2, F1), (p3, F2), and (p4, F3) are obtained, p1 is y min , and p4 is y maxOn this basis, the slope parameter k1 and the intercept parameter b1 corresponding to the first segmented interval are obtained based on (p1, F0) and (p2, F1), the slope parameter k2 and the intercept parameter b2 corresponding to the second segmented interval are obtained based on (p2, F1) and (p3, F2), and the slope parameter k3 and the intercept parameter b3 corresponding to the third segmented interval are obtained based on (p3, F2) and (p4, F3), so that all unknown coefficients can be calculated, and a higher-precision hyper-zoom matching mapping relationship is realized. When multiple segmented intervals are used for matching mapping, a better hyper-zoom effect can be presented.
[0097] Third, the synchronization of the focusing process and the pixel row exposure process.
[0098] For example, when an image is captured by a camera, a focusing process and a pixel row exposure process are involved. For the focusing process, a motor (here, a lens focus, i.e., a focusing motor in a lens assembly) needs to be controlled to move, and the focus point F (referring to the position of the lens focusing motor) is controlled by the motor movement. For the pixel row exposure process, the Sensor (sensor) needs to be controlled to expose each pixel row in turn, i.e., the Sensor uses a rolling shutter exposure method to expose each pixel row in turn, so as to obtain the image of each pixel row.
[0099] In this embodiment, the focusing process needs to be synchronized with the pixel row exposure process, i.e., when the Sensor exposes a certain pixel row (i.e., the pixel row exposure process), the motor is exactly at the focus position of the scene depth corresponding to the pixel row (i.e., the focusing process), so that the image after the exposure of the pixel row can be ensured to be clear.
[0100] In order to ensure the synchronization of the focusing process and the pixel row exposure process, refer to FIG. 4, which is a schematic diagram of a synchronization process of the focusing process and the pixel row exposure process. The synchronization process can include the following steps. Figure 4
[0101] Step 401: Determine the number m of segmented intervals, and divide all the pixel rows between the minimum pixel row and the maximum pixel row into m segmented intervals, where m can be a positive integer greater than 1.
[0102] For example, assuming that the m segmented intervals are three segmented intervals, four pixel row positions of the focus point need to be calibrated, i.e., (p1, F0), (p2, F1), (p3, F2), and (p4, F3) are obtained, where p1 is the minimum pixel row y min , and p4 is the maximum pixel row y max p2 and p3 are located between the minimum pixel row and the maximum pixel row, and p2 is less than p3. On this basis, three segmentation intervals can be obtained, which are segmentation interval [p1, p2], segmentation interval [p2, p3] and segmentation interval [p3, p4], and the slope parameter and the intercept parameter corresponding to each segmentation interval can be obtained. After the slope parameter and the intercept parameter are substituted into formula (7), the mapping relationship between the pixel row and the focus can be obtained.
[0103] Step 402, obtaining the starting focus corresponding to the minimum pixel row. For example, the minimum pixel row is the first to-be-matched pixel row, such as the minimum pixel row y min , and the starting focus is the starting matching focus, such as the starting focus F0.
[0104] For example, the starting focus corresponding to the minimum pixel row can be obtained by the following formula: F'(n) = ki*n + bi. Since the minimum pixel row y min is in the first segmentation interval, ki represents the slope parameter k1 corresponding to the first segmentation interval, bi represents the intercept parameter b1 corresponding to the first segmentation interval, and n takes the value of y min . After substituting the above parameters into the formula, the starting focus F'(n) can be obtained, which is denoted as the starting focus F0.
[0105] Step 403, determining the synchronous starting moment based on the minimum pixel row and the one-row scanning time length.
[0106] For example, the synchronous starting moment can be determined by the following formula: t0 = t' + y min *T 1H . For example, t0 can represent the synchronous starting moment. t' can represent the moment when the exposure starting interrupt of the current frame image is received, that is, the moment when the hardware interrupt FS is received, which represents the beginning of the effective row exposure (the actual exposure has started before this time), that is, the hardware interrupt FS is generated when the first row of effective row scanning is completed.
[0107] y min may represent the minimum pixel row, T 1H may represent the one-row scanning time length, and T 1H is determined by the following formula: vmax represents the total number of rows of the sensor, and frame represents the frame rate of the sensor.
[0108] For example, in the exposure process of one frame of image, the starting moment is the moment when the Sensor rolling shutter exposure of the first row of pixels outputs the interrupt signal FS, and the starting moment of the motor synchronization with the exposure is t0. The calculation formula of the starting moment t0 is as follows: t0 = y min *T 1H , that is, the starting moment t0 from the hardware interrupt FS.
[0109] Step 404, for each segment interval, determine the exposure duration corresponding to the segment interval.
[0110] For example, for each segment interval, the exposure duration corresponding to the segment interval can be determined by the following formula: i i i-1 1H For example, DT i represents the exposure duration (i.e., driving duration) corresponding to the ith segment interval, and the value range of i is 1-m, p i-1 represents the first pixel row of the ith segment interval, p i represents the last pixel row of the ith segment interval, and T 1H represents the row scanning duration.
[0111] Step 405, for each segment interval, determine the stroke step corresponding to the segment interval based on the focus points corresponding to the adjacent two rows of the segment interval. The stroke step represents that the motor is moved by the stroke step every interval of the row scanning duration.
[0112] For each segment interval, the stroke step corresponding to the segment interval can be determined by the following steps:
[0113] Step S11, calibrate the slope parameter corresponding to the segment interval and the intercept parameter corresponding to the segment interval.
[0114] For example, the first pixel row and the second pixel row are selected from all the pixel rows of the segment interval; the first pixel row is focused to obtain the first focus point, and the second pixel row is focused to obtain the second focus point. When the motor moves to the motor position corresponding to the first focus point, the first pixel row in the image satisfies the preset sharpness condition (i.e., the first pixel row is clear). When the motor moves to the motor position corresponding to the second focus point, the second pixel row in the image satisfies the preset sharpness condition (i.e., the first pixel row is clear).
[0115] On this basis, the slope parameter corresponding to the segment interval and the intercept parameter corresponding to the segment interval can be determined based on the first pixel row, the second pixel row, the first focus point and the second focus point. For example, the slope parameter and the intercept parameter corresponding to the segment interval can be determined by the following formula (8):
[0116]
[0117] In the above formula (8), k can represent the slope parameter corresponding to the segment interval, b can represent the intercept parameter corresponding to the segment interval, F0 can represent the first focus point corresponding to the first pixel row, F1 can represent the second focus point, y s may represent the first pixel row, y f may represent the second pixel row corresponding to the second pixel row.
[0118] For example, for the first segment interval [p1, p2], the first pixel row and the second pixel row are selected from all pixel rows in the segment interval, such as the first pixel row p1 and the second pixel row p2, of course, the first pixel row can also be greater than p1, and the second pixel row can also be less than p2. The clear focus position obtained by focusing on the first pixel row p1 is taken as the first focus point, and the clear focus position obtained by focusing on the second pixel row p2 is taken as the second focus point. Then, the first pixel row, the second pixel row, the first focus point and the second focus point can be substituted into formula (6) to obtain the slope parameter and the intercept parameter corresponding to the segment interval.
[0119] Step S12, based on the slope parameter corresponding to the segment interval and the intercept parameter corresponding to the segment interval, determining the focus points corresponding to any two adjacent pixel rows in the segment interval.
[0120] For example, any two adjacent pixel rows (such as pixel row 11 and pixel row 12, or pixel row 12 and pixel row 13, which is not limited, as long as the two pixel rows are adjacent) in the segment interval can be selected, and for each pixel row in the two adjacent pixel rows, the focus point corresponding to the pixel row can be determined by using the following formula: F'(n) = ki*n + bi. Wherein, F'(n) can represent the focus point corresponding to the nth pixel row, ki can represent the slope parameter corresponding to the i-th segment interval, and the value range of i can be 1-m, bi can represent the intercept parameter corresponding to the i-th segment interval, and n represents the pixel row, such as 11, 12, etc.
[0121] Step S13, determining the motor positions corresponding to the focus points of the two adjacent pixel rows, and determining the stroke step corresponding to the segment interval based on the difference between the two determined motor positions.
[0122] For example, the two pixel rows are denoted as pixel row 1 and pixel row 2, pixel row 1 corresponds to focus point 1, and pixel row 2 corresponds to focus point 2. After the focus point 1 and the focus point 2 are obtained, the motor position corresponding to the focus point 1 and the motor position corresponding to the focus point 2 can be determined, and then the difference between the motor position corresponding to the focus point 2 and the motor position corresponding to the focus point 1 can be taken as the stroke step corresponding to the segment interval.
[0123] Based on step 402-step 405, the starting focus F0, the synchronous starting time t0, the exposure time length DT corresponding to each segment interval, the travel step length corresponding to each segment interval can be obtained i Based on the above parameters, the synchronization of the focusing process and the pixel row exposure process can be realized, which will be described below.
[0124] Step 406, control the sensor to expose the minimum pixel row from the synchronous starting time. For each segment interval, within the exposure time length corresponding to the segment interval, control the sensor to expose each pixel row of the segment interval in turn, until the exposure of the maximum pixel row is completed to obtain the current frame image.
[0125] For example, the Sensor exposes the minimum pixel row y min from the synchronous starting time t0. Within the exposure time length corresponding to the first segment interval, control the Sensor to expose each pixel row of the first segment interval in turn, that is, from the minimum pixel row y min , expose each pixel row of the first segment interval in turn. Within the exposure time length corresponding to the second segment interval, control the Sensor to expose each pixel row of the second segment interval in turn.
[0126] In this way, until the exposure of each pixel row of the last segment interval, until the exposure of the maximum pixel row y max is completed, all the pixel rows of these segment intervals form the current frame image.
[0127] Step 407, move the motor to the starting position corresponding to the starting focus. Control the motor to move from the starting position (i.e. the starting position corresponding to the starting focus) from the synchronous starting time. For each segment interval, within the exposure time length corresponding to the segment interval, control the motor to move with the travel step length corresponding to the segment interval, until the motor is moved to the end position corresponding to the end focus corresponding to the maximum pixel row.
[0128] For example, before the synchronous starting time t0, the motor has been moved to the starting position corresponding to the starting focus F0 (i.e. the starting motor position, since the motor position corresponds to the focus, the starting position corresponding to the starting focus F0 can be obtained), and the motor is at the starting position until the synchronous starting time t0.
[0129] From the synchronization starting moment t0, the motor starts to move from the starting position. In the exposure duration corresponding to the first sub-interval, the motor is controlled to move by the stroke step S1 corresponding to the first sub-interval, i.e., the motor moves by the stroke step S1 every time a row scanning duration elapses. In the exposure duration corresponding to the second sub-interval, the motor is controlled to move by the stroke step S2 corresponding to the second sub-interval, i.e., the motor moves by the stroke step S2 every time a row scanning duration elapses. In this way, in the exposure duration corresponding to the last sub-interval, the motor is controlled to move by the stroke step corresponding to the sub-interval, and the motor is moved to the maximum pixel row y max corresponding to the ending position corresponding to the ending focus.
[0130] After the above processing, the motor is just at the focus position corresponding to a pixel row when the Sensor exposes the pixel row, and the image after the exposure of the pixel row is clear.
[0131] In a possible implementation, after the motor is moved to the maximum pixel row y max corresponding to the ending position corresponding to the ending focus, after receiving an exposure end interrupt of the current frame image (indicating that the exposure of the current frame image is completed, and the exposure process of the next frame image is started), the motor can be moved to the starting position corresponding to the starting focus corresponding to the minimum pixel row y min of the next frame image (i.e., the minimum pixel row y min of the next frame image) within a target running duration, i.e., the motor is moved to the starting position corresponding to the starting focus F0 before the synchronization starting moment t0 of the next frame image, and the motor is at the starting position until the synchronization starting moment t0.
[0132] For example, the determination manner of the target running duration can include but is not limited to using the following formula: DT r =(vblank)*T 1H -△T, DT r represents the target running duration, vblank represents the total number of blanking rows of the Sensor, T 1H represents a row scanning duration, and △T represents a configured margin duration, which can be configured according to experience and can cover system timing errors.
[0133] In summary, after the exposure synchronization of a frame is completed, the Sensor enters the effect de-scanning, and the motor needs to be returned to the starting position corresponding to the starting focus F0 within the effect time period, and the running duration is DT r .
[0134] In a possible implementation, the synchronization timing of the focusing process and the pixel row exposure process can be referred toFigure 5 As shown, the entire synchronization timing can guarantee the following relationship:
[0135] Before starting the super depth of field, the endpoint p of each segment interval is obtained i The corresponding focus point Fi, and drive the motor to reach the starting position corresponding to the starting focus point F0 to wait for the FS signal (i.e. interrupt signal) of the Sensor. When waiting for the Sensor to output the FS interrupt signal after rolling shutter exposure of the first row of pixels, the super depth of field process is started, and at t0, the motor synchronization exposure will start. Since the focus position and driving time of the motor in each segment interval are known, as long as the time DT i moves at a constant speed, i.e. reaches Fi on time, i.e. realizes the matching and synchronization of the focus and exposure, see Figure 5 As shown, it is the synchronization timing diagram of the continuous frame exposure of the Sensor. In this way, the focus adjustment process of each frame and the exposure process are synchronized, and the super depth of field effect of the picture is realized.
[0136] For example, see Figure 6 As shown, it is the synchronization process of the focus adjustment process and the pixel row exposure process.
[0137] Step 601, determine the number of segments m of the segment interval.
[0138] Step 602, obtain the starting focus point F0 corresponding to the minimum pixel row (i.e. the first row of pixel rows to be matched).
[0139] Step 603, drive the motor to the motor position corresponding to the starting focus point F0.
[0140] Step 604, obtain the SHS of the Sensor exposure shutter.
[0141] Step 605, judge whether the Sensor outputs the FS interrupt signal indicating the start of exposure. If yes, execute step 606, if no, continue to judge whether the Sensor outputs the FS interrupt signal indicating the start of exposure.
[0142] Step 606, judge whether the synchronization of all segment intervals has been completed.
[0143] If no, execute step 607, if yes, execute step 609.
[0144] Step 607, calculate the exposure time DTi (i.e. driving time) corresponding to the current segment interval (e.g. the i-th segment interval, i is less than or equal to m) and the travel step length corresponding to the current segment interval.
[0145] Step 608, based on the exposure time DTi corresponding to the current segmentation interval and the travel step corresponding to the current segmentation interval, control the motor to move in the exposure time DTi with the travel step.
[0146] After the control of the current segmentation interval is completed, step 606 is performed to determine whether the synchronization of all segmentation intervals has been completed. If not, the next segmentation interval is taken as the current segmentation interval, and the above steps are repeated.
[0147] Step 609, determine whether the Sensor outputs the FE interrupt signal indicating the end of exposure. If yes, step 610 is performed, and if not, continue to determine whether the Sensor outputs the FE interrupt signal indicating the end of exposure.
[0148] Step 610, set the driving time DTr (DTr needs to end before the FS of the next frame), and drive the motor to the motor position corresponding to the starting focus F0 within the driving time DTr.
[0149] From the above technical solutions, in the embodiments of the present application, when any row of pixels of the sensor (Sensor) is exposed, the motor is at the focus position corresponding to the scene depth of the row of pixels, thereby ensuring that the image produced after the row of pixels is exposed is clear. In this way, by solving the matching synchronization of the rolling shutter exposure process of all pixel rows and the synchronous driving of the motor, the super depth of field effect of ensuring the entire depth of the picture to be clear can be achieved, thereby the super depth of field effect can be achieved, the panoramic depth of the target object can be clear, the field of view of the picture can be fully utilized, the acquisition range of the target object can be larger, and the image clarity can be improved. For example, when the target object exceeds the depth of field range, a clear image of the target object can also be acquired. When the target object is at the boundary of the field of view range, a clear image of the target object can also be acquired. The entire depth of the picture target can be clear, the panoramic depth can be clear, the field of view of the picture can be fully utilized, the acquisition range of the target object can be larger, and the implementation threshold and system cost can be reduced. Without changing the composition of the camera system, without upgrading the hardware components and advanced algorithms, the super depth of field effect can be achieved.
[0150] Based on the same application concept as the above method, an image acquisition device is proposed in the embodiments of the present application, which is described with reference to Figure 7As shown, a structural schematic diagram of the device is shown, the device comprises: a control module 71, configured to move a motor to a starting position corresponding to a starting focus point based on an acquired minimum pixel row; a determination module 72, configured to determine a synchronous starting time based on the minimum pixel row and a one-line scanning time length; the determination module 72 is configured to divide all pixel rows between the minimum pixel row and an acquired maximum pixel row into m segmented intervals; for each segmented interval, determine an exposure time length corresponding to the segmented interval, determine a travel step length corresponding to the segmented interval based on adjacent two rows corresponding to the focus points of the segmented interval, and the travel step length represents that the motor is moved by one line scanning time length interval, and the motor is moved according to the travel step length; the control module 71 is configured to control the sensor to expose the minimum pixel row from the synchronous starting time; for each segmented interval, in the exposure time length corresponding to the segmented interval, control the sensor to expose each pixel row of the segmented interval in turn until the exposure of the maximum pixel row is completed to obtain a current frame image; control the motor to move from the starting position from the synchronous starting time; for each segmented interval, in the exposure time length corresponding to the segmented interval, control the motor to move by the travel step length corresponding to the segmented interval until the motor is moved to an ending position corresponding to an ending focus point corresponding to the maximum pixel row.
[0151] For example, the determination module 72 is further configured to, before moving the motor to the starting position corresponding to the starting focus point based on the acquired minimum pixel row, acquire the minimum pixel row based on a configured minimum longitudinal pixel coordinate of a target object and a rolling shutter window size supported by the sensor; wherein the minimum longitudinal pixel coordinate represents a longitudinal center pixel coordinate of a first window of the target object appearing in a picture, and the rolling shutter window size represents a pixel row occupied by a rolling shutter window; wherein if then the minimum pixel row is the minimum longitudinal pixel coordinate y1, and if then the minimum pixel row is half of the rolling shutter window size SHS; and the determination module 72 is further configured to acquire the maximum pixel row based on a configured maximum longitudinal pixel coordinate of the target object; wherein the maximum longitudinal pixel coordinate represents a longitudinal center pixel coordinate of a second window of the target object appearing in a picture; wherein the maximum pixel row is the maximum longitudinal pixel coordinate; wherein the first window is a window close to a starting row position of an image, and the second window is a window close to an ending row position of the image.
[0152] For example, when the determination module 72 determines the synchronous starting time based on the minimum pixel row and the one-line scanning time length, it is specifically configured to determine the synchronous starting time by using the following formula: t0=t'+ymin*T 1H; wherein, t0 represents the synchronization starting moment, t' represents the moment of receiving the exposure starting interrupt of the current frame image, y min represents the minimum pixel row, T 1H represents the one-row scanning duration; the determining module 72 is further configured to determine the one-row scanning duration by using the following formula: wherein, vmax represents the total number of rows of the sensor, and frame represents the frame rate of the sensor.
[0153] For example, the determining module 72 is configured to determine the exposure duration corresponding to the segmented interval by using the following formula: DT i = (p i -p i-1 )*T 1H ; DT i represents the exposure duration corresponding to the ith segmented interval, and the value range of i is 1-m, p i-1 represents the first pixel row of the ith segmented interval, p i represents the last pixel row of the ith segmented interval, T 1H represents the one-row scanning duration.
[0154] For example, the determining module 72 is configured to determine the stroke step corresponding to the segmented interval based on the focal points corresponding to the adjacent two rows of the segmented interval by using the following method: determining the focal points corresponding to the adjacent two pixel rows of the segmented interval based on the slope parameter and the intercept parameter corresponding to the segmented interval, determining the motor positions corresponding to the focal points of the adjacent two pixel rows, and determining the stroke step corresponding to the segmented interval based on the difference between the two determined motor positions; wherein, the determining module 72 is configured to determine the focal points corresponding to the adjacent two pixel rows of the segmented interval based on the slope parameter and the intercept parameter corresponding to the segmented interval by using the following formula: F'(n) = ki*n + bi; wherein, F'(n) represents the focal point corresponding to the nth pixel row, ki represents the slope parameter corresponding to the ith segmented interval, and the value range of i is 1-m, and bi represents the intercept parameter corresponding to the ith segmented interval.
[0155] The determination module 72 is further configured to, before determining the focus points corresponding to the adjacent two pixel rows of the segmented interval based on the slope parameter and the intercept parameter corresponding to the segmented interval, calibrate the slope parameter and the intercept parameter corresponding to the segmented interval by the following steps: selecting a first pixel row and a second pixel row from all the pixel rows of the segmented interval; focusing the first pixel row to obtain a first focus point, and focusing the second pixel row to obtain a second focus point; wherein the first pixel row in the image satisfies a preset sharpness condition when the motor moves to a motor position corresponding to the first focus point; the second pixel row in the image satisfies a preset sharpness condition when the motor moves to a motor position corresponding to the second focus point; and determining the slope parameter and the intercept parameter corresponding to the segmented interval based on the first pixel row, the second pixel row, the first focus point and the second focus point.
[0156] For example, the determination module 72 is configured to determine the slope parameter and the intercept parameter corresponding to the segmented interval based on the first pixel row, the second pixel row, the first focus point and the second focus point, specifically by using the following formula to determine the slope parameter and the intercept parameter corresponding to the segmented interval:
[0157]
[0158] k represents the slope parameter corresponding to the segmented interval, b represents the intercept parameter corresponding to the segmented interval, F0 represents the first focus point, F1 represents the second focus point, y s represents the first pixel row, y f represents the second pixel row.
[0159] For example, the control module 71 is further configured to, after moving the motor to the end position corresponding to the end focus point of the maximum pixel row, after receiving an exposure end interrupt of the current frame image, move the motor to a start position corresponding to a start focus point of the minimum pixel row within a target running duration.
[0160] wherein the target running duration is determined by DT r = (vblank) * T 1H -△T.
[0161] wherein DT r represents the target running duration, vblank represents the total number of blanking lines configured for the sensor, T 1H represents a row scanning duration, and△T represents a configured margin duration.
[0162] Based on the same application concept as the above method, the embodiment of the present application proposes a camera device, comprising: a processor configured to move a motor to a starting position corresponding to a starting focal point based on a starting focal point corresponding to a minimum pixel row that has been acquired; determine a synchronous starting time based on the minimum pixel row and a row scanning duration; divide all pixel rows between the minimum pixel row and a maximum pixel row that has been acquired into m segment intervals, m being a positive integer; for each segment interval, determine an exposure duration corresponding to the segment interval, determine a travel step corresponding to the segment interval based on focal points corresponding to adjacent two rows of the segment interval, and move the motor according to the travel step every interval of a row scanning duration;
[0163] a sensor configured to expose the minimum pixel row from the synchronous starting time; for each segment interval, expose each pixel row of the segment interval in sequence within the exposure duration corresponding to the segment interval, until the exposure of the maximum pixel row is completed to obtain a current frame image;
[0164] a motor configured to move from the starting position from the synchronous starting time; for each segment interval, move using the travel step corresponding to the segment interval within the exposure duration corresponding to the segment interval, until the motor is moved to an ending position corresponding to an ending focal point corresponding to the maximum pixel row.
[0165] Based on the same application concept as the above method, the embodiment of the present application proposes an electronic device (such as a camera device), as shown in Figure 8 The electronic device comprises a processor 81 and a machine readable storage medium 82, the machine readable storage medium 82 stores machine executable instructions capable of being executed by the processor 81; the processor 81 is configured to execute the machine executable instructions to implement the image acquisition method disclosed in the above examples of the present application.
[0166] Based on the same application concept as the above method, the embodiment of the present application further provides a machine readable storage medium, the machine readable storage medium stores a plurality of computer instructions, when the computer instructions are executed by a processor, the image acquisition method disclosed in the above examples of the present application can be implemented.
[0167] The above machine readable storage medium can be any electronic, magnetic, optical or other physical storage device, and can contain or store information such as executable instructions, data, etc. For example, the machine readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state disk, any type of storage disk (such as optical disk, dvd, etc.), or similar storage medium, or combination thereof.
[0168] The systems, apparatuses, modules, or units illustrated in the above embodiments can be specifically implemented by computers or entities, or by products with certain functions. A typical implementation device is a computer, and specific forms of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an e-mail device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0169] For the sake of clarity, the above apparatuses are described with reference to functional blocks and various units that represent functions to be implemented. Of course, the functions of the units can be embodied in one or more software and / or hardware components.
[0170] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0171] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions, which are executed via the processor of the computer or other programmable data processing apparatus, generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0172] Furthermore, these computer program instructions can also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0173] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide processes for implementing the functions specified in the flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0174] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. An image acquisition method characterized by, The method comprises: based on the acquired starting focus point corresponding to the minimum pixel row, moving the motor to the starting position corresponding to the starting focus point; based on the minimum pixel row and a row scanning duration, determining a synchronous starting time; dividing all pixel rows between the minimum pixel row and the acquired maximum pixel row into m segmented intervals, m being a positive integer; for each segmented interval, determining an exposure duration corresponding to the segmented interval, based on the focus points corresponding to the adjacent two rows of the segmented interval, determining a travel step length corresponding to the segmented interval, and the travel step length representing that every interval is a row scanning duration, moving the motor according to the travel step length; controlling the sensor to expose the minimum pixel row from the synchronous starting time; for each segmented interval, within the exposure duration corresponding to the segmented interval, controlling the sensor to expose each pixel row of the segmented interval in turn, until the exposure of the maximum pixel row is completed to obtain a current frame image; controlling the motor to move from the starting position from the synchronous starting time; for each segmented interval, within the exposure duration corresponding to the segmented interval, controlling the motor to move by using the travel step length corresponding to the segmented interval, until the motor is moved to the ending position corresponding to the ending focus point corresponding to the maximum pixel row.
2. The method of claim 1, wherein, Before the step of based on the acquired starting focus point corresponding to the minimum pixel row, moving the motor to the starting position corresponding to the starting focus point, the method further comprises: obtaining the minimum pixel row based on the configured minimum longitudinal pixel coordinate of the target object and a size of a rolling shutter window supported by the sensor, wherein the minimum longitudinal pixel coordinate represents a longitudinal center pixel coordinate of a first window of the target object appearing in a picture, and the size of the rolling shutter window represents a pixel row occupied by the rolling shutter window; wherein if the minimum pixel row is the minimum longitudinal pixel coordinate y1, and if the minimum pixel row is half of the size of the rolling shutter window SHS. based on the configured maximum longitudinal pixel coordinate of the target object, acquiring the maximum pixel row; wherein the maximum longitudinal pixel coordinate represents a longitudinal center pixel coordinate of a second window of the target object appearing in the picture; wherein the maximum pixel row is the maximum longitudinal pixel coordinate; wherein the first window is a window close to the starting row position of the image, and the second window is a window close to the ending row position of the image.
3. The method of claim 1, wherein the step of based on the minimum pixel row and a row scanning duration, determining a synchronous starting time, comprises: The synchronization start time is determined using the following equation: t0 = t' + y min *T 1H ; Wherein, t0 represents the synchronization starting moment, t' represents the moment of receiving the exposure starting interrupt of the current frame image, y min represents the minimum pixel row, T 1H represents the one row scanning duration; The method further comprises: determining the one-line scanning duration by using the following formula: wherein vmax represents the total number of rows of the sensor, and frame represents the frame rate of the sensor.
4. The method of claim 1, wherein The determining of the exposure time corresponding to the segment interval comprises: determining the exposure time by using the following formula: DT i = (p i -p i-1 )*T 1H ; wherein, DT i represents the exposure time corresponding to the i th segment interval, and the value range of i is 1-m, p i-1 represents the first pixel row of the i th segment interval, p i represents the last pixel row of the i th segment interval, and T 1H represents the time length of one row scanning.
5. The method of claim 1, wherein, the step of based on the focus points corresponding to the adjacent two rows of the segmented interval, determining a travel step length corresponding to the segmented interval, comprises: based on the slope parameter and the intercept parameter corresponding to the segmented interval, determining the focus points corresponding to the adjacent two pixel rows of the segmented interval, determining the motor positions corresponding to the focus points of the adjacent two pixel rows, and based on the difference between the two determined motor positions, determining the travel step length corresponding to the segmented interval; wherein the step of based on the slope parameter and the intercept parameter corresponding to the segmented interval, determining the focus points corresponding to the adjacent two pixel rows of the segmented interval, comprises: determining the focus point corresponding to the pixel row by using the following formula: F'(n) = ki*n + bi; wherein F'(n) represents the focus point corresponding to the nth pixel row, ki represents the slope parameter corresponding to the ith segmented interval, and the value range of i is 1-m, and bi represents the intercept parameter corresponding to the ith segmented interval.
6. The method of claim 5, wherein, Before determining the focus points corresponding to the adjacent two pixel rows of the segmented interval based on the slope parameter and the intercept parameter corresponding to the segmented interval, the slope parameter and the intercept parameter corresponding to the segmented interval are calibrated by using the following steps: selecting a first pixel row and a second pixel row from all the pixel rows of the segmented interval; focusing on the first pixel row to obtain a first focus point and focusing on the second pixel row to obtain a second focus point; wherein, when the motor moves to a motor position corresponding to the first focus point, the first pixel row in the image satisfies a preset definition condition; when the motor moves to a motor position corresponding to the second focus point, the second pixel row in the image satisfies a preset definition condition; determining the slope parameter and the intercept parameter corresponding to the segmented interval based on the first pixel row, the second pixel row, the first focus point and the second focus point.
7. The method of claim 6, wherein determining the slope parameter and the intercept parameter corresponding to the segmented interval based on the first pixel row, the second pixel row, the first focus point and the second focus point comprises: determining the slope parameter and the intercept parameter corresponding to the segmented interval by using the following formula: k represents a slope parameter corresponding to the piecewise interval, b represents an intercept parameter corresponding to the piecewise interval, F0 represents a first focus, F1 represents a second focus, y s represents a first pixel row, y f represents a second pixel row.
8. The method of claim 1, wherein, After moving the motor to the end position corresponding to the end focus point of the maximum pixel row, the method further comprises: after receiving an exposure end interrupt of the current frame image, moving the motor to a start position corresponding to a start focus point of a minimum pixel row within a target running time length; Wherein, the determination manner of the target running time is: DT r = (vblank) * T 1H -△T; wherein DT r represents the target running time, vblank represents the total number of blanking lines configured for the sensor, T 1H represents the time length of one line scanning, and ΔT represents the configured margin time length.
9. An image acquisition device, characterized in that The apparatus comprises: a control module configured to move the motor to a start position corresponding to a start focus point of a minimum pixel row based on the acquired start focus point of the minimum pixel row; a determination module configured to determine a synchronous start time based on the minimum pixel row and a row scanning time length; The determination module is configured to divide all the pixel rows between the minimum pixel row and the acquired maximum pixel row into m segmented intervals; for each segmented interval, determine an exposure time length corresponding to the segmented interval, determine a travel step length corresponding to the segmented interval based on the focus points corresponding to the adjacent two rows of the segmented interval, and the travel step length represents that the motor is moved by one row scanning time length every interval; The control module is configured to control the sensor to expose the minimum pixel row from the synchronous start time; for each segmented interval, control the sensor to expose each pixel row of the segmented interval in turn within the exposure time length corresponding to the segmented interval, until the exposure of the maximum pixel row is completed to obtain a current frame image; control the motor to move from the start position from the synchronous start time; for each segmented interval, control the motor to move by the travel step length corresponding to the segmented interval within the exposure time length corresponding to the segmented interval, until the motor is moved to the end position corresponding to the end focus point of the maximum pixel row.
10. A camera device, characterized by includes: The processor is configured to: move the motor to a starting position corresponding to a starting focal point based on the acquired starting focal point corresponding to the minimum pixel row; determine a synchronous starting moment based on the minimum pixel row and a row scanning duration; divide all pixel rows between the minimum pixel row and an acquired maximum pixel row into m segmented intervals, m being a positive integer; for each segmented interval, determine an exposure duration corresponding to the segmented interval, determine a travel step corresponding to the segmented interval based on focal points corresponding to adjacent two rows of the segmented interval, and the travel step represents a travel step per row scanning duration, and move the motor according to the travel step; The sensor is configured to: expose the minimum pixel row from the synchronous starting moment; for each segmented interval, expose each pixel row of the segmented interval in turn within the exposure duration corresponding to the segmented interval, until exposure of the maximum pixel row is completed to obtain a current frame image. The motor is configured to: move from the starting position from the synchronous starting moment; for each segmented interval, move by using the travel step corresponding to the segmented interval within the exposure duration corresponding to the segmented interval, until the motor is moved to an ending position corresponding to an ending focal point corresponding to the maximum pixel row.