TWI827423B - Scanning method and related devices - Google Patents

Scanning method and related devices Download PDF

Info

Publication number
TWI827423B
TWI827423B TW111150284A TW111150284A TWI827423B TW I827423 B TWI827423 B TW I827423B TW 111150284 A TW111150284 A TW 111150284A TW 111150284 A TW111150284 A TW 111150284A TW I827423 B TWI827423 B TW I827423B
Authority
TW
Taiwan
Prior art keywords
image
barcodes
scanning
scanned
shooting
Prior art date
Application number
TW111150284A
Other languages
Chinese (zh)
Other versions
TW202427240A (en
Inventor
辜炳翰
Original Assignee
大陸商信揚科技(佛山)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 大陸商信揚科技(佛山)有限公司 filed Critical 大陸商信揚科技(佛山)有限公司
Priority to TW111150284A priority Critical patent/TWI827423B/en
Application granted granted Critical
Publication of TWI827423B publication Critical patent/TWI827423B/en
Publication of TW202427240A publication Critical patent/TW202427240A/en

Links

Images

Landscapes

  • Image Input (AREA)

Abstract

The present application provides a scanning method and related devices. The method includes: obtain a total number of a plurality of barcodes; acquiring a first image of the barcodes by using a camera device, scanning the first image, and determining a first number of scanned barcodes and corresponding first positions; when the first number is less than the total number, adjusting shooting parameters corresponding to the camera device from a first value to a second value, and scanning a second image obtained by using the camera device; determining a second number of scanned barcodes and corresponding second positions; when the first positions are different from the second positions, calculating a first sum of the first number and the second number; when the first sum is equal to the total number, determining a target scanning result according to the first image and the second image. The application can improve a scanning efficiency and reduce a scanning cost.

Description

掃描方法及相關設備 Scanning methods and related equipment

本發明涉及圖像識別技術領域,尤其涉及一種掃描方法及相關設備。 The present invention relates to the field of image recognition technology, and in particular, to a scanning method and related equipment.

條碼(Barcode)是將寬度不等的多個黑條和空白,按照一定的編碼規則排列,用以表達一組資訊的圖形識別字。通常採用鐳射刻印的方式製作條碼,在同時掃描多個條碼時,容易受到光線的影響,難以同時掃描成功多個條碼。例如,承載多個條碼的材質(例如,鋼片、軟性絕緣基材製成的PCB(Printed Circuit Board)板)不同,導致掃描時反射光的亮度不同,往往需要另外購買多相機或多個掃描器分別進行掃描,無法利用單個拍攝裝置同時掃描多個條碼,造成掃描效率低且成本較高。 Barcode is a graphic identification word that expresses a set of information by arranging multiple black bars and blanks of varying widths according to certain coding rules. Barcodes are usually produced using laser engraving. When scanning multiple barcodes at the same time, they are easily affected by light, making it difficult to successfully scan multiple barcodes at the same time. For example, the materials that carry multiple barcodes (for example, steel sheets, PCB (Printed Circuit Board) boards made of soft insulating substrates) are different, resulting in different brightness of reflected light during scanning. It is often necessary to purchase multiple cameras or multiple scanners. Scanners are scanned separately, and it is impossible to use a single shooting device to scan multiple barcodes at the same time, resulting in low scanning efficiency and high cost.

本申請實施例公開了一種掃描方法及相關設備,解決了同時掃描多個條碼時,掃描效率低的技術問題。 The embodiment of the present application discloses a scanning method and related equipment, which solves the technical problem of low scanning efficiency when scanning multiple barcodes at the same time.

本申請提供一種掃描方法,所述方法包括:獲取多個條碼的總數量;利用拍攝裝置對所述多個條碼進行拍攝,得到第一圖像;對所述第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置;在所述第一數量小於所述總數量時,將所述拍攝裝置對應的拍攝參數從第一值調整為第二值;利用調整後的拍攝裝置對所述多個條碼進行拍攝,得到第二圖像;對所述第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對 應的第二位置;在所述第一位置與所述第二位置不相同時,計算所述第一數量以及第二數量的第一總和;在所述第一總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 The present application provides a scanning method. The method includes: obtaining the total number of multiple barcodes; using a photographing device to photograph the multiple barcodes to obtain a first image; scanning the first image to determine the scanning The first number of barcodes received and the first position corresponding to the scanned barcode; when the first number is less than the total number, adjusting the shooting parameter corresponding to the shooting device from the first value to the second value; Use the adjusted shooting device to photograph the plurality of barcodes to obtain a second image; scan the second image to determine the second number of scanned barcodes and the pair of scanned barcodes. the corresponding second position; when the first position and the second position are different, calculate the first sum of the first quantity and the second quantity; when the first sum is equal to the total quantity, According to the first image and the second image, a target scanning result is determined.

在一些可選的實施方式中,所述根據所述第一圖像以及所述第二圖像,確定目標掃描結果,包括:獲取對所述第一圖像中的條碼的第一掃描結果;獲取對所述第二圖像中的條碼的第二掃描結果;將所述第一掃描結果以及所述第二掃描結果,作為所述目標掃描結果。 In some optional implementations, determining the target scan result based on the first image and the second image includes: obtaining a first scan result of the barcode in the first image; Obtain a second scan result of the barcode in the second image; use the first scan result and the second scan result as the target scan result.

在一些可選的實施方式中,若所述第一位置與所述第二位置中存在至少一個相同的位置,確定相同位置的第三數量;計算所述第一數量以及所述第三數量的第一差值;計算所述第二數量以及所述第三數量的第二差值;計算所述第三數量、所述第一差值以及所述第二差值的第二總和;在所述第二總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 In some optional implementations, if there is at least one identical position among the first position and the second position, determine a third number of the same positions; calculate the first number and the third number a first difference; calculate the second difference between the second quantity and the third quantity; calculate a second sum of the third quantity, the first difference and the second difference; When the second sum is equal to the total number, a target scanning result is determined based on the first image and the second image.

在一些可選的實施方式中,在所述第二總和小於所述總數量時,將所述拍攝參數從所述第二值調整為第三值,重新掃描所述多個條碼,直至成功掃描所有的條碼。 In some optional implementations, when the second sum is less than the total number, the shooting parameter is adjusted from the second value to a third value, and the multiple barcodes are rescanned until the scan is successful. All barcodes.

在一些可選的實施方式中,在所述第一數量等於所述總數量時,將對所述第一圖像的第一掃描結果作為所述目標掃描結果。 In some optional implementations, when the first number is equal to the total number, the first scan result of the first image is used as the target scan result.

在一些可選的實施方式中,所述獲取多個條碼的總數量,包括:利用預設的目標檢測演算法對所述多個條碼進行識別,利用矩形框框選每個條碼;計算所有矩形框的數量作為所述總數量。 In some optional implementations, obtaining the total number of multiple barcodes includes: using a preset target detection algorithm to identify the multiple barcodes, using rectangular frames to select each barcode; calculating all rectangular frames quantity as the total quantity.

在一些可選的實施方式中,所述拍攝參數包括多角度光照強度值。 In some optional implementations, the shooting parameters include multi-angle illumination intensity values.

本申請還提供一種掃描裝置,所述裝置包括:獲取模組,用於獲取多個條碼的總數量;第一拍攝模組,用於利用拍攝裝置對所述多個條碼進行拍攝,得到第一圖像;第一掃描模組,用於對所述第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置;調整模組,用於在所 述第一數量小於所述總數量時,將所述拍攝裝置對應的拍攝參數從第一值調整為第二值;第二拍攝模組,用於利用調整後的拍攝裝置對所述多個條碼進行拍攝,得到第二圖像;第二掃描模組,用於對所述第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置;計算模組,用於在所述第一位置與所述第二位置不相同時,計算所述第一數量以及第二數量的第一總和;確定模組,用於在所述第一總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 The application also provides a scanning device. The device includes: an acquisition module, used to obtain the total number of multiple barcodes; a first photographing module, used to use a photographing device to photograph the plurality of barcodes to obtain the first image; a first scanning module for scanning the first image and determining the first number of scanned barcodes and the first position corresponding to the scanned barcode; an adjustment module for scanning the first image When the first quantity is less than the total quantity, the shooting parameters corresponding to the shooting device are adjusted from the first value to the second value; the second shooting module is used to use the adjusted shooting device to capture the plurality of barcodes. Photographing is performed to obtain a second image; a second scanning module is used to scan the second image and determine the second number of scanned barcodes and the second position corresponding to the scanned barcode; and the calculation module , used to calculate the first sum of the first quantity and the second quantity when the first position and the second position are different; a determination module, used to calculate the first sum of the first quantity and the second quantity when the first sum is equal to the total number When measuring, a target scanning result is determined based on the first image and the second image.

本申請還提供一種電子設備,所述電子設備包括處理器和記憶體,所述處理器用於執行所述記憶體中存儲的電腦程式時實現所述的掃描方法。 This application also provides an electronic device. The electronic device includes a processor and a memory. The processor is configured to implement the scanning method when executing a computer program stored in the memory.

本申請還提供一種電腦可讀存儲介質,所述電腦可讀存儲介質上存儲有電腦程式,所述電腦程式被處理器執行時實現所述的掃描方法。 This application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the scanning method is implemented.

在本申請提供的掃描方法中,藉由對拍攝得到的圖像進行掃描,得到目標掃描結果,其中,在掃描得到的第一數量小於總數量時,將拍攝參數從第一值調整到第二值,重新對多個條碼進行拍攝,在得到第二圖像之後,對第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置,如果第一位置和第二位置不相同,表明沒有出現重複掃描的情況,在沒有出現重複掃描的情況時,計算第一數量以及第二數量的第一總和,在第一總和等於總數量時,可以根據第一圖像以及第二圖像,確定目標掃描結果。本申請能夠根據至少一次掃描得到目標掃描結果,提高了同時掃描多個條碼的效率以及降低了掃描成本。 In the scanning method provided by this application, the target scanning result is obtained by scanning the photographed image, wherein when the first number obtained by scanning is less than the total number, the photographing parameter is adjusted from the first value to the second value. value, re-photograph multiple barcodes, and after obtaining the second image, scan the second image to determine the second number of scanned barcodes and the second position corresponding to the scanned barcode. If the first position It is different from the second position, indicating that there is no repeated scanning. When there is no repeated scanning, the first sum of the first quantity and the second quantity is calculated. When the first sum is equal to the total quantity, the first sum can be calculated according to the first image as well as the second image to determine the target scan results. This application can obtain target scanning results based on at least one scan, improves the efficiency of scanning multiple barcodes at the same time and reduces scanning costs.

1:電子設備 1: Electronic equipment

11:通信匯流排 11: Communication bus

12:儲存器 12:Storage

13:處理器 13: Processor

14:拍攝裝置 14: Shooting device

S21~S28:步驟 S21~S28: Steps

8:掃描裝置 8: Scanning device

801:獲取模組 801: Get module

802:第一拍攝模組 802:The first shooting module

803:第一掃描模組 803: First scanning module

804:調整模組 804:Adjust module

805:第二拍攝模組 805: Second shooting module

806:第二掃描模組 806: Second scanning module

807:計算模組 807:Computing module

808:確定模組 808: Confirm module

圖1是本申請實施例提供的掃描方法的應用環境架構圖。 Figure 1 is an application environment architecture diagram of the scanning method provided by the embodiment of the present application.

圖2是本申請實施例提供的掃描方法的流程圖。 Figure 2 is a flow chart of a scanning method provided by an embodiment of the present application.

圖3是本申請實施例提供的第一圖像掃描示意圖。 Figure 3 is a schematic diagram of a first image scanning provided by an embodiment of the present application.

圖4是本申請另一實施例提供的第一圖像掃描示意圖。 Figure 4 is a schematic diagram of a first image scanning provided by another embodiment of the present application.

圖5是本申請實施例提供的第二圖像掃描示意圖。 Figure 5 is a schematic diagram of a second image scanning provided by an embodiment of the present application.

圖6是本申請實施例提供的掃描結果示意圖。 Figure 6 is a schematic diagram of scanning results provided by an embodiment of the present application.

圖7是本申請另一實施例提供的掃描示意圖。 Figure 7 is a schematic diagram of scanning provided by another embodiment of the present application.

圖8是本申請實施例提供的掃描裝置的結構示意圖。 Figure 8 is a schematic structural diagram of a scanning device provided by an embodiment of the present application.

為了便於理解,示例性的給出了部分與本申請實施例相關概念的說明以供參考。 To facilitate understanding, some descriptions of concepts related to the embodiments of the present application are exemplarily provided for reference.

需要說明的是,本申請中“至少一個”是指一個或者多個,“多個”是指兩個或多於兩個。“和/或”,描述關聯物件的關聯關係,表示可以存在三種關係,例如,A和/或B可以表示:單獨存在A,同時存在A和B,單獨存在B的情況,其中A,B可以是單數或者複數。本申請的說明書和請求項書及附圖中的術語“第一”、“第二”、“第三”、“第四”等(如果存在)是用於區別類似的物件,而不是用於描述特定的順序或先後次序。 It should be noted that “at least one” in this application refers to one or more, and “multiple” refers to two or more than two. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can Is singular or plural. The terms "first", "second", "third", "fourth", etc. (if present) in the description, claims and drawings of this application are used to distinguish similar objects, rather than to Describe a specific order or sequence.

條碼(Barcode)是將寬度不等的多個黑條和空白,按照一定的編碼規則排列,用以表達一組資訊的圖形識別字。通常採用鐳射刻印的方式製作條碼,在同時掃描多個條碼時,容易受到光線的影響,難以同時掃描成功多個條碼。例如,承載多個條碼的材質(例如,鋼片、軟性絕緣基材製成的PCB(Printed Circuit Board)板)不同,導致掃描時反射光的亮度不同,往往需要另外購買多相機或多個掃描器分別進行掃描,無法利用單個拍攝裝置同時掃描多個條碼,造成掃描效率低且成本較高。 Barcode is a graphic identification word that expresses a set of information by arranging multiple black bars and blanks of varying widths according to certain coding rules. Barcodes are usually produced using laser engraving. When scanning multiple barcodes at the same time, they are easily affected by light, making it difficult to successfully scan multiple barcodes at the same time. For example, the materials that carry multiple barcodes (for example, steel sheets, PCB (Printed Circuit Board) boards made of soft insulating substrates) are different, resulting in different brightness of reflected light during scanning. It is often necessary to purchase multiple cameras or multiple scanners. Scanners are scanned separately, and it is impossible to use a single shooting device to scan multiple barcodes at the same time, resulting in low scanning efficiency and high cost.

為了解決同時掃描多個條碼時,掃描效率低的技術問題,以及為了更好地理解本申請實施例提供的掃描方法及相關設備,下面首先對本申請掃描方法的應用場景進行描述。 In order to solve the technical problem of low scanning efficiency when scanning multiple barcodes at the same time, and to better understand the scanning method and related equipment provided by the embodiments of the present application, the application scenarios of the scanning method of the present application are first described below.

圖1是本申請實施例提供的掃描方法的應用環境架構圖。本申請實施例提供的掃描方法應用於電子設備1中,所述電子設備1包括,但不限於, 藉由通信匯流排11互相通信連接的儲存器12、至少一個處理器13以及拍攝裝置14。 Figure 1 is an application environment architecture diagram of the scanning method provided by the embodiment of the present application. The scanning method provided by the embodiment of the present application is applied to electronic equipment 1. The electronic equipment 1 includes, but is not limited to, The storage 12, at least one processor 13 and the photographing device 14 are communicatively connected to each other through the communication bus 11.

所述電子設備1可以是手機、電腦等。 The electronic device 1 may be a mobile phone, a computer, etc.

所述拍攝裝置14可以是掃描器、也可以是具有掃描功能的拍攝裝置。 The photographing device 14 may be a scanner or a photographing device with a scanning function.

所述示意圖1僅僅是電子設備1的示例,並不構成對電子設備1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如電子設備1還可以包括輸入輸出設備、網路接入設備等。 The schematic diagram 1 is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1. It may include more or less components than shown in the figure, or combine certain components, or different components, such as the electronic device 1 It can also include input and output devices, network access devices, etc.

請參閱圖2所示,圖2是本申請實施例提供的掃描方法的流程圖,應用在電子設備(例如圖1的電子設備1)中。根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。 Please refer to FIG. 2 . FIG. 2 is a flow chart of a scanning method provided by an embodiment of the present application, which is applied in an electronic device (such as the electronic device 1 in FIG. 1 ). Depending on different needs, the order of steps in this flowchart can be changed and some steps can be omitted.

S21,獲取多個條碼的總數量。 S21, obtain the total quantity of multiple barcodes.

在本申請的一些實施例中,多個條碼的位置可以是固定的,可以是安裝或黏貼在不同的裝置或者設備上。可以利用預設的目標檢測演算法對多個條碼進行識別,利用矩形框框選每個條碼,計算所有矩形框的數量作為多個條碼對應的總數量,以便後續判斷是否所有的條碼均被掃描到。 In some embodiments of the present application, the positions of multiple barcodes may be fixed, and may be installed or pasted on different devices or equipment. You can use the preset target detection algorithm to identify multiple barcodes, use rectangular frames to select each barcode, and calculate the number of all rectangular frames as the total number corresponding to multiple barcodes, so that you can subsequently determine whether all barcodes have been scanned. .

具體地,目標檢測演算法可以是長短期記憶網路(Long Short-Term Memory,LSTM)、迴圈神經網路(Recurrent Neural Network,RNN)、卷積神經網路(Convolutional Neural Networks,CNN)中的一種或多種組合。利用目標檢測演算法在檢測的過程中,採用矩形框框選出每個條碼,根據框選的位置可以確定條碼的位置,以及根據矩形框的數量可以確定條碼的總數量。 Specifically, the target detection algorithm can be Long Short-Term Memory (LSTM), Recurrent Neural Network (RNN), or Convolutional Neural Networks (CNN). one or more combinations. During the detection process, the target detection algorithm is used to select each barcode using a rectangular frame. The position of the barcode can be determined based on the position of the frame selection, and the total number of barcodes can be determined based on the number of rectangular frames.

S22,利用拍攝裝置對多個條碼進行拍攝,得到第一圖像。 S22: Use a photographing device to photograph multiple barcodes to obtain a first image.

在本申請的一些實施例中,拍攝裝置可以是具有掃描功能的拍攝裝置,在掃描之前,先拍攝多個條碼的第一圖像,第一圖像中包含所有要掃描的條碼,其中,在拍攝時,所有的條碼均在拍攝範圍之內,拍攝裝置可以固定在任意位置對所有的條碼進行拍攝。 In some embodiments of the present application, the photographing device may be a photographing device with a scanning function. Before scanning, first images of multiple barcodes are captured, and the first image contains all the barcodes to be scanned, wherein, in When shooting, all barcodes are within the shooting range, and the shooting device can be fixed at any position to shoot all barcodes.

若拍攝出的圖像的清晰度小於預設清晰度,可以重新對多個條碼進行拍攝,直至拍攝出的圖像的清晰度大於預設清晰度,將大於預設清晰度的圖像作為第一圖像,並記錄拍攝第一圖像的拍攝參數。 If the resolution of the captured image is lower than the preset resolution, multiple barcodes can be captured again until the resolution of the captured image is greater than the preset resolution, and the image greater than the preset resolution will be used as the third barcode. an image, and record the shooting parameters for shooting the first image.

S23,對第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置。 S23: Scan the first image to determine the first number of scanned barcodes and the first position corresponding to the scanned barcode.

在本申請的一些實施例中,在得到第一圖像以後,對第一圖像進行掃描,即,對第一圖像中的多個條碼進行識別。每個條碼中均包含有設備或裝置的相關資訊,還可以包括其他自訂的信息,例如,一串數位。在對第一圖像進行掃描以後,在條碼相應的位置上顯示出相關資訊,則認為該條碼掃描成功,計算掃描到的條碼的第一數量以及掃描到的條碼的第一位置。 In some embodiments of the present application, after obtaining the first image, the first image is scanned, that is, multiple barcodes in the first image are identified. Each barcode contains information about the device or device and can also include other customized information, such as a string of digits. After the first image is scanned and relevant information is displayed at the corresponding position of the barcode, it is considered that the barcode was successfully scanned, and the first number of scanned barcodes and the first position of the scanned barcode are calculated.

例如,在一些示例中,圖3是本申請實施例提供的第一圖像掃描示意圖,如圖3所示,假設每個條碼中均包含一串數位,每個條碼中包含的數位可以不同,一共有6個條碼以及6個條碼對應的6個位置,分別為位置A1、位置A2、位置A3、位置A4、位置A5以及位置A6。在對第一圖像掃描以後,掃描到了第二個條碼以及第五個條碼,即,在位置A2以及位置A5分別出現了一串數字,因此,第一數量為2,第一位置包括位置A2以及位置A5。 For example, in some examples, Figure 3 is a schematic diagram of the first image scanning provided by an embodiment of the present application. As shown in Figure 3, assuming that each barcode contains a string of digits, the digits contained in each barcode can be different. There are a total of 6 barcodes and 6 positions corresponding to the 6 barcodes, namely position A1, position A2, position A3, position A4, position A5 and position A6. After scanning the first image, the second barcode and the fifth barcode were scanned, that is, a string of numbers appeared at position A2 and position A5 respectively. Therefore, the first number is 2, and the first position includes position A2. and location A5.

S24,在第一數量小於總數量時,將拍攝裝置對應的拍攝參數從第一值調整為第二值。 S24: When the first quantity is less than the total quantity, adjust the shooting parameter corresponding to the shooting device from the first value to the second value.

在本申請的一些實施例中,如圖3所示,第一數量為2,總數量為6,2<6,即,第一數量小於總數量,表明此時的拍攝參數未能識別出所有的條碼,將第一圖像以及相應的第一數量、第一位置進行存儲。對拍攝裝置的拍攝參數進行調節,拍攝參數包括多角度光照強度值,增大多角度光照強度值,即,將拍攝參數從第一值調整為第二值,其中,第二值大於第一值。 In some embodiments of the present application, as shown in Figure 3, the first quantity is 2, the total quantity is 6, 2<6, that is, the first quantity is less than the total quantity, indicating that the shooting parameters at this time cannot identify all The barcode stores the first image and the corresponding first quantity and first position. Adjust the shooting parameters of the shooting device. The shooting parameters include multi-angle illumination intensity values. Increase the multi-angle illumination intensity values, that is, adjust the shooting parameters from the first value to the second value, where the second value is greater than the first value.

在本申請的另一些實施例中,圖4是本申請另一實施例提供的第一圖像掃描示意圖,如圖4所示,一共有6個條碼以及對應的6個位置,分別為位置A1、位置A2、位置A3、位置A4、位置A5以及位置A6。在對第一圖像 掃描以後,掃描到了所有的條碼,即,所有的條碼均出現了一串數字,此時,第一數量等於總數量,表明所有的條碼均掃描成功,記錄拍攝裝置的拍攝參數,並將對第一圖像的第一掃描結果作為目標掃描結果。 In other embodiments of the present application, Figure 4 is a schematic diagram of the first image scanning provided by another embodiment of the present application. As shown in Figure 4, there are a total of 6 barcodes and corresponding 6 positions, respectively position A1 , position A2, position A3, position A4, position A5 and position A6. on the first image After scanning, all barcodes are scanned, that is, a string of numbers appears in all barcodes. At this time, the first quantity is equal to the total quantity, indicating that all barcodes are scanned successfully. The shooting parameters of the shooting device are recorded, and the third number is The first scan result of an image is used as the target scan result.

S25,利用調整後的拍攝裝置對多個條碼進行拍攝,得到第二圖像。 S25: Use the adjusted shooting device to shoot multiple barcodes to obtain a second image.

在本申請的一些實施例中,在確定將拍攝參數從第一值調整為第二值以後,利用拍攝裝置重新對多個條碼進行拍攝,若拍攝出的圖像的清晰度小於預設清晰度,可以重新設置第二值,直至拍攝出的圖像的清晰度大於預設清晰度,將大於預設清晰度的圖像作為第二圖像,並記錄此時的第二值。 In some embodiments of the present application, after it is determined to adjust the shooting parameters from the first value to the second value, the shooting device is used to re-shoot multiple barcodes. If the resolution of the captured image is less than the preset resolution , the second value can be reset until the resolution of the captured image is greater than the preset resolution, and the image greater than the preset resolution is used as the second image, and the second value at this time is recorded.

S26,對第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置。 S26: Scan the second image to determine the second number of scanned barcodes and the second position corresponding to the scanned barcode.

在本申請的一些實施例中,在得到第二圖像以後,對第二圖像進行掃描,即,對第二圖像中的多個條碼進行識別。 In some embodiments of the present application, after obtaining the second image, the second image is scanned, that is, multiple barcodes in the second image are identified.

例如,在一些示例中,圖5是本申請實施例提供的第二圖像掃描示意圖,如圖5所示,假設每個條碼中均包含一串數位,每個條碼中包含的數位可以不同,其中,數位僅是示例,可以根據實際情況從條碼中獲取對應的資訊。如圖5所示,一共有6個條碼以及6個條碼對應的6個位置,分別為位置A1、位置A2、位置A3、位置A4、位置A5以及位置A6。在對第二圖像掃描以後,位置A1、位置A3、位置A4以及位置A6出現了一串數字,因此,第二數量為4,第二位置包括位置A1、位置A3、位置A4以及位置A6。由於第二值大於第一值,假設位置A2以及位置A5距離拍攝裝置最近,可能會出現曝光等問題,導致無法識別到位置A2以及位置A5。 For example, in some examples, Figure 5 is a schematic diagram of a second image scanning provided by an embodiment of the present application. As shown in Figure 5, assuming that each barcode contains a string of digits, the digits contained in each barcode can be different. Among them, the digits are just examples, and the corresponding information can be obtained from the barcode according to the actual situation. As shown in Figure 5, there are a total of 6 barcodes and 6 positions corresponding to the 6 barcodes, namely position A1, position A2, position A3, position A4, position A5 and position A6. After scanning the second image, a series of numbers appear at positions A1, A3, A4 and A6. Therefore, the second number is 4, and the second position includes positions A1, A3, A4 and A6. Since the second value is greater than the first value, assuming that the position A2 and the position A5 are closest to the shooting device, problems such as exposure may occur, resulting in the failure to identify the position A2 and the position A5.

S27,在第一位置與第二位置不相同時,計算第一數量以及第二數量的第一總和。 S27: When the first position and the second position are different, calculate the first sum of the first quantity and the second quantity.

在本申請的一些實施例中,如圖3以及圖5所示,圖3中的第一位置包括位置A2以及位置A5,圖5中的第二位置包括位置A1、位置A3、位置A4以及位置A6,即,第一位置與第二位置不相同。獲取得到第一數量為2以 及第二數量為4,計算第一數量以及第二數量的第一總和為6。 In some embodiments of the present application, as shown in Figures 3 and 5, the first position in Figure 3 includes position A2 and position A5, and the second position in Figure 5 includes position A1, position A3, position A4 and position A6, that is, the first position and the second position are not the same. Get the first quantity to be 2 or less and the second quantity is 4, calculate the first sum of the first quantity and the second quantity to be 6.

在本申請的另一實施例中,假設第一位置包括位置A2以及位置A5,第二位置包括位置A1、位置A3以及位置A4,此時,第一位置和第二位置不相同,並且,此時的第一數量為2,第二數量為3,根據第一數量以及第二數量計算得到第一總和為5。 In another embodiment of the present application, assume that the first position includes position A2 and position A5, and the second position includes position A1, position A3, and position A4. At this time, the first position and the second position are different, and, this When the first quantity is 2 and the second quantity is 3, the first sum calculated based on the first quantity and the second quantity is 5.

S28,在第一總和等於總數量時,根據第一圖像以及第二圖像,確定目標掃描結果。 S28: When the first sum is equal to the total quantity, determine the target scanning result based on the first image and the second image.

在本申請的一些實施例中,在計算得到第一總和以後,為了判斷所有的條碼是否全部掃描成功,比較第一總和以及總數量的大小,在第一總和等於總數量時,根據第一圖像以及第二圖像,確定目標掃描結果。 In some embodiments of the present application, after the first sum is calculated, in order to determine whether all barcodes have been successfully scanned, the first sum and the total quantity are compared. When the first sum is equal to the total quantity, according to the first figure image and the second image to determine the target scan result.

例如,在一些示例中,圖6是本申請實施例提供的掃描結果示意圖,如圖6所示,根據第一圖像以及第二圖像,確定目標掃描結果,包括:獲取對第一圖像中的條碼的第一掃描結果以及對第二圖像中的條碼的第二掃描結果,結合第一掃描結果以及第二掃描結果,作為目標掃描結果。 For example, in some examples, Figure 6 is a schematic diagram of a scan result provided by an embodiment of the present application. As shown in Figure 6, determining the target scan result based on the first image and the second image includes: obtaining a pair of the first image The first scan result of the barcode in and the second scan result of the barcode in the second image are combined with the first scan result and the second scan result as the target scan result.

本實施例能夠根據調節拍攝參數的值,獲取不同的掃描結果(如,第一掃描結果、第二掃描結果),結合不同的掃描結果可以得到目標掃描結果,本申請可以針對同一型號的不同產品(該產品包含多個條碼)進行批量掃描,在對另一產品掃描時,可以相應調節拍攝參數,在拍攝得到第一圖像以後,可以先對第一圖像的第一掃描結果進行存儲,在拍攝完第二圖像,並且對第二圖像進行掃描以後,得到第二掃描結果,再將第一掃描結果以及第二掃描結果進行展示,其中,第一圖像和第二圖像的拍攝參數可以是自動設置的,也可以是人為設置的。本申請能夠在一定程度上提高對多個條碼的掃描效率。 This embodiment can obtain different scanning results (such as the first scanning result, the second scanning result) according to adjusting the value of the shooting parameter. The target scanning result can be obtained by combining the different scanning results. This application can target different products of the same model. (This product contains multiple barcodes) perform batch scanning. When scanning another product, the shooting parameters can be adjusted accordingly. After the first image is captured, the first scan result of the first image can be stored first. After shooting the second image and scanning the second image, the second scan result is obtained, and then the first scan result and the second scan result are displayed, where the first scan result and the second scan result are Shooting parameters can be set automatically or manually. This application can improve the scanning efficiency of multiple barcodes to a certain extent.

在本申請的另一些實施例中,假設第一位置以及第二位置中存在至少一個相同的位置,確定相同位置的第三數量,計算第一數量以及第三數量的第一差值,計算第二數量以及第三數量的第二差值,根據第三數量、第一差值以及第二差值,計算第二總和,在第二總和等於總數量時,根據第一圖像以及 第二圖像,確定目標掃描結果。 In other embodiments of the present application, it is assumed that there is at least one identical position in the first position and the second position, a third quantity of the same position is determined, a first difference between the first quantity and the third quantity is calculated, and a third quantity is calculated. The second difference between the two quantities and the third quantity is calculated according to the third quantity, the first difference and the second difference. When the second sum is equal to the total quantity, the second sum is calculated according to the first image and the second difference. The second image determines the target scan results.

例如,在一些示例中,圖7是本申請另一實施例提供的掃描示意圖,如圖7所示,掃描到的第一位置包括位置A2、位置A3以及位置A5,如圖5所示,掃描到的第二位置包括位置A1、位置A3、位置A4以及位置A6,第一位置和第二位置中,位置A3是重複掃描到的,此時,總數量為6、第三數量為1、第一數量為3、第二數量為4。 For example, in some examples, Figure 7 is a scanning schematic diagram provided by another embodiment of the present application. As shown in Figure 7, the first position scanned includes position A2, position A3 and position A5. As shown in Figure 5, the scanned The second position reached includes position A1, position A3, position A4 and position A6. Among the first and second positions, position A3 is repeatedly scanned. At this time, the total number is 6, the third number is 1, and the third number is 1. The first quantity is 3 and the second quantity is 4.

根據第一數量以及第三數量計算第一差值,則,第一差值為2。 The first difference is calculated based on the first quantity and the third quantity. Then, the first difference is 2.

根據第二數量以及第三數量計算第二差值,則,第二差值為3。 The second difference is calculated based on the second quantity and the third quantity, then the second difference is 3.

根據第三數量、第一差值以及第二差值,計算第二總和,則,第二總和為6。 Calculate the second sum based on the third quantity, the first difference, and the second difference. Then, the second sum is 6.

由於第二總和6等於總數量6,則,根據第一圖像以及第二圖像,確定目標掃描結果,即,結合圖7以及圖5,得到目標掃描結果(如圖4)。 Since the second sum 6 is equal to the total number 6, the target scan result is determined based on the first image and the second image, that is, the target scan result is obtained by combining FIG. 7 and FIG. 5 (as shown in FIG. 4).

在另一些示例中,第一位置可以包括A2、位置A3、位置A5以及位置A6,第二位置可以包括位置A1、位置A3、位置A4以及位置A6,則,位置A3以及位置A6是重複掃描到的,則,第三數量為2,第一數量為4,第二數量為4,計算得到第一差值為2、第二差值為2、第二總和為6。 In other examples, the first position may include position A2, position A3, position A5, and position A6, and the second position may include position A1, position A3, position A4, and position A6. Then, position A3 and position A6 are repeatedly scanned to , then the third quantity is 2, the first quantity is 4, and the second quantity is 4. The calculated first difference is 2, the second difference is 2, and the second sum is 6.

以上僅是示例,根據實際的掃描情況,確定第三數量的值。 The above are only examples, and the value of the third quantity is determined according to the actual scanning situation.

在本申請的另一些實施例中,若第二總和小於總數量,表明還沒有完成全部條碼的掃描,此時,需要進一步調整拍攝參數,將拍攝參數從第二值調整為第三值,其中,第三值大於第二值,即,增大多角度光照強度,以便更好的進行拍攝以及掃描。在將拍攝參數調整到第三值以後,重新對多個條碼進行掃描,直至成功掃描到所有的條碼。 In other embodiments of the present application, if the second sum is less than the total quantity, it indicates that the scanning of all barcodes has not been completed. At this time, the shooting parameters need to be further adjusted from the second value to the third value, where , the third value is greater than the second value, that is, the multi-angle illumination intensity is increased for better shooting and scanning. After adjusting the shooting parameters to the third value, scan multiple barcodes again until all barcodes are successfully scanned.

本實施例可以相應調節拍攝參數,在拍攝得到第一圖像以後,可以先對第一圖像的第一掃描結果進行存儲,在拍攝完第二圖像,並且對第二圖像進行掃描以後,得到第二掃描結果,在得到第一掃描結果以及第二掃描結果以後,判斷是否全部掃描完成,如果還未掃描完成,繼續調整拍攝參數,直至全 部掃描完成,在掃描完成以後,記錄產品型號以及相應的拍攝參數。在對同一型號的另一產品掃描時,可以根據獲取得到的拍攝參數對相同型號的產品進行掃描,以提高批量獲取條碼相應資訊的效率。 In this embodiment, the shooting parameters can be adjusted accordingly. After the first image is captured, the first scan result of the first image can be stored first. After the second image is captured and the second image is scanned, , get the second scan result. After getting the first scan result and the second scan result, judge whether all scans are completed. If the scan has not been completed, continue to adjust the shooting parameters until all scans are completed. After the scan is completed, the product model and corresponding shooting parameters are recorded. When scanning another product of the same model, the product of the same model can be scanned based on the obtained shooting parameters to improve the efficiency of obtaining barcode corresponding information in batches.

圖8是本申請實施例提供的掃描裝置8的結構示意圖。如圖8所示,在本申請實施例中,掃描裝置8根據其所執行的功能,可以被劃分為多個功能模組。所述功能模組可以包括:獲取模組801、第一拍攝模組802、第一掃描模組803、調整模組804、第二拍攝模組805、第二掃描模組806、計算模組807、確定模組808。 FIG. 8 is a schematic structural diagram of the scanning device 8 provided by the embodiment of the present application. As shown in FIG. 8 , in this embodiment of the present application, the scanning device 8 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 801, a first photography module 802, a first scanning module 803, an adjustment module 804, a second photography module 805, a second scanning module 806, and a calculation module 807. , determine module 808.

獲取模組801,用於獲取多個條碼的總數量;第一拍攝模組802,用於利用拍攝裝置對所述多個條碼進行拍攝,得到第一圖像;第一掃描模組803,用於對所述第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置;調整模組804,用於在所述第一數量小於所述總數量時,將所述拍攝裝置對應的拍攝參數從第一值調整為第二值;第二拍攝模組805,用於利用調整後的拍攝裝置對所述多個條碼進行拍攝,得到第二圖像;第二掃描模組806,用於對所述第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置;計算模組807,用於在所述第一位置與所述第二位置不相同時,計算所述第一數量以及第二數量的第一總和;確定模組808,用於在所述第一總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 The acquisition module 801 is used to obtain the total number of multiple barcodes; the first shooting module 802 is used to use a shooting device to shoot the multiple barcodes to obtain a first image; the first scanning module 803 is used to To scan the first image and determine the first number of scanned barcodes and the first position corresponding to the scanned barcode; the adjustment module 804 is used to adjust the module 804 when the first number is less than the total number. , adjust the shooting parameters corresponding to the shooting device from the first value to the second value; the second shooting module 805 is used to use the adjusted shooting device to shoot the plurality of barcodes to obtain a second image; The second scanning module 806 is used to scan the second image and determine the second number of scanned barcodes and the second position corresponding to the scanned barcode; the calculation module 807 is used to scan the second image. When a position is different from the second position, calculate the first sum of the first quantity and the second quantity; the determination module 808 is used to calculate the first sum according to the total quantity when the first sum is equal to the total quantity. The first image and the second image determine the target scanning result.

在一些可選的實施方式中,所述根據所述第一圖像以及所述第二圖像,確定目標掃描結果,包括:獲取對所述第一圖像中的條碼的第一掃描結果;獲取對所述第二圖像中的條碼的第二掃描結果;將所述第一掃描結果以及所述 第二掃描結果,作為所述目標掃描結果。 In some optional implementations, determining the target scan result based on the first image and the second image includes: obtaining a first scan result of the barcode in the first image; Obtain a second scan result of the barcode in the second image; combine the first scan result and the The second scan result is used as the target scan result.

在一些可選的實施方式中,若所述第一位置與所述第二位置中存在至少一個相同的位置,確定相同位置的第三數量;計算所述第一數量以及所述第三數量的第一差值;計算所述第二數量以及所述第三數量的第二差值;計算所述第三數量、所述第一差值以及所述第二差值的第二總和;在所述第二總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 In some optional implementations, if there is at least one identical position among the first position and the second position, determine a third number of the same positions; calculate the first number and the third number a first difference; calculate the second difference between the second quantity and the third quantity; calculate a second sum of the third quantity, the first difference and the second difference; When the second sum is equal to the total number, a target scanning result is determined based on the first image and the second image.

在一些可選的實施方式中,在所述第二總和小於所述總數量時,將所述拍攝參數從所述第二值調整為第三值,重新掃描所述多個條碼,直至成功掃描所有的條碼。 In some optional implementations, when the second sum is less than the total number, the shooting parameter is adjusted from the second value to a third value, and the multiple barcodes are rescanned until the scan is successful. All barcodes.

在一些可選的實施方式中,在所述第一數量等於所述總數量時,將對所述第一圖像的第一掃描結果作為所述目標掃描結果。 In some optional implementations, when the first number is equal to the total number, the first scan result of the first image is used as the target scan result.

在一些可選的實施方式中,所述獲取多個條碼的總數量,包括:利用預設的目標檢測演算法對所述多個條碼進行識別,利用矩形框框選每個條碼;計算所有矩形框的數量作為所述總數量。 In some optional implementations, obtaining the total number of multiple barcodes includes: using a preset target detection algorithm to identify the multiple barcodes, using rectangular frames to select each barcode; calculating all rectangular frames quantity as the total quantity.

在一些可選的實施方式中,所述拍攝參數包括多角度光照強度值。 In some optional implementations, the shooting parameters include multi-angle illumination intensity values.

請繼續參閱圖1,本實施例中,所述儲存器12可以是電子設備1的內部儲存器,即內置於所述電子設備1的儲存器。在其他實施例中,所述儲存器12也可以是電子設備1的外部儲存器,即外接於所述電子設備1的儲存器。 Please continue to refer to FIG. 1 . In this embodiment, the storage 12 may be an internal storage of the electronic device 1 , that is, a storage built into the electronic device 1 . In other embodiments, the storage 12 may also be an external storage of the electronic device 1 , that is, a storage external to the electronic device 1 .

在一些實施例中,所述儲存器12用於存儲程式碼和各種資料,並在電子設備1的運行過程中實現高速、自動地完成程式或資料的存取。 In some embodiments, the storage 12 is used to store program codes and various data, and realize high-speed and automatic access to programs or data during the operation of the electronic device 1 .

所述儲存器12可以包括隨機存取儲存器,還可以包括非易失性儲存器,例如硬碟、記憶體(Memory)、插接式硬碟、智慧存儲卡(Smart Media Card,SMC)、安全數位(Secure Digital,SD)卡、記憶卡(Flash Card)、至少一個磁碟儲存元件、快閃儲存器元件、或其他易失性固態儲存元件。 The storage 12 may include random access memory, and may also include non-volatile storage, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), Secure Digital (SD) card, memory card (Flash Card), at least one disk storage component, flash memory component, or other volatile solid-state storage component.

