Aperture steady-state value fast calibration method and device, computer equipment and medium

By using differential calculation and PID control, the steady-state value of the DC-driven aperture is quickly calibrated, solving the problems of long time consumption and instability in the existing technology, and realizing efficient and accurate aperture control.

CN115409901BActive Publication Date: 2025-12-16SHENZHEN TVT DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211066107.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-12-16
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

Existing technologies are time-consuming and have a wide range of limitations when calibrating the steady-state value of DC-driven apertures (DC-IRIS). They are also susceptible to human factors, resulting in unstable aperture control and excessively long convergence times in batch products, which affects production efficiency and the accuracy of calibration results.

Method used

By acquiring the current image brightness and performing a difference calculation with the pre-set desired image brightness, combined with positional PID control and gradual adjustment of the PWM duty cycle, the upper and lower limits of the steady-state value of the aperture within the convergence threshold range of the desired image brightness are found, and the steady-state value is found within this range to achieve rapid calibration.

Benefits of technology

Rapid calibration was achieved in the production line environment, reducing calibration time, saving labor costs, and improving data accuracy and aperture control stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115409901B_ABST
    Figure CN115409901B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a kind of diaphragm steady-state value fast calibration method, device, computer equipment and medium, method includes: obtaining the image brightness of current time;Current time image brightness and pre-set image expected brightness difference value operation is operated, to obtain difference value operation result;Difference value operation result and pre-set image expected brightness convergence threshold are compared, to obtain comparison result;According to comparison result, diaphragm is adjusted, to find out the upper limit value and lower limit value of diaphragm steady-state value in image expected brightness convergence threshold range;In the upper limit value and lower limit value range of steady-state value, the steady-state value of diaphragm is found out;The steady-state value of diaphragm found out is output as steady-state calibration value.The present application realizes fast calibration in production line environment, reduces calibration time, saves manpower cost, improves the accuracy of data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of aperture calibration, in particular to an aperture steady-state value rapid calibration method and device, a computer device and a medium. BACKGROUND

[0002] The scene brightness range faced by a camera equipment is very large, and most commonly used lenses are fixed apertures. Images collected by the camera equipment (such as a security monitoring camera) will be overexposed or too dark with a high probability. In order to collect images with appropriate brightness, an automatic aperture is usually used to adjust the light intake of the lens at any time and anywhere, so as to achieve the required image brightness.

[0003] There are various automatic apertures on the market, and a DC-IRIS is an automatic aperture with low cost and without an aperture size or position feedback circuit. In order to control such an aperture, a PWM is usually used to adjust the duty cycle, and a push-pull drive operational amplifier for driving a coil is converted into a voltage with different voltage amplitudes. The coil is energized, and the coil will obtain a torque to drive the aperture to open or close. When the light intake is weak, the voltage is increased to increase the driving torque, so that the driving torque is greater than the damping torque, and the aperture moves to the opening direction. When the required light intake is reached, the aperture needs to be stabilized and not changed. At this time, the voltage needs to be reduced to reduce the driving torque, so that the driving torque is equal to the damping torque. This state is called steady state. The voltage value at which the driving torque is equal to the damping torque is called the steady state voltage value, and the corresponding PWM duty cycle is called the steady state value. When the light intake is strong, the voltage is reduced based on the steady state voltage value to reduce the driving torque, so that the driving torque is less than the damping torque, and the aperture moves to the closing direction. When the required light intake is reached, the aperture needs to be stabilized and not changed. At this time, the voltage needs to be increased to increase the driving torque, so that the driving torque is equal to the damping torque.

[0004] In this aperture control process, the steady state voltage is extremely important. If the steady state voltage value is inaccurate, the aperture control will lose the reference, and the aperture will keep opening and closing without a steady state. The steady state value is inconsistent due to the influence of the performance of the operational amplifier, the performance of the control circuit, the inertia of the damping coil, the damping coefficient and the like. If the same steady state value is used to cover batch products, the aperture control of the batch products will be unstable, and the convergence time will be too long. Therefore, the calibration of the steady state value of the low-cost DC-IRIS before the product is shipped is extremely important.

[0005] The existing technology calibration is to calibrate each duty cycle in the PWM linear range. This method has a too wide calibration range, and the steady state value is only in a relatively narrow range. Moreover, the calibration time is very long, which seriously affects the production efficiency. There are also subjective factors of many calibration personnel, and the reliability of the calibration result is greatly reduced. SUMMARY

[0006] The present application aims to overcome the deficiencies of the prior art, and provide an aperture steady-state value fast calibration method and device, computer equipment and medium, which can realize fast calibration in a factory production line environment, reduce calibration time, save labor costs, and improve data accuracy.

[0007] To achieve the above object, the present application adopts the following technical solutions:

[0008] In a first aspect, the aperture steady-state value fast calibration method comprises:

[0009] Obtaining the image brightness at the current time;

[0010] Subtracting the image brightness at the current time from the pre-set image expected brightness to obtain a difference operation result;

[0011] Comparing the difference operation result with the pre-set image expected brightness convergence threshold to obtain a comparison result;

[0012] Adjusting the aperture according to the comparison result to find the upper limit value and the lower limit value of the aperture steady-state value within the image expected brightness convergence threshold range;

[0013] Finding the aperture steady-state value within the upper limit value and the lower limit value range of the steady-state value;

[0014] Outputting the found aperture steady-state value as the steady-state calibration value.

[0015] Further technical solutions thereof are as follows: the obtaining of the image brightness at the current time comprises:

[0016] Collecting the image at the current time;

[0017] Counting the brightness value of each pixel in the collected image at the current time;

[0018] Dividing the image at the current time into multiple blocks;

[0019] Assigning a weight value to each block;

