Patent Description:
Barcodes are widely used in current commerce and industry and are often used for commodity marking, logistics tracking, stock management, production process control and the like, and a plurality of barcodes of the same type or different types may be set on one article. When a user scans an interface with a plurality of barcodes, a barcode decoder may receive a plurality of barcode images captured by a scanner, resulting in decoding failure or errors.

<CIT> discloses a method for graphic code recognition including: displaying a target image, the target image including at least two graphic codes; in response to receiving a graphic code recognition operation on the target image, obtaining graphic code position information of the at least two graphic codes in the target image; determining a target graphic code indicated by the graphic code recognition operation according to the graphic code position information; and displaying a target graphic code recognition result corresponding to the target graphic code. The determining of the target graphic code includes calculating distances between a target recognition position and the graphic codes according to the target recognition position and the graphic code position information, and determines a graphic code corresponding to the shortest distance as the target graphic code.

<CIT> discloses an image display device including a video display part for displaying a video by overlapping it with an external image; an imaging part having an angle of view including the video display area of the video display part and imaging the external image of the video display area; a detection part for detecting an object from an imaged image imaged by the imaging part; an analysis part for analyzing the content of the object detected by the detection part; a processing part for performing processing in accordance with the content of the object analyzed by the analysis part; a distance calculation part for calculating a distance from the center of the video display area to each object when a plurality of objects are detected in one imaged image by the detection part; and a control part for determining the object whose distance calculated by the distance calculation part is the minimum as a target object, and for making the analysis part analyze the content of the object, and for performing processing corresponding to the analysis result.

According to the present invention, a barcode image recognition method according to claim <NUM> and a barcode image recognition device according to claim <NUM> are provided. Preferred embodiments are further defined in the dependent claims.

In view of this, the present disclosure provides a barcode image recognition method and a device using the same, which are suitable for scanning and obtaining barcode information of an expected barcode among a plurality of barcodes, and therefore the barcode information of the expected barcode can be accurately and controllably obtained.

In one embodiment, a barcode image recognition method includes: capturing at least one barcode to generate a preview image, the preview image having at least one barcode image of the at least one barcode; decoding the barcode image to obtain barcode information and a plurality of vertex coordinates of the barcode image; caching the barcode information of the barcode image; forming a plurality of image boundaries of the barcode image with the plurality of vertex coordinates of the barcode image; generating a detection beeline from a specified point to a side edge of the preview image; determining the number of intersections I1 of the plurality of image boundaries of the barcode image and the detection beeline; identifying the barcode image with odd number of intersections I1 from the at least one barcode image as a target image; and outputting the barcode information of the target image.

The present disclosure further provides a barcode image recognition device. In one embodiment, the barcode image recognition device includes an optical sensing module, a decoding module, a displayer and a processing module. The optical sensing module is configured to scan at least one barcode to generate a preview image, the preview image having at least one barcode image of the at least one barcode. The decoding module is coupled to the optical sensing module and configured to decode the barcode image to obtain barcode information and a plurality of vertex coordinates of the barcode image. The processing module is coupled to the decoding module and the displayer and configured to: cache the barcode information of the barcode image, form a plurality of image boundaries of the barcode image with the plurality of vertex coordinates of the barcode image, generate a detection beeline from a specified point to a side edge of the preview image, determine the number of intersections of the plurality of image boundaries of the barcode image and the detection beeline, identify the barcode image with odd number of intersections from the at least one barcode image as a target image, and display the barcode information of the target image on the displayer.

The disclosure will become more fully understood from the detailed description given herein below for illustration only, and thus not limitative of the disclosure, wherein:.

Referring to <FIG>, a barcode image recognition device <NUM> is suitable for scanning a plurality of barcodes to obtain and output barcode information of an expected barcode. The barcode image recognition device <NUM> includes an optical sensing module <NUM>, a decoding module <NUM>, a displayer <NUM> and a processing module <NUM>. The optical sensing module <NUM> is coupled to the decoding module <NUM>; and the decoding module <NUM> and the displayer <NUM> are coupled to the processing module <NUM>.

In some embodiments, commodities or shelves are provided with one or more barcodes. Each barcode may carry relevant information, such as producing areas, prices, batch numbers and activity websites. In some embodiments, these barcodes may be adjacently set (such as pasted or printed) on the commodities or the shelves.

As shown in <FIG> and <FIG>, in a case of acquiring the barcode information represented by the expected barcode among a plurality of barcodes, the barcode image recognition device <NUM> will scan the barcodes with the optical sensing module <NUM> to capture a preview image with barcode images of the barcodes (step S10).