在一實施例中,所述處理器13可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯元件、分立門或者電晶體邏輯元件、分立硬體元件等。通用處理器可以是微處理器或者所述處理器也可以是其它任何常規的處理器等。 In one embodiment, the processor 13 may be a central processing unit (Central Processing Unit). Processing Unit (CPU), or other general-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array, FPGA) or other programmable logic components, discrete gate or transistor logic components, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any other conventional processor, etc.

所述儲存器12中的程式碼和各種資料如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以存儲在一個電腦可讀取存儲介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,例如掃描方法,也可以藉由電腦程式來指令相關的硬體來完成,所述的電腦程式可存儲於電腦可讀存儲介質中,所述電腦程式在被處理器執行時,可實現上述各個方法實施例的步驟。其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可執行檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀儲存器(Read-Only Memory,ROM)等。 If the program codes and various data in the storage 12 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above embodiment methods, such as the scanning method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage. In the medium, when the computer program is executed by the processor, the steps of each of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in the form of original program code, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, flash drive, mobile hard drive, magnetic disk, optical disk, computer storage, read-only memory (Read-Only Memory) ,ROM) etc.

可以理解的是,以上所描述的模組劃分,為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。另外,在本申請各個實施例中的各功能模組可以集成在相同處理單元中,也可以是各個模組單獨物理存在,也可以兩個或兩個以上模組集成在相同單元中。上述集成的模組既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。 It can be understood that the module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application can be integrated in the same processing unit, or each module can exist physically alone, or two or more modules can be integrated in the same unit. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.