[0020] Calculating the average brightness of each block according to the brightness value of each pixel;

[0021] Obtaining the image brightness according to the calculated average brightness of each block and the weight value of each block.

[0022] Further technical solutions thereof are as follows: the adjusting of the aperture according to the comparison result to find the upper limit value and the lower limit value of the aperture steady-state value within the image expected brightness convergence threshold range comprises:

[0023] If the absolute value of the difference operation result is greater than the image expected brightness convergence threshold, a position type PID regulation PWM control aperture is selected to make the image brightness at the current time approach the image expected brightness convergence threshold;

[0024] If the absolute value of the difference operation result is less than the image expected brightness convergence threshold, the PWM duty cycle at this time is recorded;

[0025] The PWM duty cycle is gradually increased or decreased based on the PWM duty cycle at this time, so that the image brightness at the current time approaches the image expected brightness convergence threshold;

[0026] When the image brightness at the current time is equal to the difference operation result of the image expected brightness and the image expected brightness convergence threshold, the PWM duty cycle at this time is recorded as the lower limit of the steady state value;

[0027] When the image brightness at the current time is equal to the sum operation result of the image expected brightness and the image expected brightness convergence threshold, the PWM duty cycle at this time is recorded as the upper limit of the steady state value.

[0028] Further technical solutions are as follows: the steady state value of the aperture is found in the range of the upper limit value and the lower limit value of the steady state value, comprising:

[0029] The number of image frames that need to be counted for each execution of the PWM duty cycle is set;

[0030] The execution of the PWM duty cycle next time is determined according to the image brightness change direction reflected by the multiple frames of images counted at the current execution of the PWM duty cycle;

[0031] When the executed PWM duty cycle appears no image brightness change of the multiple frames of images counted, the PWM duty cycle is taken as the steady state value of the aperture.

[0032] In the second aspect, the aperture steady state value rapid calibration device comprises an acquisition unit, an operation unit, a comparison unit, an adjustment unit, a search unit and an output unit;

[0033] The acquisition unit is used to acquire the image brightness at the current time;

[0034] The operation unit is used to perform difference operation on the image brightness at the current time and the image expected brightness set in advance to obtain a difference operation result;

[0035] The comparison unit is used to compare the difference operation result with the image expected brightness convergence threshold set in advance to obtain a comparison result;

[0036] The adjustment unit is used to adjust the aperture according to the comparison result to find the upper limit value and the lower limit value of the steady state value of the aperture in the image expected brightness convergence threshold range.

[0037] The searching unit is configured to search for the steady-state value of the aperture within the upper limit value and the lower limit value of the steady-state value.

[0038] The output unit is configured to output the searched steady-state value of the aperture as a steady-state calibration value.

[0039] Further technical solutions are as follows: the acquisition unit comprises a driving module, a statistical module, a division module, a marking module, a calculation module, and a combination module.

[0040] The driving module is configured to acquire an image at a current time.

[0041] The statistical module is configured to count the brightness value of each pixel in the acquired image at the current time.

[0042] The division module is configured to divide the image at the current time into a plurality of blocks.

[0043] The marking module is configured to assign a weight value to each block.

[0044] The calculation module is configured to calculate the average brightness of each block according to the brightness value of each pixel.

[0045] The combination module is configured to combine the weight value of each block with the calculated average brightness of each block to obtain the image brightness.

[0046] Further technical solutions are as follows: the adjustment unit comprises a first adjustment module, a first recording module, a second adjustment module, a second recording module, and a third recording module.

[0047] The first adjustment module is configured to, if the absolute value of the difference value operation result is greater than the image expected brightness convergence threshold value, select a positional PID to adjust the PWM to control the aperture, so that the image brightness at the current time approaches the image expected brightness convergence threshold value.

[0048] The first recording module is configured to, if the absolute value of the difference value operation result is less than the image expected brightness convergence threshold value, record the PWM duty cycle at this time.

[0049] The second adjustment module is configured to, based on the PWM duty cycle at this time, gradually increase or decrease the PWM duty cycle, so that the image brightness at the current time approaches the image expected brightness convergence threshold value.

[0050] The second recording module is configured to, when the image brightness at the current time is equal to the difference value operation result of the image expected brightness and the image expected brightness convergence threshold value, record the PWM duty cycle at this time as the lower limit of the steady-state value.

[0051] The third recording module is configured to record the PWM duty cycle at the current moment as an upper limit of the steady state value when the image brightness at the current moment is equal to a sum of the image expected brightness and the image expected brightness convergence threshold.

[0052] Further technical solutions are as follows: the searching unit comprises a setting module, an executing module and a judging module.

[0053] The setting module is configured to set the number of image frames that need to be counted for each execution of the PWM duty cycle.

[0054] The executing module is configured to determine the execution of the PWM duty cycle in the next time according to the image brightness change direction reflected by the multiple image frames counted at the current execution of the PWM duty cycle.

[0055] The judging module is configured to take the PWM duty cycle as the steady state value of the aperture when the multiple image frames counted show no image brightness change.

[0056] In a third aspect, a computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the aperture steady state value fast calibration method as described above when executing the computer program.

[0057] In a fourth aspect, a computer readable storage medium stores a computer program, and the computer program comprises program instructions, which, when executed by a processor, cause the processor to execute the aperture steady state value fast calibration method as described above.

[0058] Compared with the prior art, the present application has the following beneficial effects: the present application obtains the image brightness at the current moment, performs difference operation on the image brightness at the current moment and the pre-set image expected brightness to obtain a difference operation result, compares the difference operation result with the pre-set image expected brightness convergence threshold to obtain a comparison result, adjusts the aperture according to the comparison result to find the upper limit value and the lower limit value of the steady state value of the aperture within the image expected brightness convergence threshold range, finds the steady state value of the aperture within the upper limit value and the lower limit value of the steady state value, and outputs the found steady state value of the aperture as the steady state calibration value. The present application realizes fast calibration in a production line environment, reduces the calibration time, saves the labor cost, and improves the accuracy of data.

