Scanner control method, scanner, storage medium and computer equipment
By obtaining the light source status signal in the 3D scanner to determine the brightness peak and performing it synchronously when the camera takes a photo, the problem of low data accuracy caused by the optical machine triggering and exposure is solved, and the accuracy and clarity of the sampled photos are improved.
Patent Information
- Application Number
- CN202111514173.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-12-10
AI Technical Summary
When the 3D scanner scans an object, the optical machine triggers are out of synchronization with the exposure, causing the photo to be blurred and reducing the accuracy of the data of the object to be measured.
By obtaining the status signal of the scanner light source, we judge whether the brightness of the light source reaches the peak, and control the camera to take pictures when the brightness reaches the peak.
Ensure that the clarity and brightness of the light source maps the object to the highest level, improve the accuracy and clarity of the sampled photos, and solve the problem of low data accuracy caused by the out-synchronization of the trigger and exposure.
Smart Images

Figure CN116260913B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of scanners, and in particular to a scanner control method, a scanner, a storage medium and a computer device. Background Art
[0002] A 3D scanner system generally consists of a camera and a light source. The light source projects a one-dimensional or two-dimensional image onto the object being measured. The camera scans the object at equal intervals and determines the surface shape of the object based on the deformation of the image projected on the object.
[0003] In the above context, when a 3D scanner scans an object, the asynchrony between the time machine triggering and the exposure will cause huge errors in the measurement, easily resulting in blurred photos and leading to the technical problem that the final scan data obtained from the measured object has low accuracy. Summary of the Invention
[0004] The object of the present invention is to provide a scanner control method, device, computer-readable storage medium and computer equipment to solve the technical problem of low accuracy of various data of the measured object due to the existence of asynchronous triggering and exposure.
[0005] In order to achieve the above object, the present invention provides a scanner control method, the scanner control method comprising:
[0006] Obtaining a status signal of a light source of a scanner;
[0007] determining whether the brightness of the light source reaches a peak value according to the status signal;
[0008] When the brightness of the light source reaches a peak value, the camera is controlled to take a photo.
[0009] Optionally, before the step of obtaining the status signal of the light source of the scanner, the step further includes:
[0010] Get the first system standard time and the cycle start time of the previous cycle;
[0011] If the time difference between the first system standard time and the cycle start time of the previous cycle is greater than or equal to a first preset time difference, the first system standard time is updated to the cycle start time of the previous cycle, and the light source of the scanner is controlled to turn on.
[0012] Optionally, the step of obtaining a status signal of a light source of the scanner includes:
[0013] A second system standard time is acquired, and a time difference between the second system standard time and the cycle start time of the previous cycle is used as a status signal.
[0014] Optionally, the step of determining whether the brightness of the light source reaches a peak value according to the status signal includes:
[0015] When the state signal is greater than or equal to a second preset time difference, determining that the brightness of the light source reaches a peak value;
[0016] When the state signal is less than the second preset time difference, it is determined that the brightness of the light source has not reached a peak value.
[0017] Optionally, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo further includes:
[0018] A third system standard time is obtained, and if a time difference between the third system standard time and the second system standard time is greater than or equal to a third preset time difference, the light source is controlled to be turned off.
[0019] Optionally, the step of obtaining the third system standard time, and if the time difference between the third system standard time and the second system standard time is greater than or equal to a third preset time difference, after the step of controlling the light source to turn off, further comprises:
[0020] Obtain scanning working signal;
[0021] If the scanning working signal is a continue working signal, returning to execute obtaining the first system standard time and the cycle start time of the previous cycle;
[0022] If the scanning operation signal is a stop operation signal, the scanning is ended.
[0023] Optionally, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo includes:
[0024] When the brightness of the light source reaches a peak;
[0025] The control module of the scanner outputs a first start signal to the camera;
[0026] acquiring a fourth system standard time, and outputting a second activation signal to the camera if a time difference between the fourth system standard time and the second system standard time is greater than or equal to a fourth preset time difference;
[0027] After receiving the first start signal and receiving the second start signal at least after the fourth preset time difference, the camera takes a picture.
[0028] In order to achieve the above object, the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the scanner control method described above.
[0029] To achieve the above object, the present invention further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the scanner control method described above.
[0030] In order to achieve the above object, the present invention further provides a scanner, comprising:
[0031] camera;
[0032] light source;
[0033] A control module is electrically connected to the camera and the light source respectively, and the control module executes the steps of the scanner control method as described above.
[0034] In the above technical solution, the light source of the scanner is controlled so that the camera is controlled to take photos and samples when the light source reaches its peak. At this time, the clarity and brightness of the object to be scanned illuminated by the light source reach the highest level, thereby improving the accuracy and clarity of the sampled photos, and solving the technical problem of low accuracy of various data of the measured object due to the lack of synchronization between triggering and exposure. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments;
[0036] Figure 1 FIG. 4 is a flow chart of a scanner control method in one embodiment.
[0037] Figure 2 FIG. 4 is a flow chart of a scanner control method in one embodiment.
[0038] Figure 3 FIG. 4 is a flow chart of a scanner control method in one embodiment.
[0039] Figure 4 FIG. 4 is a flow chart of a scanner control method in one embodiment.
[0040] Figure 5 Schematic diagram of a scanner module in one embodiment. DETAILED DESCRIPTION
[0041] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it should not be understood as a limitation on the scope of protection of the present invention.
[0042] In one embodiment, if Figure 1As shown, the scanner control method includes:
[0043] S1. Obtaining a status signal of a scanner light source;
[0044] The status signal is used to reflect the working status of the light source of the scanner, and will change with the change of the working status. The status signal can be a high or low level or other types of control signals.
[0045] S2. determining whether the brightness of the light source has reached a peak value according to the status signal;
[0046] At this time, in a pre-experimental environment or during the test, by sampling and storing the data of each stage of the light source, a one-to-one correspondence between the status signal and the working status is established, so that it is possible to determine whether the brightness of the light source has reached its peak through the status signal.
[0047] S3. When the brightness of the light source reaches a peak value, control the camera to take a photo.
[0048] First of all, it should be noted that scanners generally include a light source and a camera, wherein the light source is used to illuminate the object to be inspected, and the camera is used to take pictures of the object. When the light source is a structured light source, a one-dimensional or two-dimensional image can be projected onto the object to be inspected. Finally, the image of the object captured by the camera will change according to the shape of the object to be inspected, so that the surface shape of the object to be inspected can be judged more accurately based on the image captured by the camera.
[0049] Based on the above structure, in the above embodiment, by controlling the light source of the scanner, the camera is controlled to take photos and samples when the light source reaches its peak value. At this time, the clarity and brightness of the object to be scanned, which are reflected by the light source, are at their highest, thereby improving the accuracy and clarity of the sampled photos. Compared with traditional scanners, the above embodiment enables the light source and camera of the scanner to be triggered in an orderly manner, thereby solving the technical problem of low accuracy of various data of the object to be measured due to the existence of asynchronous triggering and exposure. In addition, the present application does not adopt the method of synchronously turning on the light source and camera, thereby further avoiding the error caused by the synchronous turning on of the light source and camera.
[0050] It should be noted that the embodiments of the present application are applied to 3D scanners. Due to the particularity of 3D scanners, they rely heavily on structured light sources to project one-dimensional or two-dimensional images onto the object being measured. Therefore, by taking pictures during the peak period of the structured light source, the clarity of subsequent pictures can be improved and the errors caused by unclear pictures can be reduced.
[0051] In one embodiment, if Figure 2 As shown, before the step of obtaining the status signal of the light source of the scanner, the step further includes:
[0052] S4. Obtain the first system standard time and the cycle start time of the previous cycle;
[0053] Among them, the first system standard time is the system standard time of the scanner, the cycle in the previous cycle refers to the complete cycle of light source turning on - light source peak - camera turning on - structured light source turning off, and the cycle start time of the previous cycle refers to the system standard time when the light source in the previous cycle is turned on.
[0054] S5. If the time difference between the first system standard time and the cycle start time of the previous cycle is greater than or equal to a first preset time difference, the first system standard time is updated to the cycle start time of the previous cycle, and the light source of the scanner is controlled to turn on.
[0055] Among them, when the time difference between the first system standard time and the cycle start time of the previous cycle is greater than or equal to the first preset time difference, it means that the previous cycle has been completed. At this time, the first system standard time is updated to the cycle start time of the previous cycle to ensure the accurate start of the next scanning process. Controlling the light source of the scanner to turn on can be performed simultaneously with or after the step of updating the first system standard time to the cycle start time of the previous cycle. When performed at the same time, the scanning process can be controlled to be relatively short. Delaying it can slightly reduce the requirements for the controller or processor, thereby reducing the hardware cost of the scanner equipped with the solution of this application.
[0056] Optionally, the first preset time difference is set as the time interval of each scanning cycle, which can be set to 5-20 frames / second, that is, the cycle can be 50-200 milliseconds.
[0057] In one embodiment, the step of obtaining a status signal of a light source of the scanner includes:
[0058] A second system standard time is acquired, and a time difference between the second system standard time and the cycle start time of the previous cycle is used as a status signal.
[0059] The above embodiment obtains the time difference between the second system standard time and the cycle start time of the previous cycle. In the present embodiment, the scanner's light source is activated when the time difference between the first system standard time and the cycle start time of the previous cycle is greater than or equal to a first preset time difference. Therefore, the practical significance of this step is to monitor the light source's activation time. This monitoring eliminates the need for sensor configuration and feedback loop setup, simplifying the device's connection circuitry.
[0060] In one embodiment, the step of determining whether the brightness of the light source has reached a peak value according to the status signal includes:
[0061] When the state signal is greater than or equal to a second preset time difference, determining that the brightness of the light source reaches a peak value;
[0062] When the state signal is less than the second preset time difference, it is determined that the brightness of the light source has not reached a peak value.
[0063] In exemplary technologies, it is generally rare to judge whether the brightness of the light source has reached its peak. Moreover, based on the constant current drive and PWM drive principles of the light source, technicians in this field believe that it is also possible to directly feed back the values of these drive signals to judge whether the brightness of the light source meets actual needs. However, this requires the setting of an additional feedback loop, as well as increased judgment of data such as current and voltage. It is also necessary to set parameters for comparison, resulting in diversification and complexity of the data.
[0064] In the above-mentioned scheme of the present application, when scanning the object to be detected, in order to accurately judge the peak value without changing the product circuit and structure, a method of detecting time is proposed to determine whether the brightness of the light source has reached the peak value. That is, when the time meets the preset conditions, that is, when the status signal is greater than or equal to the second preset time difference, it can be directly confirmed that the light source has reached the peak value without adding the judgment of current, voltage and other data to the process, thereby simplifying the control factor and reducing the difficulty of judgment.
[0065] Optionally, after the step of determining that the brightness of the light source has not reached a peak value when the state signal is less than the second preset time difference, the method further includes:
[0066] Return to the step of obtaining the second system standard time.
[0067] At this time, returning to the step of obtaining the second system standard time can continuously confirm whether the brightness of the light source has reached its peak, so that it can be confirmed in time when it reaches the peak without waiting.
[0068] Optionally, the second preset time difference is generally 5-100 microseconds.
[0069] In one embodiment, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo further includes:
[0070] A third system standard time is obtained, and if a time difference between the third system standard time and the second system standard time is greater than or equal to a third preset time difference, the light source is controlled to be turned off.
[0071] At this time, when the time difference between the third system standard time and the second system standard time is greater than or equal to the third preset time difference, the light source is controlled to be turned off, which can ensure that the camera has sufficient exposure time, thereby achieving synchronous and orderly triggering.
[0072] Optionally, the third preset time difference is 5-100 microseconds.
[0073] In one embodiment, if Figure 3 As shown, the step of obtaining the third system standard time, if the time difference between the third system standard time and the second system standard time is greater than or equal to the third preset time difference, controlling the light source to turn off further includes:
[0074] S6. Obtain scanning working signal;
[0075] The scanning working signal can be a trigger signal given by the outside world, or a scanning working signal given by the controller of the scanner itself.
[0076] S7. If the scanning working signal is a continue working signal, return to execute obtaining the first system standard time and the cycle start time of the previous cycle;
[0077] S8. If the scanning working signal is a stop working signal, the scanning is ended.
[0078] Through the above solution, sustainable and reliable triggering of each scanning cycle can be guaranteed.
[0079] In one embodiment, if Figure 4 As shown, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo includes:
[0080] S311, when the brightness of the light source reaches a peak value;
[0081] S312: The control module of the scanner outputs a first start signal to the camera;
[0082] The first start signal at this time can be a high or low level signal format.
[0083] S313, obtaining a fourth system standard time, and if the time difference between the fourth system standard time and the second system standard time is greater than or equal to a fourth preset time difference, the control module of the scanner outputs a second start signal to the camera;
[0084] S314: After receiving the first start signal and receiving the second start signal at least after the fourth preset time difference, the camera takes a photo.
[0085] In the above embodiment, the control module of the scanner will output two start signals with a certain time interval to the camera to control the camera to start. On the camera side, there is a controller in the camera. After receiving the first start signal, it is stored in advance. When the second start signal is received after a preset time, the photo-taking program will be triggered. In this way, the control signal can be divided into multiple segments, and it will be started only after certain conditions are met to avoid false triggering.
[0086] In the exemplary technology, PWM signals or high and low level signals are generally used to trigger subsequent actions, and no other technical solutions are involved. However, in the above-mentioned solution of the present application, since the control module controls the camera and the camera shutter is very fast, the control solution using the above-mentioned WM signal or high and low level signals is prone to false triggering, and is very likely to cause camera sampling image distortion when the ambient light source is not clear. If only PWM signals or high and low level signals are used to trigger shutter sampling, the accuracy of the sampling data will be very low.
[0087] In the embodiment of the present application, based on the high and low level signal control principle, a new triggering method is proposed, that is, when the control module controls the camera to take pictures, a TTL high level signal is used as the first start signal and the second start signal, and when the two signals need at least a fourth preset time difference interval, it is a complete trigger timing, thereby avoiding the single high and low level false triggering scheme in the prior art. In addition, the purpose of quickly controlling the camera to take pictures can be achieved to the greatest extent. Since the high and low level triggering is relatively simple, the fourth preset time difference can be shortened as much as possible, which can be close to or even exceed the speed of PWM signal transmission, but can avoid false triggering during PWM signal control.
[0088] Optionally, the fourth preset time difference is 2-100 milliseconds.
[0089] The present application also proposes a storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the scanner control method described above.
[0090] It should be noted that, since the storage medium of the present application includes all the steps of the above-mentioned scanner control method, the storage medium can also implement all the schemes of the scanner control method and have the same beneficial effects, which will not be repeated here.
[0091] A scanner control method according to the above-described method embodiment is implemented. The device embodiment described above is merely illustrative, and the units described as separate components may or may not be physically separate, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected to achieve the objectives of this embodiment according to practical needs. Those skilled in the art will appreciate that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, or any suitable combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0092] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the scanner control method described above.
[0093] It should be noted that, since the computer device of the present application includes all the steps of the above-mentioned scanner control method, the computer device can also implement all the schemes of the scanner control method and have the same beneficial effects, which will not be repeated here.
[0094] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transitory memory, such as at least one disk memory, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory may optionally include a memory remotely located relative to the control processor, and these remote memories may be connected to the power transmission circuit cross-span intelligent identification device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0095] This application also proposes a scanner, such as Figure 5 As shown, the scanner includes:
[0096] Camera 20;
[0097] Light source 30;
[0098] The control module 10 is electrically connected to the camera 20 and the light source 30 respectively, and the control module 10 executes the steps of the scanner control method as described above.
[0099] It should be noted that, since the scanner of the present application includes all the steps of the above-mentioned scanner control method, the scanner can also implement all the schemes of the scanner control method and have the same beneficial effects, which will not be repeated here.
[0100] Optionally, the control module is a microcontroller.
[0101] In existing technologies, synchronous triggering of the light source and camera is typically achieved through controllers such as PCI (Peripheral Component Interconnect) frame grabbers and FPGAs (Field Programmable Gate Arrays), which output the industrial camera's frame clock synchronization signal and the structured light source synchronization signal. However, these controllers are typically expensive, requiring complex design and wiring. However, using a microcontroller not only achieves synchronous triggering through high and low-level signals but also systematically controls the trigger timing, achieving superior control accuracy and scanning performance compared to existing technologies. Furthermore, compared to expensive PCI frame grabbers and FPGAs, using a microcontroller can significantly reduce costs.
[0102] Alternatively, a microcontroller such as GD32F103RCT6 may be used.
[0103] Optionally, the camera is an industrial camera and the light source is a structured light source.
[0104] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A scanner control method, characterized in that: The scanner control method comprises: Obtaining a status signal of a light source of a scanner; determining whether the brightness of the light source reaches a peak value according to the status signal; When the brightness of the light source reaches a peak value, controlling the camera to take a photo; Wherein, before the step of obtaining the status signal of the light source of the scanner, the step further includes: Get the first system standard time and the cycle start time of the previous cycle; If the time difference between the first system standard time and the cycle start time of the previous cycle is greater than or equal to a first preset time difference, the first system standard time is updated to the cycle start time of the previous cycle, and the light source of the scanner is controlled to turn on; Wherein, the step of obtaining the status signal of the light source of the scanner includes: Acquire a second system standard time, and use a time difference between the second system standard time and the cycle start time of the previous cycle as a status signal; Wherein, the step of judging whether the brightness of the light source reaches a peak value according to the status signal comprises: When the state signal is greater than or equal to a second preset time difference, determining that the brightness of the light source reaches a peak value; When the state signal is less than a second preset time difference, determining that the brightness of the light source has not reached a peak value; Wherein, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo further includes: Acquire a third system standard time, and if the time difference between the third system standard time and the second system standard time is greater than or equal to a third preset time difference, control the light source to be turned off; Wherein, the step of obtaining the third system standard time, if the time difference between the third system standard time and the second system standard time is greater than or equal to the third preset time difference, after the step of controlling the light source to be turned off, further comprises: Obtain scanning working signal; If the scanning working signal is a continuing working signal, returning to execute obtaining the first system standard time and the cycle start time of the previous cycle; If the scanning working signal is a stop working signal, the scanning is terminated; Wherein, when the brightness of the light source reaches a peak value, the step of controlling the camera to take a photo comprises: When the brightness of the light source reaches a peak value; The control module of the scanner outputs a first start signal to the camera; Acquiring a fourth system standard time, if the time difference between the fourth system standard time and the second system standard time is greater than or equal to a fourth preset time difference, the control module of the scanner outputs a second start signal to the camera; After receiving the first start signal and receiving the second start signal after an interval of at least the fourth preset time difference, the camera takes a photo.
2. A storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to execute the steps of the scanner control method according to claim 1.
3. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the scanner control method as claimed in claim 1.
4. A scanner, characterized in that: The scanner comprises: camera; light source; A control module, wherein the control module is electrically connected to the camera and the light source respectively, and the control module executes the steps of the scanner control method as claimed in claim 1.
Citation Information
Patent Citations
Light source of slide scanner
CN110233973A