Background technology
Bar code scanner is widely used in supermarket, retail shop and the various place that relates to catalogue and inventory management, for example warehouse and factory now.Usually, bar code sticks on the article in the catalogue, and adopts the label that can be read by optical scanner.Following IBM such as those can be helped the user to read at the correct position of the bar code of relative scanning device at the common linearity or the one-dimensional bar code of the unified product code (UPC) of the research and development seventies in 20th century by the grating of " luminous point (flying spot) " laser scanner emission.Usually these scanners or be fixed on the directory management equipment of cashier counter, supermarket such as travelling belt are perhaps as hand-held wired or wireless equipment.
Two dimension (2D) bar code is also more and more general.Therefore linear bar code is limited between 10 to 20 characters usually, the simple index that writes down in the database (for example part number, customer accounting code etc.).Yet two-dimensional bar can be finished same function with the space of much less.Equally, such as the Aztec sign indicating number, PDF417, the two-dimensional bar of Data Matrix and MaxiCode also can be used as database itself, the character that several thousand machine readables fetch data because they can be encoded out.Therefore two-dimensional bar can be used as portable database or portable data file, binds with product in whole produce and market chain.In addition, can in two-dimensional bar, embed the error correcting rule, thereby guarantee when the code surface zone is damaged, not lose any readable information.Therefore the improvement in the widely-used and design of bar code makes bar code continue to be popularized in future.
Digital camera has been represented another technology that widely adopts.Recent years, the cost and the size of digital camera reduced rapidly, and camera quality and screen resolution improve constantly.Present digital camera is frequent and various electronic is integrated, for example mobile phone, personal digital assistant and notebook computer.
Prior art has comprised the enlightenment that digital camera technology is combined with bar code scanner.Such combination can be to the digital picture of bar code, rather than the laser scanning of bar code is analyzed and decoded.Therefore bar code scanner not only can be used for retailer and directory administrator, and can search this product more information or storage products price and out of Memory consumer for future reference by the scanning product bar code and use.Yet if bar code is not decoded immediately, there is certain problem in the digital picture of bar code so, because can't confirm whether the digital picture of bar code has enough quality and can successfully be decoded.When successfully obtaining with the decoding bar font code in system usually, hand-held Laser Barcode Scanner sends familiar signal sound.Especially when the bar code that part is degraded or damage scanned, the user of scanner needed the bar code position of repetitive operation with respect to scanner usually, sends signal indication up to scanner and successfully reads bar code.What on the other hand, the user of digital camera may take is the bar code image that can not decode immediately.At this moment, such as fuzzy, out of focus or the low-quality image of the not enough bar code of resolution or size possibly can't read, and the user may no longer access to bar code, thereby can not obtain new, a high-quality image.
Embodiment
With reference to figure 1, be synoptic diagram according to embodiment of the invention diagram camera system 100.With most of camera-type seemingly, system 100 has comprised the camera frame 105 of leading face 110 integrated.Leading face 110 comprises the imageing sensor 115 that is suitable for receiving image.Imageing sensor 115 can comprise conventional camera lens and optical device and such as the digital image sensor of charge-coupled device (CCD) (CCD) sensor, cmos sensor etc.
With reference to figure 2, be the synoptic diagram of camera system 100 back workplaces 120.Back workplace 120 comprises the preview window 125 that is fit to show the image frame that is received by imageing sensor 115.Similar with most digital cameras, those skilled in the art will know that the preview window 125 can be used as the view finder of conventional camera, and show any mobile image that is positioned at imageing sensor 115 the place ahead scenes in real time.Typically, the only of short duration existence of realtime graphic that the preview window 125 shows, and when the user activates shutter release button (not shown), timer or other image taking flip flop equipment, be kept in the storer of system 100.A kind of embodiment of the present invention further comprises mode selector switch 130, is used for camera system 100 is arranged to different Photographing Mode.For example, with most prior art equipment class seemingly, mode selector switch 130 can be used for system 100 is arranged to standard rest image pattern, video mode, low optical mode, fast mode etc.According to the present invention, mode selector switch 130 also can be used for system 100 is arranged to the bar code read mode.When mode selector switch 130 is arranged to the bar code read mode, take indicator 135 in the preview window 125 show bar font code data.Those skilled in the art will know that mode selector switch 130 can be physical switch or the toggle switch on the camera frame 105, or use for example soft switch of the preview window 125 activation.The inside of frame 105 also comprises the processor 140 that is connected with mode selector switch 130 with imageing sensor 115 the preview windows 125, to help being used for the mutual of image data processing between those assemblies of control.
The different embodiment that data are taken indicator 135 can comprise different sizes, shape and form, and can be translucent or opaque.Data are taken the user that indicator 135 is used for guidance system 100 and are correctly placed imageing sensor 115 such as the coded data of bar code relatively in the use.Therefore, the position of data shooting indicator 135 will be fixing with respect to the preview window 125 in the use.According to a kind of embodiment, data are taken the pattern that indicator 135 is designed to simulate conventional bar code laser scanning grating, thereby are shown as the red lines that are positioned near the flicker at the preview window 124 centers at the preview window 125.
As shown in Figure 2, in the operation of an embodiment of the present invention, the user takes indicator 135 with data and lies in a horizontal plane on the linear bar code, thereby data are taken first and last bar code that the left and right edges of indicator 135 just extends to bar code respectively.In addition, the user takes indicator 135 with data and vertically places, thereby indicator just is located on the text data of correspondence of bar code lower end.On this position, system 100 is designed for take to aim at focus, clear and have the bar code of enough resolution and an image of corresponding text data thereof.This image can adopt decoding algorithm effectively and reliably to be analyzed and to bar code decoding.Equally, by taking the picture rich in detail of corresponding text data, optical character identification (OCR) technology can be applied to corresponding text data reliably.OCR resolves the text data of correspondence, then with decoded bar code data contrast, confirms the correctness of decode procedure.
Because data are taken the grating that indicator 135 can be simulated conventional bar code laser scanner, the user of the bar code read mode of the embodiment of system 100 can be very easy to usually and use data to take indicator 135 by intuition.That is because majority are familiar to the laser scanner in when shopping in the retail shop.
With reference to figure 3, be the diagram that adopts the bar code number image typical, that partly blur that comprises data area 305 and text filed 310 of prior art camera shooting.Although image section shown in Figure 3 is fuzzy, and the part bar code of the data area 305 of bar code can't decode, and text filed 310 character of bar code is still readable.Have relative size and distance mainly due to bar code in the bar code that comprises character data with character, text filed 310 of bar code readable situations are more common so can't decode in data area 305.Text character usually and be easy to blur unlike bar code data.In addition, the text character of corresponding bar code is far away at interval usually, thereby OCR program ratio is easier to segmentation and identification.As everyone knows, the most mistakes in the OCR program are produced by the mistake to each character segmentation.The present invention adopts the above-mentioned fact that the improved method and system that bar code image is decoded is provided.
With reference to figure 4, be the diagram that shows bar code images according to the preview window 125 of the camera 100 of the embodiment of the invention.Activated bar code read mode of the present invention among Fig. 4, thereby the preview window 125 comprises data and takes indicator 135, this indicator suitably is presented at the position of all bar codes of passing bar code data zone 305, and bar code text filed 310 on the stack.This suitable position helps to take the image that can accurately decode, wherein such as all decodable elements of bar code of all lines of linear bar code, has enough sharpness and OCR program and can discern corresponding text data reliably when taking.
With reference to figure 5, be based on the diagram of the bar code image after the reduction that is taken, stores and decode of bar code image shown in Figure 4.The image of this cut out areas is compared the barcode reader relevant with digital picture of those prior aries for native system 100, has many advantages.At first, image as shown in Figure 5 is very little and compact, thereby needs still less storage space than the full size image of bar code shown in Figure 4; The second, image shown in Figure 5 is only taken the related data part of the bar code that needs decoding.This means that decoding algorithm can directly handle image, and without any need for pre-determined bit, registration, location or shear step.Therefore decoding algorithm can be simplified, and this is highly beneficial in the limited handheld device of storage and computational resource.According to different embodiment of the present invention, the size in photographic images zone can be used for the effectively optimization of decoding by specific graphical analysis and decoding algorithm.Therefore the size in photographic images zone as shown in Figure 5 can be adjusted or be preset by manufacturer by the user.
The technology that those skilled in the art will know that the digital camera miniaturization makes camera frame 105, imageing sensor 115 and the preview window 125 can have almost arbitrary dimension, so embodiments of the invention can be integrated in the various electronic such as mobile phone, personal digital assistant and notebook computer.In addition, data are taken indicator 135 and can be designed at various types of coded datas, and are not only the linear bar code data.For example circular or oval data are taken indicator 135 and are gone for helping to read the Code such as Aztec, PDF417, and DataMatrix and MaxiCode etc. also comprises the multiple two-dimension code of corresponding text character sometimes.
With reference to figure 6, be process flow diagram according to embodiment of the invention graphic technique 600 steps.At first, in step 605, at the imageing sensor 115 reception preview images of camera system 100.Preview image comprises the data area 305 and text filed 310 of expression text character of the coded data of expression such as bar code.As mentioned above, preview image normally is used for camera system 100 is aimed at the temporary transient image of coded data.Then, in step 610, the preview window 125 related with camera system 100 shows the picture of preview images.The preview window 125 can be included in the demonstration that superposition of data is taken indicator 135 on the preview image picture.In step 615, take the data image comprise at least a portion data area 305 in the preview image and text filed 310.
Next, in the step 620 of method 600, to analyzing and the noise grade in data zone 305 is estimated in data zone 305.Estimation to noise grade is the quality of the captured data image of assessment, and can adopt various technology well known to those skilled in the art to finish.For example serious fuzzy data image has very high noise grade usually, and sharp keen data image clearly has lower noise grade.In step 625, use the decoding algorithm decision data zone 305 related whether can decode with camera system 100.Can not decode if data area 305 is judged to be, method 600 is carried out the OCR program at text filed 310 of step 630 pair data image so.At last, the final decoded result of result's conduct that provides OCR to handle in step 630.
The present invention can use various types of OCR program and systems that are suitable for the size reduction electronic equipment.Those skilled in the art are well-known, and these OCR systems can comprise the OCR technology of matrix coupling, feature extraction and other type.
Get back to the step 625 of method 600 once more, can decode if data area 305 is judged to be, method 600 adopts any bar code decoding algorithm well known to those skilled in the art to be decoded in data zone 305 in step 640 so.Whether be correctly decoded in step 645 decision data zone 305.Many linearities and two-dimensional bar contain error detection mechanism, can confirm correct decoded result.Therefore, if data area 305 is judged to be correctly decoded, method 600 is directly to step 635 so, with decoded data area 305 as last decoded result.
As selection, if be not correctly decoded in step 645 decision data zone 305, the step 650 couple text filed 310 execution OCR in method 600 handle so.In step 655, the result that the OCR of the result in decoded data zone 305 and text filed 310 is handled compares.Next, in step 660, determine the OCR confidence score for each character of data image text filed 310.In step 665, based on the comparative result of step 655 and the confidence score of step 660, the specific character of decoding character replacement step 630 identifications of the correspondence that usefulness step 640 obtains.Usually when being lower than user's manufacturer's preset threshold value that set or camera system 100, the OCR confidence score of institute's substitute character carries out above-mentioned replacement.Method 600 provides final decoded result in step 635 then.
In a word, the present invention is the improved method and system that bar code image is decoded.Embodiments of the invention are user friendly and are imbued with intuition, because they have simulated the action of hand-held laser scanner effectively, although be under the diverse environment of the preview window 125 of camera system 100.Therefore the present invention helps the user accurately and reliably to take the decodable picture of coded data by the correct placement of camera system 100 relative coding data.In addition, the image of captured coded data can be than the image that uses prior art to take more succinctly and handled by image analysis software easilier.The present invention also improves the accuracy of bar code decoding by the redundant decode to bar code data zone 305 and text filed 310.The text filed decoding that employing standard OCR handles can obtain higher decoding accuracy sometimes than the standard bar code decode procedure, especially in the blurred picture decoding to bar code.At last, the result by contrast decoded data zone 305 and identification text filed 310 optimizes decode procedure.
Top detailed description only provides typical embodiment, and the scope that is not meant to limit the present invention, applicability or structure.On the contrary, but the those skilled in the art that are specifically described as of typical embodiment provide the line description of realizing exemplary embodiments of the present invention.Need will be appreciated that, under the prerequisite of the spirit and scope of the present invention that illustrate without prejudice to claims, can carry out multiple modification with arranging the function of element and step.