[0059] The above description is only a summary of the technical solutions of the present application, in order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS

[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0061] Figure 1 A camera equipment erecting calibration environment schematic diagram provided by the embodiment of the present application;

[0062] Figure 2 An application scenario schematic diagram of the aperture steady-state value rapid calibration method provided by the embodiment of the present application;

[0063] Figure 3 A flowchart of the aperture steady-state value rapid calibration method provided by the embodiment of the present application;

[0064] Figure 4 A schematic block diagram of the aperture steady-state value rapid calibration device provided by the embodiment of the present application;

[0065] Figure 5 A schematic block diagram of the computer device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be described clearly and completely in the embodiments of the present application in combination with the drawings. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the protection scope of the present application.

[0067] It should be understood that when used in the specification and the appended claims, the terms “comprise” and “include” indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0068] It should also be understood that the terms used in the present application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms “a”, “an” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0069] It should be further understood that the term "and / or" as used herein in the specification and in the claims, if any, means one or the other or both of the listed terms.

[0070] The embodiments of the present application disclose a method for quickly calibrating a steady value of an iris. Before the present application is described, terminology and terms used in the embodiments of the present application are explained, which are applicable to the following explanations.

[0071] DC-IRIS: a kind of DC voltage driven iris, which can automatically adjust the size of the iris according to the brightness of the image collected by the camera, so as to automatically control the light flux entering the lens, so that the camera image reaches the desired brightness.

[0072] Image brightness: used to represent the brightness of the camera picture.

[0073] Image desired brightness: used to represent the desired picture brightness that makes the vision comfortable, which can be artificially set by an image processing system.

[0074] PID control: a kind of adjustment control method, which is to control the controlled object by linear combination of the proportion (P) of the control deviation formed by the given value and the actual output value, the integral (I) and the differential (D).

[0075] PWM (Pulse-width modulation): full name is pulse width modulation, which is to use a high-resolution counter to disperse the analog electrical signal into a discrete form, that is, digital coding, which is usually in the form of square wave, and the duty cycle of the square wave is modulated to encode the level of a specific analog signal.

[0076] Hold value: in the low-cost DC-IRIS structure, only one driving coil and one damping coil are provided, and there is no device for feedback of the size or position of the diaphragm, a direct current voltage converted by the PWM device is supplied to the driving coil, the driving coil obtains a torque, when the torque is greater than the torque of the damping coil, the light curtain of the diaphragm moves in the opening direction, and the light quantity increases; when the torque of the driving coil is less than the torque of the damping coil, the light curtain of the diaphragm moves in the closing direction, and the light quantity decreases; when the torque of the driving coil is equal to the torque of the damping coil, the light curtain of the diaphragm is kept stable, and the light quantity is kept stable, and this state is called the steady state. In the whole control process, it is usually required that the torque of the driving coil is equal to the torque of the damping coil, and the PWM duty ratio corresponding to the direct current voltage value is called the steady state value. If the steady state value cannot be obtained, the diaphragm control of the DC-IRIS will lose the reference, and the DC-IRIS will cause overshoot in the adjustment process, and problems such as frequent flickering of the image picture, non-convergence of the diaphragm and the like.

[0077] The application is mainly applied to the calibration of the steady state value of a direct current driving diaphragm (DC-IRIS), and the application will be described below through specific embodiments.

[0078] Please refer to Figure 2 and Figure 2 , Figure 2 the application scenario diagram of the diaphragm steady state value rapid calibration method provided by the embodiments of the application; Figure 3 the flowchart of the diaphragm steady state value rapid calibration method provided by the embodiments of the application, the diaphragm steady state value rapid calibration method is applied to a server, and the method is executed by application software installed in the server.

[0079] As shown in Figure 3 , the diaphragm steady state value rapid calibration method comprises the following steps: S10-S60.

[0080] S10, acquiring the image brightness at the current moment.

[0081] Before step S10, the arrangement of shooting needs to be performed, and specifically, as shown in Figure 1 , the shooting device is erected in front of the panel light source, the panel light source needs to be a uniform white panel light source, and the planar light source needs to occupy more than 90% of the image picture.

[0082] When the shooting scene is arranged, the system parameters of the shooting device need to be set, and the shooting device refers to the shooting device which needs to be calibrated for the diaphragm (DC-IRIS) steady state value.

[0083] The system parameters to be set include aperture parameters and exposure parameters, wherein the aperture parameters include an aperture PWM linear control range and a trigger calibration flag; the exposure parameters include an image expected brightness Ytarget, an image expected brightness convergence threshold Yoffset, and a function of closing exposure automatic adjustment, a fixed exposure time at a certain value, a range suggestion of 20ms-30ms, a fixed gain setting of ISO100, and the aperture entering a controlled state. In this process, a very strict ambient illumination is not required, and a normal illumination of about 100lux can be used for calibration, which is one of the advantages of the present application.

[0084] When the system parameters are set, the calibration link can be entered, so that the image can be collected and the image brightness can be counted.

[0085] In an embodiment, step S10 specifically includes the following steps: S101-S106.

[0086] S101, collect the image at the current time.

[0087] S102, count the brightness value of each pixel in the collected image at the current time.

[0088] S103, divide the image at the current time into multiple blocks.

[0089] S104, assign a weight value to each block.

[0090] S105, calculate the average brightness of each block according to the brightness value of each pixel;

[0091] S106, obtain the image brightness according to the calculated average brightness of each block combined with the weight value of each block.