Referring to <FIG> and <FIG>, the optical sensing module <NUM> forms a preview image <NUM> after capturing the barcodes. In some embodiments, the preview image <NUM> is enclosed by a plurality of side edges, for example, four side edges E1, E2, E3 and E4 enclose a rectangular window. The preview image <NUM> has the barcode images. The barcode images correspond to the scanned barcodes, so that the preview image <NUM> has the same number of barcode images as the barcodes. Among the plurality of barcode images, one of the barcode images will be taken as a target image T. The target image T is a barcode that a user wants to read and decode to obtain the information when operating the barcode image recognition device <NUM>. The preview image <NUM> can be transmitted to the displayer <NUM> for displaying through the processing module <NUM>, and thus the user can know the range captured by the optical sensing module <NUM> during use in real time.

Continuing referring to <FIG>, the decoding module <NUM> decodes the barcode images to obtain the barcode information represented by one or more barcodes (step S20). The decoding module <NUM> is generally composed of one or more decoding algorithms, and can recognize different types of barcodes. The decoded barcode information can be cached in an internal memory of the processing module <NUM>, or stored in various external memories connected to the processing module <NUM> (step S30). The barcode information is a content represented by the barcode, can be a text or a website, and can also be an audio, a graphic file and the like in some embodiments. For example, when the barcode information is the text, corresponding information can be obtained by scanning and reading the barcode, and thus rapid recognition and communication are realized. When the barcode information is the website, a function of rapidly opening a corresponding website page on an electronic device is realized.

The decoding module <NUM> obtains a plurality of vertex coordinates of one or more barcode images while decoding the barcode images (step S20). The situation that the barcode image is a rectangle is taken as an example, and the barcode image has four vertexes. The vertex coordinates refer to coordinate values of each vertex of the barcode image on a coordinate system of the preview image <NUM>. Specifically, image pixels of the preview image <NUM> can be distributed as a two-dimensional coordinate system, the coordinate system has an X-axis and a Y-axis, and the vertex coordinates of the barcode image are absolute coordinates of the vertex on the coordinate system.

For example, the barcode image recognition device <NUM> generates the preview image <NUM> after capturing the images of two barcodes located on the same plane (see <FIG>). The preview image <NUM> has a barcode image <NUM> of a first barcode and a barcode image <NUM> of a second barcode. The barcode images <NUM> and <NUM> respectively have four vertexes. The decoding module <NUM> decodes the barcode images <NUM> and <NUM> to obtain four vertex coordinates P1, P2, P3 and P4 of the barcode image <NUM> and four vertex coordinates P5, P6, P7 and P8 of the barcode image <NUM>.

Referring to <FIG>, four image boundaries of the barcode images <NUM> and <NUM> can be respectively formed with the vertex coordinates (step S40). The length-width ratio of a range enclosed by the image boundaries is the same as that of the barcode.

The preview image <NUM> has a specified point DP. The specified point DP can be located at any position in the preview image <NUM>, and the position relates to a subsequent method for determining the target image T among the plurality of barcode images. In some embodiments, the specified point DP can be positioned right in the middle of the preview image, and the coordinate value of the specified point DP is (<NUM>, <NUM>) with respect to the coordinate system.

In some embodiments, the user can know the range captured by the optical sensing module <NUM> during use in real time, and as described above, the information of the captured range is displayed by transmitting the preview image <NUM> to the displayer <NUM> through the processing module <NUM>. In order to facilitate the operation of the user, a prompt mark <NUM> is provided at a position corresponding to the specified point DP. The processing module <NUM> synthesizes the prompt mark <NUM> and the preview image <NUM> and transmits to the displayer <NUM> for displaying. A picture synthesized by the prompt mark <NUM> and the preview image <NUM> is called a synthesized image <NUM> (as shown in <FIG>).

In some embodiments, the prompt mark <NUM> can be a cross line taking the specified point DP as an intersection or a geometric figure taking the specified point DP as a center. When using the barcode image recognition device <NUM>, the user can align the prompt mark <NUM> to a barcode with information to be outputted. Then, through the operation of the processing module <NUM>, even if the quantity of barcodes is large and the barcode image cannot be independently captured by the optical sensing module <NUM>, the information of the expected barcode can also be obtained.

Continuing referring to <FIG> and <FIG>, the method for determining the target image T by the processing module <NUM> includes: generating a detection beeline <NUM> from the specified point DP to any point on a side edge of the preview image <NUM> in the preview image <NUM> (step S50). The direction in which the detection beeline <NUM> is generated is not limited, for example, in <FIG>, the detection beeline <NUM> is generated in the direction from the specified point DP to the side edge E4, and the detection beeline <NUM> can also form a detection beeline <NUM>' in the direction from the specified point DP to the side edge E3.