最後應說明的是,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神和範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be modified. Modifications or equivalent substitutions may be made without departing from the spirit and scope of the technical solution of the present application.

S21~S28:步驟 S21~S28: Steps

Claims (10)

一種掃描方法,應用於電子設備,其中,該方法包括:獲取多個條碼的總數量,包括:利用預設的目標檢測演算法對多個條碼進行識別,利用矩形框框選每個條碼,計算所有矩形框的數量作為多個條碼對應的總數量;利用拍攝裝置對所述多個條碼進行拍攝,得到第一圖像;對所述第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置;在所述第一數量小於所述總數量時,將所述拍攝裝置對應的拍攝參數從第一值調整為第二值,所述拍攝參數包括多角度光照強度值;利用調整後的拍攝裝置對所述多個條碼進行拍攝,得到第二圖像;對所述第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置;在所述第一位置與所述第二位置不相同時,計算所述第一數量以及第二數量的第一總和;在所述第一總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 A scanning method, applied to electronic equipment, wherein the method includes: obtaining the total number of multiple barcodes, including: using a preset target detection algorithm to identify multiple barcodes, using a rectangular frame to select each barcode, and calculating all The number of rectangular frames is used as the total number corresponding to multiple barcodes; the multiple barcodes are photographed using a shooting device to obtain a first image; the first image is scanned to determine the first number of scanned barcodes and the first position corresponding to the scanned barcode; when the first number is less than the total number, the shooting parameters corresponding to the shooting device are adjusted from the first value to the second value, and the shooting parameters include multi-angle Illumination intensity value; use the adjusted shooting device to photograph the plurality of barcodes to obtain a second image; scan the second image to determine the second number of scanned barcodes and the corresponding number of scanned barcodes the second position; when the first position and the second position are different, calculate the first sum of the first quantity and the second quantity; when the first sum is equal to the total quantity, according to The first image and the second image determine the target scan result. 如請求項1所述的掃描方法,其中,所述根據所述第一圖像以及所述第二圖像,確定目標掃描結果,包括:獲取對所述第一圖像中的條碼的第一掃描結果;獲取對所述第二圖像中的條碼的第二掃描結果;將所述第一掃描結果以及所述第二掃描結果,作為所述目標掃描結果。 The scanning method according to claim 1, wherein determining the target scanning result according to the first image and the second image includes: obtaining a first image of the barcode in the first image. Scan the result; obtain the second scan result of the barcode in the second image; use the first scan result and the second scan result as the target scan result. 如請求項1所述的掃描方法,其中:若所述第一位置與所述第二位置中存在至少一個相同的位置,確定相同位置的第三數量;計算所述第一數量以及所述第三數量的第一差值; 計算所述第二數量以及所述第三數量的第二差值;計算所述第三數量、所述第一差值以及所述第二差值的第二總和;在所述第二總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 The scanning method according to claim 1, wherein: if there is at least one identical position between the first position and the second position, determine a third number of the same positions; calculate the first number and the third number The first difference of three quantities; Calculate a second difference between the second quantity and the third quantity; calculate a second sum of the third quantity, the first difference and the second difference; when the second sum is equal to When the total number is determined, a target scan result is determined based on the first image and the second image. 如請求項3所述的掃描方法,其中,所述方法還包括:在所述第二總和小於所述總數量時,將所述拍攝參數從所述第二值調整為第三值,重新掃描所述多個條碼,直至成功掃描所有的條碼。 The scanning method according to claim 3, wherein the method further includes: when the second sum is less than the total number, adjusting the shooting parameter from the second value to a third value, and rescanning The multiple barcodes are scanned until all barcodes are successfully scanned. 如請求項1所述的掃描方法,其中:在所述第一數量等於所述總數量時,將對所述第一圖像的第一掃描結果作為所述目標掃描結果。 The scanning method according to claim 1, wherein: when the first quantity is equal to the total quantity, the first scanning result of the first image is used as the target scanning result. 如請求項1所述的掃描方法,其中,所述獲取多個條碼的總數量,包括:利用預設的目標檢測演算法對所述多個條碼進行識別,利用矩形框框選每個條碼;計算所有矩形框的數量作為所述總數量。 The scanning method as described in claim 1, wherein obtaining the total number of multiple barcodes includes: using a preset target detection algorithm to identify the multiple barcodes, using a rectangular frame to select each barcode; calculating The number of all rectangular boxes is used as the total quantity. 如請求項1至6中任一項所述的掃描方法,其中,所述拍攝參數包括多角度光照強度值。 The scanning method according to any one of claims 1 to 6, wherein the shooting parameters include multi-angle illumination intensity values. 一種掃描裝置,應用於電子設備,其中,所述裝置包括:獲取模組,用於獲取多個條碼的總數量,包括:利用預設的目標檢測演算法對多個條碼進行識別,利用矩形框框選每個條碼,計算所有矩形框的數量作為多個條碼對應的總數量;第一拍攝模組,用於利用拍攝裝置對所述多個條碼進行拍攝,得到第一圖像;第一掃描模組,用於對所述第一圖像進行掃描,確定掃描到的條碼的第一數量以及掃描到的條碼對應的第一位置;調整模組,用於在所述第一數量小於所述總數量時,將所述拍攝裝置對應的 拍攝參數從第一值調整為第二值,所述拍攝參數包括多角度光照強度值;第二拍攝模組,用於利用調整後的拍攝裝置對所述多個條碼進行拍攝,得到第二圖像;第二掃描模組,用於對所述第二圖像進行掃描,確定掃描到的條碼的第二數量以及掃描到的條碼對應的第二位置;計算模組,用於在所述第一位置與所述第二位置不相同時,計算所述第一數量以及第二數量的第一總和;確定模組,用於在所述第一總和等於所述總數量時,根據所述第一圖像以及所述第二圖像,確定目標掃描結果。 A scanning device, applied to electronic equipment, wherein the device includes: an acquisition module, used to obtain the total number of multiple barcodes, including: using a preset target detection algorithm to identify multiple barcodes, using a rectangular frame Select each barcode and calculate the number of all rectangular frames as the total number corresponding to the multiple barcodes; the first shooting module is used to use the shooting device to shoot the multiple barcodes to obtain the first image; the first scanning module A group, used to scan the first image and determine the first number of scanned barcodes and the first position corresponding to the scanned barcode; an adjustment module, used to adjust the first number when the first number is less than the total number. When measuring, put the corresponding part of the shooting device The shooting parameters are adjusted from the first value to the second value, the shooting parameters include multi-angle light intensity values; the second shooting module is used to use the adjusted shooting device to shoot the plurality of barcodes to obtain the second image Image; a second scanning module, used to scan the second image and determine the second number of scanned barcodes and the second position corresponding to the scanned barcode; a calculation module, used to scan the second image When a position is different from the second position, calculate a first sum of the first quantity and the second quantity; and determine a module for calculating the first sum according to the first quantity when the first sum is equal to the total quantity. An image and the second image determine the target scan result. 一種電子設備,其中,所述電子設備包括處理器和儲存器,所述處理器用於執行儲存器中存儲的電腦程式以實現如請求項1至7中任意一項所述的掃描方法。 An electronic device, wherein the electronic device includes a processor and a storage, and the processor is used to execute a computer program stored in the storage to implement the scanning method as described in any one of claims 1 to 7. 一種電腦可讀存儲介質,其中,所述電腦可讀存儲介質存儲有至少一個指令,所述至少一個指令被處理器執行時實現如請求項1至7中任意一項所述的掃描方法。 A computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the scanning method described in any one of claims 1 to 7 is implemented.
TW111150284A 2022-12-28 2022-12-28 Scanning method and related devices TWI827423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111150284A TWI827423B (en) 2022-12-28 2022-12-28 Scanning method and related devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111150284A TWI827423B (en) 2022-12-28 2022-12-28 Scanning method and related devices