[0092] For S101-S106, in the present embodiment, when entering the calibration state, the aperture enters the controlled state, the control PWM drives the voltage of the aperture to the maximum, the image brightness at the current time is greater than the image expected brightness Ytarget, the image is collected in real time by the camera device, and the brightness value of each pixel of the image is counted. The image is evenly divided into M*N blocks, each block is assigned a weight value Wm,n, wherein m and n represent the mth row and nth column block, the average brightness Ym,n,mean of each block is counted, the counting method is to sum all the pixel values in the block and then average, assuming that there are k pixels in each block, each pixel brightness value is Pi, and the block average brightness formula is:

[0093]

[0094] In combination, the weight of each block is used to obtain the brightness of the whole image at the current time:

[0095]

[0096] S20. Perform a difference calculation between the current image brightness and the preset desired image brightness to obtain the difference calculation result.

[0097] In this embodiment, the image brightness Y at the current moment cur Perform a difference operation between the image's expected brightness Ytarget and the target brightness Ytarget: Yerr = Ycur – Ytarget, to obtain the difference result Yerr.

[0098] S30. Compare the difference calculation result with the preset image expected brightness convergence threshold to obtain the comparison result.

[0099] In this embodiment, the difference calculation result Yerr is compared with the image expected brightness convergence threshold Yoffset to obtain the comparison result.

[0100] S40. Adjust the aperture based on the comparison results to find the upper and lower limits of the steady-state value of the aperture within the desired brightness convergence threshold range of the image.

[0101] In one embodiment, step S40 specifically includes the following steps: S401-S405.

[0102] S401. If the absolute value of the difference calculation result is greater than the image expected brightness convergence threshold, then select position-type PID to adjust the PWM control aperture so that the image brightness at the current moment approaches the image expected brightness convergence threshold.

[0103] In this embodiment, when |Yerr|>Yoffset, the positional PID-adjusted PWM control aperture is selected to adjust the image brightness Y. cur It rapidly approaches the convergence threshold Yoffset of the desired image brightness.

[0104] Specifically, if |Yerr|>Yoffset, it means that the image brightness Y at the current moment is... cur The image brightness deviates significantly from the desired brightness Ytarget, requiring a rapid and substantial approximation to the target brightness convergence range Yoffset. A positional PID control method is used to control the PWM duty cycle, adjusting the voltage driving the aperture. If Yerr > 0, it indicates that the current image brightness Y... cur If the brightness is greater than the desired image brightness, the driving voltage should be reduced to cause the aperture to move rapidly towards the closing direction. If Yerr < 0, it indicates that the current image brightness Y... cur If the brightness is less than the target brightness, the driving voltage should be increased to cause the aperture to move rapidly towards opening; and steps S20 and S30 should be executed continuously to calculate the current image brightness Y. cur, the position PID control aperture moves so that Y cur quickly approaches the image desired brightness convergence range [Ytarget-Yoffset, Ytarget+Yoffset]; the PID algorithm in this process is multiplied by the difference Yerr times the position proportional coefficient, which greatly affects the adjustment of the PWM duty cycle, the adjustment range is large, which greatly reduces the Y cur to the image desired brightness convergence range, as follows:

[0105] Where Yerr,i is the brightness error at a certain time, which is integrated over a period of time to eliminate the system error to 0.

[0106] ΔYerr=Yerr,t-Yerr,t-1, second-order differential difference, to avoid system overshoot, DRt-1 is the last adjusted PWM duty cycle, the above formula ensures that the PID control is fast, accurate and stable.

[0107] S402, if the absolute value of the difference operation result is less than the image desired brightness convergence threshold, record the PWM duty cycle at this time.

[0108] S403, take the PWM duty cycle at this time as the reference, gradually increase or decrease the PWM duty cycle, so that the image brightness at the current time is equal to the image desired brightness convergence threshold.

[0109] S404, when the image brightness at the current time is equal to the difference operation result of the image desired brightness and the image desired brightness convergence threshold, record the PWM duty cycle at this time as the lower limit of the steady state value.

[0110] S405, when the image brightness at the current time is equal to the sum operation result of the image desired brightness and the image desired brightness convergence threshold, record the PWM duty cycle at this time as the upper limit of the steady state value.

[0111] For S402-S405, in this embodiment, when |Yerr|≤Yoffset, the aperture opening and closing will be gradually increased or decreased to find the upper and lower limits of the steady state value within the image desired brightness convergence threshold.

[0112] Specifically, if |Yerr|≤Yoffset, it means that the image brightness Y curThe image desired brightness Ytarget is slightly deviated from the image actual brightness Ycur, and Ycur enters the image desired brightness convergence threshold Yoffset for the first time. The PWM duty cycle DR corresponding to this time is recorded, the position formula PID control is stopped, the duty cycle is gradually increased or decreased based on the duty cycle DR, the aperture is moved to the opening or closing direction, the current time image brightness Ycur is detected, and the image desired brightness convergence threshold is reached. When Ycur=Ytarget-Yoffset, the PWM duty cycle DRmin at this time is recorded; when Ycur=Ytarget+Yoffset, the PWM duty cycle DRmax at this time is recorded; and DRmin and DRmax are the upper and lower limits of the steady state value.

[0113] S50, searching for the steady state value of the aperture within the upper limit value and the lower limit value of the steady state value.

[0114] In an embodiment, the step S50 specifically comprises the following steps: S501-S503.

[0115] S501, setting the number of image frames that need to be counted for each execution of the PWM duty cycle.

[0116] S502, determining the execution of the next PWM duty cycle according to the image brightness change direction reflected by the multiple frames of images counted at the current execution of the PWM duty cycle.

