TWI623882B - Barcode capturing method and barcode reader - Google Patents
Barcode capturing method and barcode reader Download PDFInfo
- Publication number
- TWI623882B TWI623882B TW105123557A TW105123557A TWI623882B TW I623882 B TWI623882 B TW I623882B TW 105123557 A TW105123557 A TW 105123557A TW 105123557 A TW105123557 A TW 105123557A TW I623882 B TWI623882 B TW I623882B
- Authority
- TW
- Taiwan
- Prior art keywords
- distance
- barcode
- processing unit
- feature parameter
- decoding
- Prior art date
Links
Landscapes
- Image Input (AREA)
- Studio Devices (AREA)
Abstract
一種條碼擷取方法,包含下列步驟:以一條碼讀取機擷取一目標條碼之一目標影像;判斷目標影像中是否存在二反光區域;當判斷目標影像中存在二反光區域時,計算對應二反光區域之一參考特徵參數;判斷參考特徵參數與一預定特徵參數是否相符;當判斷參考特徵參數與預定特徵參數相符時,判斷條碼讀取機與目標條碼間之一目前距離為一有效解碼距離;以及當判斷參考特徵參數與預定特徵參數不相符時,判斷條碼讀取機與目標條碼間之目前距離為一無效解碼距離。A barcode capture method includes the following steps: capturing a target image of a target barcode by using a code reader; determining whether there is a two-reflection region in the target image; and determining that there is a two-reflection region in the target image, calculating corresponding two One of the reflective areas refers to the feature parameter; determines whether the reference feature parameter matches a predetermined feature parameter; and when the reference feature parameter is determined to be consistent with the predetermined feature parameter, determining that the current distance between the bar code reader and the target bar code is a valid decoding distance And determining that the current distance between the barcode reader and the target barcode is an invalid decoding distance when determining that the reference feature parameter does not match the predetermined feature parameter.
Description
本發明關於一種條碼擷取方法及條碼讀取機,尤指一種可有效提昇解碼效率之條碼擷取方法及條碼讀取機。The invention relates to a barcode capturing method and a barcode reading machine, in particular to a barcode capturing method and a barcode reading machine which can effectively improve decoding efficiency.
條碼(barcode)是將寬度不等的多個黑條和空白,按照一定的編碼規則排列,用以表達一組資訊的圖形識別元。條碼可以標出物品的生產國、製造廠家、商品名稱、生產日期、圖書分類號、郵件起止地點、類別、日期等資訊,因而在商品流通、圖書管理、郵政管理、銀行系統等許多領域都得到了廣泛的應用。A barcode is a graphic recognition element that expresses a set of information by arranging a plurality of black bars and spaces of different widths according to a certain coding rule. Bar code can indicate the country of manufacture, manufacturer, product name, date of manufacture, book classification number, start and end of mail, category, date and other information, so it can be obtained in many fields such as commodity circulation, book management, postal management, banking system, etc. A wide range of applications.
在以條碼讀取機讀取條碼時,條碼讀取機與條碼之間的距離是否為有效解碼距離以及條碼影像中是否存在反光區域,皆會對條碼的解碼效率產生影響。由於使用者無法得知解碼失敗的原因為何,因此,使用者只能反覆將條碼讀取機靠近或遠離條碼來進行掃描,進而導致條碼的解碼效率降低。若解碼失敗係由條碼影像中存在反光區域造成,則無論使用者如何改變條碼讀取機與條碼之間的距離,皆無法解碼成功,進而造成使用者操作上的困擾。When the bar code reader reads the bar code, whether the distance between the bar code reader and the bar code is the effective decoding distance and whether there is a reflective area in the bar code image, all of which will affect the decoding efficiency of the bar code. Since the user cannot know the reason for the decoding failure, the user can only scan the barcode reader closer to or away from the barcode, thereby reducing the decoding efficiency of the barcode. If the decoding failure is caused by the presence of a reflective area in the barcode image, no matter how the user changes the distance between the barcode reader and the barcode, the decoding cannot be successfully performed, thereby causing user troubles.
本發明的目的之一在於提供一種可有效提昇解碼效率之條碼擷取方法及條碼讀取機,以解決上述問題。One of the objects of the present invention is to provide a bar code extraction method and a bar code reader that can effectively improve decoding efficiency to solve the above problems.
根據一實施例,本發明之條碼擷取方法包含下列步驟:以一條碼讀取機擷取一目標條碼之一目標影像;判斷目標影像中是否存在二反光區域;當判斷目標影像中存在二反光區域時,計算對應二反光區域之一參考特徵參數;判斷參考特徵參數與一預定特徵參數是否相符;當判斷參考特徵參數與預定特徵參數相符時,判斷條碼讀取機與目標條碼間之一目前距離為一有效解碼距離;以及當判斷參考特徵參數與預定特徵參數不相符時,判斷條碼讀取機與目標條碼間之目前距離為一無效解碼距離。According to an embodiment, the barcode capture method of the present invention comprises the steps of: capturing a target image of a target barcode by a code reader; determining whether there is a two-reflection region in the target image; and determining that there is a second reflection in the target image. In the region, calculating a reference feature parameter corresponding to the two reflective regions; determining whether the reference feature parameter matches a predetermined feature parameter; and determining that the reference feature parameter matches the predetermined feature parameter, determining one of the bar code reader and the target bar code The distance is an effective decoding distance; and when it is determined that the reference feature parameter does not match the predetermined feature parameter, it is determined that the current distance between the barcode reader and the target barcode is an invalid decoding distance.
根據另一實施例,本發明之條碼讀取機包含一影像擷取單元以及一處理單元,其中處理單元電性連接於影像擷取單元。影像擷取單元擷取一目標條碼之一目標影像。處理單元判斷目標影像中是否存在二反光區域。當處理單元判斷目標影像中存在二反光區域時,處理單元計算對應二反光區域之一參考特徵參數。處理單元判斷參考特徵參數與一預定特徵參數是否相符。當處理單元判斷參考特徵參數與預定特徵參數相符時,處理單元判斷條碼讀取機與目標條碼間之一目前距離為一有效解碼距離。當處理單元判斷參考特徵參數與預定特徵參數不相符時,處理單元判斷條碼讀取機與目標條碼間之目前距離為一無效解碼距離。According to another embodiment, the barcode reader of the present invention comprises an image capturing unit and a processing unit, wherein the processing unit is electrically connected to the image capturing unit. The image capturing unit captures a target image of a target barcode. The processing unit determines whether there is a two-reflecting area in the target image. When the processing unit determines that there is a two-reflecting area in the target image, the processing unit calculates a reference characteristic parameter corresponding to one of the two reflective areas. The processing unit determines whether the reference feature parameter matches a predetermined feature parameter. When the processing unit determines that the reference feature parameter matches the predetermined feature parameter, the processing unit determines that the current distance between the bar code reader and the target bar code is a valid decoding distance. When the processing unit determines that the reference feature parameter does not match the predetermined feature parameter, the processing unit determines that the current distance between the barcode reader and the target barcode is an invalid decoding distance.
綜上所述,本發明係利用目標影像中的二反光區域來判斷條碼讀取機與目標條碼間之目前距離為有效解碼距離或無效解碼距離。接著,本發明即可根據上述判斷結果進行對應處理程序,以有效提昇解碼效率。In summary, the present invention utilizes the two reflective areas in the target image to determine whether the current distance between the barcode reader and the target barcode is a valid decoding distance or an invalid decoding distance. Then, the present invention can perform a corresponding processing procedure according to the above judgment result to effectively improve the decoding efficiency.
舉例而言,當條碼讀取機與目標條碼間之目前距離為有效解碼距離卻解碼失敗時,表示解碼失敗有可能是由條碼影像中存在反光區域造成。此時,本發明可調整條碼讀取機之補光燈之亮度,直到二反光區域之面積小於預定閥值時,再對目標影像進行解碼。當調整補光燈之亮度超過預定次數後,二反光區域之面積仍大於或等於預定閥值時,表示解碼失敗有可能是由距離與反光之外的其它因素造成(例如,條碼毀損、條碼讀取機故障、環境光太亮等),本發明可自條碼讀取機發出警示訊息,以提示使用者針對條碼、條碼讀取機及/或環境光進行檢查。當條碼讀取機與目標條碼間之目前距離為無效解碼距離時,本發明可自條碼讀取機發出警示訊息,以提示使用者將條碼讀取機與目標條碼間之目前距離調整為有效解碼距離。此外,若條碼讀取機裝設有變焦鏡頭,當條碼讀取機與目標條碼間之目前距離為無效解碼距離時,本發明亦可調整變焦鏡頭之焦距,以自動將條碼讀取機與目標條碼間之目前距離調整為有效解碼距離。For example, when the current distance between the barcode reader and the target barcode is a valid decoding distance but the decoding fails, it indicates that the decoding failure may be caused by the presence of a reflective area in the barcode image. At this time, the present invention can adjust the brightness of the fill light of the bar code reader until the area of the two reflective areas is less than a predetermined threshold, and then decode the target image. When the brightness of the fill light is adjusted more than a predetermined number of times, the area of the two reflective areas is still greater than or equal to the predetermined threshold, indicating that the decoding failure may be caused by factors other than distance and reflection (for example, bar code damage, bar code reading) The invention can issue a warning message from the barcode reader to prompt the user to check the barcode, the barcode reader and/or the ambient light. When the current distance between the barcode reader and the target barcode is an invalid decoding distance, the present invention can issue a warning message from the barcode reader to prompt the user to adjust the current distance between the barcode reader and the target barcode to be effectively decoded. distance. In addition, if the bar code reader is equipped with a zoom lens, when the current distance between the bar code reader and the target bar code is an invalid decoding distance, the present invention can also adjust the focal length of the zoom lens to automatically input the bar code reader and the target. The current distance between the barcodes is adjusted to the effective decoding distance.
關於本發明之優點與精神可以藉由以下的發明詳述及所附圖式得到進一步的瞭解。The advantages and spirit of the present invention will be further understood from the following detailed description of the invention.
請參閱第1圖至第3圖,第1圖為根據本發明一實施例之條碼讀取機1與樣本條碼3之樣本影像SI的示意圖,第2圖為第1圖中的條碼讀取機1的功能方塊圖,第3圖為根據本發明一實施例之條碼擷取方法建立條碼影像特徵與相對距離之對照表的流程圖。Please refer to FIG. 1 to FIG. 3 . FIG. 1 is a schematic diagram of a sample image SI of a barcode reader 1 and a sample barcode 3 according to an embodiment of the present invention, and FIG. 2 is a barcode reader in FIG. 1 . 1 is a functional block diagram, and FIG. 3 is a flow chart of establishing a comparison table of bar code image features and relative distances according to a bar code acquisition method according to an embodiment of the invention.
如第2圖所示,本發明之條碼讀取機1包含一影像擷取單元10、一處理單元12、至少一補光燈14、一警示單元16以及一記憶單元18,其中處理單元12電性連接於影像擷取單元10、補光燈14、警示單元16與記憶單元18。補光燈14之數量可根據實際應用而決定,不以一個為限。於實際應用中,影像擷取單元10可為電荷耦合元件(Charge-coupled Device,CCD)感測器或互補式金屬氧化半導體(Complementary Metal-Oxide Semiconductor,CMOS)感測器;處理單元12可為具有資料處理功能之處理器或控制器;警示單元16可為光源、顯示器、揚聲器、振動馬達或其組合;記憶單元18可為記憶體或其它資料儲存裝置。一般而言,條碼讀取機1中還會設有運作時必要的軟硬體元件,如電路板、電源供應器、應用程式、通訊模組、鏡頭等,視實際應用而定。As shown in FIG. 2, the barcode reading machine 1 of the present invention comprises an image capturing unit 10, a processing unit 12, at least one fill light 14, a warning unit 16, and a memory unit 18, wherein the processing unit 12 is electrically The image capturing unit 10, the fill light 14, the warning unit 16, and the memory unit 18 are connected. The number of fill lamps 14 can be determined according to the actual application, not limited to one. In an actual application, the image capturing unit 10 may be a Charge-coupled Device (CCD) sensor or a Complementary Metal-Oxide Semiconductor (CMOS) sensor; the processing unit 12 may be The processor or controller having a data processing function; the alert unit 16 can be a light source, a display, a speaker, a vibration motor, or a combination thereof; the memory unit 18 can be a memory or other data storage device. In general, the bar code reader 1 also has hardware and software components necessary for operation, such as a circuit board, a power supply, an application, a communication module, a lens, etc., depending on the actual application.
本發明係藉由條碼讀取機1取得樣本條碼3之影像特徵,再估測條碼讀取機1與樣本條碼3之相對距離,以提供解碼時需要的相對距離資訊,進而有效提昇解碼效率。因此,在對條碼進行解碼前,本發明之條碼擷取方法需先建立條碼影像特徵與相對距離之對照表。The invention obtains the image feature of the sample barcode 3 by the barcode reader 1, and estimates the relative distance between the barcode reader 1 and the sample barcode 3 to provide relative distance information required for decoding, thereby effectively improving the decoding efficiency. Therefore, before decoding the barcode, the barcode capture method of the present invention needs to first establish a comparison table of barcode image features and relative distances.
首先,執行步驟S10,提供一樣本條碼3,且於樣本條碼3上形成二反光區域30、32。First, step S10 is performed to provide the same barcode 3, and the two reflective areas 30, 32 are formed on the sample barcode 3.
接著,執行步驟S12,以條碼讀取機1於複數個預定距離下擷取樣本條碼3之複數個樣本影像SI,其中每一個預定距離分別屬於有效解碼距離與無效解碼距離的其中之一,且每一個樣本影像SI存在二反光區域30、32。Next, step S12 is executed, and the barcode reader 1 samples a plurality of sample images SI of the barcode 3 at a plurality of predetermined distances, wherein each predetermined distance belongs to one of a valid decoding distance and an invalid decoding distance, respectively, and There are two reflective areas 30, 32 for each sample image SI.
接著,執行步驟S14,計算且分析每一個樣本影像SI之二反光區域30、32間之一相對距離,以得到對應有效解碼距離與無效解碼距離之預定特徵參數。Next, step S14 is performed to calculate and analyze a relative distance between the two reflective areas 30 and 32 of each sample image SI to obtain predetermined characteristic parameters corresponding to the effective decoding distance and the invalid decoding distance.
於此實施例中,本發明可於每一個反光區域30、32中分別選取一特徵點C1、C2,再計算二反光區域30、32之二特徵點C1、C2間之一相對距離D,作為上述之預定特徵參數。需說明的是,上述之特徵點可為反光區域之中心點、邊界點或根據預定規則產生之特定點(例如,反光區域之外接圓或內切圓之圓心),視實際應用而定。於此實施例中,可經由影像處理技術辨識出二反光區域30、32之形狀後,再於每一個反光區域30、32中分別選取特徵點C1、C2。In this embodiment, the present invention can select a feature point C1, C2 in each of the reflective regions 30, 32, and then calculate a relative distance D between the two feature points C1, C2 of the two reflective regions 30, 32 as The predetermined characteristic parameters described above. It should be noted that the above feature points may be the center point of the reflective area, the boundary point or a specific point generated according to a predetermined rule (for example, the center of the circle or the inscribed circle outside the reflective area), depending on the actual application. In this embodiment, after the shapes of the two reflective regions 30 and 32 are recognized by the image processing technology, the feature points C1 and C2 are respectively selected in each of the reflective regions 30 and 32.
在以條碼讀取機1於複數個不同的預定距離下擷取樣本條碼3之複數個樣本影像SI,且對每一個樣本影像SI之二反光區域30、32間之相對距離進行如上之計算與分析後,即可建立如下表1所示之條碼影像特徵與相對距離之對照表。需說明的是,表1中的數值係基於影像大小為752x480像素而建立,本發明不以此為限。 表1 <TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td> 條碼影像特徵與相對距離之對照表 </td></tr><tr><td> 二特徵點C1、C2間之相對距離D(預定特徵參數),單位:像素 </td><td> 條碼讀取機1與條碼之相對距離 </td><td> </td></tr><tr><td> D > 100 </td><td> 相對近距離 </td><td> 無效解碼距離 </td></tr><tr><td> 65 ≦ D ≦ 100 </td><td> 相對中距離 </td><td> 有效解碼距離 </td></tr><tr><td> D < 65 </td><td> 相對遠距離 </td><td> 無效解碼距離 </td></tr></TBODY></TABLE>The plurality of sample images SI of the barcode 3 are sampled by the barcode reader 1 at a plurality of different predetermined distances, and the relative distance between the two reflective regions 30 and 32 of each sample image SI is calculated as above. After the analysis, a comparison table of bar code image features and relative distances as shown in Table 1 below can be established. It should be noted that the values in Table 1 are based on the image size of 752×480 pixels, and the present invention is not limited thereto. Table 1 <TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td> Comparison of barcode image features and relative distances</td></tr><tr>< Td> relative distance D between two feature points C1 and C2 (predetermined characteristic parameter), unit: pixel </td><td> relative distance between bar code reader 1 and bar code </td><td> </td> </tr><tr><td> D > 100 </td><td> Relative close distance </td><td> Invalid decoding distance</td></tr><tr><td> 65 ≦ D ≦ 100 </td><td> relative medium distance </td><td> effective decoding distance </td></tr><tr><td> D < 65 </td><td> relative distance < /td><td> Invalid decoding distance</td></tr></TBODY></TABLE>
如表1所示,本發明可將相對中距離定義為有效解碼距離,且將相對近距離與相對遠距離皆定義為無效解碼距離。表1所示之對照表係儲存於記憶單元18中。於此實施例中,表1所示之對照表係同時記錄對應有效解碼距離與無效解碼距離之預定特徵參數。然而,於另一實施例中,本發明之對照表亦可僅記錄對應有效解碼距離之預定特徵參數。當二特徵點C1、C2間之相對距離D與有效解碼距離之預定特徵參數不相符時,即可判斷為無效解碼距離。As shown in Table 1, the present invention can define the relative median distance as the effective decoding distance, and define both the relatively close distance and the relatively long distance as the invalid decoding distance. The comparison table shown in Table 1 is stored in the memory unit 18. In this embodiment, the comparison table shown in Table 1 simultaneously records predetermined feature parameters corresponding to the effective decoding distance and the invalid decoding distance. However, in another embodiment, the look-up table of the present invention may also record only predetermined feature parameters corresponding to the effective decoding distance. When the relative distance D between the two feature points C1 and C2 does not match the predetermined feature parameter of the effective decoding distance, the invalid decoding distance can be determined.
請參閱第4圖至第6圖,第4圖為根據本發明一實施例之條碼擷取方法的流程圖,第5圖為在有效解碼距離擷取目標條碼5之目標影像TI1的示意圖,第6圖為在無效解碼距離擷取目標條碼5之目標影像TI2的示意圖。在建立如上表1所示之條碼影像特徵與相對距離之對照表後,即可根據表1對目標條碼5進行擷取與解碼。Please refer to FIG. 4 to FIG. 6 . FIG. 4 is a flowchart of a barcode capture method according to an embodiment of the present invention. FIG. 5 is a schematic diagram of a target image TI1 of a target barcode 5 captured at a valid decoding distance. 6 is a schematic diagram of the target image TI2 of the target barcode 5 captured at the invalid decoding distance. After establishing a comparison table of bar code image features and relative distances as shown in Table 1 above, the target bar code 5 can be captured and decoded according to Table 1.
首先,執行步驟S30,以條碼讀取機1擷取目標條碼5之目標影像,亦即,經由條碼讀取機1之影像擷取單元10擷取目標條碼5之目標影像。如第5圖所示,條碼讀取機1之影像擷取單元10在有效解碼距離擷取目標條碼5之目標影像TI1。如第6圖所示,條碼讀取機1之影像擷取單元10在無效解碼距離擷取目標條碼5之目標影像TI2。First, in step S30, the target image of the target barcode 5 is captured by the barcode reader 1, that is, the target image of the target barcode 5 is captured by the image capturing unit 10 of the barcode reader 1. As shown in FIG. 5, the image capturing unit 10 of the barcode reader 1 captures the target image TI1 of the target barcode 5 at the effective decoding distance. As shown in FIG. 6, the image capturing unit 10 of the barcode reader 1 captures the target image TI2 of the target barcode 5 at the invalid decoding distance.
接著,執行步驟S32,處理單元12判斷目標影像中是否存在二反光區域。Next, in step S32, the processing unit 12 determines whether there is a two-reflecting area in the target image.
如第5圖與第6圖所示所示,目標影像TI1中存在二反光區域50、52,且目標影像TI2中存在二反光區域54、56。當處理單元12判斷目標影像中存在二反光區域時,執行步驟S34,處理單元12計算對應二反光區域之一參考特徵參數。針對第5圖所示之目標影像TI1,處理單元12係於每一個反光區域50、52中分別選取一特徵點C1'、C2',且計算二反光區域50、52之二特徵點C1'、C2'間之相對距離D',作為參考特徵參數。針對第6圖所示之目標影像TI2,處理單元12係於每一個反光區域54、56中分別選取一特徵點C1''、C2'',且計算二反光區域54、56之二特徵點C1''、C2''間之相對距離D'',作為參考特徵參數。需說明的是,特徵點C1'、C2'、C1''、C2''的選取方式與上述之特徵點C1、C2的選取方式相同,在此不再贅述。As shown in FIGS. 5 and 6, the two reflection areas 50 and 52 are present in the target image TI1, and the two reflection areas 54, 56 are present in the target image TI2. When the processing unit 12 determines that there is a two-reflecting area in the target image, step S34 is performed, and the processing unit 12 calculates one of the reference feature parameters of the corresponding two-reflecting area. For the target image TI1 shown in FIG. 5, the processing unit 12 selects one feature point C1', C2' in each of the reflective areas 50, 52, and calculates two feature points C1' of the two reflective areas 50, 52, The relative distance D' between C2' is used as a reference feature parameter. For the target image TI2 shown in FIG. 6, the processing unit 12 selects one feature point C1'', C2'' in each of the reflective areas 54, 56, and calculates two feature points C1 of the two reflective areas 54, 56. The relative distance D'' between '' and C2'' is used as a reference feature parameter. It should be noted that the selection manners of the feature points C1', C2', C1'', and C2'' are the same as those of the feature points C1 and C2 described above, and are not described herein again.
接著,執行步驟S36,處理單元12判斷參考特徵參數與對應有效解碼距離之預定特徵參數是否相符。當處理單元12判斷參考特徵參數與對應有效解碼距離之預定特徵參數相符時,執行步驟S38,處理單元12判斷條碼讀取機1與目標條碼5間之目前距離為有效解碼距離。當處理單元12判斷參考特徵參數與對應有效解碼距離之預定特徵參數不相符時,執行步驟S40,處理單元12判斷條碼讀取機1與目標條碼5間之目前距離為無效解碼距離。Next, in step S36, the processing unit 12 determines whether the reference feature parameter matches the predetermined feature parameter of the corresponding effective decoding distance. When the processing unit 12 determines that the reference feature parameter matches the predetermined feature parameter corresponding to the effective decoding distance, step S38 is performed, and the processing unit 12 determines that the current distance between the barcode reader 1 and the target barcode 5 is the effective decoding distance. When the processing unit 12 determines that the reference feature parameter does not match the predetermined feature parameter of the corresponding effective decoding distance, step S40 is performed, and the processing unit 12 determines that the current distance between the barcode reader 1 and the target barcode 5 is an invalid decoding distance.
針對第5圖所示之目標影像TI1,假設二反光區域50、52之二特徵點C1'、C2'間之相對距離D'為80像素,則處理單元12根據表1判斷參考特徵參數(亦即,相對距離D')與對應有效解碼距離之預定特徵參數相符,進而判斷條碼讀取機1與目標條碼5間之目前距離為有效解碼距離。For the target image TI1 shown in FIG. 5, assuming that the relative distance D' between the two feature points C1' and C2' of the two reflective areas 50, 52 is 80 pixels, the processing unit 12 determines the reference characteristic parameter according to Table 1. That is, the relative distance D') coincides with the predetermined characteristic parameter corresponding to the effective decoding distance, and further determines that the current distance between the barcode reader 1 and the target barcode 5 is the effective decoding distance.
當條碼讀取機1與目標條碼5間之目前距離為有效解碼距離卻解碼失敗時,表示解碼失敗有可能是由條碼影像中存在反光區域50、52造成。因此,當處理單元12判斷條碼讀取機1與目標條碼5間之目前距離為有效解碼距離時,執行步驟S42,處理單元12調整補光燈14之亮度。於此實施例中,補光燈之亮度調整可為循環式,每次適度調降後就再對目標條碼5擷取一張新的目標影像TI1,且計算二反光區域50、52之面積。當二反光區域50、52之面積小於一預定閥值時,執行步驟S44,處理單元12對目標影像TI1進行解碼。上述之預定閥值可根據實際應用而設定。需說明的是,對於一般條碼解碼程序須注意之事項或一般影像前處理程序,本案並無例外。舉例而言,一般條碼解碼程序還會計算影像對比,且在影像對比大於預定值時才開始解碼程序。When the current distance between the barcode reader 1 and the target barcode 5 is the effective decoding distance but the decoding fails, it indicates that the decoding failure may be caused by the presence of the reflective areas 50, 52 in the barcode image. Therefore, when the processing unit 12 determines that the current distance between the barcode reader 1 and the target barcode 5 is the effective decoding distance, step S42 is performed, and the processing unit 12 adjusts the brightness of the fill light 14. In this embodiment, the brightness adjustment of the fill light can be cyclic, and after each moderation, a new target image TI1 is captured for the target barcode 5, and the area of the two reflective areas 50, 52 is calculated. When the area of the two reflective areas 50, 52 is less than a predetermined threshold, step S44 is performed, and the processing unit 12 decodes the target image TI1. The predetermined threshold described above can be set according to the actual application. It should be noted that there are no exceptions to this matter for matters that should be noted in general bar code decoding procedures or general image pre-processing procedures. For example, a general barcode decoding program also calculates image contrast and begins the decoding process when the image contrast is greater than a predetermined value.
當處理單元12調整該補光燈14之亮度超過一預定次數(例如,三次、五次等)後,二反光區域50、52之面積仍大於或等於預定閥值時,表示解碼失敗有可能是由距離與反光之外的其它因素造成(例如,條碼毀損、條碼讀取機故障、環境光太亮等),因此,可執行步驟S46,由處理單元12控制警示單元16發出一警示訊息,以提示使用者針對條碼、條碼讀取機及/或環境光進行檢查。於此實施例中,警示訊息可為光線、影像、聲音、振動或其組合,視實際應用而定。此外,本發明亦可利用一般條碼讀取機上的定位指示燈作為警示單元16,此時,處理單元12可控制定位指示燈以閃光方式提示使用者。When the processing unit 12 adjusts the brightness of the fill light 14 for more than a predetermined number of times (for example, three times, five times, etc.), and the area of the two reflective areas 50, 52 is still greater than or equal to a predetermined threshold, it indicates that the decoding failure may be Caused by other factors than distance and reflection (for example, barcode damage, barcode reader failure, ambient light is too bright, etc.), therefore, step S46 may be performed, and the processing unit 12 controls the alert unit 16 to issue a warning message to prompt The user checks for bar codes, bar code readers and/or ambient light. In this embodiment, the warning message may be light, image, sound, vibration, or a combination thereof, depending on the actual application. In addition, the present invention can also utilize the positioning indicator light on the general barcode reader as the warning unit 16. At this time, the processing unit 12 can control the positioning indicator to prompt the user in a flashing manner.
針對第6圖所示之目標影像TI2,假設二反光區域54、56之二特徵點C1''、C2''間之相對距離D''為40像素,則處理單元12根據表1判斷參考特徵參數(亦即,相對距離D'')與對應有效解碼距離之預定特徵參數不相符,進而判斷條碼讀取機1與目標條碼5間之目前距離為無效解碼距離。For the target image TI2 shown in FIG. 6, assuming that the relative distance D'' between the two feature points C1'' and C2'' of the two reflective regions 54, 56 is 40 pixels, the processing unit 12 determines the reference feature according to Table 1. The parameter (ie, the relative distance D'') does not match the predetermined characteristic parameter corresponding to the effective decoding distance, and further determines that the current distance between the barcode reader 1 and the target barcode 5 is an invalid decoding distance.
當處理單元12判斷條碼讀取機1與目標條碼5間之目前距離為無效解碼距離時,執行步驟S48,處理單元12控制警示單元16發出警示訊息,以提示使用者將條碼讀取機1與目標條碼5間之目前距離調整為有效解碼距離。如上所述,警示訊息可為光線、影像、聲音、振動或其組合,視實際應用而定。When the processing unit 12 determines that the current distance between the barcode reader 1 and the target barcode 5 is an invalid decoding distance, step S48 is executed, and the processing unit 12 controls the alert unit 16 to issue a warning message to prompt the user to display the barcode reader 1 and The current distance between the target barcodes 5 is adjusted to the effective decoding distance. As noted above, the alert message can be light, image, sound, vibration, or a combination thereof, depending on the application.
根據表1,當二反光區域54、56之二特徵點C1''、C2''間之相對距離D''為40像素時,條碼讀取機1與目標條碼5間之目前距離係為相對遠距離,亦即,條碼讀取機1距離目標條碼5過遠。本發明可以快速閃光方式提示使用者需將條碼讀取機1靠近目標條碼5來取像。反之,若條碼讀取機1距離目標條碼5過近,本發明可以慢速閃光方式提示使用者需將條碼讀取機1遠離目標條碼5來取像。當然,本發明亦可直接透過影像顯示“過遠”、“過近”或其它文字、符號或圖像來提示使用者。換言之,警示訊息之呈現方式可根據實際應用而決定,不以上述實施例為限。According to Table 1, when the relative distance D'' between the two feature points C1'' and C2'' of the two reflective areas 54, 56 is 40 pixels, the current distance between the barcode reader 1 and the target barcode 5 is relative. At a long distance, that is, the barcode reader 1 is too far from the target barcode 5. The invention can prompt the user to take the barcode reader 1 close to the target barcode 5 for image capture in a quick flash mode. On the other hand, if the barcode reader 1 is too close to the target barcode 5, the present invention can prompt the user to take the barcode reader 1 away from the target barcode 5 for image capture in a slow flash mode. Of course, the present invention can also prompt the user directly through the image display "too far", "too close" or other words, symbols or images. In other words, the manner in which the warning message is presented may be determined according to the actual application, and is not limited to the above embodiment.
於上述之步驟S32中,當處理單元12判斷目標影像中不存在二反光區域時,可執行步驟S50,進行一般條碼解碼程序。In the above step S32, when the processing unit 12 determines that there is no second reflective area in the target image, step S50 may be performed to perform a general barcode decoding process.
請參閱第7圖,第7圖為根據本發明另一實施例之條碼讀取機1'的功能方塊圖。條碼讀取機1'與上述的條碼讀取機1的主要不同之處在於,條碼讀取機1'另包含一變焦鏡頭20以及一驅動模組22,其中驅動模組22電性連接於處理單元12,且驅動模組22連接於變焦鏡頭20,如第7圖所示。於此實施例中,驅動模組22可為馬達模組。當處理單元12判斷條碼讀取機1'與目標條碼5間之目前距離為無效解碼距離時,除了發出警示訊息外,處理單元12亦可控制驅動模組22驅動變焦鏡頭20,以調整變焦鏡頭20之一焦距,進而將條碼讀取機1'與目標條碼5間之目前距離調整為有效解碼距離。換言之,對於裝設有變焦鏡頭20之條碼讀取機1'而言,可自動調整變焦鏡頭20之焦距,進而自動將條碼讀取機1'與目標條碼5間之目前距離調整為有效解碼距離。無須使用者手動將條碼讀取機1'與目標條碼5間之目前距離調整為有效解碼距離,使用上更為方便。需說明的是,第7圖中與第2圖中所示相同標號的元件,其作用原理大致相同,在此不再贅述。Please refer to FIG. 7. FIG. 7 is a functional block diagram of a bar code reader 1' according to another embodiment of the present invention. The bar code reader 1 ′ is different from the bar code reader 1 described above in that the bar code reader 1 ′ further includes a zoom lens 20 and a driving module 22 , wherein the driving module 22 is electrically connected to the processing. The unit 12 and the drive module 22 are connected to the zoom lens 20 as shown in FIG. In this embodiment, the driving module 22 can be a motor module. When the processing unit 12 determines that the current distance between the barcode reader 1' and the target barcode 5 is an invalid decoding distance, in addition to issuing an alert message, the processing unit 12 can also control the driving module 22 to drive the zoom lens 20 to adjust the zoom lens. 20 one focal length, and then the current distance between the barcode reader 1' and the target barcode 5 is adjusted to the effective decoding distance. In other words, for the barcode reader 1 ′ equipped with the zoom lens 20 , the focal length of the zoom lens 20 can be automatically adjusted, and the current distance between the barcode reader 1 ′ and the target barcode 5 is automatically adjusted to the effective decoding distance. . The user does not need to manually adjust the current distance between the barcode reader 1' and the target barcode 5 to a valid decoding distance, which is more convenient to use. It should be noted that the components of the same reference numerals as those shown in FIG. 2 have substantially the same operation principle, and are not described herein again.
綜上所述,本發明係利用目標影像中的二反光區域來判斷條碼讀取機與目標條碼間之目前距離為有效解碼距離或無效解碼距離。接著,本發明即可根據上述判斷結果進行對應處理程序,以有效提昇解碼效率。In summary, the present invention utilizes the two reflective areas in the target image to determine whether the current distance between the barcode reader and the target barcode is a valid decoding distance or an invalid decoding distance. Then, the present invention can perform a corresponding processing procedure according to the above judgment result to effectively improve the decoding efficiency.
舉例而言,當條碼讀取機與目標條碼間之目前距離為有效解碼距離卻解碼失敗時,表示解碼失敗有可能是由條碼影像中存在反光區域造成。此時,本發明可調整條碼讀取機之補光燈之亮度,直到二反光區域之面積小於預定閥值時,再對目標影像進行解碼。當調整補光燈之亮度超過預定次數後,二反光區域之面積仍大於或等於預定閥值時,表示解碼失敗有可能是由距離與反光之外的其它因素造成(例如,條碼毀損、條碼讀取機故障、環境光太亮等),本發明可自條碼讀取機發出警示訊息,以提示使用者針對條碼、條碼讀取機及/或環境光進行檢查。當條碼讀取機與目標條碼間之目前距離為無效解碼距離時,本發明可自條碼讀取機發出警示訊息,以提示使用者將條碼讀取機與目標條碼間之目前距離調整為有效解碼距離。此外,若條碼讀取機裝設有變焦鏡頭,當條碼讀取機與目標條碼間之目前距離為無效解碼距離時,本發明亦可調整變焦鏡頭之焦距,以自動將條碼讀取機與目標條碼間之目前距離調整為有效解碼距離。 以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。For example, when the current distance between the barcode reader and the target barcode is a valid decoding distance but the decoding fails, it indicates that the decoding failure may be caused by the presence of a reflective area in the barcode image. At this time, the present invention can adjust the brightness of the fill light of the bar code reader until the area of the two reflective areas is less than a predetermined threshold, and then decode the target image. When the brightness of the fill light is adjusted more than a predetermined number of times, the area of the two reflective areas is still greater than or equal to the predetermined threshold, indicating that the decoding failure may be caused by factors other than distance and reflection (for example, bar code damage, bar code reading) The invention can issue a warning message from the barcode reader to prompt the user to check the barcode, the barcode reader and/or the ambient light. When the current distance between the barcode reader and the target barcode is an invalid decoding distance, the present invention can issue a warning message from the barcode reader to prompt the user to adjust the current distance between the barcode reader and the target barcode to be effectively decoded. distance. In addition, if the bar code reader is equipped with a zoom lens, when the current distance between the bar code reader and the target bar code is an invalid decoding distance, the present invention can also adjust the focal length of the zoom lens to automatically input the bar code reader and the target. The current distance between the barcodes is adjusted to the effective decoding distance. The above are only the preferred embodiments of the present invention, and all changes and modifications made to the scope of the present invention should be within the scope of the present invention.
1、1' 條碼讀取機 3 樣本條碼 5 目標條碼 10 影像擷取單元 12 處理單元 14 補光燈 16 警示單元 18 記憶單元 20 變焦鏡頭 22 驅動模組 30、32、50、52、54、56 反光區域 C1、C2、C1'、C2'、C1''、C2'' 特徵點 D、D'、D'' 相對距離 SI 樣本影像 TI1、TI2 目標影像 S10-S14、S30-S50 步驟1, 1' barcode reader 3 sample barcode 5 target barcode 10 image capture unit 12 processing unit 14 fill light 16 warning unit 18 memory unit 20 zoom lens 22 drive module 30, 32, 50, 52, 54, 56 Reflective areas C1, C2, C1', C2', C1'', C2'' Feature points D, D', D'' Relative distance SI Sample images TI1, TI2 Target images S10-S14, S30-S50 Steps
第1圖為根據本發明一實施例之條碼讀取機與樣本條碼之樣本影像的示意圖。 第2圖為第1圖中的條碼讀取機的功能方塊圖。 第3圖為根據本發明一實施例之條碼擷取方法建立條碼影像特徵與相對距離之對照表的流程圖。 第4圖為根據本發明一實施例之條碼擷取方法的流程圖。 第5圖為在有效解碼距離擷取目標條碼之目標影像的示意圖。 第6圖為在無效解碼距離擷取目標條碼之目標影像的示意圖。 第7圖為根據本發明另一實施例之條碼讀取機的功能方塊圖。1 is a schematic diagram of a sample image of a bar code reader and a sample bar code according to an embodiment of the invention. Fig. 2 is a functional block diagram of the bar code reader in Fig. 1. FIG. 3 is a flow chart of establishing a comparison table of bar code image features and relative distances according to a bar code acquisition method according to an embodiment of the invention. 4 is a flow chart of a bar code capture method according to an embodiment of the invention. Figure 5 is a schematic diagram of the target image of the target barcode captured at the effective decoding distance. Figure 6 is a schematic diagram of the target image of the target barcode captured at the invalid decoding distance. Figure 7 is a functional block diagram of a bar code reader in accordance with another embodiment of the present invention.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105123557A TWI623882B (en) | 2016-07-26 | 2016-07-26 | Barcode capturing method and barcode reader |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105123557A TWI623882B (en) | 2016-07-26 | 2016-07-26 | Barcode capturing method and barcode reader |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201804370A TW201804370A (en) | 2018-02-01 |
TWI623882B true TWI623882B (en) | 2018-05-11 |
Family
ID=62014073
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW105123557A TWI623882B (en) | 2016-07-26 | 2016-07-26 | Barcode capturing method and barcode reader |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI623882B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203179035U (en) * | 2013-03-18 | 2013-09-04 | 苏州斯普锐智能***有限公司 | Bar code scanner |
TW201602917A (en) * | 2014-07-03 | 2016-01-16 | Mexxen Technology Inc | Optimized barcode scanning parameter learning method of barcode reader |
-
2016
- 2016-07-26 TW TW105123557A patent/TWI623882B/en not_active IP Right Cessation
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203179035U (en) * | 2013-03-18 | 2013-09-04 | 苏州斯普锐智能***有限公司 | Bar code scanner |
TW201602917A (en) * | 2014-07-03 | 2016-01-16 | Mexxen Technology Inc | Optimized barcode scanning parameter learning method of barcode reader |
Also Published As
Publication number | Publication date |
---|---|
TW201804370A (en) | 2018-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3040906B1 (en) | Visual feedback for code readers | |
US9521284B2 (en) | Interactive user interface for capturing a document in an image signal | |
US8503818B2 (en) | Eye defect detection in international standards organization images | |
US20160019406A1 (en) | System and method for indicia verification | |
US7143948B2 (en) | Reading method of the two-dimensional bar code | |
EP3285198B1 (en) | Method for reading indicia off a display of a mobile device | |
US20150144692A1 (en) | System and method for indicia reading and verification | |
EP2507741B1 (en) | Imaging-based scanner including border searching for image acquisition | |
TW200300540A (en) | Very person identification system | |
JP2007213359A (en) | Two-dimensional code detection system and two-dimensional code detection program | |
US10951808B2 (en) | Method for focusing control, mobile terminal and non-transitory storage medium | |
KR102366643B1 (en) | Method and apparatus for calibrating a client computing device to decode symbols | |
TWI623882B (en) | Barcode capturing method and barcode reader | |
CN106295455B (en) | Bar code indicating method and bar code reader | |
KR101685161B1 (en) | Converting apparatus of passport information and method using the same | |
CN106250792B (en) | Bar code acquisition method and bar code reader | |
CN108737733B (en) | Information prompting method and device, electronic equipment and computer readable storage medium | |
TWI623884B (en) | Barcode indicating method and barcode reader | |
CN112997217A (en) | Document detection from video images | |
JP4378491B2 (en) | Code image output device | |
JP7063488B2 (en) | Imaging method, imaging device, determination method and program of imaging target | |
JP2010250408A (en) | Optical information reader | |
JP5853345B2 (en) | Focus index calculation apparatus, image processing apparatus, computer program, and focus index calculation method | |
TWI827423B (en) | Scanning method and related devices | |
JP2019046330A (en) | Optical type information reading device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |