Code reading apparatus and method

A code reading apparatus, comprising: an image capturing unit configured to capture the image picked-up by a image pickup unit; a detection unit configured to detect the code contained in the captured image; a decoding unit configured to decode the detected code; and a recognition unit configured to recognize, if the detected code is a two-dimensional code, the model number of the two-dimensional code. The decoding unit decodes the detected two-dimensional code if the model number recognized is a predetermined model number.

CROSS-REFERENCE TO RELATED APPLICATION

The present application contains subject matter related to that disclosed in Japanese Priority Patent Application No. 2011-110772 filed in the Japan Patent Office on May 17, 2011 and Japanese Priority Patent Application No. 2012-038023 filed in the Japan Patent Office on Feb. 23, 2012 the entire contents of which are hereby incorporated by reference.

FIELD

Embodiments described herein relate to a code reading apparatus and method.

BACKGROUND

At present, in a conventional commodity information processing system used in a supermarket or other shops, some checkout system provided with a POS (Point Of Sale) contains a pre-handling system. The pre-handling system is that the portable terminal carried by a store clerk is operated by the store clerk to register a commodity, and a provisional receipt is printed by a printer on which the two-dimensional code of the commodity registered by the portable terminal is printed before an account settlement processing using the POS terminal installed in the checkout region of a shop. In a shop where this pre-handling system is deployed, the customer delivers the provisional receipt issued by the pre-handling system to an operator in a checkout region. The operator reads the two-dimensional code printed on the provisional receipt to a code reading apparatus connected with the scanner of a POS terminal. Then, the POS terminal carries out an account settlement processing based on the two-dimensional code read by the code reading apparatus.

DETAILED DESCRIPTION

According to one embodiment, a code reading apparatus, comprising: an image capturing unit configured to capture the image picked-up by a image pickup unit; a detection unit configured to detect the code contained in the captured image; a decoding unit configured to decode the detected code; and a recognition unit configured to recognize, if the detected code is a two-dimensional code, the model number of the two-dimensional code, wherein the decoding unit decodes the detected two-dimensional code if the model number recognized is a predetermined model number.

According to other embodiment, a method, comprising: capturing the image picked-up by a image pickup unit; detecting the code contained in the captured image; decoding the detected code; and recognizing, if the detected code is a two-dimensional code, the model number of the two-dimensional code, wherein the decoding decodes the detected two-dimensional code if the model number recognized is a predetermined model number.

By taking a checkout system as an example, the code reading apparatus and the program provided herein are described below with reference to accompanying drawings. The checkout system has a POS terminal for registering and calculating the account of the commodities settled in one transaction. The embodiments are described based on an example of the application of the checkout system in a restaurant or supermarket.

FIG. 1is a perspective view of a checkout system1. As shown inFIG. 1, the checkout system1has a POS terminal11for registering and calculating the account of the commodities settled in a transaction. The POS terminal11is configured on a cash drawer21on a checkout counter51. The cash drawer21is opened by the POS terminal11. A keyboard22for the operator (user) to press down is configured on the POS terminal11. Seen from the operator of the keyboard22, a display23is configured more interior than the keyboard22to display information for the operator. The display23displays information on the display panel23athereof. A touch panel26indicates hierarchical structure on the display panel23a. A vertical customer display24is rotationally and freely configured at the side further than the display23. The costumer display24displays information on the display panel24athereof. Moreover, the display panel24aof the customer display24shown inFIG. 1faces the nearer side inFIG. 1and can, however, also face the far side inFIG. 1by rotating the customer display24to enable the customer display24to display information for the customer.

An elongate desk-shaped counter151is arrange which forms an L shape with the checkout counter51provided with the POS terminal11. A commodity receiving side152is formed on the counter151. A shop basket153in which a commodity A added with a barcode BC is contained is hold on the commodity receiving side152. The shopping basket153is classified into a first shopping basket153ahold by a customer and a second shopping basket153bspaced from the first shopping basket153aby a code reading apparatus101.