[0117] S503, when the executed PWM duty cycle appears no image brightness change in the counted multiple frames of images, the PWM duty cycle is taken as the steady state value of the aperture.

[0118] For S501-S503, in the embodiment, the PWM starting value is set as the middle value of the upper limit value and the lower limit value of the steady state value, that is, DRcur=DRmid=(DRmin+DRmax) / 2, the cycle of 5 frames of images is started, and steps S20 and S30 are executed in real time, whether there is a larger change in the brightness comparison of the 5 frames of images is counted, if there is a change, the image brightness change direction is judged to determine the next duty ratio, when the image brightness change direction is in the decreasing direction, it is indicated that the torque of the driving coil is less than the torque of the damping coil, the steady state value is greater than the current DRcur value, then the current DRcur value is the new lower limit value DRmin of the steady state value, the range is reduced again, and the next executed duty ratio is DRnext=(DRmin+DRmax) / 2; when the image brightness change direction is in the increasing direction, it is indicated that the torque of the driving coil is greater than the torque of the damping coil, the steady state value is less than the current DRcur value, then the current DRcur value is the new upper limit value DRmax of the steady state value, the range is reduced again, and the next executed duty ratio is DRnext=(DRmin+DRmax) / 2; then the image brightness change direction is judged in turn to determine the next executed duty ratio DRnext=(DRmin+DRmax) / 2, the range is reduced once for each execution of the duty ratio, and the duty ratio executed in the whole process is executed for 5 frames, the change of the brightness of the 5 frames of images is counted, if there is no change, the current duty ratio is the steady state value.

[0119] S60, output the steady state value of the aperture found as a steady state calibration value.

[0120] The steady state value is found and output.

[0121] The application obtains the image brightness at the current time, performs difference value operation on the image brightness at the current time and the pre-set image expected brightness to obtain a difference value operation result, compares the difference value operation result with the pre-set image expected brightness convergence threshold to obtain a comparison result, adjusts the aperture according to the comparison result to find the upper limit value and the lower limit value of the steady state value of the aperture within the image expected brightness convergence threshold range, finds the steady state value of the aperture within the upper limit value and the lower limit value of the steady state value, and outputs the steady state value of the aperture found as a steady state calibration value. The application realizes fast calibration in a production line environment, reduces calibration time, saves labor cost, and improves data accuracy.

[0122] Figure 4is a schematic block diagram of the aperture steady-state value fast calibration device 100 provided by the embodiment of the present application. Corresponding to the aperture steady-state value fast calibration method described above, the embodiment of the present application further provides an aperture steady-state value fast calibration device 100. The aperture steady-state value fast calibration device 100 includes units for executing the aperture steady-state value fast calibration method described above, and the device can be configured in a server.

[0123] As shown in Figure 4 , the aperture steady-state value fast calibration device 100 includes an acquisition unit 110, an operation unit 120, a comparison unit 130, an adjustment unit 140, a lookup unit 150, and an output unit 160.

[0124] The acquisition unit 110 is configured to acquire the image brightness at the current time.

[0125] Before acquiring the image brightness at the current time, the arrangement of shooting needs to be performed. Specifically, as shown in Figure 1 , the shooting device is erected opposite to the panel light source, and the panel light source needs to be a uniform white panel light source. The planar light source needs to occupy more than 90% of the image picture.

[0126] When the shooting scene is arranged, the system parameters of the shooting device need to be set. The shooting device refers to the shooting device that needs to be calibrated for the aperture (DC-IRIS) steady-state value.

[0127] The system parameters that need to be set include aperture parameters and exposure parameters. The aperture parameters include aperture PWM linear control range and trigger calibration flag. The exposure parameters include image expected brightness Ytarget, image expected brightness convergence threshold Yoffset, and the exposure automatic adjustment function is turned off. The exposure time is fixed at a certain value, and the range is recommended to be 20ms-30ms. The gain is fixed at ISO100, so that the aperture enters the controlled state. In this process, the ambient illuminance does not need to be very strict, and the normal illuminance of about 100 lux can be calibrated. This is one of the advantages of the present application.

[0128] When the system parameters are set, the calibration link can be entered, so that the image can be acquired and the image brightness can be counted.

[0129] In an embodiment, the acquisition unit 110 includes a driving module, a counting module, a division module, a marking module, a calculation module, and a combination module.

[0130] The driving module is configured to acquire the image at the current time.

[0131] The counting module is configured to count the brightness value of each pixel in the acquired image at the current time.

[0132] The dividing module is configured to divide the image at the current time into a plurality of blocks.

[0133] The marking module is configured to assign a weight value to each block.

[0134] The calculating module is configured to calculate the average brightness of each block according to the brightness value of each pixel.

[0135] The combining module is configured to combine the weight value of each block according to the calculated average brightness of each block to obtain the image brightness.

[0136] For the acquisition unit, in the embodiment, when entering the calibration state, the aperture enters the controlled state, the control PWM drives the voltage of the aperture to reach the maximum, the image brightness at the current time will be greater than the image expected brightness Ytarget, the image is collected in real time by the camera device, and the brightness value of each pixel of the image is counted. The image is evenly divided into M*N blocks, each block is assigned a weight value Wm,n, wherein m and n represent the mth row and nth column block, the average brightness Ym,n,mean of each block is counted, the counting method is to sum all the pixel values in the block and then average, assuming that there are k pixels in each block, each pixel has a brightness value Pi, and the block average brightness formula is:

[0137]

[0138] In combination, the weight of each block is used to obtain the brightness of the entire image at the current time:

[0139]

[0140] The operation unit 120 is configured to perform difference value operation on the image brightness at the current time and the image expected brightness to obtain a difference value operation result.

[0141] In the embodiment, the image brightness Ycur at the current time is subjected to difference value operation with the image expected brightness Ytarget to obtain a difference value operation result Yerr. cur

