Image acquisition method, device and electronic equipment
By outputting different target currents between the circuit driving devices of the image acquisition device and controlling the exposure time, the problem of brightness adjustment limitations caused by the fixed LED light source driving current in the prior art is solved, and a flexible image acquisition method is realized, and the production line efficiency is improved.
Patent Information
- Application Number
- CN202411950203.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, when the LED light source is lit based on the pulse width modulation PWM signal, the driving current is fixed, resulting in the total exposure time of high-brightness and low-brightness image acquisition greater than the PWM signal period, and the brightness cannot be effectively adjusted, limiting the flexibility of image acquisition.
By outputting a plurality of different target currents between the control circuit driving devices in each period, the light source device is lit according to the image brightness of the multiple target images to be collected, and the exposure time corresponding to the exposure target current of the image acquisition device is controlled in each period to acquire the target image.
The current strobe-changing driving method is realized, which can meet the needs of multiple usage scenarios, has high flexibility, and can accelerate production line speed, improve efficiency, and adapt to the application of complex systems.
Smart Images

Figure CN119767122A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of machine vision, and in particular, relates to an image acquisition method, device and electronic equipment. Background Art
[0002] In the field of industrial visual defect detection, for each target object on the assembly line, an image acquisition device is usually used to take multiple images with different DN values for each target object (usually one high DN value image and one low DN value image), so as to perform defect detection on each target object.
[0003] The light source device of the image acquisition device is usually an LED. In the related art, when the LED is lit based on a pulse width modulation (PWM) signal, the driving current for each lighting is the same. In this case, the DN value is positively correlated with the LED's brightness per unit time, which may cause the total exposure time required to capture multiple images with different DN values for a target object to be greater than the duration of the PWM signal cycle. In this case, brightness adjustment can only be achieved by increasing the duty cycle. However, in some cases, increasing the duty cycle may not achieve the desired brightness, which has high limitations. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes an image acquisition method, device and electronic device, which realizes a current-changing stroboscopic driving mode, meets the needs of various usage scenarios, and has high flexibility.
[0005] In a first aspect, the present application provides an image acquisition method, which is applied to an image acquisition device, wherein a light source device and a circuit driving device of the image acquisition device are connected; the method comprises:
[0006] Based on the image brightness of multiple target images to be collected, the circuit driving device is controlled to output multiple different target currents at intervals in each cycle to light up the light source device; each target current has a corresponding exposure time;
[0007] In each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the target current for an exposure time corresponding to the target current to acquire the target image; the image brightness of the target image corresponding to each target current is different; the total exposure time corresponding to different target currents is less than the duration of the cycle.
[0008] According to the image acquisition method of the present application, based on the image brightness of multiple target images to be acquired, a circuit driving device is controlled to output multiple different target currents at intervals in each cycle; each target current has a corresponding exposure time; in each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the exposure time corresponding to the target current to acquire the target image; the image brightness of the target images corresponding to each target current is different; the total exposure time corresponding to different target currents is less than the cycle time, thereby realizing a current-changing stroboscopic driving mode, and the light source device can be lit with a variety of different target currents to meet the needs of various usage scenarios, with high flexibility, and can accelerate the production line speed, improve efficiency, and adapt to the application of complex systems.
[0009] According to an embodiment of the present application, in the case where there are multiple circuit driving devices, the multiple circuit driving devices include a first circuit driving device and a second circuit driving device; the multiple target currents include a first current and a second current;
[0010] The control circuit drives the device to output multiple different target currents at intervals in each cycle, including:
[0011] Controlling the first circuit driving device or the second circuit driving device to output a first current at a first moment and to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; and the first circuit driving device is in a closed state when the second circuit driving device outputs the current;
[0012] or,
[0013] Controlling the first circuit driving device to output a first current at a first moment, and adjusting the second circuit driving device to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; the second circuit driving device is in a closed state when the first circuit driving device outputs the current;
[0014] or,
[0015] The sum of the currents output by the first circuit driver and the second circuit driver at the first moment is controlled to be the first current, and the sum of the currents output by the second circuit driver and the second circuit driver at the second moment is adjusted to be the second current.
[0016] According to an embodiment of the present application, the first circuit driving device and the second circuit driving device are connected in parallel; the sampling resistor of the first circuit driving device and the sampling resistor of the second circuit driving device have different resistances.
[0017] According to one embodiment of the present application, the plurality of target currents include a first current and a second current;
[0018] In the case where there is only one circuit driving device, the circuit driving device is controlled to output a plurality of different target currents at intervals in each cycle, including:
[0019] The circuit driving device is controlled to output a first current at a first time and a second current at a second time in each cycle.
[0020] According to one embodiment of the present application, the image acquisition device further comprises a control digital-to-analog conversion chip DAC; the DAC is used to output an analog voltage; the DAC is connected to the circuit driving device;
[0021] Before the circuit driving device is controlled in each cycle to output the first current at a first moment and to output the second current at a second moment, the method further comprises:
[0022] Obtaining a first input voltage required by the circuit driving device at a first moment according to the first current and a sampling resistor of the circuit driving device;
[0023] Obtaining a second input voltage required by the circuit driving device at a second moment according to the second current and the sampling resistance of the circuit driving device;
[0024] The DAC is controlled to output a first analog voltage and a second analog voltage to the circuit driving device at a first moment and a second moment respectively; the first analog voltage is the same as the first input voltage; and the second analog voltage is the same as the second input voltage.
[0025] According to an embodiment of the present application, when the DAC is a multi-channel DAC, the image acquisition device further includes an analog switch; the analog switch is located between the DAC and the circuit driving device; and controlling the DAC to output a first analog voltage and a second analog voltage to the circuit driving device at a first moment and a second moment, respectively, includes:
[0026] Controlling the analog switch to select a first analog voltage from a plurality of analog voltages output by the DAC at a first moment, so that an input voltage of the circuit driving device is the first analog voltage;
[0027] The analog switch is controlled to select a second analog voltage from the plurality of analog voltages output by the DAC at a second moment, so that the input voltage of the circuit driving device is the second analog voltage.
[0028] According to an embodiment of the present application, obtaining a first input voltage required by the circuit driving device at a first moment according to the first current and a sampling resistor of the circuit driving device includes:
[0029] Obtaining an output voltage of the circuit driving device at a first moment according to the first current and a sampling resistance of the circuit driving device;
[0030] A first input voltage required by the circuit driving device at the first moment is obtained according to the output voltage and the voltage drop of the circuit driving device at the first moment.
[0031] In a second aspect, the present application provides an image acquisition device, which is applied to an image acquisition device, wherein a light source device of the image acquisition device is connected to a circuit driving device; the device comprises:
[0032] A first control module is used to control the circuit driving device to output a plurality of different target currents at intervals in each cycle to light up the light source device based on the image brightness of a plurality of target images to be collected; each target current has a corresponding exposure time;
[0033] The second control module is used to control the exposure time corresponding to the target current of the image acquisition device in each cycle, when the light source device is lit based on the target current, so as to acquire the target image; the image brightness of the target image corresponding to each target current is different; the total exposure time corresponding to different target currents is less than the duration of the cycle.
[0034] According to the image acquisition device of the present application, based on the image brightness of multiple target images to be acquired, a circuit driving device is controlled to output multiple different target currents at intervals in each cycle; each target current has a corresponding exposure time; in each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the exposure time corresponding to the target current to acquire the target image; the target images corresponding to each target current have different image brightness; the total exposure time corresponding to different target currents is less than the cycle time, thereby realizing a current-changing stroboscopic driving mode, and the light source device can be lit with a variety of different target currents to meet the needs of various usage scenarios, with high flexibility, and can accelerate the production line speed, improve efficiency, and adapt to the application of complex systems.
[0035] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the image acquisition method provided in the first aspect described above is implemented.
[0036] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the image acquisition method provided in the first aspect described above is implemented.
[0037] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the image acquisition method provided in the first aspect.
[0038] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the image acquisition method provided in the first aspect above.
[0039] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0040] Based on the image brightness of multiple target images to be collected, a circuit driving device is controlled to output multiple different target currents at intervals in each cycle; each target current has a corresponding exposure time; in each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the exposure time corresponding to the target current to collect the target image; the image brightness of the target images corresponding to each target current is different; the total exposure time corresponding to different target currents is less than the cycle time, thereby realizing a current-changing stroboscopic driving mode, and the light source device can be lit with a variety of different target currents to meet the needs of various usage scenarios, with high flexibility, and can accelerate the production line speed, improve efficiency, and adapt to the application of complex systems.
[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0043] Figure 1 This is one of the flowcharts of the image acquisition method provided in the embodiment of the present application;
[0044] Figure 2 This is a current waveform diagram of pulse width modulation (PWM) dimming of the related technology provided by the embodiment of the present application;
[0045] Figure 3 This is a current waveform diagram of analog dimming of the related technology provided by the embodiment of the present application;
[0046] Figure 4 is a schematic diagram of a circuit for driving a light source device based on multiple circuit driving devices provided in an embodiment of the present application;
[0047] Figure 5 It is a circuit waveform diagram based on two different target current drives provided in an embodiment of the present application;
[0048] Figure 6 is a schematic diagram of a circuit for driving a light source device based on a circuit driving device provided in an embodiment of the present application;
[0049] Figure 7 is a structural schematic diagram of an image acquisition device provided in an embodiment of the present application;
[0050] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0052] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0053] LED driving methods mainly include constant current driving and constant voltage driving, each of which has its own unique characteristics and application scenarios.
[0054] Constant current drive controls the output current to maintain constant brightness when the LED is working. Regardless of changes in input voltage or LED resistance, constant current drive can ensure that the LED works normally and maintains stable brightness. Constant current drive is suitable for scenes that need to maintain stable brightness and color consistency.
[0055] Constant voltage drive controls the output voltage to maintain a constant voltage when the LED is working. Regardless of changes in input current or LED resistance, constant voltage drive can ensure that the LED works normally and maintains a stable voltage. Constant voltage drive is suitable for scenarios where multiple LEDs need to be connected on one line to achieve a unified lighting effect.
[0056] When the model of LED particles has been determined, the main ways to adjust the brightness are: ① Pulse Width Modulation (PWM) dimming: using the fast switching characteristics of LEDs, the brightness is adjusted by controlling the switching time and duty cycle. Specifically, by quickly switching the power supply at a fixed frequency (the ratio of on and off time), the ratio of the "on" and "off" time of the LED (i.e., the duty cycle) is changed to control the brightness of the light. PWM dimming has the advantages of a large dimming range, high precision, and no color temperature shift, but it is necessary to pay attention to the selection of pulse frequency to avoid flickering to the human eye or whistling to the human ear; ② Analog dimming: The brightness is adjusted by changing the size of the DC current flowing through the LED.
[0057] like Figure 2 As shown, the embodiment of the present application provides a current waveform diagram of pulse width modulation (PWM) dimming of the related technology, where the horizontal axis represents time, which is 0s, 1s, 2s, 3s, 4s..., and the vertical axis represents current, which is 0A, 0.5A, 1.0A, 1.5A and 2.0A. In this scenario, the driving current is 1A, and the duty cycles on the left and right sides are 50% and 30% respectively. The larger the duty cycle, the longer the LED light is on.
[0058] like Figure 3 As shown, an embodiment of the present application provides a current waveform diagram of analog dimming of the related technology, where the horizontal axis represents time, which is 1s, 2s, 3s, 4s..., and the vertical axis represents current, which is 0A, 0.5A, 1.0A, 1.5A and 2.0A, respectively. The driving current on the left is 1A, and the driving current on the right is 0.5A, and the current at each moment is constant.
[0059] Each time the LED is turned on, the driving current is consistent, that is, the brightness of the LED particles is consistent, and it is impossible to achieve a difference in brightness before and after, and it is impossible to produce a difference in dynamic range.
[0060] In the field of machine vision, the brightness DN value of an industrial camera image = the integrated area of the light source (exposure time * brightness per unit time). In the process of defect detection, two images with different brightness DN values need to be taken. When the production line speed is slow, the PWM cycle is long, for example, 10us per cycle. If within this cycle, Figure 2 One captures low brightness 1us*1A, and the other captures high brightness 5us*1A. The total time consumption is 1us+5us=6us. However, when the production line runs at high speed, the cycle is shortened. For example, within a 5us cycle, Figure 2 Zhang, if according to the original plan, the two lighting time is 6us in total, which has exceeded the cycle and cannot be met. When this cycle is compressed to the limit, the brightness can only be changed by adjusting the current.
[0061] In summary, the current technology is based on a fixed current strobe mode, which is limited in some scenarios. There is a need for a driving mode with adjustable LED driving time and current variable strobe.
[0062] The image acquisition method, image acquisition device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0063] Among them, the image acquisition method can be applied to an image acquisition device, which can refer to a device with an image acquisition function, such as a camera, a webcam, a mobile phone, a tablet computer, a computer, a camera and a wearable device.
[0064] like Figure 1 As shown, the image acquisition method includes: step 110 and step 120.
[0065] Step 110 , based on the image brightness of multiple target images to be collected, control the circuit driving device to output multiple different target currents at intervals in each cycle to light up the light source device; each target current has a corresponding exposure time.
[0066] The image acquisition device of the embodiment of the present application includes a light source device and a circuit driving device.
[0067] The light source device generally refers to various hardware devices and functions used to provide or adjust brightness. The light source device can make the captured image or video obtain a certain brightness and appropriate light conditions. In the defect detection scene, the light source device can be a light source used to form a bright field environment and a dark field environment.
[0068] The light source device may be an LED or the like, and in some scenarios, may also be other lights, such as a focusing auxiliary light, which is not limited. The number of light source devices may be one or more.
[0069] The circuit driving device refers to a circuit system or control circuit used to control and adjust the working state of the light source device.
[0070] The circuit driving device may be a MOS (Metal-Oxide-Semiconductor) constant current driving device or an IGBT (Insulated Gate Bipolar Transistor) constant current driving device.
[0071] Of course, the circuit driving device may also be other circuits capable of adjusting the brightness of the light source device, and this application does not limit this.
[0072] The number of the circuit driving devices may be one or more, and the number of the circuit driving devices is expandable.
[0073] In the embodiment of the present application, the target image to be captured may be an image containing a target object, and the target object may be any object. For example, in an industrial production line, the target object may refer to a product in the production line that needs to be inspected for defects.
[0074] The image brightness in the embodiment of the present application is the DN value when the image acquisition device acquires the image. When performing defect detection, the image brightness of multiple target images of the same target object is usually different.
[0075] It can be understood that since the image brightness of multiple target images is different, in order to avoid lengthening the PWM cycle, the current can be adjusted. For example, when it is necessary to capture an image with a high DN value, the control circuit driver outputs a larger current, and when it is necessary to capture an image with a low DN value, the control circuit driver outputs a smaller current. That is, based on the image brightness of multiple target images to be captured, the control circuit driver outputs multiple different target currents at intervals.
[0076] The PWM cycle refers to the total duration of a complete high level and low level in the signal.
[0077] An "interval" may refer to a control switch switching from an open state to a closed state, or from a closed state to an open state.
[0078] The number of circuit driving devices can be one or more. One circuit driving device can output multiple different target currents based on a certain duty cycle interval, or multiple circuit driving devices can output multiple different target currents based on their respective corresponding duty cycles. The detailed process is shown in the subsequent content.
[0079] In addition, since the exposure duration is also related to the image brightness, when the image brightness is determined, each target current and the exposure duration corresponding to each target current can be set based on the image brightness and the duration of a cycle.
[0080] Continuing with the foregoing embodiment, in order to make the total exposure time required for the two target images less than the cycle time (5us), one target current of 5A and exposure time of 1us, and another target current of 1A and exposure time of 1us can be selected, and the total exposure time of the two exposure times is 2us<5us; one target current of 2.5A and exposure time of 2us, and another target current of 1A and exposure time of 1us can be selected, and the total exposure time of the two exposure times is 3us<5us.
[0081] Step 120: In each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the target current for an exposure time corresponding to the target current to acquire the target image; the target images corresponding to each target current have different image brightness; and the total exposure time corresponding to different target currents is less than the cycle time.
[0082] In an embodiment of the present application, a plurality of target objects with different brightness are photographed for the target object in each cycle, and the light source device is illuminated based on different target currents. For any target current, when the light source device is illuminated based on the target current, the exposure time corresponding to the target current is exposed. When the exposure time corresponding to the target current is reached, the target image is captured so that the image brightness of the target image meets the requirements.
[0083] Specifically, assuming that the multiple target currents include a first current and a second current, the exposure time corresponding to the first current is a first time, and the exposure time corresponding to the second current is a second time. In each cycle, when the light source device is lit based on the first current, the image acquisition device is controlled to expose for the first time to capture the first target image; when the light source device is lit based on the second current, the image acquisition device is controlled to expose for the second time to capture the second target image; the total time of the first time and the second time is less than the time of the cycle.
[0084] The embodiment of the present application controls the circuit driving device to output multiple different target currents at intervals in each cycle based on the image brightness of multiple target images to be collected; each target current has a corresponding exposure time; in each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the exposure time corresponding to the target current to collect the target image; the image brightness of the target images corresponding to each target current is different; the total exposure time corresponding to different target currents is less than the cycle time, thereby realizing a current-changing stroboscopic driving mode, and the light source device can be lit with a variety of different target currents to meet the needs of various usage scenarios, with high flexibility, and can accelerate the production line speed, improve efficiency, and adapt to the application of complex systems.
[0085] In some embodiments, when there are multiple circuit driving devices, the multiple circuit driving devices include a first circuit driving device and a second circuit driving device; the multiple target currents include a first current and a second current;
[0086] The control circuit drives the device to output multiple different target currents at intervals in each cycle, including:
[0087] Controlling the first circuit driving device or the second circuit driving device to output a first current at a first moment and to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; and the first circuit driving device is in a closed state when the second circuit driving device outputs the current;
[0088] or,
[0089] Controlling the first circuit driving device to output a first current at a first moment, and adjusting the second circuit driving device to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; the second circuit driving device is in a closed state when the first circuit driving device outputs the current;
[0090] or,
[0091] The sum of the currents output by the first circuit driver and the second circuit driver at the first moment is controlled to be the first current, and the sum of the currents output by the second circuit driver and the second circuit driver at the second moment is adjusted to be the second current.
[0092] In the case where there are multiple circuit driving devices in the embodiment of the present application, these circuit driving devices may be connected in parallel, that is, each circuit driving device has the same input voltage, the multiple circuit driving devices include a first circuit driving device and a second circuit driving device, the multiple target currents are respectively a first current and a second current, the time when the first current is output is the first time, and the time when the second current is output is the second time, then the first current and the second current may be output in the following five ways:
[0093] Mode 1: Control the first circuit driving device to output the first current at a first moment and the second current at a second moment, and the second circuit driving device is in a closed state when the first circuit driving device outputs the current.
[0094] Mode 1: Control the second circuit driving device to output the first current at a first moment and to output the second current at a second moment; the first circuit driving device is in a closed state when the second circuit driving device outputs the current.
[0095] Method three: control the first circuit driver to output the first current at the first moment, and adjust the second circuit driver to output the second current at the second moment; the second circuit driver is in a closed state when the first circuit driver outputs the current; the second circuit driver is in a closed state when the first circuit driver outputs the current.
[0096] Mode 4: controlling the second circuit driving device to output the first current at the first moment, and adjusting the first circuit driving device to output the second current at the second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; the first circuit driving device is in a closed state when the second circuit driving device outputs the current;
[0097] Mode 5: Control the sum of the currents output by the first circuit driver and the second circuit driver at the first moment to be the first current, and adjust the sum of the currents output by the second circuit driver and the second circuit driver at the second moment to be the second current.
[0098] From the above, it can be found that the first and second methods are to select one circuit driving device from multiple circuit driving devices, and the selected circuit driving device outputs the first current at the first moment and the second current at the second moment, and the unselected circuit driving devices are in the off state.
[0099] Methods 3, 4 and 5 are used in conjunction with two circuit driving devices. In methods 3 and 4, one of the circuit driving devices outputs the first current at the first moment, and the other circuit driving device outputs the second current at the second moment, presenting an effect of "alternating" output current. Method 5 is that the two circuit driving devices output current at the same time. At the first moment, the sum of the currents output by the two circuit driving devices at the same time is the first current, and at the second moment, the sum of the currents output by the two circuit driving devices at the same time is the second current. Method 5 requires that the two circuit driving devices have the same duty cycle.
[0100] In addition, the number of multiple target currents is not two in some scenarios, but may be more, such as 3 or 4. In some high-demand scenarios, it may be more. Similarly, the number of drive devices is also expandable and can be set according to actual needs.
[0101] like Figure 4 As shown, an embodiment of the present application provides a circuit schematic diagram for driving a light source device based on multiple circuit driving devices, including multiple driving circuits 41, a driving circuit 42, a light source device 43, a ground wire 44 and a wire 45, the light source device 43 is an LED, and the circuit corresponding to each circuit driving device is a driving circuit. Each driving circuit has a corresponding duty cycle and sampling resistor. The lighting time of the driving circuit 41 and the driving circuit 42 is controlled by their respective PWM signals. The input voltages of the driving circuit 41 and the driving circuit 42 are Vref1 and Vref2 respectively. Since they are parallel circuits, the values of Vref1 and Vref2 are the same.
[0102] Assuming that the output current of the driving circuit 41 is 0.5A and the output current of the driving circuit 42 is 2A, based on Figure 4The two parallel drive circuits can realize four current size controls: 0A, 0.5A, 2A, and 2.5A, wherein 0A indicates that the drive circuit 41 and the drive circuit 42 are both turned off, 0.5A indicates that the drive circuit 41 is connected and the drive circuit 42 is turned off; 2A indicates that the drive circuit 42 is connected and the drive circuit 41 is turned off, and 2.5A indicates that the drive circuit 41 and the drive circuit 42 are both connected.
[0103] based on Figure 4 The circuit can adjust the lighting time. On this basis, the integral area of the light source (exposure time * brightness per unit time) can form a higher difference and achieve a high dynamic range.
[0104] like Figure 5 As shown, the embodiment of the present application provides a circuit waveform diagram based on two different target current drives, the vertical axis represents the current, which are 0A, 0.5A, 1.0A, 1.5A, 2.0A respectively, and the horizontal axis represents the time, which are 0us, 0.5us, 1.0us, 1.5us, 2.0us, 2.5us, 3.0us... respectively, the duty cycle is 40%, and it is driven at intervals of 2A and 0.5A in one cycle respectively. Specifically, after turning on the control switch to drive at 2A for 2us, the control switch is turned off. After the control switch is turned off for 3us, the control switch is turned on again to drive at 0.5A for 2us, and then the control switch is turned off and turned on to drive at 2A for 2us..., presenting the effect of driving based on different target current intervals.
[0105] Compared with the related art of using a fixed current to perform stroboscopic driving on an LED, the solution provided in the embodiment of the present application realizes the function of current variable stroboscopic driving.
[0106] In some embodiments, the first circuit driving device and the second circuit driving device are connected in parallel; the sampling resistor of the first circuit driving device and the sampling resistor of the second circuit driving device have different resistances.
[0107] In some embodiments, the plurality of target currents include a first current and a second current;
[0108] In the case where there is only one circuit driving device, the circuit driving device is controlled to output a plurality of different target currents at intervals in each cycle, including:
[0109] The circuit driving device is controlled to output a first current at a first time and a second current at a second time in each cycle.
[0110] In the embodiment of the present application, when there is only one circuit driving device, the circuit driving device outputs different target currents at different driving moments. For example, when the target current includes a first current and a second current, the circuit driving device can be controlled to output the first current at a first moment and to output the second current at a second moment.
[0111] In some embodiments, the image acquisition device further comprises a control digital-to-analog conversion chip DAC; the DAC is used to output analog voltage; the DAC is connected to the circuit driving device;
[0112] Before controlling the circuit driving device to output the first current at a first moment and output the second current at a second moment in each cycle, the method further includes:
[0113] Obtaining a first input voltage required by the circuit driving device at a first moment according to the first current and a sampling resistor of the circuit driving device;
[0114] Obtaining a second input voltage required by the circuit driving device at a second moment according to the second current and the sampling resistance of the circuit driving device;
[0115] The DAC is controlled to output a first analog voltage and a second analog voltage to the circuit driving device at a first moment and a second moment respectively; the first analog voltage is the same as the first input voltage; and the second analog voltage is the same as the second input voltage.
[0116] The image acquisition device of the embodiment of the present application also includes a control digital to analog converter chip (Digital to Analog Converter, DAC), where DAC is an electronic device that converts digital signals (usually binary numbers) into corresponding analog signals (such as voltage or current).
[0117] The required analog voltage can be output through the DAC.
[0118] Specifically, based on the first current and the sampling resistance of the circuit driving device, the output voltage of the circuit driving device at the first moment is obtained, and then based on the output voltage and the voltage drop of the circuit driving device at the first moment, the first input voltage required by the circuit driving device at the first moment is obtained. The DAC can be configured in advance to control the DAC to output a first analog voltage at the first moment, and the first analog voltage is the same as the first input voltage.
[0119] Similarly, the output voltage of the circuit driving device at the second moment can be obtained based on the second current and the sampling resistance of the circuit driving device, and then the second input voltage required by the circuit driving device at the second moment can be obtained based on the output voltage and voltage drop of the circuit driving device at the second moment. The DAC can be configured in advance to control the DAC to output a second analog voltage at the second moment, and the second analog voltage is the same as the second input voltage.
[0120] In some embodiments, when the DAC is a multi-channel DAC, the image acquisition device further includes an analog switch; the analog switch is located between the DAC and the circuit driving device; and controlling the DAC to output a first analog voltage and a second analog voltage to the circuit driving device at a first moment and a second moment, respectively, includes:
[0121] Controlling the analog switch to select a first analog voltage from a plurality of analog voltages output by the DAC at a first moment, so that an input voltage of the circuit driving device is the first analog voltage;
[0122] The analog switch is controlled to select a second analog voltage from the plurality of analog voltages output by the DAC at a second moment, so that the input voltage of the circuit driving device is the second analog voltage.
[0123] DAC can be divided into single-channel DAC and multi-channel DAC (such as 4-channel and 8-channel) according to the number of channels. Single-channel DAC can generate one analog voltage at each moment, and multi-channel DAC can generate multiple analog voltages at each moment. However, the circuit driving device requires an input voltage. Therefore, it is necessary to select one analog voltage from the multiple analog voltages as the input voltage of the circuit driving device.
[0124] Specifically, when the DAC is a multi-channel DAC, the image acquisition device also includes an analog switch; the analog switch is located between the DAC and the circuit driving device; the analog switch is used to select one analog voltage from the multiple analog voltages output by the DAC as the input voltage of the circuit driving device.
[0125] Specifically, the analog switch is controlled to select a first analog voltage from multiple analog voltages output by the DAC at a first moment, so that the input voltage of the circuit driving device is the first analog voltage, and the analog switch is controlled to select a second analog voltage from multiple analog voltages output by the DAC at a second moment, so that the input voltage of the circuit driving device is the second analog voltage.
[0126] In some embodiments, obtaining a first input voltage required by the circuit driving device at a first moment according to the first current and a sampling resistor of the circuit driving device includes:
[0127] Obtaining an output voltage of the circuit driving device at a first moment according to the first current and a sampling resistance of the circuit driving device;
[0128] A first input voltage required by the circuit driving device at the first moment is obtained according to the output voltage and the voltage drop of the circuit driving device at the first moment.
[0129] Voltage drop is the reduction in voltage due to energy loss when current passes through a resistor or impedance.
[0130] The circuit driving device in the embodiment of the present application has a sampling resistor, so there is a voltage drop between the input voltage and the output voltage of the circuit driving device. When determining the input voltage required by the circuit driving device to drive the light source device, the voltage drop of the circuit driving device needs to be considered to more accurately control the driving of the light source device.
[0131] Specifically, the output voltage of the circuit driving device at the first moment can be obtained according to the first current and the sampling resistance of the circuit driving device, and the sum of the output voltage of the circuit driving device at the first moment and the voltage drop is used as the first input voltage required by the circuit driving device at the first moment.
[0132] Similarly, the output voltage of the circuit driving device at the second moment can be obtained according to the second current and the sampling resistance of the circuit driving device, and the sum of the output voltage of the circuit driving device at the second moment and the voltage drop is used as the second input voltage required by the circuit driving device at the second moment.
[0133] like Figure 6 As shown, an embodiment of the present application provides a circuit schematic diagram for driving a light source device based on a circuit driving device, including a multi-channel DAC 61, an analog switch 62, a driving circuit 63, a light source device 64, a ground wire 65 and a wire 66, the light source device 43 is an LED, and the circuit corresponding to the circuit driving device is the driving circuit 63.
[0134] DAC61 can input 8 analog voltages, namely Vref1, Vref2, Vref3...Vref8.
[0135] The analog switch 62 is used to select an analog voltage Vref from the multiple analog voltages output by the DAC 61 as the input voltage of the driving circuit 63 to achieve current variation stroboscopic.
[0136] The driving circuit 63 has a corresponding duty cycle and a sampling resistor. The lighting time of the driving circuit 63 is controlled by a PWM signal. The driving circuit 63 can light up the light source device 64 after receiving the PWM signal.
[0137] The image acquisition method provided in the embodiment of the present application can be executed by an image acquisition device. In the embodiment of the present application, the image acquisition device provided in the embodiment of the present application is described by taking the image acquisition method executed by the image acquisition device as an example.
[0138] The embodiment of the present application also provides an image acquisition device.
[0139] like Figure 7 As shown, the image acquisition device includes: a first control module 710 and a second control module 720 .
[0140] The first control module 710 is used to control the circuit driving device to output a plurality of different target currents at intervals in each cycle to light up the light source device based on the image brightness of the plurality of target images to be collected; each target current has a corresponding exposure time;
[0141] The second control module 720 is used to control the exposure time corresponding to the target current of the image acquisition device in each cycle to acquire the target image when the light source device is lit based on the target current; the image brightness of the target image corresponding to each target current is different; and the total exposure time corresponding to different target currents is less than the duration of the cycle.
[0142] According to the image acquisition device provided by the embodiment of the present application, based on the image brightness of multiple target images to be acquired, a circuit driving device is controlled to output multiple different target currents at intervals in each cycle; each target current has a corresponding exposure time; in each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the exposure time corresponding to the target current to acquire the target image; the target images corresponding to each target current have different image brightness; the total exposure time corresponding to different target currents is less than the cycle time, thereby realizing a current-changing stroboscopic driving mode, and the light source device can be lit with a variety of different target currents to meet the needs of various usage scenarios, with high flexibility, and can accelerate the production line speed, improve efficiency, and adapt to the application of complex systems.
[0143] In some embodiments, when there are multiple circuit driving devices, the multiple circuit driving devices include a first circuit driving device and a second circuit driving device; the multiple target currents include a first current and a second current;
[0144] The first control module is used for:
[0145] Controlling the first circuit driving device or the second circuit driving device to output a first current at a first moment and to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; and the first circuit driving device is in a closed state when the second circuit driving device outputs the current;
[0146] or,
[0147] Controlling the first circuit driving device to output a first current at a first moment, and adjusting the second circuit driving device to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; the second circuit driving device is in a closed state when the first circuit driving device outputs the current;
[0148] or,
[0149] The sum of the currents output by the first circuit driver and the second circuit driver at the first moment is controlled to be the first current, and the sum of the currents output by the second circuit driver and the second circuit driver at the second moment is adjusted to be the second current.
[0150] In some embodiments, the first circuit driving device and the second circuit driving device are connected in parallel; the sampling resistor of the first circuit driving device and the sampling resistor of the second circuit driving device have different resistances.
[0151] In some embodiments, the plurality of target currents include a first current and a second current;
[0152] When there is only one circuit driving device, the first control module is further used for:
[0153] The control circuit driving device outputs a first current at a first moment and outputs a second current at a second moment.
[0154] In some embodiments, the image acquisition device further comprises a control digital-to-analog conversion chip DAC; the DAC is used to output analog voltage; the DAC is connected to the circuit driving device;
[0155] The image acquisition device also includes:
[0156] A first processing module, used for obtaining a first input voltage required by the circuit driving device at a first moment according to the first current and a sampling resistance of the circuit driving device;
[0157] A second processing module, used for obtaining a second input voltage required by the circuit driving device at a second moment according to the second current and the sampling resistance of the circuit driving device;
[0158] The third control module is used to control the DAC to output a first analog voltage and a second analog voltage to the circuit driving device at a first moment and a second moment respectively; the first analog voltage is the same as the first input voltage; the second analog voltage is the same as the second input voltage.
[0159] In some embodiments, when the DAC is a multi-channel DAC, the image acquisition device further includes an analog switch; the analog switch is located between the DAC and the circuit driving device; and the third control module is specifically used for:
[0160] Controlling the analog switch to select a first analog voltage from a plurality of analog voltages output by the DAC at a first moment, so that an input voltage of the circuit driving device is the first analog voltage;
[0161] The analog switch is controlled to select a second analog voltage from the plurality of analog voltages output by the DAC at a second moment, so that the input voltage of the circuit driving device is the second analog voltage.
[0162] In some embodiments, the third control module is further configured to:
[0163] Obtaining an output voltage of the circuit driving device at a first moment according to the first current and a sampling resistance of the circuit driving device;
[0164] A first input voltage required by the circuit driving device at the first moment is obtained according to the output voltage and the voltage drop of the circuit driving device at the first moment.
[0165] The image acquisition device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0166] The image acquisition device in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0167] The image acquisition device provided in the embodiment of the present application can achieve Figures 1 to 6 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0168] In some embodiments, Figure 8 As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the above-mentioned image acquisition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0169] The processor 801 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 801 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0170] The memory 802 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0171] The memory 802 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 801. The processor 801 is used to execute the computer program stored in the memory 802 to implement the steps shown in the above method embodiment.
[0172] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0173] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned image acquisition method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0174] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0175] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned image acquisition method when executed by a processor.
[0176] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0177] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image acquisition method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0178] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0179] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0181] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0182] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0183] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. An image acquisition method, characterized in that: Applied to an image acquisition device, the light source device of the image acquisition device is connected to a circuit driving device; the method comprises: Based on the image brightness of multiple target images to be collected, the circuit driving device is controlled to output multiple different target currents at intervals in each cycle to light up the light source device; each target current has a corresponding exposure time; In each cycle, when the light source device is lit based on the target current, the image acquisition device is controlled to expose the target current for an exposure time corresponding to the target current to acquire a target image; the target images corresponding to each target current have different image brightnesses; and the total exposure time corresponding to different target currents is less than the duration of the cycle.
2. The image acquisition method according to claim 1, characterized in that: In the case where there are multiple circuit driving devices, the multiple circuit driving devices include a first circuit driving device and a second circuit driving device; The plurality of target currents include a first current and a second current; The step of controlling the circuit driving device to output a plurality of different target currents at intervals in each cycle includes: Controlling the first circuit driving device or the second circuit driving device to output the first current at a first moment and to output the second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs the current; the first circuit driving device is in a closed state when the second circuit driving device outputs the current; or, Controlling the first circuit driving device to output a first current at a first moment, and adjusting the second circuit driving device to output a second current at a second moment; the second circuit driving device is in a closed state when the first circuit driving device outputs current; the second circuit driving device is in a closed state when the first circuit driving device outputs current; or, The sum of the currents output by the first circuit driving device and the second circuit driving device at a first moment is controlled to be the first current, and the sum of the currents output by the second circuit driving device and the second circuit driving device at a second moment is adjusted to be the second current.
3. The image acquisition method according to claim 2, characterized in that: The first circuit driving device and the second circuit driving device are connected in parallel; the sampling resistor of the first circuit driving device and the sampling resistor of the second circuit driving device have different resistances.
4. The image acquisition method according to claim 1, characterized in that: The plurality of target currents include a first current and a second current; In the case where there is one circuit driving device, controlling the circuit driving device to output a plurality of different target currents at intervals in each cycle includes: The circuit driving device is controlled to output the first current at a first time and the second current at a second time in each cycle.
5. The image acquisition method according to claim 4, characterized in that: The image acquisition device further comprises a control digital-to-analog conversion chip DAC; the DAC is used to output analog voltage; the DAC is connected to the circuit driving device; Before controlling the circuit driving device to output the first current at a first moment and to output the second current at a second moment in each cycle, the method further includes: Obtaining a first input voltage required by the circuit driving device at the first moment according to the first current and a sampling resistor of the circuit driving device; obtaining a second input voltage required by the circuit driving device at the second moment according to the second current and a sampling resistor of the circuit driving device; The DAC is controlled to output a first analog voltage and a second analog voltage to the circuit driving device at the first moment and the second moment respectively; the first analog voltage is the same as the first input voltage; and the second analog voltage is the same as the second input voltage.
6. The image acquisition method according to claim 5, characterized in that: In the case where the DAC is a multi-channel DAC, the image acquisition device further comprises an analog switch; the analog switch is located between the DAC and the circuit driving device; The controlling the DAC to output a first analog voltage and a second analog voltage to the circuit driving device at the first moment and the second moment respectively comprises: controlling the analog switch to select the first analog voltage from a plurality of analog voltages output by the DAC at the first moment, so that an input voltage of the circuit driving device is the first analog voltage; The analog switch is controlled to select the second analog voltage from the plurality of analog voltages output by the DAC at the second moment, so that the input voltage of the circuit driving device is the second analog voltage.
7. The image acquisition method according to claim 5, characterized in that: The step of obtaining a first input voltage required by the circuit driving device at the first moment according to the first current and a sampling resistor of the circuit driving device includes: obtaining an output voltage of the circuit driving device at the first moment according to the first current and a sampling resistor of the circuit driving device; A first input voltage required by the circuit driving device at the first moment is obtained according to the output voltage and the voltage drop of the circuit driving device at the first moment.
8. An image acquisition device, characterized in that: Applied to an image acquisition device, the light source device of the image acquisition device is connected to a circuit driving device; the device comprises: A first control module, for controlling the circuit driving device to output a plurality of different target currents at intervals in each cycle to light up the light source device based on the image brightness of a plurality of target images to be collected; each target current has a corresponding exposure time; The second control module is used to control the image acquisition device to expose the target current for an exposure time corresponding to the target current in each cycle so as to acquire the target image when the light source device is lit based on the target current; the image brightness of the target image corresponding to each target current is different; and the total exposure time corresponding to different target currents is less than the duration of the cycle.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the image acquisition method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image acquisition method according to any one of claims 1 to 7 is implemented.