The code reading apparatus101, which is connected with the POS terminal11to transmit data with the POS terminal11freely, is configured on the commodity receiving side152of the counter151. The code reading apparatus101has a thin rectangular housing102, the front surface of which is provided with a reading window103. A display operating unit104is configured on the upper part of the housing102and provided with a display106the surface of which indicates hierarchical structure with a touch panel105. A keyboard107is configured on the right of the display106. The card reading slot108of a card reader (not shown) is configured on the right of the keyboard107. Seen from the operator, a customer display109is configured at the left inner side of the back of the display operating unit104to provide information for the customer. A customer touch panel109aindicates hierarchical structure on the display panel of the customer display109.

A commodity A to be settled in a transaction is accommodated in the first shopping basket153ahold by the customer. A barcode BC encoded by the commodity code related to the commodity A is adhered on the commodity A. The operator manually moves the commodity A into the second shopping basket153b. The barcode BC faces the reading window103of the code reading apparatus101during the movement. At this time, an image pickup unit164(refer toFIG. 2) configured at the inner side of the reading window103pickups the barcode BC. In the code reading apparatus101, the commodity code of the commodity A is read by detecting and decoding the BC contained in the image picked-up by the image pickup unit164. The commodity code described as the BC is a code distributed to a commodity to specify the commodity, such as a JAN code consisting of 13 figures.

Moreover, in addition to the BC adhered on the commodity A, the code reading apparatus101further reads a discount code adhered on the commodity A and a pre-handling code printed on a provisional receipt (commodity pre-registration voucher) issued by the portable terminal carried by a store clerk in the pre-handling system. The discount code and the pre-handling code may be JAN codes, like the BC, or two-dimensional codes (e.g. QR code (trademark)). Especially, as definitely required to contain the information (e.g. commodity code) representing a registered commodity, the pre-handling code is a two-dimensional code using large storage data. In; this embodiment, the pre-handling code is a QR code ((trademark)) the model number of which is 17-20 and the data size of which is large enough to store the information representing a registered commodity.

For instance, in the pre-handling system, before an account settlement is carried out using the POS terminal11, the portable terminal carried by a store clerk is operated by the operator to register a commodity, and a commodity pre-registration voucher T (refer toFIG. 7) printed with a two-dimensional code C1containing the information of the commodity registered in the portable terminal is printed by a printer. In a shop where the pre-handling system is installed, the customer delivers the commodity pre-registration voucher T issued by the pre-handling system to an operator in a checkout region. The operator reads the two-dimensional code C1printed on the commodity pre-registration voucher T to the code reading apparatus101connected with the POS terminal11. Then, the POS terminal carries out an account settlement based on the two-dimensional code C1read by the code reading apparatus101.

FIG. 2is a block diagram showing the hardware components of the POS terminal11and the code reading apparatus101according to an embodiment of the present invention. The POS terminal11is provided with a micro computer60functioning as an information processing unit for carrying out an information processing. The micro computer60is formed by connecting a CPU (Central Processing Unit)61that carries out various operations and controls each other unit with an ROM (Read Only Memory)62and an RAM (Random Access Memory)63via a bus line.

The CPU61of the POS terminal11is connected with the cash drawer21, the keyboard22, the display23, the touch panel26and the customer display24via various input/output circuits (not shown). The components connected with the CPU61of the POS terminal11are controlled by the CPU61.

The keyboard22includes a numeric keypad22dthe upper surface of which is displayed with figures such as ‘1’, ‘2’, ‘3’ and mathematical operator such as ‘*’, a provisional closing key22eand a closing key22f.

The CPU61of the POS terminal1is connected with an HDD (Hard Disk Drive)64, in which programs and files are stored. When run in the POS terminal11, the programs and files stored in the HDD64are completely or partially copied into the RAM63to be sequentially executed by the CPU61. An example of the program stored in the HDD64is a commodity sales data processing program PR. An example of the file stored in the HDD64is a PLU file F1that is sent from a storage computer SC and then stored in the HDD64. The PLU file F1is a file in which commodity-related information such as commodity name, unit price and commodity type is stored corresponding to a commodity code that is uniquely distributed to a commodity.

The CPU61of the POS terminal11is connected, via an input-output circuit (not shown), with a communication interface25that communicates in data with the storage computer SC. The storage computer SC is installed at the backyard of the shop. The PLU file F1to be sent to the POS terminal11is stored in the HDD (not shown) of the storage computer SC.