[0142] The comparison unit 130 is configured to compare the difference value operation result with a pre-set image expected brightness convergence threshold to obtain a comparison result.

[0143] In the embodiment, the difference value operation result Yerr is compared with the image expected brightness convergence threshold Yoffset to obtain a comparison result.

[0144] The adjusting unit 140 is configured to adjust the aperture according to the comparison result to find the upper limit value and the lower limit value of the stable state value of the aperture within the image expected brightness convergence threshold range. ​

[0145] In an embodiment, the adjusting unit 140 comprises a first adjusting module, a first recording module, a second adjusting module, a second recording module, and a third recording module.

[0146] The first adjusting module is configured to select the position PID to adjust the PWM to control the aperture if the absolute value of the difference value operation result is greater than the image expected luminance convergence threshold value, so that the image luminance at the current time approaches the image expected luminance convergence threshold value.

[0147] In the embodiment, when |Yerr|>Yoffset, the position PID is selected to adjust the PWM to control the aperture, so that the image luminance Y cur quickly approaches the image expected luminance convergence threshold value Yoffset.

[0148] Specifically, if |Yerr|>Yoffset, it indicates that the image luminance Y cur at the current time deviates from the image expected luminance Ytarget greatly, and needs to quickly and greatly approach the target luminance convergence range Yoffset. The position PID control method is used to control the PWM duty cycle, to drive the voltage of the aperture. If Yerr>0, it indicates that the image luminance Y cur at the current time is greater than the image expected luminance, and the driving voltage needs to be adjusted to decrease, so that the aperture quickly moves to the closing direction. If Yerr<0, it indicates that the image luminance Y cur at the current time is less than the target luminance, and the driving voltage needs to be adjusted to increase, so that the aperture quickly moves to the opening direction. Steps S20 and S30 are executed at all times to count the image luminance Y cur at the current time. The position PID control of the aperture movement makes Y cur quickly approach the image expected luminance convergence range [Ytarget-Yoffset, Ytarget+Yoffset]. In the process, the PID algorithm is multiplied by the position proportional coefficient, greatly affects the adjustment of the PWM duty cycle, the adjustment range is large, and the time of Y cur to the image expected luminance convergence range is greatly reduced. The formula is as follows:

[0149] Yerr,i is the luminance error at a certain time, which is integrated for a period of time, and can eliminate the system error to be 0.

[0150] ΔYerr=Yerr,t-Yerr,t-1, which is a second-order differential difference value, avoids system overshoot, and DRt-1 is the PWM duty cycle of the last adjustment. The above formula ensures that the PID control is fast, accurate, and stable.

[0151] The first recording module is used to record the PWM duty cycle at this time if the absolute value of the difference calculation result is less than the convergence threshold of the image's expected brightness.

[0152] The second adjustment module is used to gradually increase or decrease the PWM duty cycle based on the current PWM duty cycle, so that the image brightness detection image at the current moment converges to the desired brightness threshold.

[0153] The second recording module is used to record the PWM duty cycle as the lower limit of the steady-state value when the image brightness at the current moment is equal to the difference between the expected image brightness and the convergence threshold of the expected image brightness.

[0154] The third recording module is used to record the PWM duty cycle at the current moment as the upper limit of the steady-state value when the image brightness at the current moment is equal to the sum of the image expected brightness and the image expected brightness convergence threshold.

[0155] For the first recording module, the second adjustment module, the second recording module, and the third recording module, in this embodiment, when |Yerr|≤Yoffset, the aperture opening and closing will be gradually increased or decreased to find the upper and lower limits of the steady-state value within the image's desired brightness convergence threshold.

[0156] Specifically, if |Yerr|≤Yoffset, it means that the image brightness Y at the current moment is... cur When the deviation from the desired image brightness Ytarget is small, and Ycur enters the desired image brightness convergence threshold Yoffset for the first time, the corresponding PWM duty cycle DR is recorded. The position-type PID control is stopped, and the duty cycle is gradually increased or decreased based on the duty cycle DR to control the aperture to move in the opening or closing direction, so that the current image brightness Ycur detects the desired image brightness convergence threshold. When Ycur = Ytarget - Yoffset, the PWM duty cycle DRmin is recorded; when Ycur = Ytarget + Yoffset, the PWM duty cycle DRmax is recorded. DRmin and DRmax are the upper and lower limits of the steady-state value.

[0157] The lookup unit 150 is used to find the steady-state value of the aperture within the range of the upper and lower limits of the steady-state value.

[0158] In one embodiment, the search unit 150 includes a setting module, an execution module, and a determination module.

[0159] The setting module is used to set the number of image frames to be counted for each PWM duty cycle execution.

[0160] The execution module is configured to determine the execution of the next PWM duty cycle according to the direction of the image brightness change reflected by the multiple frames of images.

[0161] The determination module is configured to determine the PWM duty cycle as the steady state value of the aperture when the multiple frames of images do not have image brightness change.

[0162] For the searching unit 150, in the embodiment, the PWM starting value is set as the middle value of the upper limit value and the lower limit value of the steady state value, that is, DRcur=DRmid=(DRmin+DRmax) / 2, and the steps S20 and S30 are executed for 5 frames of images in a cycle, and the comparison of the brightness of the 5 frames of images is counted in real time. If there is a large change, the direction of the image brightness change is determined to determine the execution of the next duty cycle. When the direction of the image brightness change is in the decreasing direction, it is indicated that the torque of the driving coil is less than the torque of the damping coil, the steady state value is greater than the current DRcur value, the current DRcur value is the new lower limit value DRmin of the steady state value, the range is reduced again, and the next executed duty cycle is DRnext=(DRmin+DRmax) / 2. When the direction of the image brightness change is in the increasing direction, it is indicated that the torque of the driving coil is greater than the torque of the damping coil, the steady state value is less than the current DRcur value, the current DRcur value is the new upper limit value DRmax of the steady state value, the range is reduced again, and the next executed duty cycle is DRnext=(DRmin+DRmax) / 2. Then, the direction of the image brightness change is determined to determine the next executed duty cycle DRnext=(DRmin+DRmax) / 2. The range is reduced once for each execution of the duty cycle. The duty cycle is executed for 5 frames in the whole process, and the change of the brightness of the 5 frames of images is counted. If there is no change, the duty cycle is the steady state value.