Then, the target image T is determined by determining the number of intersections I1 generated by the detection beeline <NUM> and the image boundary in the barcode image (step S60). The number of the intersections I1 generated by the image boundary of the target image T and the detection beeline <NUM> will be odd number, so the processing module <NUM> can find out the barcode image with odd number of the intersections I1 as the target image T (step S70).

Referring to <FIG> and <FIG>, after the target image T is determined, the barcode information cached after decoding is extracted, and the information is outputted and displayed by the displayer <NUM> (step S80). A result field <NUM> can be set on the displayer <NUM>, and the barcode information is displayed in the result field <NUM>, so that the user can visually obtain the information represented by the barcode. The design of the result field <NUM> in the displayer <NUM> can be adjusted according to the requirements of the user. In some embodiments, the synthesized image <NUM> and the result field <NUM> can be simultaneously displayed on the displayer <NUM>, for example, the synthesized image <NUM> and the result field <NUM> are displayed in a display frame in parallel, the user refers to the display frame in the synthesized image <NUM> to capture the image of the barcode, and the barcode information can be obtained in the result field <NUM> after the image is recognized by the decoding module <NUM> and the processing module <NUM>. In some embodiments, the result field <NUM> can be presented as a window, and the window will pop up after the processing module <NUM> determines the target image T and display the barcode information.

Continuing referring to <FIG>, <FIG> and <FIG>, as described above, the optical sensing module <NUM> captures the images of two barcodes, and the decoding module <NUM> decodes the images to obtain barcode information <NUM> of the first barcode, barcode information <NUM> of the second barcode (not shown in the figure) and respective four vertex coordinates P1, P2, P3, P4, P5, P6, P7 and P8 of the two barcodes. The barcode information <NUM> and <NUM> are cached in the processing module <NUM>, so as to be extracted and displayed conveniently after determining the target image T. The adjacent vertex coordinates are connected through two points to form a plurality of image boundaries L1, L2, L3, L4, L5, L6, L7 and L8. The detection beeline <NUM> is generated from the specified point DP of the preview image <NUM> to any side edge E4 of the preview image <NUM>. An intersection I1 is generated by the detection beeline <NUM> and one image boundary L4 of the barcode image <NUM>, the number of the intersection is <NUM> and is an odd number, so the barcode image <NUM> is taken as the target image T and the barcode information <NUM> is outputted to the result field <NUM>.

In another embodiment, the detection beeline <NUM>', the image boundary L3 of the barcode image <NUM>, and the image boundaries L5 and L7 of the barcode image <NUM> generate intersections <NUM><NUM>, I3 and I4, and the total number of the intersections I1 is <NUM>. Although the detection beeline <NUM> and both the two barcode images <NUM> and <NUM> generate the intersections I1, the number of the intersection I1 of the barcode image <NUM> is <NUM>, which is an odd number, the number of the intersections I1 I2 and I3 of the barcode image <NUM> is <NUM>, which is an even number, therefore, the barcode image <NUM> is taken as the target image T and the barcode information <NUM> is outputted.

