A method and device for batch scanning of codes
By collecting images and performing image change detection and intercepting interest areas, the recognition of batch code scanning is realized, solving the problem of low batch fast code scanning recognition efficiency in the prior art, and improving the scanning speed and efficiency of code scanning.
Patent Information
- Application Number
- CN202011324987.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-23
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2040-11-23
AI Technical Summary
The existing code scanning technology cannot realize batch quick scan code recognition, resulting in low efficiency in the process of quickly scanning materials or products.
By collecting images, grayscale edge detection and image change detection, the target image is determined and the area of interest images are intercepted, code recognition and output recognition results are performed, and batch code scanning is realized.
It realizes the one-time scanning operation of multiple codes and multiple codes. It is simple to use and low cost, which speeds up the scanning speed and improves the scanning efficiency.
Smart Images

Figure CN112528692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of batch code scanning, and particularly to a batch code scanning method and device. Background Art
[0002] Currently, barcodes or QR codes are attached to production materials or products, and code scanning is achieved through code scanning devices or terminal devices. In the prior art, most of the code scanning of QR codes and barcodes is carried out by single devices. When it comes to quickly scanning a large number of production materials or products, batch code scanning is mostly achieved by controlling the movement of production materials or products or by installing multiple code scanning devices, but this method is suitable for implementation on large-scale production lines and has a high cost; when using a single code scanning device to scan each commodity one by one at some commodity sales windows such as pharmacies, supermarkets, logistics, etc., batch code scanning cannot be achieved and the efficiency is low. Summary of the Invention
[0003] The present invention provides a batch code scanning method and device, aiming to solve the problem that existing code scanning cannot perform batch and fast code scanning and recognition.
[0004] To achieve the above object, the present invention provides a batch code scanning method, and the batch code scanning method includes:
[0005] Collect images;
[0006] Image change detection: Perform grayscale edge detection on the collected images to determine whether the images have changed, and determine each changed image as a target image;
[0007] Region of interest (ROI) extraction: Calculate the ROI contour of the target image through the dense region of edge lines and extract the ROI image;
[0008] Code recognition: Perform code recognition judgment on the ROI image. After the code recognition judgment is successful, intercept the code scanning image according to the ROI image, and call the code recognition interface to recognize the code scanning image to obtain the recognition result;
[0009] Code output: Output the recognition result to the specified virtual keyboard module, and simultaneously voice broadcast the number of recognized codes.
[0010] Further, in the step of collecting images, the collected images are saved in the memory file system in a file format.
[0011] Further, the image change detection step includes:
[0012] Convert the collected images into grayscale images;
[0013] Calculate the edges of the grayscale images to obtain edge images;
[0014] Divide the edge map into several regions;
[0015] Uniformly extract the regions corresponding to the regions in the previous edge map for comparison to obtain the image change value of this region;
[0016] Subtract the image change value obtained by the same method last time from the image change value to obtain the absolute difference, and at the same time save the image change value this time;
[0017] Take the largest image change value among all regions as the image change degree this time;
[0018] Determine whether the image has changed according to the image change degree.
[0019] Further, the step of intercepting the region of interest includes:
[0020] Divide the target image into several first regions;
[0021] Calculate the energy value of each first region; the energy value is the contribution value of the edge line to the first region;
[0022] Merge all adjacent first regions with high energy into second regions;
[0023] Take the rectangular contour of the second region as the region of interest image.
[0024] Further, the step of code recognition includes:
[0025] Detect the change of the target image, and trigger code recognition when the target image changes;
[0026] Wait for the target image to stabilize, and trigger the search for the region of interest image when the target image is stable;
[0027] Intercept the code scanning image according to the region of interest image;
[0028] Perform tilt adjustment on the code scanning image, and use the corresponding recognition interface to recognize the code scanning image to obtain the recognition result.
[0029] Further, the step of code output includes:
[0030] Add the recognition result to the code linked list;
[0031] Sort and remove duplicates from the code linked list;
[0032] Write the data of the code linked list to the virtual keyboard module, and at the same time voice broadcast the number of recognized codes.
[0033] Further, the virtual keyboard module transmits the data of the code linked list in the communication format of the keyboard.
[0034] In addition, the present invention provides a batch code scanning device, which includes a housing with a receiving space, a circuit board, a camera module, a condenser cover, a lighting lamp, and a transparent cover plate; the circuit board and the condenser cover are received in the receiving space, the condenser cover has a regular shape with a flared opening, the large end of the flared opening is provided on the housing and covered with the transparent cover plate; the lighting lamp is provided at the edge where the large end of the flared opening meets the transparent cover plate and is inclined to shine towards the condenser cover; an opening is provided at the small end of the flared opening of the condenser cover; the camera module is connected to the circuit board; the camera module includes a camera lens, the camera lens extends out of the opening and the camera lens faces the direction of the transparent cover plate; the circuit board includes a processor, a memory, a voice module, and an output module, the memory, the voice module, and the output module are all connected to the processor; the voice module is used for voice broadcasting the number of recognized codes; the output module is used for outputting the code scanning recognition result; a batch code scanning program is stored on the memory and can run on the processor, and when the batch code scanning program is executed by the processor, it realizes the steps of the batch code scanning method as described in any one of claims 1 to 7.
[0035] Further, the batch code scanning device further includes a power supply module, and the power supply module is connected to the lighting lamp and the circuit board to provide power.
[0036] Meanwhile, the present invention provides a storage medium, which is a computer-readable storage medium, and a batch code scanning program is stored on the storage medium, and the batch code scanning program can be executed by one or more processors to realize the steps of the batch code scanning method as described above.
[0037] The batch code scanning method and device provided by the present invention complete batch code scanning by collecting images, intercepting region-of-interest images, and recognition, realizing a one-time code scanning action for multiple codes, being simple to use, having a low implementation cost, accelerating the code scanning speed, and improving the code scanning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic flowchart of the batch code scanning method provided by an embodiment of the present invention;
[0039] Figure 2 For Figure 1 it is a schematic flowchart of step S20 in
[0040] Figure 3 For Figure 1 it is a schematic flowchart of step S30 in
[0041] Figure 4 For Figure 1 it is a schematic flowchart of step S40 in
[0042] Figure 5 is Figure 1 the process schematic diagram of step S50 in
[0043] Figure 6 the structural schematic diagram of the batch code scanning device provided by an embodiment of the present invention;
[0044] Figure 7 is Figure 6 the structural schematic diagram of the batch code scanning device after removing the housing in
[0045] Figure 8 is Figure 7 the structural schematic diagram of the circuit board in
[0046] Figure 9 the schematic diagram of the batch code scanning device provided by an embodiment of the present invention connecting to a computer terminal;
[0047] Figure 10 the schematic diagram of the batch code scanning device provided by an embodiment of the present invention connecting to a cloud platform server;
[0048] Figure 11 the program module schematic diagram of the batch code scanning program in an embodiment of the batch code scanning device of the present invention.
[0049] In the figure, 100 is the batch code scanning device; 10 is the housing; 11 is the bottom wall; 12 is the side wall; 13 is the top cover; 20 is the circuit board; 21 is the processor; 22 is the memory; 23 is the voice module; 24 is the output module; 30 is the camera module; 40 is the light condensing cover; 41 is the opening; 50 is the lighting lamp; 60 is the transparent cover plate; 71 is the USB interface; 72 is the power interface; 101 is the acquisition module; 102 is the detection module; 103 is the interception module; 104 is the recognition module; 105 is the recognition result output module. Specific embodiments
[0050] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0051] Please refer to Figure 1 , the batch code scanning method provided by an embodiment of the present invention includes:
[0052] Step S10: Collect images;
[0053] Step S20: Image change detection. Perform grayscale edge detection on the captured image to determine whether the image has changed, and determine each changed image as the target image;
[0054] Step S30: Region of interest extraction. Calculate through the dense edge line area to find the contour of the region of interest of the target image and extract the region of interest image;
[0055] Step S40: Code recognition. Perform code recognition judgment on the region of interest image. After the code recognition judgment is successful, intercept the code scanning image according to the region of interest image, and call the code recognition interface to recognize the code scanning image to obtain the recognition result;
[0056] Step S50: Code output. Output the recognition result to the specified virtual keyboard module, and at the same time, voice broadcast the number of recognized codes.
[0057] Specifically, in an embodiment of the present invention, the acquisition of the image can be realized through a single camera. During the actual code scanning operation, directly place one side of the item with a barcode or QR code in the image acquisition area to complete the image acquisition. The captured image is saved in the memory file system in the YUYV or JPEG file format. The user can view the captured image through a browser. At the same time, saving the captured image in the file format to the memory file system reduces writing data to the hardware memory, improves efficiency, reduces access to the hardware memory, and increases the service life of the hardware memory.
[0058] Please refer to Figure 2 , specifically, the image change detection in step S20 includes:
[0059] Step S210: Convert the captured image into a grayscale image; Using the grayscale image can improve the calculation speed and reduce the calculation amount;
[0060] Step S220: Calculate the edge of the grayscale image to obtain an edge image; Detect image changes through the edge image;
[0061] Step S230: Divide the edge image into several regions;
[0062] Step S240: Uniformly extract the regions corresponding to the previous edge image for comparison to obtain the image change value of the region;
[0063] Step S250: Subtract the image change value obtained by the same method last time from the image change value to obtain the absolute difference, and at the same time save the image change value this time;
[0064] Step S260: Take the largest image change value in all regions as the image change degree this time;
[0065] Step S270: Determine whether the image has changed according to the degree of image change.
[0066] Specifically, since the edges of the image are relatively unchanged, using the edges of the image for change detection makes the detection more accurate; at the same time, edge detection is performed on a part of the image area, reducing the detection calculation amount and making the detection speed faster.
[0067] Please refer to Figure 3 , and the specific steps of ROI extraction in step S30 include:
[0068] Step S310: Divide the target image into several first regions;
[0069] Step S320: Calculate the energy value of each first region; the energy value is the contribution value of the edge line to the first region; there are many edge lines in barcodes and QR codes, and all edge lines contribute to the energy value. The more lines there are in the region, the higher the region energy;
[0070] Step S330: Merge all adjacent regions with high energy into a second region;
[0071] Step S340: Use the rectangular contour of the second region as the ROI image.
[0072] Use the edge map as the calculation basis; use the edge line as the calculation basis for energy level, without distinguishing between barcodes and QR codes, reducing the amount of calculation.
[0073] Please refer to Figure 4 , and specifically, the steps of code recognition in step S40 include:
[0074] Step S410: Detect the change of the target image, and trigger code recognition when the target image changes;
[0075] Step S420: Wait for the target image to stabilize, and trigger the search for the ROI image when the target image is stable;
[0076] Step S430: Extract the scanning code image according to the ROI image;
[0077] Step S440: Perform tilt adjustment on the scanning code image, and use the corresponding recognition interface to recognize the scanning code image to obtain the recognition result. Specifically, judge whether the image needs tilt adjustment according to the ROI image. If the ROI image is tilted, then perform tilt adjustment on the ROI image, such as image rotation.
[0078] Through the change detection of the target image, code scanning can be performed quickly and continuously. After one code scan and material replacement, the next code scan can be carried out. At the same time, the success rate of code scanning is ensured through image stability detection. Unstable and moving images are blurred, which will cause code scanning failures. Such problems will not occur through stability detection. At the same time, when the image of the region of interest is tilted, the success rate of code scanning is also improved through automatic tilt adjustment.
[0079] Please refer to Figure 5 , and specifically, the code output in step S50 includes:
[0080] Step S510: Add the recognition result to the code linked list;
[0081] Step S520: Sort and remove duplicates from the code linked list; By sorting and removing duplicates of the recognition results in the code linked list, the uniqueness of the recognition results is ensured, and it is convenient for users to view;
[0082] Step S530: Write the code linked list data to the virtual keyboard module, and at the same time, voice broadcast the number of recognized codes. By writing the code linked list data to the virtual keyboard module, the virtual keyboard module transmits the code linked list data in the communication format of the keyboard, which is convenient for users to use and reduces the usage cost; At the same time, by voice broadcasting the number of recognized codes, it is convenient for users to know whether the number of code scans in this operation is incorrect during operation, avoiding errors.
[0083] To achieve the above object, the present invention also provides a batch code scanning device, which includes a memory and a processor. A batch code scanning program that can run on the processor is stored on the memory. When the batch code scanning program is executed by the processor, the steps of the above batch code scanning method are implemented.
[0084] Please refer to in combination Figure 6 and Figure 7, an embodiment of the present invention provides a batch code scanning device 100, which includes a housing 10 with a receiving space, a circuit board 20, a camera module 30, a light condensing cover 40, a lighting lamp 50, and a transparent cover plate 60; the circuit board 20 and the light condensing cover 40 are received in the receiving space; the housing 10 is customized according to the shape of the light condensing cover 40. Specifically, in this embodiment, the housing 10 is made into a square shape. In other embodiments, the housing 10 can also be made into a circular shape or other shapes, which is not limited herein; specifically, in this embodiment, the housing 10 includes a bottom wall 11, four side walls 12 extending upward from the bottom wall 11, and a top cover 13 disposed opposite to the bottom wall 11, and the top cover 13 has an opening; the transparent cover plate 60 is installed on the top cover 13 and covers the opening at the top cover 13; the light condensing cover 40 has a regular shape with a flared opening. Specifically, in one embodiment, the regular shape is a long strip shape with four sides or a cylindrical shape, and the large end of its flared opening is disposed at the top cover 13 and is covered by the transparent cover plate 60; the lighting lamp 50 is disposed at the edge where the large end of the flared opening meets the transparent cover plate 60 and is inclined to shine on the light condensing cover. The lighting lamp 50 shines on the light condensing cover 40 and reflects the light on the object to be code scanned after converging the light through the light condensing cover 40, making the light irradiation brighter, and at the same time avoiding the lighting lamp 50 shining upward and the light leaking out through the transparent cover plate 60, and the light leaking out through the transparent cover plate 60 will cause discomfort to the operator during operation; the light condensing cover 40 is fixed in the housing 10 and has an opening 41 at the small end of the flared opening of the light condensing cover 40. The camera lens of the camera module 30 extends out of the opening 41 and faces the direction of the transparent cover plate 60. The area of the transparent cover plate 60 located in the area of the light condensing cover 40 is the image acquisition area, that is, the photographing area of the camera lens. When the material or commodity to be code scanned is placed in the acquisition area of the transparent cover plate 60, the camera lens is triggered to take a picture and acquire an image; due to the light condensing effect of the light condensing cover 40, the camera lens is brighter when taking pictures, and the acquired image is clearer, making the code scanning effect better. The batch code scanning device 100 further includes a power supply module (not labeled), a USB interface 71 and a power supply interface 72 provided on the side wall 12. The power supply module is connected to the lighting lamp 50 and the circuit board 20 to provide power; the USB interface 71 is connected to the circuit board 20, and the power supply interface 72 is connected to the power supply module.
[0085] Please refer to Figures 6 - 10As shown in the figure, it is a schematic structural diagram of a circuit board 20 and a camera module 30. Among them, the circuit board 20 includes a processor 21, a memory 22, a voice module 23, and an output module 24. The memory 22, the voice module 23, and the output module 24 are all connected to the processor 21, and the camera module 30 is also connected to the processor 21. Specifically, when performing batch code scanning, the user places the item to be scanned in the imaging area, which is on the transparent cover plate 60 corresponding to the large end of the horn-shaped opening of the condenser cover 40. The item is placed on the transparent cover plate 60, and the camera module 30 is in a working state and continuously takes pictures. Specifically, in one embodiment, the camera module 30 continuously takes pictures at about 15 pictures per second. The voice module 23 is used to voice broadcast the number of recognized codes. The output module 24 includes a USB interface or a communication unit, and the communication unit can be any one of Bluetooth, WiFi, mobile communication, or wired communication. Specifically, in one embodiment, as Figure 4 shown, the output module 24 is a USB interface for connecting to a computer terminal or other code scanning result receiving devices. When the batch code scanning device 100 is connected to the computer terminal 110 through the USB interface, the batch code scanning device 100 is virtualized as a kind of keyboard device, and the linked list data obtained by the above batch code scanning method is written to the virtual keyboard module. The virtual keyboard module serves as a virtual keyboard relative to the computer terminal or other code scanning result receiving devices, and outputs the linked list data to the computer terminal 110 or other code scanning result receiving devices through the USB interface. In another embodiment provided by the present invention, as Figure 5 shown, the output module 24 is a communication unit. The batch code scanning device 100 can be used as an independent cloud terminal and is connected to the cloud platform server 300 through the network 200 to realize automatic update of the program and configuration through the cloud platform server 300, and automatically report the recognition result to the cloud platform server 300.
[0086] Specifically, the synchronization method between the batch code scanning device and the cloud platform server includes:
[0087] Step S1: The batch code scanning device starts and automatically obtains an IP address, and broadcasts the IP address through voice after starting.
[0088] Step S2: The batch code scanning device automatically logs in to the cloud platform server, and regularly downloads component files or listens for MQTT messages for component upgrades. When receiving the MQTT message, it automatically downloads the component files.
[0089] Step S3: The batch code scanning device compares the component files with the component files stored locally to determine whether to update. If there is an update, it is upgraded; otherwise, it returns to Step S2.
[0090] Step S4: Voice broadcast a reminder not to shut down during the upgrade.
[0091] Step S5: The batch scanning device pulls the changed encrypted data from the cloud platform service.
[0092] Step S6: The batch scanning device decrypts the encrypted data and determines whether the decryption is successful; if it fails, it pulls again; if it is successful, it proceeds to Step S7.
[0093] Step S7: Replace the old component file with the new component file and voice broadcast that the upgrade is successful, reminding the user to restart the device for it to take effect.
[0094] After the batch scanning device starts successfully, the user can access it through the IP address of the batch scanning device using a browser, which is convenient for the user to view data and perform operations. At the same time, through the automatic acquisition of component files by the batch scanning device and the cloud platform server for data update and system upgrade, the system becomes more reliable. When the file is updated, a voice broadcast is initiated to remind the user not to shut down, making the system more user-friendly; the data is not updated immediately after being downloaded and is only updated when restarting, so it will not affect the normal use of the user, and even if the device is shut down during the upgrade, it will not affect the system; the component file is replaced only after the data is pulled, making the system stronger. Even if the device is shut down during the data pulling process, there will be no impact, and the data will be pulled again after restarting.
[0095] In addition, the present invention provides a storage medium, which is a computer-readable storage medium. A batch scanning program is stored on the storage medium, and the batch scanning program can be executed by one or more processors to implement the steps of the above batch scanning method.
[0096] Among them, the memory 22 includes at least one type of readable storage medium. The readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. The memory 22 can be the internal storage unit of the batch scanning device in some embodiments, such as the hard disk of the batch scanning device. The memory 22 can also be an external storage device of the batch scanning device in other embodiments, such as a plug-in hard disk equipped on the batch scanning device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 22 can also include both the internal storage unit and the external storage device of the batch scanning device. The memory 22 can be used not only to store the application software installed on the batch scanning device and various types of data, such as the code of the batch scanning program, but also to temporarily store the data that has been output or will be output.
[0097] In some embodiments, the processor 21 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips, which is used to run the program code stored in the memory 22 or process data, such as executing a batch scanning program, etc.
[0098] Figure 8 Only the batch scanning device with components 21-25 and the batch scanning program is shown. Those skilled in the art can understand that Figure 8 the shown structure does not constitute a limitation on the batch scanning device, and it may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0099] In Figure 8 the shown embodiment of the batch scanning device, a batch scanning program is stored in the memory 22; when the processor 21 executes the batch scanning program stored in the memory 22, the following steps are implemented:
[0100] Collect images;
[0101] Image change detection, perform grayscale edge detection on the collected images to determine whether the images have changed, and determine each changed image as a target image;
[0102] Region of interest (ROI) extraction, find the ROI contour of the target image through calculation of the dense edge line area and extract the ROI image;
[0103] Code recognition, perform code recognition judgment on the ROI image, after the code recognition judgment is successful, intercept the scanning code image according to the ROI image, and call the code recognition interface to recognize the scanning code image to obtain the recognition result;
[0104] Code output, output the recognition result to the specified virtual keyboard module, and simultaneously voice broadcast the number of recognized codes.
[0105] Referring to Figure 11 shown, it is a schematic diagram of the program modules of the batch scanning program in an embodiment of the batch scanning device of the present invention. In this embodiment, the batch scanning program can be divided into a collection module 101, a detection module 102, an extraction module 103, a recognition module 104, and a recognition result output module 105. Exemplarily:
[0106] The collection module 101 is used to collect images;
[0107] The detection module 102 is used for image change detection;
[0108] The extraction module 103 is used for ROI extraction;
[0109] An identification module 104, configured to perform code identification and judgment on the image of the region of interest;
[0110] An identification result output module 105, configured to output the identification result.
[0111] The functions or operation steps implemented when the above-mentioned acquisition module 101, detection module 102, interception module 103, identification module 104, and identification result output module 105 and other program modules are executed are substantially the same as those in the above embodiments, and will not be elaborated here.
[0112] In addition, an embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium, and a batch code scanning program is stored on the storage medium. The batch code scanning program can be executed by one or more processors to implement the following operations:
[0113] Acquire an image;
[0114] Image change detection, perform gray-scale edge detection on the acquired image to determine whether the image has changed, and determine each image that has changed as a target image;
[0115] Region of interest interception, find the contour of the region of interest of the target image through calculation of the dense region of the edge line and extract the image of the region of interest;
[0116] Code identification, perform code identification and judgment on the image of the region of interest. After the code identification and judgment is successful, intercept the code scanning image according to the image of the region of interest, and call the code identification interface to identify the code scanning image to obtain an identification result;
[0117] Code output, output the identification result to a specified virtual keyboard module, and simultaneously voice broadcast the number of codes recognized.
[0118] The specific implementation manner of the storage medium of the present invention is substantially the same as that of each embodiment of the above batch code scanning method and device, and will not be repeated here.
[0119] Specifically, when using the batch code scanning device, install the batch code scanning device under the user's work desk or tabletop and make the transparent cover flush with the tabletop. It is also possible to use the transparent cover of the batch code scanning device as part of the tabletop. When the user needs to scan a code, place multiple items to be scanned, such as commodities, express packages, drugs, etc., place the two-dimensional code or bar code of the item in the imaging area of the batch code scanning device. The imaging module works to acquire an image, and complete the code scanning through the above batch code scanning method, and then directly output in the form of a virtual keyboard through the USB interface or send the identification result to the cloud platform server through the network.
[0120] Compared with the prior art, the batch code scanning method and device provided by the present invention collect images, intercept the region of interest images, and complete batch code scanning through recognition, achieving a one-time code scanning action for multiple types of codes and multiple codes. It is simple to use, has a low implementation cost, speeds up the code scanning speed, and improves the code scanning efficiency.
[0121] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the term "including", "comprising" or any other variant thereof in this article is intended to cover a non-exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such a process, device, article or method. Without more limitations, the element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, device, article or method including the element.
[0122] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a drone, mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0123] Note that the above is only the preferred embodiment of the present invention and the applied technical principle. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A batch scanning method, It is characterized in that include: Collect images; Image change detection, converting the collected image into a grayscale image; Calculate the edge of the grayscale image to obtain an edge map; divide the edge map into several regions; evenly extract regions and compare them with regions corresponding to the previous edge map to obtain image change values of the regions; use the image change value to subtract the image change value obtained by the same method last time to obtain an absolute difference, and save the image change value of this time; take the maximum image change value of all regions as the image change degree of this time; determine whether the image has changed according to the image change degree, and determine each changed image as a target image; Region of interest interception, dividing the target image into a plurality of first regions; calculating the energy value of each first region; the energy value is the contribution value of the edge line to the first region; merging all adjacent first regions with high energy into a second region; and taking the rectangular outline of the second region as the region of interest image; Code recognition, performing code recognition judgment on the image of the area of interest, intercepting a scanned code image according to the image of the area of interest after the code recognition judgment is successful, and calling a code recognition interface to recognize the scanned code image to obtain a recognition result; Code output, output the recognition result to the specified virtual keyboard module, and voice broadcast the number of recognized codes.
2. The batch scanning method according to claim 1, It is characterized in that In the image acquisition step, the acquired image is saved in a file format to a memory file system.
3. The batch scanning method according to claim 1, It is characterized in that The code recognition step includes: detecting changes in the target image, and triggering code recognition when the target image changes; Waiting for the target image to be stable, and triggering searching for an image of the region of interest when the target image is stable; Intercepting a scanned code image according to the image of the area of interest; The scanned code image is tilted and recognized using a corresponding recognition interface to obtain a recognition result.
4. The batch scanning method according to claim 1, It is characterized in that The code output step includes: adding the recognition result to a code chain list; Sorting and removing duplicates from the code chain list; The code chain table data is written to the virtual keyboard module, and the number of recognized codes is announced by voice.
5. The batch scanning method according to claim 4, It is characterized in that The virtual keyboard module transmits the code link table data in the communication format of the keyboard.
6. A batch scanning device, It is characterized in that The batch code scanning device comprises a housing with a receiving space, a circuit board, a camera module, a condenser, an illuminator and a transparent cover; the circuit board and the condenser are received in the receiving space, the condenser is in a regular trumpet-shaped opening, the large end of the trumpet-shaped opening is arranged on the housing and covered by the transparent cover; The lighting lamp is arranged at the edge where the large end of the trumpet-shaped opening intersects the transparent cover and is inclined to illuminate the condenser; an opening is arranged at the small end of the trumpet-shaped opening of the condenser; the camera module is connected to the circuit board; the camera module includes a camera lens, which extends out of the opening and faces the transparent cover; the circuit board includes a processor, a memory, a voice module and an output module, and the memory, voice module and output module are all connected to the processor; the voice module is used to voice broadcast the number of recognized codes; the output module is used to output the scan code recognition results; the memory stores a batch scan code program that can be run on the processor, and when the batch scan code program is executed by the processor, the steps of the batch scan code method as described in any one of claims 1 to 5 are implemented.
7. The batch code scanning device according to claim 6, It is characterized in that The batch code scanning device also includes a power module, which is connected to the lighting lamp and the circuit board to provide power.
8. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, on which a batch code scanning program is stored. The batch code scanning program can be executed by one or more processors to implement the steps of the batch code scanning method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Scan-based imaging with variable scan speed using predictions of region-of-interest positions
US20180246309A1
Multi-region image scanning
US20200218924A1