Publications (2)

Publication Number Publication Date
TWI827423B true TWI827423B (en) 2023-12-21
TW202427240A TW202427240A (en) 2024-07-01

Family

ID=90053501

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111150284A TWI827423B (en) 2022-12-28 2022-12-28 Scanning method and related devices

Country Status (1)

Country Link
TW (1) TWI827423B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171098A (en) * 2016-12-07 2018-06-15 杭州海康威视数字技术股份有限公司 A kind of code detection method and equipment
CN109426756A (en) * 2017-09-04 2019-03-05 杭州海康威视数字技术股份有限公司 A kind of error-checking method and device of bar code recognition result
CA2893387C (en) * 2014-06-13 2019-12-24 Xerox Corporation Image processing methods and systems for barcode and/or product label recognition
CN112800797A (en) * 2020-12-30 2021-05-14 凌云光技术股份有限公司 Method and system for positioning DM code region
CN113051950A (en) * 2019-12-27 2021-06-29 华为技术有限公司 Multi-code identification method and related equipment
CN114970590A (en) * 2022-04-22 2022-08-30 中国计量大学 Bar code detection method
CN115249024A (en) * 2022-07-29 2022-10-28 东集技术股份有限公司 Bar code identification method and device, storage medium and computer equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2893387C (en) * 2014-06-13 2019-12-24 Xerox Corporation Image processing methods and systems for barcode and/or product label recognition
CN108171098A (en) * 2016-12-07 2018-06-15 杭州海康威视数字技术股份有限公司 A kind of code detection method and equipment
CN109426756A (en) * 2017-09-04 2019-03-05 杭州海康威视数字技术股份有限公司 A kind of error-checking method and device of bar code recognition result
CN113051950A (en) * 2019-12-27 2021-06-29 华为技术有限公司 Multi-code identification method and related equipment
CN112800797A (en) * 2020-12-30 2021-05-14 凌云光技术股份有限公司 Method and system for positioning DM code region
CN114970590A (en) * 2022-04-22 2022-08-30 中国计量大学 Bar code detection method
CN115249024A (en) * 2022-07-29 2022-10-28 东集技术股份有限公司 Bar code identification method and device, storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
網路文獻 STEVE KEARNS 深入瞭解使用行動裝置讀取多個條碼 康耐視部落格 2019年06月04日 https://www.cognex.com/zh-tw/blogs/industrial-barcode-reader/a-closer-look-at-multi-code-barcode-reading-with-mobile-devices *