In addition, the CPU61of the POS terminal11is connected with a connection interface65to transmit data with the code reading apparatus101. Therefore, the POS terminal11is connected with the code reading apparatus101via the connection interface65. Moreover, the CPU61of the POS terminal11is connected with a printer66for printing receipts. The POS terminal11prints the content of a transaction on a receipt under the control of the CPU61.

Like the POS terminal11, the code reading apparatus101also has a micro computer160, which is formed by connecting a CPU161with an ROM162and an RAM163via a bus line. The programs executed by the CPU161are stored in the ROM162. The CPU161is connected with a image pickup unit164via various input/output circuits (not shown). The actions of the image pickup unit164are controlled by the CPU161. The display operating unit104is connected with the POS terminal11via a connection interface176. The actions of the display operating unit104are controlled by the CPU161of the POS terminal11.

The image pickup unit164is a CCD image sensor or a CONS image sensor which carries out a image pickup at the reading window103under the control of the CPU161. For instance, the image pickup unit164pickups dynamic images at 30 fps. The frame images sequentially picked-up by the image pickup unit164at a predetermined frame rate are stored in the RAM163.

Further, the CPU161is connected with a connection interface175which is connected with the connection interface65of the POS terminal11to transmit data with the POS terminal11. The commodity code that is read from the image picked-up by the image pickup unit164of the code reading apparatus101and then decoded is output through the connection interface175under the control of the CPU161and then input to the POS terminal11via the connection interface65.

The functional units of the code reading apparatus101achieved by the sequential program running of the CPU161are described below with reference toFIG. 3.FIG. 3is a block diagram showing the functional components of the CPU161of the code reading apparatus101according to an embodiment of the present invention. As shown inFIG. 3, by executing programs sequentially, the CPU161functions as a picked-up image capturing unit1611, a code detector unit1612, a recognition unit1613, a decoder unit1614and an output unit1615.

The picked-up image capturing unit1611sequentially captures the frame images that are stored in the RAM163after picked-up by the image pickup unit164. The picked-up image capturing unit1611captures the frame images in accordance with the storage order of the images in the RAM163. The code detector unit1612detects the codes (the barcode BC adhered on the commodity A as well as a discount code and a frontier checker code) contained in the frame image captured by the picked-up image capturing unit1611. Specifically, a barcode BC is detected from the captured frame image using a pattern matching technology, while a two-dimensional code is detected using a predetermined finder pattern (refer toFIG. 4).

When a two-dimensional code is detected by the code detector unit1612using a predetermined finder pattern, the recognition unit1613recognizes the model number of the two-dimensional code based on the shape of the detected two-dimensional code. The recognition unit1613carries out the recognition before the two-dimensional code detected by the code detector1612is decoded by the decoder unit1614. The model numbers (versions) of two-dimensional codes such as QR codes (trademark) include version 1 (21*21 cells) to version 40 (177*177 cells), every 4 cells defining a different version, therefore, the model number of a two-dimensional code can be recognized based on the shape or size of the two-dimensional code.

The model number recognition of a two-dimensional code based on the shape of the two-dimensional code is described here in detail.FIG. 4is a conceptual diagram showing a finder pattern P1and an alignment pattern P11in an exemplary two-dimensional code C. As shown inFIG. 4, the position detection patterns contained in the two-dimensional code C for the position detection of the two-dimensional code C include finder patterns P1-P3for detecting the two-dimensional code C and alignment patterns P11-P16for a position alignment during the decoding of the detected two-dimensional code C. The finder patterns P1-P3are located at three corners of the two-dimensional code C. The finder pattern P1having a width of WUL is a distance D away from the finder pattern P2having a width of WUR.

The recognition unit1613calculates the distance D, the widths WUL and WUR between the finder patterns P1and P2along a pixel line which extends across the maximum width of the finder patterns P1and P2and through the central part of the finder patterns P1and P2, according to the frame image that the two-dimensional code C is detected. Then, the recognition unit1613calculates the dimension X of the two-dimensional code C according to the following formula: X=(WUL+WUR)/14. Sequentially, the recognition unit1613temporarily calculates, based on the calculated dimension X, the model number V of the two-dimensional code C according to the following formula:
V=[(D/X)−10]/4.