[0163] The output unit 160 is configured to output the searched steady state value of the aperture as the steady state calibration value.

[0164] The steady state value can be outputted after being searched.

[0165] The above-mentioned aperture steady state value rapid calibration device can be realized in the form of a computer program, and the computer program can run on a computer device as shown in Figure 5 .

[0166] Please refer to Figure 5 , Figure 5 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a server, wherein the server can be a stand-alone server or a server cluster composed of multiple servers.

[0167] AsFigure 5 As shown in the figure, the computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above-mentioned fast calibration method of the aperture steady-state value when executing the computer program.

[0168] The computer device 700 can be a terminal or a server. The computer device 700 comprises a processor 720, a memory, and a network interface 750 connected through a system bus 710, wherein the memory can comprise a non-volatile storage medium 730 and an internal memory 740.

[0169] The non-volatile storage medium 730 can store an operating system 731 and a computer program 732. The computer program 732, when executed, can cause the processor 720 to execute any one of the fast calibration methods of the aperture steady-state value.

[0170] The processor 720 is configured to provide computing and control capabilities to support the operation of the entire computer device 700.

[0171] The internal memory 740 provides an environment for the execution of the computer program 732 in the non-volatile storage medium 730, and the computer program 732, when executed by the processor 720, can cause the processor 720 to execute any one of the fast calibration methods of the aperture steady-state value.

[0172] The network interface 750 is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that, Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 700 to which the scheme of the present application is applied. The specific computer device 700 can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. The processor 720 is configured to run the program code stored in the memory to implement the following steps:

[0173] The fast calibration method of the aperture steady-state value comprises:

[0174] Obtaining the image brightness at the current time;

[0175] Performing difference operation on the image brightness at the current time and the pre-set image expected brightness to obtain a difference operation result;

[0176] Comparing the difference operation result with the pre-set image expected brightness convergence threshold to obtain a comparison result;

[0177] Adjusting the aperture according to the comparison result to find the upper limit value and the lower limit value of the steady-state value of the aperture within the image expected brightness convergence threshold;

[0178] searching the steady state value of the aperture within the upper limit value and the lower limit value of the steady state value;

[0179] outputting the searched steady state value of the aperture as a steady state calibration value.

[0180] The further technical scheme is that the image brightness at the current time is acquired, and the method comprises the following steps:

[0181] acquiring the image at the current time;

[0182] counting the brightness value of each pixel in the acquired image at the current time;

[0183] dividing the image at the current time into a plurality of blocks;

[0184] assigning a weight value to each block;

[0185] calculating the average brightness of each block according to the brightness value of each pixel;

[0186] combining the weight value of each block with the calculated average brightness of each block to obtain the image brightness.

[0187] The further technical scheme is that the aperture is adjusted according to the comparison result to search the upper limit value and the lower limit value of the steady state value of the aperture within the image expected brightness convergence threshold value range, and the method comprises the following steps:

[0188] if the absolute value of the difference value operation result is greater than the image expected brightness convergence threshold value, the position type PID is selected to adjust the PWM to control the aperture, so that the image brightness at the current time approaches the image expected brightness convergence threshold value;

[0189] if the absolute value of the difference value operation result is less than the image expected brightness convergence threshold value, the PWM duty cycle at this time is recorded;

[0190] the PWM duty cycle is gradually increased or decreased based on the PWM duty cycle at this time, so that the image brightness at the current time approaches the image expected brightness convergence threshold value;

[0191] when the image brightness at the current time is equal to the difference operation result of the image expected brightness and the image expected brightness convergence threshold value, the PWM duty cycle at this time is recorded as the lower limit of the steady state value;

[0192] when the image brightness at the current time is equal to the sum operation result of the image expected brightness and the image expected brightness convergence threshold value, the PWM duty cycle at this time is recorded as the upper limit of the steady state value.

[0193] The further technical scheme is that the steady state value of the aperture is searched within the upper limit value and the lower limit value of the steady state value, and the method comprises the following steps:

[0194] Set the image frame number needed to be counted for each execution of the PWM duty cycle;

[0195] According to the image brightness change direction reflected by the multiple frames of images counted when the current PWM duty cycle is executed, the execution of the next PWM duty cycle is determined.

[0196] When the multiple frames of images counted show no image brightness change when the executed PWM duty cycle is executed, the PWM duty cycle is taken as the steady value of the aperture.

[0197] It should be understood that, in the embodiments of the present application, the processor 720 can be a central processing unit (CPU), and the processor 720 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0198] Those skilled in the art can understand that, Figure 5 The structure of the computer device 700 shown in the figures does not constitute a limitation on the computer device 700, and the computer device 700 can include more or fewer components than those shown, or combine certain components, or arrange different components.

[0199] In another embodiment of the present application, a computer readable storage medium is provided. The computer readable storage medium can be a non-volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the aperture steady value fast calibration method disclosed in the embodiments of the present application.

[0200] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the devices, apparatuses and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here. Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in the foregoing description in terms of its general functionality, without regard to its specific combination of hardware and software. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0201] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic, for example, the division of the units is merely logical functional division, and actual implementation can have another division, or units with the same function can be combined into one unit, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other form of connection.