Similar Documents

Publication Publication Date Title
US11301661B2 (en) Encoded information reading terminal configured to pre-process images
US11430103B2 (en) Method for image processing, non-transitory computer readable storage medium, and electronic device
US7143948B2 (en) Reading method of the two-dimensional bar code
US10554898B2 (en) Method for dual-camera-based imaging, and mobile terminal
KR102293443B1 (en) Image processing method and mobile terminal using dual camera
JP4415188B2 (en) Image shooting device
US8464954B2 (en) Method of improving the barcode recognition efficiency using continuous sampling, computer readable medium, and barcode recognition apparatus
JP4412214B2 (en) Pattern recognition apparatus, pattern recognition method, and electronic apparatus having the pattern recognition apparatus
WO2023065523A1 (en) Isp-based image processing method and apparatus, storage medium, and camera device
CN110365894A (en) The method and relevant apparatus of image co-registration in camera system
CN102104709A (en) Method for processing image shot by camera and camera
CN111932462B (en) Training method and device for image degradation model, electronic equipment and storage medium
CN100586144C (en) Image processing device and method
CN110490196A (en) Subject detection method and apparatus, electronic equipment, computer readable storage medium
CN109584311B (en) Camera calibration method, device, electronic equipment and computer-readable storage medium
CN110838088B (en) Multi-frame noise reduction method and device based on deep learning and terminal equipment
TWI827423B (en) Scanning method and related devices
CN112241737B (en) Text image correction method and device
CN112104860B (en) Calibration method, calibration device, computer device and readable storage medium
US20230222639A1 (en) Data processing method, system, and apparatus
JP2003050990A (en) Image processor and program making computer function as the image processor
JP2010035177A (en) Image photographing apparatus and image processing system
US20240220753A1 (en) Scanning method and electronic device
CN116128748A (en) Fisheye image correction method and system based on effective area extraction algorithm
US8629925B2 (en) Image processing apparatus, image processing method, and computer program