If the temporarily calculated model number V is below6, the recognition unit1613takes the temporarily calculated model number V as a recognized model number. If the temporarily calculated model number V is above 7, the recognition unit1613calculates the modular size CP of the two-dimensional code C by dividing the width WUR of the right upper finder pattern P2by 7, that is, CP=WUR/7. Then, the recognition unit1613sets the sampling grid of a recognition information area I1based on the central coordinate and the modular size CP of the finder pattern P2. The recognition unit1613reads the recognition information area I1based on the set sampling grid and recognizes the model number of the two-dimensional code C based on the model number information contained in the recognition information area I1. Moreover, if a detected error is beyond the error correction capacity of an error correcting symbol applied to the recognition information area I1, finder patterns P1and P3, like the finder patterns P1and P2, are used to read a recognition information area I2, and the model number of the two-dimensional code C is recognized based on the model number information contained in the recognition information area I2. In this way, the recognition unit1613can recognize the model number of the two-dimensional code C accurately based on the widths of finder patterns P1-P3and the distance between each of the finder patterns P1-P3. Moreover, the recognition of the model number using finder patterns P1-P3is merely an example, and the same recognition can be certainly realized according to the position relationship between alignment patterns P11-P16.

The decoder unit1614decodes the codes (barcode BC, two-dimensional code C) detected by the code detector unit1612according to the predetermined processing (for example, JAN code or QR code (a registered trademark)). In the case where a two-dimensional code C is detected by the code detector unit1612and the model number recognized by the recognition unit1613is preset in the ROM162, the decoder unit1614decodes the detected two-dimensional code C. More specifically, the decoder unit1614decodes the detected two-dimensional code C if the recognized model number is a model number used as a pre-handling code. The output unit1615outputs the code decoded by the decoder unit1614to the POS terminal11via the connection interface175.

In this way, in the code reading apparatus101, the detected two-dimensional code C is recognized by the recognition unit1613before decoded by the decoder unit1614, and the decoder unit1614decodes the detected two-dimensional code C if the recognized model number is a predetermined model number such as a pre-handling code. Thus, in the code reading apparatus101, the two-dimensional code of a pre-handling system can be recognized quickly to prevent other two-dimensional codes from being decoded to shorten processing time.

The actions of the code reading apparatus101are described below in detail.FIG. 5is a flow chart showing an example of the actions carried out by the code reading apparatus101according to an embodiment of the present invention.

As shown inFIG. 5, the image pickup unit164outputs a image pickup starting signal corresponding to the starting of the commodity registration of the POS terminal11to start the image pickup of the image pickup unit164(S1). Next, the picked-up image capturing unit1611sequentially captures the frame images that are stored in the RAM163after picked-up by the image pickup unit164(S2). Then, the code detector unit1612detects the codes contained in the frame images captured by the picked-up image capturing unit1611(S3).

Sequentially, the code detector unit1612determines whether or not a code is detected in Act S3(S4). If no code is detected in Act S3(S4: No), the flow returns to Act S2to process the next frame image. If there is a code detected in Act S3(S4: Yes), the code detector unit1612determines whether or not the detected code is a two-dimensional code C containing finder patterns P1-P3(S5). If the detected code is not a two-dimensional code C (S5: No), the decoder unit1614extracts the codes contained in the frame images and decodes the codes (e.g. JAN codes) exclusive of two-dimensional code.

FIG. 6shows an example of the relationship between the reading area R of the image pickup unit16and a commodity A. The area surrounded by the dotted lines inFIG. 6is an area in which the image pickup unit164can pickup a frame of image at a time, that is, a reading area R. Moreover, a barcode BC is adhered on the commodity A. As shown inFIG. 6, the commodity A is placed by the operator to face the image pickup unit164so that the barcode BC can enter into the reading area R, the barcode BC contained in the frame image detected in Act S3is decoded in Act S6.