[0202] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0203] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or software functional unit.

[0204] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the present application, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various media that can store program codes.

[0205] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A rapid calibration method for steady-state aperture values, characterized in that, include: Get the image brightness at the current moment; The difference between the current image brightness and the preset desired image brightness is calculated to obtain the difference result. The difference calculation result is compared with a pre-set image expected brightness convergence threshold to obtain the comparison result; The aperture is adjusted based on the comparison results to find the upper and lower limits of the steady-state value of the aperture within the convergence threshold range of the desired image brightness. Find the steady-state value of the aperture within the upper and lower limits of the steady-state value; The found steady-state value of the aperture is output as the steady-state calibration value; The step of obtaining the image brightness at the current moment includes: Capture the image at the current moment; The brightness value of each pixel in the image at the current moment is statistically analyzed. Divide the image at the current moment into multiple blocks; Assign a weight value to each block; The average brightness of each block is calculated based on the brightness value of each pixel; The image brightness is obtained by combining the average brightness of each block with the weight value of each block. The step of adjusting the aperture based on the comparison results to find the upper and lower limits of the steady-state value of the aperture within the convergence threshold range of the desired image brightness includes: If the absolute value of the difference calculation result is greater than the image expected brightness convergence threshold, then position-type PID adjustment of the PWM control aperture is selected so that the image brightness at the current moment approaches the image expected brightness convergence threshold. If the absolute value of the difference operation result is less than the convergence threshold of the image's expected brightness, then record the PWM duty cycle at this time. Based on the PWM duty cycle at this time, the PWM duty cycle is gradually increased or decreased so that the image brightness detection image at the current moment converges to the desired brightness threshold. When the image brightness at the current moment is equal to the difference between the expected image brightness and the convergence threshold of the expected image brightness, the PWM duty cycle at this moment is recorded as the lower limit of the steady-state value. When the image brightness at the current moment equals the sum of the desired image brightness and the desired image brightness convergence threshold, the PWM duty cycle at this moment is recorded as the upper limit of the steady-state value.

2. The method for rapid calibration of aperture steady-state value according to claim 1, characterized in that, Finding the steady-state value of the aperture within the upper and lower limits of the steady-state value includes: Set the number of image frames to be counted for each PWM duty cycle execution; The execution of the next PWM duty cycle is determined based on the direction of image brightness change reflected in multiple frames of images collected during the current PWM duty cycle execution. When the executed PWM duty cycle shows no change in image brightness across multiple frames, the PWM duty cycle is taken as the steady-state value of the aperture.

3. A device for rapid calibration of aperture steady-state value, characterized in that, It includes an acquisition unit, an arithmetic unit, a comparison unit, an adjustment unit, a search unit, and an output unit; The acquisition unit is used to acquire the image brightness at the current moment; The calculation unit is used to perform a difference calculation between the current image brightness and the preset desired image brightness to obtain the difference calculation result; The comparison unit is used to compare the difference calculation result with a preset image expected brightness convergence threshold to obtain a comparison result; The adjustment unit is used to adjust the aperture according to the comparison result in order to find the upper and lower limits of the steady-state value of the aperture within the convergence threshold range of the desired brightness of the image. The search unit is used to find the steady-state value of the aperture within the range of the upper and lower limits of the steady-state value; The output unit is used to output the found steady-state value of the aperture as a steady-state calibration value; The acquisition unit includes a driving module, a statistics module, a partitioning module, a labeling module, a calculation module, and a combination module; The driving module is used to acquire the image at the current moment; The statistics module is used to count the brightness value of each pixel in the image at the current moment. The segmentation module is used to divide the image at the current moment into multiple blocks; The marking module is used to assign a weight value to each block; The calculation module is used to calculate the average brightness of each block based on the brightness value of each pixel; The combining module is used to obtain the image brightness by combining the calculated average brightness of each block with the weight value of each block; The adjustment unit includes a first adjustment module, a first recording module, a second adjustment module, a second recording module, and a third recording module; The first adjustment module is used to select position-type PID adjustment of the PWM control aperture if the absolute value of the difference calculation result is greater than the image expected brightness convergence threshold, so that the image brightness at the current moment approaches the image expected brightness convergence threshold. The first recording module is used to record the PWM duty cycle at this time if the absolute value of the difference calculation result is less than the image expected brightness convergence threshold. The second adjustment module is used to gradually increase or decrease the PWM duty cycle based on the current PWM duty cycle, so that the image brightness detection image at the current moment converges to the desired brightness threshold. The second recording module is used to record the PWM duty cycle at the current moment as the lower limit of the steady-state value when the image brightness at the current moment is equal to the difference between the image expected brightness and the image expected brightness convergence threshold. The third recording module is used to record the PWM duty cycle at the current moment as the upper limit of the steady-state value when the image brightness at the current moment is equal to the sum of the image expected brightness and the image expected brightness convergence threshold.

4. The aperture steady-state value rapid calibration device according to claim 3, characterized in that, The search unit includes a setting module, an execution module, and a judgment module; The setting module is used to set the number of image frames to be counted each time the PWM duty cycle is executed; The execution module is used to determine the next PWM duty cycle execution based on the direction of image brightness change reflected by multiple frames of images collected during the current PWM duty cycle execution. The determination module is used to take the PWM duty cycle as the steady-state value of the aperture when there is no change in image brightness in multiple frames of the executed PWM duty cycle.

5. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rapid calibration method for steady-state aperture values ​​as described in any one of claims 1 to 2.

6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor performs the aperture steady-state value rapid calibration method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Automatic aperture correction method

    CN104202536A

  • Automatic diaphragm control method and system

    CN104243835A