System-based high-speed professional code scanning method
By using a high frame rate camera and fill light on smart terminal devices, the problem of fixed and cost of scanning code module structure is solved, and high-speed professional scanning code is realized, which improves efficiency and equipment adaptability and reduces power consumption.
Patent Information
- Application Number
- CN202510394520.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-08
AI Technical Summary
The existing code scanning module has a fixed structure and is cost-effective, making it difficult to achieve high-speed professional code scanning, debugging is difficult, and it is impossible to flexibly adapt to different equipment structures.
Based on the system platform, high-frame rate module camera and fill light are used to scan codes by obtaining rawdata data, combining exposure value and brightness control, and high-speed professional scanning codes are directly realized on terminal devices.
It reduces cost and debugging difficulty, improves code scanning efficiency, enhances the structural adaptability and user experience of the equipment, reduces power consumption and loss, and extends the service life of the terminal equipment.
Smart Images

Figure CN120278174A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high-speed code scanning, and particularly to a high-speed professional code scanning method based on a system. Background Art
[0002] In the continuous development of the intelligent POS and intelligent retail industries, the demand for professional code scanning in various devices is becoming more and more common. For the devices used for code scanning in intelligent devices to meet the high-speed code scanning requirements of customers, basically, a professional code scanning module and a professional code scanning library need to be used. However, the disadvantages of the code scanning modules in the market are as follows: 1. The fixed structure design leads to limitations in the design of the price inquiry machine. The model ID needs to be designed according to the status of the module, which has certain limitations; 2. Compared with the camera module, the cost of the code scanning module is high, increasing the R & D cost of the project; 3. The ordinary camera implementation method cannot meet the requirements of high-speed professionalism and cannot achieve high-standard motion tolerance, resulting in slow code scanning; 4. R & D debugging is not easy. Since the code scanning modules are provided by suppliers, the code scanning effect and the code scanning library are bound inside the module. When there are problems with the code scanning effect, they cannot be adjusted and controlled within the company. When encountering code scanning problems, one can only choose to accept or wait for debugging, which is not friendly to the debugging cycle.
[0003] Therefore, we propose to implement a high-speed professional code scanning method directly based on the system platform without using a code scanning module on the intelligent system. Instead, use the platform, camera, and fill light of the intelligent device to achieve high-speed professional code scanning, so as to increase the flexibility to adapt to each project and make system development more convenient. Summary of the Invention
[0004] To solve the above problems, the present technical solution provides a method for implementing a high-speed professional code scanning solution that can be realized based on the system platform itself in intelligent terminal devices.
[0005] To achieve the above object, the present technical solution is as follows: A high-speed professional code scanning method based on a system, including: S1, select a suitable viewing angle, high-frame-rate module camera, and fill light module according to the requirements of the product's motion tolerance for professional code scanning; S2, calculate the exposure values required at different frame rates of the camera, and calculate the values of the current of the fill light required under the required depth of field to ensure that the image on the preview interface is clear; S3, the system obtains the rawdata data of the camera by turning off the ISP module; S4. The system application obtains raw data by controlling the output of the camera module and the brightness of the fill light, uses the Y data of the raw data to detect the approach of a person or an object, lights up the screen to display the QR code scanning preview interface, and gives the captured QR code data image to the QR code library for data analysis; S5. Display the image result scanned by the QR code library on the screen.
[0006] Furthermore, in step S1, the camera is a fixed-focus module.
[0007] Furthermore, in step S1, the chip of the camera adopts the global exposure method.
[0008] Furthermore, in step S1, the camera defaults to using the maximum frame rate limited within 60 - 120 fps to achieve the corresponding high-speed motion tolerance.
[0009] Furthermore, in step S1, calculate the frame rate according to the motion tolerance: Fps = motion tolerance distance / (focal length / tan(field of view angle / 2) * 2).
[0010] Furthermore, in step S2, calculate the exposure time of the camera chip, and use the PWM control method to control the on and off of the fill light. It is known that within the same current and a fixed time period, PWM adjusts the brightness by controlling the on and off time of the LED light. The larger the on and off time ratio, the higher the brightness of the LED light; the smaller the on and off time ratio, the lower the brightness of the LED light. The start time and duration of the exposure are the minimum values for which the fill light needs to remain on.
[0011] The beneficial effects of this application are as follows: It realizes the reduction of the cost of professional QR code scanning and the diversification of the structure. Professional QR code scanning can be realized based on the existing mobile phone structure, POS machine structure, and other terminal device structures, without the need for an additional large space for designing a professional QR code scanning module, and various adaptations can also be made according to different structures, greatly increasing the convenience of structural design.
[0012] It reduces the debugging difficulty of realizing professional QR code scanning. Since the raw data has not undergone image processing by the ISP module, only satisfactory effects can be achieved through the combined configuration and debugging of the brightness of the fill light, the gain value, the exposure value, and the frame rate of the camera.
[0013] It improves the efficiency of QR code scanning. High-speed professional QR code scanning is completed with a simple module design. Using a high speed can greatly improve the rate of obtaining correct QR code scanning, enabling the terminal to obtain stable QR code scanning results under high-speed movement, and improving the user experience.
[0014] The implementation of the code scanning application can compare the Y - value data of the acquired image without previewing to detect the approach of people or objects. For terminals powered by electricity for a long time, such as price inquiry machines in supermarkets or POS machines directly connected to the power supply, it can reduce power consumption loss, and can better protect terminals with displays from abnormal display problems caused by long - term screen - on use, and extend the service life of the terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments.
[0016] Figure 1 is a schematic structural diagram of the camera module in the embodiment of the present invention Figure 1 ; Figure 2 is a schematic structural diagram of the camera module in the embodiment of the present invention Figure 2 ; Figure 3 is a schematic diagram of the exposure time data in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clear, the following further details the present invention in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0018] Please refer to Figures 1 - 3 as shown below, the specific implementation of this application is as follows: Select a suitable viewing angle, high - frame - rate module camera and fill - light module for professional code scanning according to the requirements of the motion tolerance of the project product.
[0019] Calculate the exposure values required for different frame rates of the camera, and calculate the current value of the fill - light required to make the image on the preview interface clear without being dazzling under the required depth of field.
[0020] For most platforms, the cameras used are basically MIPI interfaces, and all effects need to be displayed after algorithms such as image noise reduction, sharpening, decontamination, and white balance of the ISP module of the platform. This part of data processing will affect the efficient execution of the code - scanning module. Therefore, when using, we directly take or obtain only rawdata through the ISP.
[0021] The system application obtains rawdata by controlling the output of the camera module and the brightness of the fill light, uses the Y data of the rawdata to detect the approach of a person or an object, lights up the screen to display the QR code scanning preview interface, and gives the captured QR code data image to the QR code library for data analysis.
[0022] Step 2: The preview interface refers to the data output by the sensor being displayed on the screen in reverse, similar to the interface that can be seen on the screen after opening the mobile phone camera app.
[0023] Step 4: Lighting up the screen means lighting up the display screen of the entire peripheral device. The QR code scanning preview interface is the same as above. The purpose of this action is that if the device we use needs to be kept on all the time waiting for the customer to use for QR code scanning, for a device that is always powered on, long-term screen lighting consumes a large amount of power, and it is also a loss for the display screen and reduces its service life. Therefore, we provide a solution, that is, when the system detects that the data obtained by the camera has not changed significantly for a long time and there is no person or object blocking the view of the data, the device display screen will be turned off after a timeout to reduce power consumption. Once an object is detected approaching the system, the screen will be quickly lit up for the customer to use the QR code scanning device.
[0024] Step 5: The customer uses the QR code scanning device to obtain information, such as the price and information of the scanned commodity or cash register. No matter what the result is, it can be presented on the screen according to the user. Therefore, the result is uniformly written. As for what operations need to be done with the result, it can be defined and developed by the user himself.
[0025] The QR code library is used for QR code scanning, supporting not only commodity barcodes but also one-dimensional and two-dimensional codes. You can scan any type of code you want.
[0026] During implementation: (1) Design the structure according to the two situations of handheld or fixed terminals. If it is a handheld device such as Figure 1 Due to its light weight, it is difficult to align the camera's perspective and the position of the code. The structure of the fill light can be designed in a positioning or aiming state for the user to use. The distance between the light and the camera module should be narrow so that the light can cover the outermost edge of the camera and the focus is concentrated at the focal length position. A spotlight hood can be used. If it is a price inquiry machine or self-service checkout terminal commonly used in supermarkets, such as Figure 2Due to the relatively wide structure, the structure of the fill light should surround the camera chip with lights or be inclined so that the brightness of the lights can directly shine on the camera chip to avoid direct exposure to the human eye. The camera module is selected to be fixed-focus, which takes less time than the autofocus module during preview focusing and can achieve a faster QR code scanning effect more effectively. The camera chip has progressive exposure and global exposure modes. The global exposure mode has more consistent time and better effects.
[0027] (2)The software platform enables the camera to default to a maximum frame rate limited to 30fps to meet video recording and normal preview display, achieving the corresponding high-speed motion tolerance. The camera module chip sets a low resolution and a high frame rate output of 60fps or 90fps in the set driver code. In the system platform, the data is set not to pass through image processing in the ISP. If the platform does not support turning off the data processing in the ISP, pure data can also be received directly from the data in the CSImipi interface at the bottom layer.
[0028] Calculate the frame rate according to the motion tolerance: Fps = Motion tolerance distance / (Focal length / tan(Field of view angle / 2) * 2) Note: fps is the minimum frame rate that must be achieved to reach the corresponding motion tolerance. (3)Since the camera chip was set to output a high frame rate in the previous step and the system does not have algorithms such as automatic exposure, the data output by the camera chip is black. To be able to capture normal relevant information, the exposure value and gain value of the camera chip need to be adjusted to achieve the latest display effect. Under normal circumstances, the fill light always remains on when the camera module is turned on, which can definitely achieve a normal display state. However, for energy conservation and comfortable lighting, we will use the PWM control method to control the brightness of the fill light. It is known that within the same current and a fixed time period, PWM adjusts the brightness by controlling the on and off time of the LED light. The larger the on and off time ratio, the higher the brightness of the LED light; the smaller the on and off time ratio, the lower the brightness of the LED light. Check Figure 3 Calculate the exposure time of the camera chip according to the data format. The start time and duration of this exposure are the minimum values for which the fill light needs to remain on. The gain value of the gain is mainly used to debug the clarity and noise of the scanned code data. The barcode scanning library is integrated in the software. The barcode scanning library can be added to the system and judged according to the data output by the camera. Based on the reasons for success and failure, it can be inferred whether the previously debugged parameters are reasonable. There are multiple choices for the barcode scanning library, and the advantages and disadvantages of various libraries can also be compared. It is not bound to the module, providing a large debugging space.
[0029] (4)Regarding the use of the system's QR code scanning application, compared with a handheld battery-powered terminal device, due to power consumption reasons, it can be designed to enter the QR code scanning interface during use, and exit the QR code scanning interface and turn off the fill light after obtaining data by scanning the QR code or after reaching the timeout. For a continuously powered terminal device, in order to protect the lifespan of the terminal device, the entire terminal can time out and turn off the display screen during QR code scanning, while the camera module remains in the working state without displaying the preview interface. Since the camera module has been obtaining data all the time, we can judge whether there is no item approaching by obtaining the average Y vector value of the entire image data or the Y vector value of the block data. When in a static state, the data output by the camera module changes within a fixed small range and there is no significant difference. However, when an item approaches, the Y value output by the camera module significantly decreases. At this time, while performing QR code decoding, the system executes to turn on the display screen and display the QR code scanning preview interface, which can quickly display the result and also reduce the overall power consumption during the whole process.
[0030] Display the image result scanned by the QR code library on the screen for users to develop other functions.
[0031] Figure 3 In it, Start of frame N: The exposure ends and starts to read and transmit image data; When Active Rows, the chip image data is read out, controlled by the register, in units of rows; When Blank Rows, the blanking time after reading out the chip image data, controlled by the register, in units of rows; Exposure time = The number of rows to be exposed * The length of one row / The clock of pixel output.
[0032] The above are only the preferred embodiments of the present application and are not used to limit the scope of implementation of the present application. All other embodiments with the same or similar principles and basic structures as the present application are within the protection scope of the present application.
Claims
1. A high-speed professional code scanning method based on a system, characterized in that Including: S1. Select a suitable perspective and high-frame-rate module camera and fill light module according to the requirements of the product movement tolerance for professional code scanning. S2. Calculate the exposure values required at different frame rates of the camera, and calculate the values required for the current of the fill light under the required depth of field to ensure that the image on the preview interface is clear. S3. The system obtains the raw data of the camera by turning off the ISP module. S4. The system application obtains the raw data by controlling the output of the camera module and the brightness of the fill light, uses the Y data of the raw data to detect the approach of a person or an object, lights up the screen to display the code scanning preview interface, and gives the captured data image of a two-dimensional code to the code scanning library for data analysis. S5. Display the image result scanned by the code scanning library on the screen.
2. The high-speed professional code scanning method based on the system according to claim 1, characterized in that: In step S1, the camera is a fixed-focus module.
3. The high-speed professional code scanning method based on the system according to claim 2, characterized in that: In step S1, the chip of the camera adopts the global exposure method.
4. The high-speed professional code scanning method based on the system according to claim 3, characterized in that: In step S1, the camera defaults to using the maximum frame rate limited within 60 - 120 fps to achieve the corresponding high-speed movement tolerance.
5. The high-speed professional code scanning method based on the system according to claim 4, characterized in that: In step S1, calculate the frame rate according to the movement tolerance: Fps = movement tolerance distance / (focal length / tan(field of view angle / 2) * 2).
6. The high-speed professional code scanning method based on the system according to claim 5, wherein: In step S2, calculate the exposure time of the camera chip, and control the brightness of the fill light by using the PWM control method. It is known that within the same current and a fixed time period, PWM adjusts the brightness by controlling the on and off time of the LED light. The larger the on and off time ratio, the higher the brightness of the LED light; the smaller the on and off time ratio, the lower the brightness of the LED light. The start time and duration of the exposure are the minimum values for which the fill light needs to remain on.
Citation Information
Cited By
Method and device for acquiring effective alarm image of moving object
CN120614529A