Image acquisition method and device
By generating a frequency multiplication signal for controlling the exposure of the image sensor and lighting of the light source device, the time coincides, the problems of waste of resources and insufficient line frequency in the prior art are solved, and more efficient image acquisition is achieved.
Patent Information
- Application Number
- CN202411853171.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art cannot fully utilize the exposure time of the image sensor during image acquisition, resulting in waste of resources and is difficult to adapt to image acquisition needs of higher line frequency.
By generating a first frequency multiplied signal for controlling exposure of the image sensor and a second frequency multiplied signal for controlling lighting of the light source device, the time when the strobe light of the light source device coincides with the time when the pulse width of the image sensor is exposed, and the exposure time is fully utilized.
Reduces resource waste, increases the line frequency of image acquisition, and can adapt to the higher running speed of the object to be tested without reducing the image resolution.
Smart Images

Figure CN119788981A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of industrial vision technology, and in particular, relates to an image acquisition method and device. Background Art
[0002] In the field of industrial vision, when performing surface inspection on an object to be tested, multiple strobing of a light source and a linear array camera are often used to obtain an image of the surface of the object to be tested, thereby performing industrial inspection based on the image. In the related art, there is a method of sending a trigger signal to a light source device synchronously through a controller to make the light source strobe, and sending a trigger signal to a camera to make the camera synchronously expose. However, in this method, when the duration of each strobing of the light source device varies greatly, for the few times when the strobing of the light source device is short, the exposure time of the camera cannot be fully utilized when performing image acquisition, which easily causes a waste of resources, and it is impossible to meet the image acquisition requirements of a higher line frequency while keeping the strobing time of the light source device unchanged. Summary of the invention
[0003] 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 and device, which fully utilizes the exposure time of the image sensor, reduces resource waste, and can adapt to a higher running speed of the object to be measured while ensuring the resolution of the acquired image, and has a wide range of applicable scenarios.
[0004] In a first aspect, the present application provides an image acquisition method, the method comprising:
[0005] Generate the first frequency-multiplied signal based on the coded pulse signal, the number of frequency-multiplied periods corresponding to the target number of consecutive pulse periods in the coded pulse signal, and the duration of the high level of the first frequency-multiplied signal in each of the frequency-multiplied periods; generate the second frequency-multiplied signal based on the first frequency-multiplied signal;
[0006] Based on the first frequency-doubled signal, the image sensor is controlled to be exposed; based on the second frequency-doubled signal, the light source device is controlled to light up;
[0007] When the image sensor is in an exposure state and the light source device is in a lighting state, the image sensor is controlled to capture an image of the object to be measured.
[0008] According to the image acquisition method provided in the embodiment of the present application, by utilizing the pulse width exposure mode of the image sensor, a first frequency doubling signal for controlling the exposure of the image sensor and a second frequency doubling signal for controlling the lighting of the light source device are respectively generated, and the second frequency doubling signal is generated based on the first frequency doubling signal, so that the moment when the light source device is strobed and lit can coincide with the moment when the image sensor is pulse-width exposed, thereby making full use of the exposure time of the image sensor and reducing resource waste. Moreover, the image acquisition line frequency can be improved without modifying the strobing time of the light source device, that is, on the basis of ensuring the resolution of the acquired image, a higher running speed of the object to be measured can be adapted, and the applicable scenarios are relatively wide.
[0009] An image acquisition method according to an embodiment of the present application, generating the first frequency-doubling signal based on a coded pulse signal, the number of frequency-doubling periods corresponding to a target number of consecutive pulse periods in the coded pulse signal, and the duration of a high level of the first frequency-doubling signal in each of the frequency-doubling periods, includes:
[0010] Determine the low level duration of the first frequency multiplication signal in each frequency multiplication period based on the total duration of the target number of consecutive pulse periods, the number of the frequency multiplication periods, and the high level duration of the first frequency multiplication signal in each frequency multiplication period;
[0011] When the starting moment of the first pulse cycle in the continuous target number of pulse cycles is detected, the first frequency doubling signal in the current frequency doubling cycle is generated based on the high level duration of the first frequency doubling signal in the current frequency doubling cycle and the low level duration of the first frequency doubling signal in the current frequency doubling cycle.
[0012] In an image acquisition method according to an embodiment of the present application, generating a second frequency-doubled signal based on the first frequency-doubled signal includes:
[0013] Within the continuous target number of pulse cycles, when it is detected that the first frequency-multiplied signal changes from a high level to a low level, the second frequency-multiplied signal is controlled to become a high level and last for a first duration; the first duration is the duration of the low level of the first frequency-multiplied signal within the same frequency-multiplied cycle as that of the second frequency-multiplied signal.
[0014] In an image acquisition method according to an embodiment of the present application, controlling the exposure of an image sensor based on the first frequency-doubled signal includes:
[0015] During a target frequency doubling period, when it is detected that the first frequency doubling signal changes from a high level to a low level, the image sensor is controlled to be exposed for a second duration; the second duration is the duration during which the high level of the first frequency doubling signal during the target frequency doubling period.
[0016] In an image acquisition method according to an embodiment of the present application, controlling the lighting of the light source device based on the second frequency-doubled signal includes:
[0017] During the target frequency doubling period, when it is detected that the second frequency doubling signal changes from a low level to a high level, the light source device is controlled to light up and last for a third time period, wherein the third time period is the duration of the high level of the first frequency doubling signal during the target frequency doubling period.
[0018] In an image acquisition method according to an embodiment of the present application, before generating the first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each of the frequency multiplication periods, the method further includes:
[0019] receiving a first input from a user;
[0020] In response to the first input, the number of frequency multiplication cycles corresponding to the continuous target number of pulse cycles and the duration of the high level of the first frequency multiplication signal in each of the frequency multiplication cycles are determined.
[0021] In a second aspect, the present application provides an image acquisition device, the device comprising:
[0022] A first processing module is used to generate the first frequency-multiplied signal based on the coded pulse signal, the number of frequency-multiplied periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency-multiplied signal in each of the frequency-multiplied periods; and generate the second frequency-multiplied signal based on the first frequency-multiplied signal;
[0023] A second processing module, configured to control the exposure of the image sensor based on the first frequency-doubled signal; and to control the lighting of the light source device based on the second frequency-doubled signal;
[0024] The third processing module is used to control the image sensor to collect an image of the object to be measured when the image sensor is in an exposure state and the light source device is in a lighting state.
[0025] According to the image acquisition device provided in the embodiment of the present application, by utilizing the pulse width exposure method of the image sensor, a first frequency doubling signal for controlling the exposure of the image sensor and a second frequency doubling signal for controlling the lighting of the light source device are respectively generated, and the second frequency doubling signal is generated based on the first frequency doubling signal, so that the moment when the light source device is strobed and lit can coincide with the moment when the image sensor is pulse-width exposed, thereby making full use of the exposure time of the image sensor and reducing resource waste. Moreover, the image acquisition line frequency can be improved without modifying the strobing time of the light source device, that is, on the basis of ensuring the resolution of the acquired image, a higher running speed of the object to be measured can be adapted, and the applicable scenarios are relatively wide.
[0026] 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 the processor implements the image acquisition method as described in the first aspect above when executing the computer program.
[0027] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image acquisition method as described in the first aspect above.
[0028] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the image acquisition method as described in the first aspect above.
[0029] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0030] By utilizing the pulse width exposure method of the image sensor, a first frequency doubling signal for controlling the exposure of the image sensor and a second frequency doubling signal for controlling the lighting of the light source device are generated respectively, and the second frequency doubling signal is generated based on the first frequency doubling signal, so that the moment when the light source device is strobed and lit can coincide with the moment of the pulse width exposure of the image sensor, thereby making full use of the exposure time of the image sensor and reducing resource waste. Moreover, the image acquisition line frequency can be improved without modifying the stroboscopic time of the light source device, that is, on the basis of ensuring the resolution of the acquired image, a higher running speed of the object to be measured can be adapted, and the applicable scenarios are relatively wide.
[0031] 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
[0032] 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:
[0033] Figure 1 It is a flowchart of the image acquisition method provided in the embodiment of the present application;
[0034] Figure 2 This is one of the timing diagrams of the image acquisition method provided in the embodiment of the present application;
[0035] Figure 3 This is the second timing diagram of the image acquisition method provided in the embodiment of the present application;
[0036] Figure 4 is a structural schematic diagram of an image acquisition device provided in an embodiment of the present application;
[0037] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] 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.
[0039] 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.
[0040] 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.
[0041] The image acquisition method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.
[0042] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0043] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.
[0044] The image acquisition method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the image acquisition method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The image acquisition method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.
[0045] like Figure 1 As shown, the image acquisition method includes: step 110, step 120 and step 130.
[0046] It should be noted that the image acquisition method can be applied to an image acquisition system.
[0047] The image acquisition system may include: an image sensor, a light source device, a controller and an acquisition card.
[0048] The controller is connected with the image sensor, the light source device and the acquisition card respectively.
[0049] An image sensor may include a camera and a lens.
[0050] The acquisition card can be connected to the image sensor.
[0051] The acquisition card is used to receive the control signal sent by the controller to control the image sensor to acquire images.
[0052] Step 110: Generate a first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the target number of consecutive pulse periods in the coded pulse signal, and the duration of the high level of the first frequency multiplication signal in each frequency multiplication period; and generate a second frequency multiplication signal based on the first frequency multiplication signal;
[0053] In this step, the encoding pulse signal can be output through the A phase of the encoder.
[0054] The frequency and number of encoder pulse signals can be adjusted by adjusting the encoder's rotation speed and number of turns.
[0055] In some encoders, the output signal of phase A can be differential, that is, the two signal lines A+ and A- output positive and negative phase signals respectively.
[0056] The encoder can output a coded pulse signal of uniform motion of the production line. The coded pulse signal output by the encoder is input into the frequency multiplier. Based on the set frequency multiplier coefficient, the frequency multiplier can output a multiplied signal after frequency multiplication.
[0057] The number of frequency doubling periods corresponding to the continuous target number of pulse periods can be used to characterize how many times the camera signal is multiplied within the pulse period of the coded pulse signal, that is, the number of pulses of the first frequency doubling signal, and can be used to characterize how many times the light source signal is multiplied within the pulse period of the coded pulse signal, that is, the number of pulses of the second frequency doubling signal.
[0058] like Figure 2 As shown, the number of frequency doubling periods can be set to 5 within two pulse periods in the encoded pulse signal (the signal output by encoder phase A), that is, the number of pulses of the first frequency doubling signal (camera frequency doubling) is 5, and the number of pulses of the second frequency doubling signal (light source frequency doubling) is 5.
[0059] A pulse cycle is the time interval from the moment when the rising edge of the encoded pulse signal is generated to the moment when the next rising edge is generated.
[0060] One frequency doubling period is the time interval from the moment when the rising edge of the first frequency doubling signal is generated to the moment when the next rising edge is generated.
[0061] The duration of the high level of the first frequency-multiplied signal in each frequency-multiplied period (ie, the pulse width of the first frequency-multiplied signal) may be different and can be customized by the user.
[0062] The time interval between each pulse of the first frequency-multiplied signal may also be user-defined.
[0063] The high level duration of each pulse of the second frequency-doubled signal may be user-defined, or may be determined based on the first frequency-doubled signal, which is not limited in the present application.
[0064] For example, the start time and the end time of each pulse of the second frequency multiplied signal may be determined based on the start time and the end time of each pulse of the first frequency multiplied signal, thereby generating the second frequency multiplied signal.
[0065] Step 120: Based on the first frequency-doubled signal, control the image sensor to expose; based on the second frequency-doubled signal, control the light source device to light up;
[0066] In this step, when the first frequency-multiplied signal is generated, the exposure of the image sensor may be controlled based on the first frequency-multiplied signal.
[0067] The image sensor may be a linear array camera with Trigger Width (pulse width exposure mode), and the image sensor may be exposed according to the pulse duration of the controller input signal (ie, the width of each pulse of the first frequency-doubled signal).
[0068] After receiving the second frequency-doubled signal, the light source device can start to flash.
[0069] The light source device may include an LED light source, a halogen lamp (fiber optic light source) or a high-frequency fluorescent lamp, etc., which may be selected based on user needs and is not limited in this application.
[0070] Step 130: When the image sensor is in an exposure state and the light source device is in a lighting state, control the image sensor to capture an image of the object to be measured.
[0071] In this step, the image acquisition method can be applied to industrial inspection scenarios, and the objects to be inspected may include industrial equipment and products, etc. For example, the objects to be inspected may include mechanical equipment, automation equipment, and metal materials, etc.
[0072] The exposure of the image sensor is controlled based on the first frequency doubling signal, and the lighting of the light source device is controlled based on the second frequency doubling signal, so that the light source device can be lit during each exposure time of the image sensor, so that the image sensor can be controlled to capture an image of the object to be measured when the light source device is in the lit state.
[0073] During the research and development process, the inventor discovered that the exposure duration of each image sensor in the related technology needs to be greater than the maximum duration T of the stroboscopic light source device. If the light source strobes n times in each stroboscopic cycle, the image sensor exposure duration n*T needs to be set in the stroboscopic cycle. For several times when the light source stroboscopic duration is short, the exposure time of the image sensor cannot be fully utilized, which can easily cause a waste of resources; and the maximum triggering line frequency of the controller is determined by the maximum duration of the stroboscopic light source device. If one wants to further increase the triggering line frequency of the controller, it is necessary to reduce the stroboscopic duration of the light source device, which can easily lead to a reduction in the resolution of the image of the object to be measured.
[0074] In the present application, the pulse width exposure mode of the image sensor is utilized and the controller is designed as an asynchronous trigger device, that is, different controller ports are used to generate different control signals (a first frequency doubling signal and a second frequency doubling signal) to respectively trigger the exposure of the image sensor and the lighting of the light source device, and the second frequency doubling signal is generated based on the first frequency doubling signal. By adjusting the interval between the first frequency doubling signal and the second frequency doubling signal, it is ensured that the moment when the light source device is flashed and lit coincides with the moment when the image sensor is pulse width exposed, thereby reducing resource waste. As a result, the image acquisition line frequency can be improved without modifying the flash duration of the light source device, that is, the higher running speed of the object to be measured can be adapted without reducing the image resolution.
[0075] According to the image acquisition method provided in the embodiment of the present application, by utilizing the pulse width exposure mode of the image sensor, a first frequency doubling signal for controlling the exposure of the image sensor and a second frequency doubling signal for controlling the lighting of the light source device are respectively generated, and the second frequency doubling signal is generated based on the first frequency doubling signal, so that the moment when the light source device is strobed and lit can coincide with the moment when the image sensor is pulse-width exposed, thereby making full use of the exposure time of the image sensor and reducing resource waste. Moreover, the image acquisition line frequency can be improved without modifying the strobing time of the light source device, that is, on the basis of ensuring the resolution of the acquired image, a higher running speed of the object to be measured can be adapted, and the applicable scenarios are relatively wide.
[0076] In some embodiments, before step 110, the image acquisition method may further include:
[0077] receiving a first input from a user;
[0078] In response to the first input, the number of frequency doubling periods corresponding to the continuous target number of pulse periods and the duration of the high level of the first frequency doubling signal in each frequency doubling period are determined.
[0079] In this embodiment, the first input is used to determine the number of frequency doubling periods corresponding to the continuous target number of pulse periods, and the duration of the high level of the first frequency doubling signal in each frequency doubling period.
[0080] The first input may be in at least one of the following ways:
[0081] First, the first input may be a touch operation, including but not limited to a click operation, a slide operation, and a press operation.
[0082] In this implementation, receiving the first input from the user may be receiving a touch operation of the user in the display area of the terminal display screen.
[0083] In order to reduce the user error operation rate, the effective area of the first input can be limited to a specific area, such as the upper middle area of the first frequency doubling signal generation interface; or when the first frequency doubling signal generation interface is displayed, the target control is displayed on the current interface, and the first input can be achieved by touching the target control; or the first input can be set to a continuous multiple tapping operation on the display area within a target time interval.
[0084] Secondly, the first input may be a physical key input.
[0085] In this embodiment, the terminal body is provided with physical buttons corresponding to the number of frequency doubling cycles and the duration of the high level of the first frequency doubling signal in each frequency doubling cycle, and receiving the user's first input can be an operation of receiving the user pressing the corresponding physical button; the first input can also be a combined operation of pressing multiple physical buttons at the same time.
[0086] Third, the first input may be voice input.
[0087] In this embodiment, the terminal can trigger the display of the interface for generating the first frequency doubling signal when receiving a voice such as "Set the frequency doubling to 5 times, and the high level duration of the first frequency doubling signal in each frequency doubling period is 0.1ms, 0.2ms, 0.3ms, 0.4ms and 0.5ms respectively".
[0088] Of course, in other embodiments, the first input may also be in other forms, including but not limited to character input, etc., which can be determined according to actual needs and is not limited in this embodiment of the present application.
[0089] In some embodiments, generating the first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the target number of consecutive pulse periods in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each frequency multiplication period may include:
[0090] Determine the low level duration of the first frequency multiplication signal in each frequency multiplication period based on the total duration of the target number of consecutive pulse periods, the number of frequency multiplication periods, and the high level duration of the first frequency multiplication signal in each frequency multiplication period;
[0091] When the starting time of the first pulse cycle in the continuous target number of pulse cycles is detected, the first frequency doubling signal in the current frequency doubling cycle is generated based on the high level duration of the first frequency doubling signal in the current frequency doubling cycle and the low level duration of the first frequency doubling signal in the current frequency doubling cycle.
[0092] In this embodiment, based on the difference between the total duration of a target number of consecutive pulse cycles and the total duration of the high level of the first frequency-doubling signal in multiple frequency-doubling cycles, the total duration of the low level of the first frequency-doubling signal in multiple frequency-doubling cycles can be obtained, and then the duration of the low level of the first frequency-doubling signal in each frequency-doubling cycle can be calculated based on the number of frequency-doubling cycles.
[0093] The starting time of the first pulse period detected, that is, the starting time of the first rising edge of the coded pulse signal, can be determined as the starting time of the first frequency-multiplied signal.
[0094] In the current frequency doubling cycle, based on the set high level duration t1, the first frequency doubling signal can be maintained at a high level for t1 time and then become a low level, and based on the calculated low level duration t2, the first frequency doubling signal can be maintained at a low level for t2 time and then become a high level again.
[0095] In the next frequency doubling cycle of the current frequency doubling cycle, based on the set high level duration t3, the first frequency doubling signal can be maintained at a high level for t3 duration and then become a low level, and based on t2, the first frequency doubling signal can be maintained at a low level for t2 duration and then become a high level again.
[0096] In some embodiments, controlling the exposure of the image sensor based on the first frequency-doubled signal may include:
[0097] In the target frequency doubling period, when it is detected that the first frequency doubling signal changes from a high level to a low level, the image sensor is controlled to be exposed for a second time period.
[0098] In this embodiment, the target frequency multiplication period is any period among a plurality of frequency multiplication periods.
[0099] In each frequency doubling period, when it is detected that the first frequency doubling signal changes from a high level to a low level, the image sensor can be controlled to be exposed, that is, the image sensor is controlled to be exposed at the moment when the falling edge of the first frequency doubling signal is generated, and the image sensor is controlled to be exposed continuously for the second time length.
[0100] The second duration is the duration of the high level of the first frequency-doubling signal within the target frequency-doubling period.
[0101] like Figure 3 As shown, after the image sensor selects the pulse width exposure mode, after the first frequency doubling signal is input, the image sensor can read the high level duration X1 of the first frequency doubling signal in the first frequency doubling cycle. When the first frequency doubling signal changes from a high level to a low level, the image sensor starts to expose, and the duration of the exposure is consistent with the high level duration X1 of the read first frequency doubling signal.
[0102] According to the above-mentioned exposure timing, when the first frequency multiplication signal becomes a high level for the second time, the image sensor starts to read the next exposure time X2, and when the first frequency multiplication signal changes from a high level to a low level again, the image sensor starts the second exposure, and the exposure time is consistent with the second high level duration X2 of the first frequency multiplication signal, and so on, repeatedly reading the high level duration and exposure of the first frequency multiplication signal.
[0103] During the previous exposure process of the image sensor, the image sensor may also receive a high level signal of the first frequency-doubled signal.
[0104] In some embodiments, generating a second frequency-multiplied signal based on the first frequency-multiplied signal may include:
[0105] Within the target number of consecutive pulse cycles, when it is detected that the first frequency-doubled signal changes from a high level to a low level, the second frequency-doubled signal is controlled to change to a high level and last for a first time period.
[0106] In this embodiment, during the entire pulse period, when it is detected that the first frequency multiplied signal changes from a high level to a low level, the second frequency multiplied signal can be controlled to become a high level, that is, at the moment when the falling edge of the first frequency multiplied signal is generated, the second frequency multiplied signal is controlled to become a high level, and the high level of the second frequency multiplied signal is controlled to last for a first duration.
[0107] The first duration is the duration of the low level of the first frequency-multiplied signal within the same frequency-multiplied period as that of the second frequency-multiplied signal.
[0108] In some embodiments, controlling the light source device to light up based on the second frequency-doubled signal may include:
[0109] In the target frequency doubling period, when it is detected that the second frequency doubling signal changes from a low level to a high level, the light source device is controlled to light up and last for a third time period.
[0110] In this embodiment, within each frequency doubling cycle, when it is detected that the second frequency doubling signal changes from a low level to a high level, the light source device can be controlled to light up, that is, at the moment when the rising edge of the second frequency doubling signal is generated, the light source device is controlled to light up, and the light source device is controlled to continue to light up for a third period of time.
[0111] The third duration is the duration of the high level of the first frequency-doubling signal within the target frequency-doubling period.
[0112] In the actual implementation process, Figure 2 As shown, when the first rising edge of the encoded pulse signal is detected at time t0, the first frequency-multiplied signal can be generated.
[0113] Among them, based on the user's first input, it can be determined that the number of pulses of the first frequency doubling signal within two pulse periods is 5, and the high level duration in each frequency doubling period is 2t, 3t, 4t, 5t and 7t respectively. At the same time, it can be determined that the low level duration in each frequency doubling period is t.
[0114] Taking the first frequency doubling cycle as an example, at time t0, the image sensor can start to read the high level duration (2t) of the first frequency doubling signal. After the high level of the first frequency doubling signal lasts for 2t, at time t1, the second frequency doubling signal can be controlled to become a high level.
[0115] At time t1, when the falling edge of the first frequency doubling signal is detected, the image sensor can start exposing and continue exposing for 2t until time t3, then stop exposing and start reading the next high level duration (3t) of the first frequency doubling signal.
[0116] At time t1, when the rising edge of the second frequency-doubled signal is detected, the light source device may start lighting up, and continue lighting up for 2t until time t3, and then stop lighting up.
[0117] At time t2, the first frequency-doubled signal changes to a high level again, and the second frequency-doubled signal changes from a high level to a low level.
[0118] The inventor discovered during the research and development process that Figure 2 As shown, the longest lighting time of the light source device in the present application is 7t. To complete 5 consecutive stroboscopic shots, the total exposure time of the image sensor required is 32t. In the related art, when a fixed time is used for exposure, the total exposure time of the image sensor required is 5*7t (35t). The method of the present application can save a certain amount of time, and can enable the light source device to be lit within the limited time of each exposure of the image sensor, thereby improving the exposure efficiency of the image sensor.
[0119] The image acquisition device provided in the present application is described below. The image acquisition device described below and the image acquisition method described above can be referenced to each other.
[0120] 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.
[0121] The embodiment of the present application also provides an image acquisition device.
[0122] like Figure 4 As shown, the image acquisition device includes: a first processing module 410, a second processing module 420 and a third processing module 430.
[0123] The first processing module 410 is used to generate a first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each frequency multiplication period; and generate a second frequency multiplication signal based on the first frequency multiplication signal;
[0124] The second processing module 420 is used to control the exposure of the image sensor based on the first frequency-doubled signal and to control the lighting of the light source device based on the second frequency-doubled signal;
[0125] The third processing module 430 is used to control the image sensor to capture an image of the object to be measured when the image sensor is in an exposure state and the light source device is in a lighting state.
[0126] According to the image acquisition device provided in the embodiment of the present application, by utilizing the pulse width exposure method of the image sensor, a first frequency doubling signal for controlling the exposure of the image sensor and a second frequency doubling signal for controlling the lighting of the light source device are respectively generated, and the second frequency doubling signal is generated based on the first frequency doubling signal, so that the moment when the light source device is strobed and lit can coincide with the moment when the image sensor is pulse-width exposed, thereby making full use of the exposure time of the image sensor and reducing resource waste. Moreover, the image acquisition line frequency can be improved without modifying the strobing time of the light source device, that is, on the basis of ensuring the resolution of the acquired image, a higher running speed of the object to be measured can be adapted, and the applicable scenarios are relatively wide.
[0127] In some embodiments, the first processing module 410 may also be used to:
[0128] Determine the low level duration of the first frequency multiplication signal in each frequency multiplication period based on the total duration of the target number of consecutive pulse periods, the number of frequency multiplication periods, and the high level duration of the first frequency multiplication signal in each frequency multiplication period;
[0129] When the starting time of the first pulse cycle in the continuous target number of pulse cycles is detected, the first frequency doubling signal in the current frequency doubling cycle is generated based on the high level duration of the first frequency doubling signal in the current frequency doubling cycle and the low level duration of the first frequency doubling signal in the current frequency doubling cycle.
[0130] In some embodiments, the first processing module 410 may also be used to:
[0131] Within a continuous target number of pulse cycles, when it is detected that the first frequency-doubled signal changes from a high level to a low level, the second frequency-doubled signal is controlled to become a high level and last for a first duration; the first duration is the duration of the low level of the first frequency-doubled signal within the same frequency-doubled cycle as that of the second frequency-doubled signal.
[0132] In some embodiments, the second processing module 420 may also be used to:
[0133] In the target frequency doubling period, when it is detected that the first frequency doubling signal changes from a high level to a low level, the image sensor is controlled to be exposed for a second time period; the second time period is the time period during which the high level of the first frequency doubling signal lasts in the target frequency doubling period.
[0134] In some embodiments, the second processing module 420 may also be used to:
[0135] In the target frequency doubling period, when it is detected that the second frequency doubling signal changes from a low level to a high level, the light source device is controlled to light up and last for a third time period, which is the high level duration of the first frequency doubling signal in the target frequency doubling period.
[0136] In some embodiments, the image acquisition device may further include a fourth processing module, which is used to receive a first input from a user before generating the first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication cycles corresponding to the continuous target number of pulse cycles in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each frequency multiplication cycle;
[0137] In response to the first input, the number of frequency doubling periods corresponding to the continuous target number of pulse periods and the duration of the high level of the first frequency doubling signal in each frequency doubling period are determined.
[0138] 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.
[0139] The image acquisition device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0140] The image acquisition device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0141] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, 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.
[0142] 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.
[0143] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute 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.
[0144] On the other hand, 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, it is implemented to perform 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.
[0145] On the other hand, 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.
[0146] 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.
[0147] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An image acquisition method, characterized in that: include: Generate the first frequency-multiplied signal based on the coded pulse signal, the number of frequency-multiplied periods corresponding to the target number of consecutive pulse periods in the coded pulse signal, and the duration of the high level of the first frequency-multiplied signal in each of the frequency-multiplied periods; generate the second frequency-multiplied signal based on the first frequency-multiplied signal; Based on the first frequency-doubled signal, controlling the exposure of the image sensor; Based on the second frequency-doubled signal, controlling the light source device to light up; When the image sensor is in an exposure state and the light source device is in a lighting state, the image sensor is controlled to capture an image of the object to be measured.
2. The image acquisition method according to claim 1, characterized in that: The method of generating the first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each of the frequency multiplication periods comprises: Determine the low level duration of the first frequency multiplication signal in each frequency multiplication period based on the total duration of the target number of consecutive pulse periods, the number of the frequency multiplication periods, and the high level duration of the first frequency multiplication signal in each frequency multiplication period; When the starting moment of the first pulse cycle in the continuous target number of pulse cycles is detected, the first frequency doubling signal in the current frequency doubling cycle is generated based on the high level duration of the first frequency doubling signal in the current frequency doubling cycle and the low level duration of the first frequency doubling signal in the current frequency doubling cycle.
3. The image acquisition method according to claim 1, characterized in that: The step of generating a second frequency-doubled signal based on the first frequency-doubled signal comprises: Within the continuous target number of pulse cycles, when it is detected that the first frequency-multiplied signal changes from a high level to a low level, the second frequency-multiplied signal is controlled to become a high level and last for a first duration; the first duration is the duration of the low level of the first frequency-multiplied signal within the same frequency-multiplied cycle as that of the second frequency-multiplied signal.
4. The image acquisition method according to any one of claims 1 to 3, characterized in that: The step of controlling the exposure of the image sensor based on the first frequency doubling signal includes: During a target frequency doubling period, when it is detected that the first frequency doubling signal changes from a high level to a low level, the image sensor is controlled to be exposed for a second duration; the second duration is the duration during which the high level of the first frequency doubling signal during the target frequency doubling period.
5. The image acquisition method according to any one of claims 1 to 3, characterized in that: The controlling the light source device to light up based on the second frequency-doubled signal comprises: During the target frequency doubling period, when it is detected that the second frequency doubling signal changes from a low level to a high level, the light source device is controlled to light up and last for a third time period, wherein the third time period is the duration of the high level of the first frequency doubling signal during the target frequency doubling period.
6. The image acquisition method according to any one of claims 1 to 3, characterized in that: Before generating the first frequency multiplication signal based on the coded pulse signal, the number of frequency multiplication periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency multiplication signal in each of the frequency multiplication periods, the method further includes: receiving a first input from a user; In response to the first input, the number of frequency multiplication cycles corresponding to the continuous target number of pulse cycles and the duration of the high level of the first frequency multiplication signal in each of the frequency multiplication cycles are determined.
7. An image acquisition device, characterized in that: include: A first processing module is used to generate the first frequency-multiplied signal based on the coded pulse signal, the number of frequency-multiplied periods corresponding to the continuous target number of pulse periods in the coded pulse signal, and the high level duration of the first frequency-multiplied signal in each of the frequency-multiplied periods; and generate the second frequency-multiplied signal based on the first frequency-multiplied signal; A second processing module, used for controlling the exposure of the image sensor based on the first frequency-doubled signal; Based on the second frequency-doubled signal, controlling the light source device to light up; The third processing module is used to control the image sensor to collect an image of the object to be measured when the image sensor is in an exposure state and the light source device is in a lighting state.
8. 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 6 is implemented.
9. 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 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image acquisition method according to any one of claims 1 to 6 is implemented.