Referring to <FIG>, in some embodiments, after the processing module <NUM> determines the target image T according to the number of the intersections I1 of the image boundaries and the detection beeline <NUM> (step S40 to step S70), and when the displayer <NUM> outputs the barcode information of the target image T, the processing module <NUM> or an external memory that stores the barcode information simultaneously abandon the remaining barcode information with even number of intersections I1 (step S80').

With regard to the total number of intersections I1, if the total number is an odd number, it indicates that the preview image <NUM> has the target image T, and further determination can be made to obtain the barcode image with odd number of intersections I1; and if the total number is an even number, it indicates that the preview image <NUM> does not have the target image T. Referring to <FIG>, in some embodiments, the preview image <NUM> has three barcode images <NUM>, <NUM> and <NUM>, and the three barcode images <NUM>, <NUM> and <NUM> have a plurality of image boundaries respectively. Two intersections I1 are generated by the detection beeline <NUM> and the image boundaries in total, namely, the intersections <NUM> and I6 generated by the detection beeline and the image boundaries L9 and L10, and the number is an even number, thus the preview image <NUM> does not have the target image T, related barcode information cannot be outputted, and the decoded barcode information <NUM> and <NUM> will be abandoned.

In some other embodiments, after the detection beeline <NUM> is formed from the specified point DP to one side edge of the preview image <NUM>, no intersection is generated between the detection beeline <NUM> and any image boundary in the preview image <NUM>, thus it can be determined that the number of intersection is zero and is an odd number, and no target image T exists. For example, the detection beeline <NUM>' is formed from the specified point DP to the side edges E2 and E4 of the preview image <NUM> respectively, and no intersection is generated between the detection beeline <NUM>' and any image boundary in the preview image <NUM>.

In some embodiments, the optical sensing module <NUM> and the decoding module <NUM> can be integrated into an independent component such as a barcode engine <NUM>, so as to be embedded into a common electronic device. The common electronic device can be a handheld device such as a smart phone, a notebook computer and a tablet personal computer or a handheld or desktop checkout machine.

The optical sensing module <NUM> of the barcode engine <NUM> captures the image of the barcode; then the decoding module <NUM> decodes the preview image <NUM> formed by the optical sensing module <NUM>; and after decoding, barcode data is transmitted to other elements of the barcode image recognition device <NUM> for processing through a connection interface.

Referring to <FIG> and <FIG>, the barcode image recognition device <NUM> includes the barcode engine <NUM>, the displayer <NUM> and the processing module <NUM>. The barcode engine <NUM> includes the optical sensing module <NUM> and the decoding module <NUM>. The barcode engine <NUM> is coupled to the displayer <NUM> and the processing module <NUM>. The barcode engine <NUM> captures and decodes the barcode image, and transmits the preview image <NUM> to the processing module <NUM> for caching of the barcode information, recognition of the target image T and output and/or abandoning of the barcode information.

In some embodiments, the barcode engine <NUM> is embedded in the electronic device. Therefore, a processor <NUM> of the electronic device can be directly used as the processing module <NUM> of the barcode image recognition device <NUM>. A screen of the electronic device is used as the displayer <NUM> of the barcode image recognition device <NUM>, the synthesized image <NUM> and the result field <NUM> are displayed through a user interface of the electronic device, and a caching position of the barcode information can be an internal memory of the processor <NUM> or an external memory of the electronic device. In some embodiments, a camera device <NUM> of the electronic device can be alternately used with the optical sensing module <NUM> in the barcode engine <NUM>, the camera device <NUM> acquires the barcode image of the barcode, and the barcode image is transmitted to the processor <NUM> and the decoding module <NUM> for subsequent processing through the connection interface.

In some embodiments, the barcode engine <NUM> may include an application programming interface (API), which allows a designer to customize parameters of the optical sensing module <NUM> and a processing mode of a result decoded by the decoding module <NUM> according to the requirements of the user. The user can access the barcode engine <NUM> with the API to obtain the barcode image, and transmit the barcode image to the decoding module <NUM> for decoding. Then, the preview image <NUM> formed by the barcode image and the barcode information decoded by the decoding module <NUM> are transmitted to the processor <NUM> of the electronic device. Therefore, the influence caused by a fixed decoding algorithm of the decoding module <NUM> can be avoided through the API.

Referring to <FIG>, the barcode engine <NUM> can be implemented by a handheld scanner <NUM>. The optical sensing module <NUM> and the decoding module <NUM> are located in a casing <NUM>. The preview image <NUM> and the barcode information which are captured and decoded by the barcode engine <NUM> are transmitted to the electronic device from the barcode engine <NUM> in a wired or wireless mode, such as a USB or RS232 connection mode. The electronic device includes the processor and the displayer which are inherent in the electronic device. The same as the previous embodiment, the processor inherent in the electronic device is directly used as the processing module <NUM> of the barcode image recognition device <NUM>, and the screen of the electronic device is used as the displayer <NUM> of the barcode image recognition device <NUM>. The designer sets a method for detecting the target image T and a visual result field <NUM> window in the processor <NUM> of the electronic device. In some embodiments, the barcode image recognition device <NUM> can be operated in a fixed environment, such as a supermarket cashier desk; and the environmental parameters of the optical sensing module <NUM> are adjusted during design according to the requirements of the user, so as to improve the environmental adaptability of the optical sensing module <NUM>.

Referring to <FIG> and <FIG>, in some embodiments, the optical sensing module <NUM> is the camera device <NUM>. The barcode image recognition device <NUM> includes the camera device <NUM>, the displayer <NUM> and the processor <NUM>. The camera device <NUM> is coupled to the displayer <NUM> and the processor <NUM>. The camera device <NUM> can be a rear/front-facing camera of the electronic device or a camera externally connected to the electronic device. The processor <NUM> can be implemented by the decoding module <NUM> and the processing module <NUM>.

In some embodiments, the camera device <NUM> can adjust the parameters for barcode shooting by means of the user interface of the electronic device, such as adjusting exposure, focal length and light sensitivity, so that the camera device <NUM> can obtain a clearer barcode image. The camera device <NUM> transmits the captured preview image <NUM> to the processing module <NUM>, the processing module <NUM> synthesizes the preview image <NUM> and the prompt mark <NUM> into the synthesized image <NUM>, and the synthesized image is displayed through the displayer <NUM>. At the moment, the user can see a shooting scene through the synthesized image <NUM>, and then adjust the setting and angle of the camera device <NUM>.

In some embodiments, the decoding module <NUM> in the processor <NUM> can be implemented by an application (APP) and interacts with the processing module <NUM>, so as to save the space required by the device. The APP can be selected and started from a plurality of applications through the user interface. After the camera device <NUM> shoots the barcode, the preview image <NUM> will be transmitted to the processing module <NUM> for image processing, such as background noise removal, image brightness adjustment and contrast ratio adjustment, so that the barcode image can be better recognized. Then the processing module <NUM> converts the image into a digital signal, that is, the barcode image is binarized, black and white parts in the barcode image are converted into binary digits of <NUM> and <NUM>. The decoding module <NUM> decodes the digital signal by the decoding algorithm to obtain the barcode information represented by the barcode. Different from the decoding module <NUM> in the barcode engine <NUM>, in some embodiments, the decoding module <NUM> in the barcode engine <NUM> is provided with a special decoding chip and a scanner head, so that high decoding speed and high accuracy are achieved; and the decoding module <NUM> in the processor <NUM> may have the characteristics of being more convenient and free of purchasing or additionally installing elements.

In some embodiments, the processor <NUM> can further design the APP according to the requirements of the user, for example, the processor <NUM> is connected to a storage module, and the preview image <NUM> and/or the barcode information are/is recorded in a local access or online access mode. In some embodiments, menu, check box, label and other character fields can be established on the user interface to meet the requirements of the user.

In some embodiments, the barcodes may have the same or different barcode types at the same time, and specifically, the barcodes may be in the same coding mode (namely the same barcode type) or in different coding modes (namely different barcode types). In some embodiments, the barcodes can be, but are not limited to, any one-dimensional barcode (such as a Code <NUM> barcode, an interleaved <NUM> barcode, an EAN-<NUM> barcode, an EAN-<NUM> barcode or a Code <NUM> barcode) or any two-dimensional barcode (such as a QR Code barcode, a PDF <NUM> barcode, a combined barcode or a Data Matrix barcode). The one-dimensional barcode can represent barcode information of dozens of bits of characters, and the two-dimensional barcode can represent barcode information of thousands of characters. In some embodiments, the barcodes are usually used for commodity identification, stock control, logistics management and the like.

In some embodiments, the optical sensing module <NUM> can be implemented by a combination of a lens, an optical element and an image processor.

In some embodiments, the processor <NUM> can be implemented by one or more processors. Each processor can be but is not limited to a central processing unit, a system on chip (SOC), a microprocessor for general purpose or special purpose, a digital signal processor (DSP), a programmable logic controller (PLC), application specific integrated circuits (ASIC), a programmable logic device (PLD), other similar processing devices or a combination of the devices.

In some embodiments, the displayer <NUM> can be but is not limited to a touchscreen or a general display screen (namely, the displayer does not have a touch function). When the displayer <NUM> is the touchscreen, the user interface can be the displayer <NUM> or an input device such as an additionally arranged keyboard, one or more keys, a handwriting board or any combination thereof.

Claim 1:
A barcode image recognition method, comprising
capturing (S10) at least one barcode to generate a preview image (<NUM>), the preview image (<NUM>) having at least one barcode image (<NUM>) of the at least one barcode;
decoding (S20) the barcode image (<NUM>) to obtain barcode information (<NUM>) and a plurality of vertex coordinates (P1,P2,P3,P4) of the barcode image (<NUM>);
caching (S30) the barcode information (<NUM>) of the barcode image (<NUM>); forming (S40) a plurality of image boundaries (L1,L2,L3,L4) of the barcode image (<NUM>) with the plurality of vertex coordinates (P1,P2,P3,P4) of the barcode image (<NUM>);
generating (S50) a detection beeline (<NUM>) from a specified point (DP) to a side edge (E1) of the preview image (<NUM>);
determining (S60) the number of intersections (I1) of the plurality of image boundaries (L1,L2,L3,L4) of the barcode image (<NUM>) and the detection beeline (<NUM>);
identifying (S70) the barcode image (<NUM>) with odd number of intersections (I1) from the at least one barcode image (<NUM>) as a target image (T); and
outputting (S80, S80')) the barcode information (<NUM>) of the target image T).