If the detected code is a two-dimensional code C (S5: Yes), the recognition unit1613detects finder patterns P1-P3from the frame image (S7) and recognizes the model number of the two-dimensional code C according to the shape of the two-dimensional code C resulting from the detected finder patterns P1-P3(S8). Then, the decoder unit1614determines whether or not the model number recognized by the recognition unit1613is a preset predetermined model number, for example, a model number used as a pre-handling code (Act S9).

If the model number recognized by the recognition unit1613is not a model number used as a pre-handling code (S9: No), the decoder unit1614proceeds to execute Act S12, instead of decoding the detected two-dimensional code C. If the model number recognized by the recognition unit1613is a model number used as a pre-handling code (S9: Yes), the decoder unit1614decodes the detected two-dimensional code C (S10) and then proceeds to execute Act S11.

FIG. 7is a diagram showing an example of a commodity pre-registration voucher T. As shown inFIG. 7, the two-dimensional code C1of the commodity pre-registered in a pre-handling system is printed on a commodity pre-registration voucher T. The two-dimensional code C1on the commodity pre-registration voucher T needs a data size that is big enough to store the information representing a registered commodity and therefore has a predetermined model number such as versions 17-20. Thus, the commodity pre-registration voucher T is placed by the operator to face the image pickup unit164so that the two-dimensional code C1enters into the reading area R, the two-dimensional code C contained in the frame image is detected in Act S3, and the model number of the two-dimensional code C is recognized in Act S8. Moreover, the decoding processing of Act S10is carried out if the model number is the model number used in the pre-handling system.

The output unit1615outputs the code decoded in Act S6or S10to the POS terminal11(S11). Then, the CPU161determines whether or not a service ending indicator indicative of the ending of a commodity registration is received from the POS terminal11(Act S12). If the service continues (S12: No), the CPU61returns to execute Act S2to continue to process the next frame image. If the service is ended (S12: Yes), the CPU161outputs a image pickup ending signal to the image pickup unit164to end the image pickup of the image pickup unit164and then ends the processing.

Further, the program executed by the code reading apparatus101in this embodiment is provided by being compiled in an ROM but can also be provided by being stored in a computer-readable recording medium such as CD-ROM, FD (floppy drive), CD-R, DVD (digital versatile disk) as an installable or executable file, or being stored in a computer connected with a network such as the Internet to be provided through a network download, or provided or published by a network such as the Internet.

The program executed by the code reading apparatus101consists of modules including each of the foregoing units (the picked-up image capturing unit1611, the code detector unit1612, the recognition unit1613, the decoder unit1614and the output unit1615), however, as an actual piece of hardware, a CPU reads the program from the ROM and then executes the program to load each of the foregoing units to a main memory to generate each of the above-mentioned units on the main memory.

Moreover, in the exemplary embodiment, a code is detected at the side of the code reading apparatus101according to the image picked-up by the image pickup unit164, and then decoded and output to the POS terminal11. However, the code detection carried out according to the image picked-up by the image pickup unit164and the decoding on the detected code may also be carried out at the side of the POS terminal11. Specifically, by executing programs, the CPU161achieves the functions of the picked-up image capturing unit1611, the code detector unit1612, the recognition unit1613, the decoder unit1614and the output unit1615at the side of the POS terminal11.

Moreover, in this exemplary embodiment, the two-dimensional code detected by the code detector1612is recognized by the recognition unit1613before decoded by the decoder unit1614. However, the recognition unit1613can carry out the recognition before or while the decoder unit1614carries out a decoding. In the case where the recognition of the recognition unit1613and the decoding of the decoder unit1614are synchronously carried out and the model number recognized by the recognition unit1613is the model number used in the pre-handling system, the decoder unit1614continues the decoding processing to decode the two-dimensional code. Moreover, the decoding of the decoder unit1614is ended and no two-dimensional code is decoded if the model number recognized by the recognition unit1613is not the model number used in the pre-handling system. As a result, the decoding of the decoder unit1614is interrupted if the model number recognized is not the model number used in the pre-handling system to relieve load. Besides, the two-dimensional code can be decoded more quickly as the recognition of the recognition unit1613and the decoding of the decoder unit1614are synchronously carried out.