TW201939356A - Code-scanning image recognition method, apparatus and device - Google Patents

Code-scanning image recognition method, apparatus and device Download PDF

Info

Publication number
TW201939356A
TW201939356A TW107147331A TW107147331A TW201939356A TW 201939356 A TW201939356 A TW 201939356A TW 107147331 A TW107147331 A TW 107147331A TW 107147331 A TW107147331 A TW 107147331A TW 201939356 A TW201939356 A TW 201939356A
Authority
TW
Taiwan
Prior art keywords
cpu
result
binarization
code image
scan code
Prior art date
Application number
TW107147331A
Other languages
Chinese (zh)
Other versions
TWI769360B (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 香港商阿里巴巴集團服務有限公司
Publication of TW201939356A publication Critical patent/TW201939356A/en
Application granted granted Critical
Publication of TWI769360B publication Critical patent/TWI769360B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/10851Circuits for pulse shaping, amplifying, eliminating noise signals, checking the function of the sensing device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1098Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices the scanning arrangement having a modular construction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/142Image acquisition using hand-held instruments; Constructional details of the instruments

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Container Filling Or Packaging Operations (AREA)
  • Character Discrimination (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

A code-scanning image recognition method, apparatus and device. The method comprises: when a code-scanning image is recognized, a GPU performing binarization processing on a current code-scanning image frame, then providing a binarization result to a CPU, and then continuously processing a next code-scanning image frame, meanwhile, the CPU is capable of recognizing the binarization result, and if the recognition fails, recognizing the next binarization result until the recognition succeeds.

Description

一種掃描碼影像辨識方法、裝置以及設備Scan code image recognition method, device and equipment

本說明書關於計算機軟體技術領域,尤其關於一種掃描碼影像識別方法、裝置以及設備。This specification relates to the technical field of computer software, and in particular, to a method, a device, and a device for recognizing a scan code image.

智慧型手機的使用普及給人們的生活帶來了便利,透過使用智慧型手機上的各種應用,能夠相應地進行各種業務。
智慧型手機常常會透過掃描識別二維碼,獲取到二維碼包含的業務資訊,進而基於該業務資訊與另一設備進行交互,從而實現特定的業務,比如,支付業務、即時通訊業務等。
在現有技術中,在掃描二維碼時,智慧型手機利用攝影機對準二維碼,連續採集掃描碼影像框,由智慧型手機的中央處理器(Central Processing Unit,CPU)對各掃描碼影像框進行二值化處理進而識別,直至成功識別出二維碼包含的資訊。
基於現有技術,需要更高效的掃描碼影像識別方案。
The popularization of the use of smart phones has brought convenience to people's lives. Through the use of various applications on smart phones, various businesses can be performed accordingly.
Smart phones often scan and identify the QR code to obtain the business information contained in the QR code, and then interact with another device based on the business information to achieve specific services, such as payment services and instant messaging services.
In the prior art, when scanning a two-dimensional code, a smart phone uses a camera to align the two-dimensional code, and continuously captures the scan code image frame. The central processing unit (CPU) of the smart phone scans each scan code image. The frame is binarized and recognized until the information contained in the QR code is successfully identified.
Based on the existing technology, a more efficient scan code image recognition scheme is needed.

本說明書實施例提供一種掃描碼影像識別方法、裝置以及設備,用以解決如下技術問題:需要更高效的掃描碼影像識別方案。
為解決上述技術問題,本說明書實施例是這樣實現的:
本說明書實施例提供的一種掃描碼影像識別方法,包括:
獲取當前的掃描碼影像框;
利用圖形處理器(Graphics Processing Unit,GPU),對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
本說明書實施例提供的一種掃描碼影像識別裝置,包括:
獲取模組,獲取當前的掃描碼影像框;
二值化模組,利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
識別模組,將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
本說明書實施例提供的一種掃描碼影像識別設備,包括:
至少一個處理器;以及,
與所述至少一個處理器通訊連接的記憶體;其中,
所述記憶體儲存有可被所述至少一個處理器執行的指令,所述指令被所述至少一個處理器執行,以使所述至少一個處理器能夠:
獲取當前的掃描碼影像框;
利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
本說明書實施例採用的上述至少一個技術方案能夠達到以下有益效果:在識別連續的多個掃描碼影像框時,由GPU代替CPU進行二值化處理,CPU只需進一步地識別二值化結果即可,這兩個過程能夠並行執行,有利於提高掃描碼影像識別效率。
The embodiments of the present specification provide a scan code image recognition method, device, and device to solve the following technical problems: a more efficient scan code image recognition scheme is needed.
To solve the above technical problems, the embodiments of the present specification are implemented as follows:
A scanning code image recognition method provided by an embodiment of this specification includes:
Get the current scan code image frame;
Using a Graphics Processing Unit (GPU) to perform binarization processing on the current scan code image frame to obtain a binarization result;
The binarization result is provided to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
A scanning code image recognition device provided by an embodiment of this specification includes:
Acquisition module to acquire the current scan code image frame;
A binarization module, using a GPU, to binarize the current scan code image frame to obtain a binarization result;
The recognition module provides the binarization result to the CPU, so as to use the CPU to identify the binarization result to obtain a scan code image recognition result.
A scanning code image recognition device provided by an embodiment of this specification includes:
At least one processor; and
A memory connected in communication with the at least one processor; wherein,
The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can:
Get the current scan code image frame;
Using a GPU to perform a binarization process on the current scan code image frame to obtain a binarization result;
The binarization result is provided to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
The at least one of the above technical solutions adopted in the embodiments of the present specification can achieve the following beneficial effects: when identifying a plurality of continuous scan code image frames, the GPU performs the binarization processing instead of the CPU, and the CPU only needs to further identify the binarization result. However, these two processes can be performed in parallel, which is beneficial to improving the scan code image recognition efficiency.

本說明書實施例提供一種掃描碼影像識別方法、裝置以及設備。
為了使本技術領域的人員更好地理解本說明書中的技術方案,下面將結合本說明書實施例中的附圖,對本說明書實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅僅是本申請一部分實施例,而不是全部的實施例。基於本說明書實施例,本領域普通技術人員在沒有作出創造性勞動前提下所獲得的所有其他實施例,都應當屬於本申請保護的範圍。
圖1為本說明書的方案在一種實際應用場景下關於的一種整體架構示意圖。該整體架構中,主要關於使用者終端設備上的攝影機、GPU和CPU。使用者終端設備,比如包括智慧型手機、平板電腦、商戶收銀機、銷售終端(Point Of Sale,POS)機等。攝影機用於在使用者掃描碼時連續採集掃描碼影像框,GPU用於對掃描碼影像框進行二值化處理,CPU用於對二值化結果進行識別,從而實現掃描碼影像識別。
下面主要基於圖1的示例性架構,對本說明書的方案進行說明。
圖2為本說明書實施例提供的一種掃描碼影像識別方法的流程示意圖,該流程也可以基於使用者簡單的操作觸發(如點擊“掃一掃”按鈕等)而執行,或者,若有需求,也可能適時地自動執行。
從設備角度而言,該流程的執行主體可以為使用者終端設備。從程式角度而言,該流程的執行主體可以為上述設備中安裝的程式,該程式的形式可以是客戶端、網頁端或者伺服端等。
圖2中的流程可以包括以下步驟:
S202:獲取當前的掃描碼影像框。
在本說明書實施例中,對於背景技術的場景,掃描碼主要指掃描二維碼。當然,除了二維碼以外,還可能採用諸如條碼、統一資源定位符(Uniform Resource Locator,URL)等其他可能透過掃描識別的數位對象唯一標識符(Digital Object Unique Identifier,DOI),則掃描碼具體指掃描相應的DOI。
在本說明書實施例中,比如,由智慧型手機上的攝影機連續地採集掃描碼影像框,智慧型手機一般由使用者手持操作,則在掃描碼過程中,對焦情況和對準情況都可能隨時變化,因此,連續採集的各掃描碼影像框通常有所區別,從一些掃描碼影像框中可能能夠成功地識別出碼中包含的資訊,而從另一些掃描碼影像框中未必能夠成功地識別出碼中包含的資訊。可以依次嘗試識別採集到的各掃描碼影像框,在成功地識別出碼中包含的資訊後,停止後續識別過程。
S204:利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果。
在本說明書實施例中,利用GPU為CPU分擔工作,由GPU對待識別的掃描碼影像框進行二值化處理,則無需CPU進行二值化處理,CPU負責識別二值化結果即可,從而減輕了CPU的負擔。
S206:將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
在本說明書實施例中,假定只用一個掃描碼影像框即成功地識別出碼包含的資訊,則整個掃描碼影像識別過程只是一個串行工作的過程,由GPU對該掃描碼影像框進行二值化處理,再由CPU對該掃描碼影像框的二值化結果成功識別。
而若用多個掃描碼影像框才成功地識別出碼包含的資訊,由於GPU與CPU能夠並行工作,則整個掃描碼影像識別過程是一個串行工作加並行工作的過程,串行指對每個掃描碼影像框分別處理過程是串行的,並行是指以下兩個過程可以是並行地:利用CPU識別某個掃描碼影像框的二值化結果的過程,與利用GPU二值化處理該掃描碼影像框後面的掃描碼影像框的過程。
在本說明書實施例中,掃描碼影像識別結果一般是碼中包含的字符串,該字符串比如表示:付款賬戶、跳轉網址、名片等資訊。
透過圖2的方法,在識別連續的多個掃描碼影像框時,由GPU代替CPU進行二值化處理,CPU只需進一步地識別二值化結果即可,這兩個過程能夠並行執行,有利於提高掃描碼影像識別效率,而且也有利於減輕CPU的負擔。
基於圖2的方法,本說明書實施例還提供了該方法的一些具體實施方案,以及擴展方案,下面進行說明。
在本說明書實施例中,為了實現掃描碼圖片識別過程中GPU與CPU並行工作,GPU與CPU分別的工作可以基於不同的線程或者不同的進程執行,互不影響。
例如,對於步驟S204,所述利用GPU,對所述當前的掃描碼影像框進行二值化處理,具體可以包括:第一線程利用GPU,對所述當前的掃描碼影像框進行二值化處理。對於步驟S206,所述利用所述CPU識別所述二值化結果,具體可以包括:第二線程利用所述CPU識別所述二值化結果。其中,所述第一線程與所述第二線程是不同的線程。
在本說明書實施例中,根據前面的說明,單憑當前的一個掃描碼影像框,未必能夠成功識別,因此,對於步驟S206,所述將所述二值化結果提供給CPU後,還可以利用GPU,繼續對下一個掃描碼影像框進行二值化處理。當然,GPU的繼續處理過程無需等待CPU對二值化結果的處理,利用CPU識別二值化結果的過程與利用GPU二值化處理掃描碼影像框的過程能夠並行執行。
在本說明書實施例中,對於步驟S206,所述將所述二值化結果提供給CPU的具體實現方案是多樣的。比如,在利用CPU得到二值化結果後,並發送相應通知(比如,發送給利用CPU識別二值化結果的功能模組,這裡將該功能模組稱為CPU識別模組)以便CPU識別模組得到所述結果池中的所述二值化結果,或者,也可以主動將該二值化結果發送給CPU識別模組,或者,自己不主動而只是被動地等CPU識別模組獲取該二值化結果。CPU識別模組得到該二值化結果後即可提供給CPU使用。
在本說明書實施例中,GPU可能對多個掃描碼影像框進行二值化處理,相應地,會得到多個二值化結果。為了便於CPU利用,可以將這些二值化結果統一保存,比如,可以建立一個結果池用於保存各二值化結果,以供CPU使用,結果池的位置不限,可以在諸如內存或者快取等揮發性記憶體中,也可以在硬碟或者閃存等非揮發性記憶體中。
例如,對於步驟S206,所述將所述二值化結果提供給CPU,具體可以包括:將所述二值化結果保存於結果池中,並發送相應通知以便CPU得到所述結果池中的所述二值化結果。進一步地,若所述CPU識別所述二值化結果失敗,則可以利用所述CPU,從所述結果池中獲取下一個二值化結果進行識別,直至識別成功為止。
根據上面的說明,本說明書實施例還提供的上述掃描碼影像識別方法在一種實際應用場景下的實施原理示意圖,如圖3所示。
在圖3中,利用GPU連續地二值化處理各掃描碼影像框,並將得到的各二值化結果保存於結果池中,當二值化結果池中有新增的二值化結果時,通知CPU識別模組來取該二值化結果,進而CPU識別模組利用CPU識別該二值化結果,若識別成功則返回結果,若識別失敗則從結果池中獲取下一個二值化結果繼續識別,直至識別成功為止。
基於同樣的思路,本說明書實施例還提供了上述方法對應的裝置和設備,參見如圖4、圖5所示。
圖4為本說明書實施例提供的對應於圖2的一種掃描碼影像識別裝置的結構示意圖,所述裝置包括:
獲取模組401,獲取當前的掃描碼影像框;
二值化模組402,利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
識別模組403,將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
可選地,所述二值化模組402利用GPU,對所述當前的掃描碼影像框進行二值化處理,具體包括:
所述二值化模組402透過第一線程,利用GPU,對所述當前的掃描碼影像框進行二值化處理;
所述識別模組403利用CPU識別所述二值化結果,具體包括:
所述識別模組403透過第二線程,利用所述CPU識別所述二值化結果,其中,所述第一線程與所述第二線程是不同的線程。
可選地,所述識別模組403將所述二值化結果提供給CPU後,所述二值化模組402利用所述GPU,對下一個掃描碼影像框進行二值化處理,其中,利用所述CPU識別二值化結果的過程與利用所述GPU二值化處理掃描碼影像框的過程能夠並行執行。
可選地,所述識別模組403將所述二值化結果提供給CPU,具體包括:
所述識別模組403將所述二值化結果保存於結果池中,並發送相應通知以便CPU得到所述結果池中的所述二值化結果。
可選地,若利用所述CPU識別所述二值化結果失敗,所述識別模組403利用所述CPU,從所述結果池中獲取下一個二值化結果進行識別。
可選地,所述掃描碼包括掃描二維碼。
圖5為本說明書實施例提供的對應於圖2的一種掃描碼影像識別設備的結構示意圖,所述設備包括:
至少一個處理器;以及,
與所述至少一個處理器通訊連接的記憶體;其中,
所述記憶體儲存有可被所述至少一個處理器執行的指令,所述指令被所述至少一個處理器執行,以使所述至少一個處理器能夠:
獲取當前的掃描碼影像框;
利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
基於同樣的思路,本說明書實施例還提供了對應於圖2的一種非揮發性計算機儲存媒體,儲存有計算機可執行指令,所述計算機可執行指令設置為:
獲取當前的掃描碼影像框;
利用GPU,對所述當前的掃描碼影像框進行二值化處理,得到二值化結果;
將所述二值化結果提供給CPU,以便利用所述CPU識別所述二值化結果,得到掃描碼影像識別結果。
上述對本說明書特定實施例進行了描述。其它實施例在所附申請專利範圍的範圍內。在一些情況下,在申請專利範圍中記載的動作或步驟可以按照不同於實施例中的順序來執行並且仍然可以實現期望的結果。另外,在附圖中描繪的過程不一定要求示出的特定順序或者連續順序才能實現期望的結果。在某些實施方式中,多任務處理和並行處理也是可以的或者可能是有利的。
本說明書中的各個實施例均採用遞進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於裝置、設備、非揮發性計算機儲存媒體實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。
本說明書實施例提供的裝置、設備、非揮發性計算機儲存媒體與方法是對應的,因此,裝置、設備、非揮發性計算機儲存媒體也具有與對應方法類似的有益技術效果,由於上面已經對方法的有益技術效果進行了詳細說明,因此,這裡不再贅述對應裝置、設備、非揮發性計算機儲存媒體的有益技術效果。
在20世紀90年代,對於一個技術的改進可以很明顯地區分是硬體上的改進(例如,對二極體管、電晶體、開關等電路結構的改進)還是軟體上的改進(對於方法流程的改進)。然而,隨著技術的發展,當今的很多方法流程的改進已經可以視為硬體電路結構的直接改進。設計人員幾乎都透過將改進的方法流程程式化到硬體電路中來得到相應的硬體電路結構。因此,不能說一個方法流程的改進就不能用硬體實體模組來實現。例如,可程式化邏輯裝置(Programmable Logic Device, PLD)(例如現場可程式化閘陣列(Field Programmable Gate Array,FPGA))就是這樣一種積體電路,其邏輯功能由使用者對裝置程式化來確定。由設計人員自行程式化來把一個數位系統“積體”在一片PLD上,而不需要請晶片製造廠商來設計和製作專用的積體電路晶片。而且,如今,取代手工地製作積體電路晶片,這種程式化也多半改用“邏輯編譯器(logic compiler)”軟體來實現,它與程式開發撰寫時所用的軟體編譯器相類似,而要編譯之前的原始代碼也得用特定的程式化語言來撰寫,此稱之為硬體描述語言(Hardware Description Language,HDL),而HDL也並非僅有一種,而是有許多種,如ABEL (Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)與Verilog。本領域技術人員也應該清楚,只需要將方法流程用上述幾種硬體描述語言稍作邏輯程式化並程式化到積體電路中,就可以很容易得到實現該邏輯方法流程的硬體電路。
控制器可以按任何適當的方式實現,例如,控制器可以採取例如微處理器或處理器以及儲存可由該(微)處理器執行的計算機可讀程式代碼(例如軟體或韌體)的計算機可讀媒體、邏輯閘、開關、專用積體電路(Application Specific Integrated Circuit,ASIC)、可程式化邏輯控制器和嵌入微控制器的形式,控制器的例子包括但不限於以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20 以及Silicone Labs C8051F320,記憶體控制器還可以被實現為記憶體的控制邏輯的一部分。本領域技術人員也知道,除了以純計算機可讀程式代碼方式實現控制器以外,完全可以透過將方法步驟進行邏輯程式化來使得控制器以邏輯閘、開關、專用積體電路、可程式化邏輯控制器和嵌入微控制器等的形式來實現相同功能。因此這種控制器可以被認為是一種硬體部件,而對其內包括的用於實現各種功能的裝置也可以視為硬體部件內的結構。或者甚至,可以將用於實現各種功能的裝置視為既可以是實現方法的軟體模組又可以是硬體部件內的結構。
上述實施例闡明的系統、裝置、模組或單元,具體可以由計算機晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為計算機。具體的,計算機例如可以為個人計算機、膝上型計算機、蜂巢式電話、相機電話、智慧型電話、個人數位助理、媒體播放器、導航設備、電子郵件設備、遊戲控制台、平板計算機、可穿戴設備或者這些設備中的任何設備的組合。
為了描述的方便,描述以上裝置時以功能分為各種單元分別描述。當然,在實施本說明書時可以把各單元的功能在同一個或多個軟體和/或硬體中實現。
本領域內的技術人員應明白,本說明書實施例可提供為方法、系統、或計算機程式產品。因此,本說明書實施例可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體方面的實施例的形式。而且,本說明書實施例可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。
本說明書是參照根據本說明書實施例的方法、設備(系統)、和計算機程式產品的流程圖和/或方塊圖來描述的。應理解可由計算機程式指令實現流程圖和/或方塊圖中的每一流程和/或方塊、以及流程圖和/或方塊圖中的流程和/或方塊的結合。可提供這些計算機程式指令到通用計算機、專用計算機、嵌入式處理機或其他可程式化資料處理設備的處理器以產生一個機器,使得透過計算機或其他可程式化資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的裝置。
這些計算機程式指令也可儲存在能引導計算機或其他可程式化資料處理設備以特定方式工作的計算機可讀記憶體中,使得儲存在該計算機可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能。
這些計算機程式指令也可裝載到計算機或其他可程式化資料處理設備上,使得在計算機或其他可程式化設備上執行一系列操作步驟以產生計算機實現的處理,從而在計算機或其他可程式化設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的步驟。
在一個典型的配置中,計算設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和內存。
內存可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非揮發性內存等形式,如唯讀記憶體(ROM)或閃存(flash RAM)。內存是計算機可讀媒體的示例。
計算機可讀媒體包括永久性和非永久性、可行動和非可行動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變內存(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可擦除可程式化唯讀記憶體(EEPROM)、快閃記憶體或其他內存技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁碟儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,計算機可讀媒體不包括暫存電腦可讀媒體(transitory media),如調變的資料訊號和載波。
還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。
本領域技術人員應明白,本說明書實施例可提供為方法、系統或計算機程式產品。因此,本說明書可採用完全硬體實施例、完全軟體實施例或結合軟體和硬體方面的實施例的形式。而且,本說明書可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。
本說明書可以在由計算機執行的計算機可執行指令的一般上下文中描述,例如程式模組。一般地,程式模組包括執行特定任務或實現特定抽象資料類型的例程、程式、對象、組件、資料結構等等。也可以在分布式計算環境中實踐本說明書,在這些分布式計算環境中,由透過通訊網路而被連接的遠程處理設備來執行任務。在分布式計算環境中,程式模組可以位於包括儲存設備在內的本地和遠程計算機儲存媒體中。
本說明書中的各個實施例均採用遞進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於系統實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。
以上所述僅為本說明書實施例而已,並不用於限制本申請。對於本領域技術人員來說,本申請可以有各種更改和變化。凡在本申請的精神和原理之內所作的任何修改、等同替換、改進等,均應包含在本申請的申請專利範圍之內。
The embodiments of the present specification provide a scan code image recognition method, device and device.
In order to enable those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present specification. Obviously, the described The examples are only part of the examples of this application, but not all examples. Based on the embodiments of the present specification, all other embodiments obtained by a person of ordinary skill in the art without creative efforts should fall within the protection scope of the present application.
FIG. 1 is a schematic diagram of an overall architecture related to the solution of this specification in an actual application scenario. In this overall architecture, the camera, GPU, and CPU on the user terminal device are mainly concerned. User terminal equipment, for example, includes smart phones, tablet computers, merchant cash registers, and point of sale (POS) machines. The camera is used to continuously collect the scan code image frame when the user scans the code, the GPU is used to binarize the scan code image frame, and the CPU is used to identify the binarization result, thereby implementing scan code image recognition.
The following mainly describes the scheme of the present specification based on the exemplary architecture of FIG. 1.
FIG. 2 is a schematic flowchart of a scan code image recognition method provided by an embodiment of the present specification. The process can also be executed based on a simple operation trigger of a user (such as clicking a "scan" button, etc.), or, if required, also May be performed automatically in due course.
From a device perspective, the execution subject of this process can be a user terminal device. From a program perspective, the execution subject of the process can be a program installed in the above-mentioned device, and the form of the program can be a client, a web page, or a server.
The process in Figure 2 can include the following steps:
S202: Obtain the current scan code image frame.
In the embodiments of the present specification, for background scenes, the scanning code mainly refers to scanning a two-dimensional code. Of course, in addition to the two-dimensional code, other digital object unique identifiers (DOIs), such as barcodes, Uniform Resource Locators (URLs), which may be identified through scanning, may be used. Refers to scanning the corresponding DOI.
In the embodiment of the present specification, for example, a scan code image frame is continuously acquired by a camera on a smart phone, and a smart phone is generally operated by a user's hand. During the scan code process, the focus and alignment may be at any time. Therefore, each scan code image frame collected continuously is usually different. Some scan code image frames may be able to successfully identify the information contained in the code, while other scan code image frames may not be successfully identified. Information contained in the code. You can try to identify each scanned code image frame in turn, and after successfully identifying the information contained in the code, stop the subsequent recognition process.
S204: Use the GPU to perform a binarization process on the current scan code image frame to obtain a binarization result.
In the embodiment of the present specification, the GPU is used to share the work for the CPU, and the scan code image frame to be identified by the GPU is binarized. The CPU does not need to perform binarization. The CPU is responsible for identifying the binarization result, thereby reducing Burdened the CPU.
S206: The binarization result is provided to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
In the embodiment of the present specification, assuming that only one scan code image frame is used to successfully identify the information contained in the code, the entire scan code image recognition process is only a serial work process, and the GPU performs two scans on the scan code image frame. The binarization result is successfully identified by the CPU for the binarization result of the scan code image frame.
However, if multiple scan code image frames are used to successfully identify the information contained in the code, because the GPU and CPU can work in parallel, the entire scan code image recognition process is a process of serial work plus parallel work. The processing process of each scan code image frame is serial. Parallel means that the following two processes can be performed in parallel: the process of identifying the binarization result of a scan code image frame by the CPU, and the process of binarization using the GPU. The process of scanning the image frame behind the scan image frame.
In the embodiment of the present specification, the scan code image recognition result is generally a character string included in the code, and the character string represents, for example, information such as a payment account, a jump URL, and a business card.
Through the method in FIG. 2, when recognizing consecutive multiple scan code image frames, the GPU performs the binarization processing instead of the CPU. The CPU only needs to further identify the binarization result. These two processes can be executed in parallel, which is advantageous. It is used to improve the scanning code image recognition efficiency, and it is also beneficial to reduce the burden on the CPU.
Based on the method of FIG. 2, the embodiments of the present specification also provide some specific implementations of the method, as well as extended solutions, which are described below.
In the embodiment of the present specification, in order to realize the parallel operation of the GPU and the CPU during the scan code picture recognition process, the separate work of the GPU and the CPU may be performed based on different threads or different processes without affecting each other.
For example, for step S204, using the GPU to binarize the current scan code image frame may specifically include: a first thread using the GPU to binarize the current scan code image frame . For step S206, the using the CPU to identify the binarization result may specifically include: a second thread using the CPU to identify the binarization result. The first thread and the second thread are different threads.
In the embodiment of the present specification, according to the foregoing description, the current scan code image frame alone may not be able to identify successfully. Therefore, in step S206, after the binarization result is provided to the CPU, it can also be used. The GPU continues to binarize the next scan code image frame. Of course, the GPU's continuous processing process does not need to wait for the CPU to process the binarization result. The process of using the CPU to identify the binarization result and the process of using the GPU to binarize the scan code image frame can be executed in parallel.
In the embodiment of the present specification, for step S206, the specific implementation schemes of providing the binarization result to the CPU are various. For example, after using the CPU to obtain the binarization result, and sending a corresponding notification (for example, to a function module that uses the CPU to identify the binarization result, this function module is referred to as a CPU identification module here) so that the CPU can identify the module. The group obtains the binarization result in the result pool, or it can also actively send the binarization result to the CPU identification module, or it does not wait for the CPU identification module to obtain the binary by itself. Valued results. After the CPU identification module obtains the binarization result, it can be provided to the CPU for use.
In the embodiment of the present specification, the GPU may perform binarization processing on multiple scan code image frames, and accordingly, multiple binarization results will be obtained. In order to facilitate the use of the CPU, these binarized results can be stored uniformly. For example, a result pool can be established to store each binarized result for use by the CPU. The location of the result pool is not limited, and can be stored in, for example, memory or cache In other volatile memory, it can also be in non-volatile memory such as hard disk or flash memory.
For example, for step S206, the providing the binarization result to the CPU may specifically include: storing the binarization result in a result pool, and sending a corresponding notification so that the CPU obtains all the results in the result pool. The binarization results are described. Further, if the CPU fails to identify the binarization result, the CPU may use the CPU to obtain the next binarization result from the result pool for identification until the identification is successful.
According to the above description, a schematic diagram of the implementation principle of the foregoing scan code image recognition method provided in an embodiment of this specification in an actual application scenario is shown in FIG. 3.
In Figure 3, the GPU is used to continuously binarize each scan code image frame and save each binarization result in the result pool. When there are new binarization results in the binarization result pool , Notify the CPU identification module to take the binarization result, and then the CPU identification module uses the CPU to identify the binarization result. If the identification is successful, the result is returned. If the identification fails, the next binarization result is obtained from the result pool. Continue identification until identification is successful.
Based on the same thinking, the embodiments of the present specification also provide a device and a device corresponding to the foregoing method, as shown in FIG. 4 and FIG. 5.
FIG. 4 is a schematic structural diagram of a scan code image recognition device corresponding to FIG. 2 according to an embodiment of the present specification. The device includes:
The acquisition module 401 acquires the current scan code image frame;
A binarization module 402, using a GPU, to binarize the current scan code image frame to obtain a binarization result;
The recognition module 403 provides the binarization result to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
Optionally, the binarization module 402 uses a GPU to perform binarization processing on the current scan code image frame, which specifically includes:
The binarization module 402 performs a binarization process on the current scan code image frame by using a GPU through a first thread;
The identification module 403 uses the CPU to identify the binarization result, and specifically includes:
The identification module 403 uses the CPU to identify the binarization result through a second thread, wherein the first thread and the second thread are different threads.
Optionally, after the recognition module 403 provides the binarization result to the CPU, the binarization module 402 performs binarization processing on the next scan code image frame by using the GPU, where: The process of using the CPU to identify the binarization result and the process of using the GPU to binarize the scan code image frame can be executed in parallel.
Optionally, the identifying module 403 provides the binary result to the CPU, which specifically includes:
The identification module 403 stores the binarization result in a result pool, and sends a corresponding notification so that the CPU obtains the binarization result in the result pool.
Optionally, if the use of the CPU to identify the binary result fails, the identification module 403 uses the CPU to obtain the next binary result from the result pool for identification.
Optionally, the scanning code includes scanning a two-dimensional code.
FIG. 5 is a schematic structural diagram of a scan code image recognition device corresponding to FIG. 2 according to an embodiment of the present specification. The device includes:
At least one processor; and
A memory connected in communication with the at least one processor; wherein,
The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can:
Get the current scan code image frame;
Using a GPU to perform a binarization process on the current scan code image frame to obtain a binarization result;
The binarization result is provided to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
Based on the same thinking, the embodiment of the present specification also provides a non-volatile computer storage medium corresponding to FIG. 2, which stores computer-executable instructions, and the computer-executable instructions are set to:
Get the current scan code image frame;
Using a GPU to perform a binarization process on the current scan code image frame to obtain a binarization result;
The binarization result is provided to a CPU, so that the binarization result is recognized by the CPU to obtain a scan code image recognition result.
The specific embodiments of the present specification have been described above. Other embodiments are within the scope of the appended patent applications. In some cases, the actions or steps described in the scope of the patent application may be performed in a different order than in the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, the embodiments of the device, equipment, and non-volatile computer storage medium are basically similar to the method embodiment, so the description is relatively simple. For the related parts, refer to the description of the method embodiment.
The devices, devices, and non-volatile computer storage media provided in the embodiments of this specification correspond to the methods. Therefore, the devices, devices, and non-volatile computer storage media also have beneficial technical effects similar to the corresponding methods. The beneficial technical effects of the device are described in detail, and therefore, the beneficial technical effects of corresponding devices, equipment, and non-volatile computer storage media are not repeated here.
In the 1990s, for a technical improvement, it can be clearly distinguished whether it is an improvement in hardware (for example, circuit structure of diodes, transistors, switches, etc.) or an improvement in software (for method flow improvement of). However, with the development of technology, the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device . Designers can program a digital system to "integrate" on a PLD by themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, today, instead of making integrated circuit chips manually, this programming is mostly implemented with "logic compiler" software, which is similar to the software compiler used in program development and writing. The original source code before compilation must also be written in a specific programming language. This is called the Hardware Description Language (HDL). There is not only one kind of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are Very-High-Speed Integrated Circuit Hardware Description Language (VHDL) and Verilog. Those skilled in the art should also be clear that as long as the method flow is logically programmed and integrated into the integrated circuit using the above-mentioned several hardware description languages, the hardware circuit that implements the logic method flow can be easily obtained.
The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable storage of computer-readable program code (e.g., software or firmware) executable by the (micro) processor. Media, logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that, in addition to implementing the controller in pure computer-readable program code, the controller can be controlled by logic gates, switches, dedicated integrated circuits, and programmable logic by programming the method steps logically. Controller and embedded microcontroller to achieve the same function. Therefore, the controller can be considered as a hardware component, and the device included in the controller for implementing various functions can also be considered as a structure in the hardware component. Or even, a device for implementing various functions can be regarded as a structure that can be both a software module implementing the method and a hardware component.
The system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable Device or any combination of these devices.
For the convenience of description, when describing the above device, the functions are divided into various units and described separately. Of course, when implementing this specification, the functions of each unit may be implemented in the same software or multiple software and / or hardware.
Those skilled in the art should understand that the embodiments of the present specification may be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present specification may adopt a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code. form.
This specification is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and a combination of the flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special purpose computer, embedded processor, or other programmable data processing device to generate a machine for instructions to be executed by the processor of the computer or other programmable data processing device Generate means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
These computer program instructions may also be stored in computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including the instruction device , The instruction device realizes the functions specified in a flowchart or a plurality of processes and / or a block or a block of the block diagram.
These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of operating steps can be performed on the computer or other programmable device to generate computer-implemented processing, so that the computer or other programmable device can The instructions executed on the steps provide steps for realizing the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
Memory may include non-permanent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media includes permanent and non-permanent, removable and non-removable media. Information can be stored by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), Read-only memory (ROM), electrically erasable and programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, CD-ROM, digital versatile disc ( DVD) or other optical storage, magnetic tape cartridges, magnetic tape storage or other magnetic storage devices, or any other non-transmission media, can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
It should also be noted that the terms "including,""including," or any other variation thereof are intended to encompass non-exclusive inclusion, so that a process, method, product, or device that includes a range of elements includes not only those elements, but also Other elements not explicitly listed, or those that are inherent to such a process, method, product, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, product or equipment including the elements.
Those skilled in the art should understand that the embodiments of the present specification may be provided as a method, a system, or a computer program product. Therefore, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code. .
This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant part, refer to the description of the method embodiment.
The above descriptions are merely examples of the present specification and are not intended to limit the application. For those skilled in the art, this application may have various modifications and changes. Any modification, equivalent replacement, or improvement made within the spirit and principle of this application shall be included in the scope of the patent application for this application.

401‧‧‧獲取模組401‧‧‧Get Module

402‧‧‧二值化模組 402‧‧‧ Binarization Module

403‧‧‧識別模組 403‧‧‧Identification Module

S204‧‧‧步驟 S204‧‧‧step

S206‧‧‧步驟 S206‧‧‧step

S208‧‧‧步驟 S208‧‧‧step

為了更清楚地說明本說明書實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是本說明書中記載的一些實施例,對於本領域普通技術人員來講,在不付出創造性勞動性的前提下,還可以根據這些附圖獲得其他的附圖。In order to more clearly explain the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only the present invention. For some ordinary people skilled in the art, some embodiments described in the description can also obtain other drawings according to the drawings without paying creative labor.

圖1為本說明書的方案在一種實際應用場景下關於的一種整體架構示意圖; FIG. 1 is a schematic diagram of an overall architecture related to a solution of this specification in an actual application scenario;

圖2為本說明書實施例提供的一種掃描碼影像識別方法的流程示意圖; 2 is a schematic flowchart of a scan code image recognition method according to an embodiment of the present specification;

圖3為本說明書實施例提供的掃描碼影像識別方法在一種實際應用場景下的實施原理示意圖; 3 is a schematic diagram of an implementation principle of a scan code image recognition method provided in an embodiment of this specification in an actual application scenario;

圖4為本說明書實施例提供的對應於圖2的一種掃描碼影像識別裝置的結構示意圖; 4 is a schematic structural diagram of a scan code image recognition device corresponding to FIG. 2 according to an embodiment of the present specification;

圖5為本說明書實施例提供的對應於圖2的一種掃描碼影像識別設備的結構示意圖。 FIG. 5 is a schematic structural diagram of a scan code image recognition device corresponding to FIG. 2 provided in an embodiment of the present specification.

Claims (13)

一種掃描碼影像識別方法,包括: 獲取當前的掃描碼影像框; 利用圖形處理器GPU,對該當前的掃描碼影像框進行二值化處理,得到二值化結果; 將該二值化結果提供給中央處理器CPU,以便利用該CPU識別該二值化結果,得到掃描碼影像識別結果。A scanning code image recognition method includes: Get the current scan code image frame; Using a GPU GPU to perform binarization processing on the current scan code image frame to obtain a binarization result; The binarization result is provided to a central processing unit CPU, so as to use the CPU to identify the binarization result and obtain a scan code image recognition result. 如申請專利範圍第1項之方法,該利用GPU,對該當前的掃描碼影像框進行二值化處理,具體包括: 第一線程利用GPU,對該當前的掃描碼影像框進行二值化處理; 該利用該CPU識別該二值化結果,具體包括: 第二線程利用該CPU識別該二值化結果,其中,該第一線程與該第二線程是不同的線程。If the method of applying for the first item of the patent scope, the GPU is used to binarize the current scan code image frame, which specifically includes: The first thread uses the GPU to binarize the current scan code image frame; The use of the CPU to identify the binarization result specifically includes: The second thread uses the CPU to identify the binarization result, wherein the first thread and the second thread are different threads. 如申請專利範圍第1項之方法,該將該二值化結果提供給CPU後,該方法還包括: 利用該GPU,對下一個掃描碼影像框進行二值化處理,其中,利用該CPU識別二值化結果的過程與利用該GPU二值化處理掃描碼影像框的過程能夠並行執行。For example, if the method of claim 1 is applied, after the binarization result is provided to the CPU, the method further includes: The GPU is used to binarize the next scan code image frame. The process of identifying the binarization result by the CPU and the process of binarizing the scan code image frame by the GPU can be performed in parallel. 如申請專利範圍第1項之方法,該將該二值化結果提供給CPU,具體包括: 將該二值化結果保存於結果池中,並發送相應通知以便CPU得到該結果池中的該二值化結果。If applying for the method in the first item of the patent scope, the binarization result should be provided to the CPU, including: The binarization result is stored in a result pool, and a corresponding notification is sent so that the CPU obtains the binarization result in the result pool. 如申請專利範圍第4項之方法,若利用該CPU識別該二值化結果失敗,該方法還包括: 利用該CPU,從該結果池中獲取下一個二值化結果進行識別。For example, if the method of applying for the fourth item of the patent scope, if the CPU fails to identify the binarization result, the method further includes: Using the CPU, the next binarization result is obtained from the result pool for identification. 如申請專利範圍第1~5項任一項之方法,該掃描碼包括掃描二維碼。If the method of applying any one of items 1 to 5 of the patent scope, the scanning code includes scanning a two-dimensional code. 一種掃描碼影像識別裝置,包括: 獲取模組,獲取當前的掃描碼影像框; 二值化模組,利用圖形處理器GPU,對該當前的掃描碼影像框進行二值化處理,得到二值化結果; 識別模組,將該二值化結果提供給中央處理器CPU,以便利用該CPU識別該二值化結果,得到掃描碼影像識別結果。A scanning code image recognition device includes: Acquisition module to acquire the current scan code image frame; The binarization module uses a graphics processor GPU to binarize the current scan code image frame to obtain a binarization result; The recognition module provides the binarization result to a central processing unit CPU, so as to use the CPU to identify the binarization result and obtain a scan code image recognition result. 如申請專利範圍第7項之裝置,該二值化模組利用GPU,對該當前的掃描碼影像框進行二值化處理,具體包括: 該二值化模組透過第一線程,利用GPU,對該當前的掃描碼影像框進行二值化處理; 該識別模組利用CPU識別該二值化結果,具體包括: 該識別模組透過第二線程,利用該CPU識別該二值化結果,其中,該第一線程與該第二線程是不同的線程。For the device in the seventh scope of the patent application, the binarization module uses the GPU to binarize the current scan code image frame, including: The binarization module uses the GPU to binarize the current scan code image frame through the first thread; The identification module uses the CPU to identify the binary result, and specifically includes: The identification module uses the CPU to identify the binarization result through a second thread, wherein the first thread and the second thread are different threads. 如申請專利範圍第7項之裝置,該識別模組將該二值化結果提供給CPU後,該二值化模組利用該GPU,對下一個掃描碼影像框進行二值化處理,其中,利用該CPU識別二值化結果的過程與利用該GPU二值化處理掃描碼影像框的過程能夠並行執行。For example, for the device in the seventh scope of the patent application, after the recognition module provides the binarization result to the CPU, the binarization module uses the GPU to binarize the next scan code image frame. Among them, The process of using the CPU to identify the binarization result and the process of using the GPU to binarize the scan code image frame can be executed in parallel. 如申請專利範圍第7項之裝置,該識別模組將該二值化結果提供給CPU,具體包括: 該識別模組將該二值化結果保存於結果池中,並發送相應通知以便CPU得到該結果池中的該二值化結果。If the device in the seventh scope of the patent application is applied, the identification module provides the binarization result to the CPU, which specifically includes: The identification module saves the binarization result in a result pool, and sends a corresponding notification so that the CPU obtains the binarization result in the result pool. 如申請專利範圍第10項之裝置,若利用該CPU識別該二值化結果失敗,該識別模組利用該CPU,從該結果池中獲取下一個二值化結果進行識別。For example, if the device of the scope of patent application is applied for, if the CPU fails to identify the binarization result, the identification module uses the CPU to obtain the next binarization result from the result pool for identification. 如申請專利範圍第7~11項任一項之裝置,該掃描碼包括掃描二維碼。If the device of any one of claims 7 to 11 is applied for, the scanning code includes scanning a two-dimensional code. 一種掃描碼影像識別設備,包括: 至少一個處理器;以及, 與該至少一個處理器通訊連接的記憶體;其中, 該記憶體儲存有可被該至少一個處理器執行的指令,該指令被該至少一個處理器執行,以使該至少一個處理器能夠: 獲取當前的掃描碼影像框; 利用圖形處理器GPU,對該當前的掃描碼影像框進行二值化處理,得到二值化結果; 將該二值化結果提供給中央處理器CPU,以便利用該CPU識別該二值化結果,得到掃描碼影像識別結果。A scanning code image recognition device includes: At least one processor; and A memory connected in communication with the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can: Get the current scan code image frame; Using a GPU GPU to perform binarization processing on the current scan code image frame to obtain a binarization result; The binarization result is provided to a central processing unit CPU, so as to use the CPU to identify the binarization result and obtain a scan code image recognition result.
TW107147331A 2018-03-07 2018-12-27 A scanning code image recognition method, device and equipment TWI769360B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
??201810186076.6 2018-03-07
CN201810186076.6A CN108537085A (en) 2018-03-07 2018-03-07 A kind of barcode scanning image-recognizing method, device and equipment
CN201810186076.6 2018-03-07

Publications (2)

Publication Number Publication Date
TW201939356A true TW201939356A (en) 2019-10-01
TWI769360B TWI769360B (en) 2022-07-01

Family

ID=63486463

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107147331A TWI769360B (en) 2018-03-07 2018-12-27 A scanning code image recognition method, device and equipment

Country Status (3)

Country Link
CN (1) CN108537085A (en)
TW (1) TWI769360B (en)
WO (1) WO2019169965A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537085A (en) * 2018-03-07 2018-09-14 阿里巴巴集团控股有限公司 A kind of barcode scanning image-recognizing method, device and equipment
CN110516739B (en) * 2019-08-27 2022-12-27 创新先进技术有限公司 Certificate identification method, device and equipment
CN110610080B (en) * 2019-09-19 2022-02-22 武汉统信软件技术有限公司 Application isolation implementation method, mobile terminal, computer equipment and storage medium
WO2022110106A1 (en) * 2020-11-30 2022-06-02 华为技术有限公司 Code scanning method and apparatus
CN113963352B (en) * 2021-09-22 2022-08-02 支付宝(杭州)信息技术有限公司 Method and device for recognizing picture and training neural network
CN114723766A (en) * 2022-04-14 2022-07-08 润芯微科技(江苏)有限公司 Two-dimensional code extraction and display method and electronic equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103824257A (en) * 2012-11-16 2014-05-28 无锡汉兴电子有限公司 Two-dimensional code image preprocessing method
CN103955660B (en) * 2014-04-22 2017-02-22 广州闪购软件服务有限公司 Method for recognizing batch two-dimension code images
CN104125220A (en) * 2014-07-08 2014-10-29 上海仪电智能电子有限公司 Method for achieving rapid data exchange and response of cell phone application and background database
CN104933731A (en) * 2015-04-17 2015-09-23 阔地教育科技有限公司 Moving target detection method based on graphics processor and moving target detection device based on graphics processor
CN104851081A (en) * 2015-05-15 2015-08-19 南京信息工程大学 GPU-based parallel Laplacian image sharpening method
CN108256377A (en) * 2016-03-31 2018-07-06 青岛海信移动通信技术股份有限公司 Two-dimension code image recognition methods and device
CN105894514B (en) * 2016-04-06 2019-01-11 广东工业大学 A kind of printed matter defect inspection method and system based on GPU concurrent operation
CN106095536B (en) * 2016-06-22 2019-06-11 福建联迪商用设备有限公司 Multithreading coding/decoding method and system based on multicore MPU
CN107609446B (en) * 2017-07-31 2020-07-31 努比亚技术有限公司 Code pattern recognition method, terminal and computer readable storage medium
CN108537085A (en) * 2018-03-07 2018-09-14 阿里巴巴集团控股有限公司 A kind of barcode scanning image-recognizing method, device and equipment

Also Published As

Publication number Publication date
WO2019169965A1 (en) 2019-09-12
TWI769360B (en) 2022-07-01
CN108537085A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
TWI769360B (en) A scanning code image recognition method, device and equipment
WO2019034039A1 (en) Target image code recognition method and device
TW201941110A (en) Qr code identifying and reading method and apparatus, and device
TWI717644B (en) Method, device and equipment for obtaining business information
TWI742324B (en) Information processing method, device and equipment based on scanning DOI
WO2017148275A1 (en) Information display method and device
TWI743425B (en) Information recognition method, server, client and system
TWI724299B (en) Business processing method and equipment
WO2019179243A1 (en) Information display method, apparatus and device
TWI694392B (en) Method and device for displaying unique identifier of digital object
TW201913490A (en) Service execution method, device and device applied to client and server
CN112347512A (en) Image processing method, device, equipment and storage medium
TW201926173A (en) Resource transfer verification method and apparatus, and electronic payment verification method and apparatus
WO2019165870A1 (en) Method, apparatus, and device for recognizing bar code
TWI759583B (en) Decoding method of graphic code and user terminal for decoding graphic code
TWI707289B (en) Method and device for sending electronic tickets
WO2019179255A1 (en) Method and system for applying bar code, and server
WO2019154168A1 (en) Method and device for displaying identification code of application
US11080683B2 (en) DOI display and transaction information verification
US9292763B2 (en) System, method, and medium for image object and contour feature extraction
WO2016101768A1 (en) Terminal and touch operation-based search method and device
KR20170086365A (en) Optimization method for the scale space construction on a mobile GPU
CN116206228A (en) Image structured recognition method and device, electronic equipment and readable storage medium
CN115617638A (en) Test script generation method and device, storage medium and equipment