Method for automatically setting a code reading device and camera-based code reading device
By generating virtual sample images and optimizing automated parameters, the shortcomings of optical settings and decoding methods in code reading systems during dynamic operations are addressed, achieving a high-efficiency and reliable reading rate that adapts to different object heights and movements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICK AG
- Filing Date
- 2022-07-28
- Publication Date
- 2026-06-26
AI Technical Summary
Existing code reading systems are difficult to optimize optical settings and decoding methods during dynamic operation, resulting in low read rates. This is especially true when measurement values are lacking and optical parameters cannot be adjusted in a timely manner, making manual optimization complex and prone to errors.
By generating virtual sample images and evaluating the corresponding parameter sets, the code reader is automatically configured to adapt to dynamic operating conditions, including different object heights and movements. Various scenarios are simulated using computational methods to optimize exposure, focus position, and decoding algorithms.
It achieves automated optimization for high read rates in dynamic operations, reduces reliance on expert knowledge, improves read efficiency and reduces error rates, and can quickly adapt to decoder updates.
Smart Images

Figure CN115696053B_ABST
Abstract
Description
[0001] This invention relates to a method for automatically setting up a barcode reader and a camera-based barcode reader.
[0002] Barcode readers are widely used in supermarket checkouts, automated parcel identification, mail sorting, airport baggage handling, and other logistics applications. Camera-based readers use image sensors to record images of objects with codes on them, and image evaluation software extracts the code information from these images. Camera-based readers can also easily handle code types other than one-dimensional barcodes, which, like matrix codes, are constructed in two dimensions and provide more information.
[0003] In a number of important applications, coded objects are transported through barcode readers. Image sensors repeatedly record image data, which overlaps more or less depending on the recording frequency and transport speed. Barcode readers are often part of a more complex barcode reading system. Therefore, multiple readers are typically positioned at the reading channel to record the object from multiple or all sides. Furthermore, the geometry of the transported object is usually measured beforehand using a separate laser scanner.
[0004] One of the most important characteristic parameters of a code reader system is its read rate, as unread codes can lead to manual post-processing steps or even assignment errors. Therefore, it is crucial to optimize the code reader system for the specific application, i.e., finding suitable exposure, camera settings, and decoder algorithm selection and configuration, including appropriate pre-processing of the recorded images. This can be achieved manually during the setup of the code reader system, but it is very time-consuming and can only be performed by experts.
[0005] The sub-problem of focusing on objects at different heights is often addressed using an autofocus system that dynamically adapts to each individual object. Simultaneously, camera and exposure settings can be further adjusted for the measured object height. The EP 3 812 953A1 goes even further, dynamically adjusting its decoder to adapt to the corresponding object height. However, without distance values or if the reader only provides a fixed focus system, or a so-called slow focus system that allows adjustment of the focus position but is too slow for dynamically adapting to a single object, this is not a solution.
[0006] Furthermore, it is known that a good set of parameters is determined during the automatic setup and debugging process. For this purpose, the setup personnel select representative objects with codes, and the code-reading system detects these objects in a static state. However, the operating point determined in this way is only optimized for the basic static case. In practical applications, however, codes attached to objects at different heights are read in motion. Here, the number of objects and the number of tags or codes in the corresponding currently recorded image are often unknown. The code-reading system is not prepared for these deviations from the taught static case with representative objects, and therefore its operational efficiency remains lower than expected.
[0007] Therefore, in some cases, the approach taken is to determine multiple configurations for different objects recorded in a static state and store them in different parameter libraries. This doesn't solve the problem because it's unknown which configuration is suitable for the specific object to be detected next. Different configurations could be iterated over, but this slows down the decoding process and ultimately wastes valuable resources on read attempts destined to fail. This exploratory approach can be envisioned from the outset, experimentally recording and processing image data using various parameter settings and algorithms. In practice, this is not feasible in a large parameter space. At least focusing on potentially powerful configurations for different taught objects is a first step towards improvement, but nothing more.
[0008] Furthermore, it is conceivable that, during actual operation, the parameter set obtained during debugging would be further adapted in small steps. For example, EP 1 014 292 B1 discloses a method for automatically adjusting the characteristics of an optical barcode reader system, which repeatedly fine-tunes its operating point. Here, it is difficult to predict how this will specifically affect the read rate. In this way, slow changes and drifts are primarily compensated for. However, in the case of reading at a typical conveyor belt, for example, conditions change highly dynamically due to differences in object height. Subsequently, rather slow and minute parameter adaptations are too cumbersome for this. On the other hand, more drastic parameter adaptations could completely lose the initial optimization due to a single, unrepresentative event.
[0009] Therefore, optimizing a code reader system for dynamic operation presents challenges, more specifically, when measurements (e.g., distance to the corresponding object) and readily adjustable optical settings (e.g., dynamic focus) are lacking. Effective manual optimization over extended operational periods is highly complex and error-prone due to evolving decoding methods and numerous camera and decoder parameters. In practice, this results in poor readout rates.
[0010] Therefore, the objective of this invention is to improve the parameterization of barcode reading devices.
[0011] This task is achieved through a method for automatically setting up a barcode reader, as described below, and a camera-based barcode reader. For example, the barcode reader to be set up during setup includes an image sensor and a control and evaluation unit. In subsequent operations, the image sensor or a camera with an image sensor records an image of an object carrying optical codes, and the control and evaluation unit locates the code regions within the images and decodes the found codes, i.e., reads their respective code contents. The optical codes to be read can be barcodes, but can also be QR codes based on one of various known standards.
[0012] Example images of the example objects are recorded for setup. The example objects should be selected to be representative or typical of the subsequent application and therefore carry at least one type of example code that will be read in subsequent operations. The setup personnel are responsible for selecting suitable example objects. For less representative objects, the method works in the same way, but slightly less suitable configurations may be found. It is conceivable that multiple image sensors work together to combine a larger image or example image, which is preferably included below and treated as a single camera or single image sensor with a large field of view.
[0013] Through automatic setup, at least one recording parameter and / or at least one decoding parameter of the decoding method are set based on an evaluation of a sample image for use in subsequent operations. The code reading device then uses the decoding method to read the code content during operation. The corresponding set of parameters or combination of parameters is also referred to as the operating point.
[0014] This invention is based on the fundamental idea of transforming recorded example images through computational alteration and thereby replicating them. "Computational" refers to the same physical original image being transformed through different processing. These can be considered virtual example images generated only indirectly from real-world recordings. This does not preclude the possibility of multiple physical original images, which are then processed with different or identical widths for replication. In this way, an enlarged image dataset with additional example images is generated. Now, an evaluation (followed by which at least one recording parameter and / or at least one decoding parameter of the decoding method is set) incorporates these additional example images. This creates a broader foundation that can better cover future operational scenarios compared to example images solely based on physical recordings.
[0015] This method is computer-implemented and operates automatically or independently. Certain manual interventions, such as confirming that the example object is within the field of view, can be integrated into the automated process. The actual optimization does not require manual steps, where the final setup is left to the discretion of the operator. The setup method can operate within the control and evaluation unit of the barcode reader and / or at least partially within a persistently or temporarily connected computing unit (e.g., a higher-level controller, a configuration computer, or a network including the cloud).
[0016] The advantage of this invention lies in finding a particularly suitable operating point by generating additional sample images during setup and evaluating the corresponding magnified image dataset. This operating point takes into account subsequent dynamic operations, such as moving objects and different object heights, even variations that are not readily apparent from the sample objects and their sample images. This achieves a particularly high readout rate. The temporal characteristics of the decoder also play a role here, as the decoder has only a limited computation time available during the recording and evaluation of image sequences until the next image. The available decoder time can be exhausted by the optimized operating point, or a higher image recording frequency can be adjusted. Complex optimization tasks can be performed quickly and economically due to the automated process. It does not require the deep expert knowledge required for manual optimization, and automation helps avoid errors. Subsequent fine-tuning is possible. By re-executing the potentially shortened method, it is very easy to react to changes such as decoder updates.
[0017] Preferably, the evaluation of the example image includes a decoding attempt. A decoding attempt refers to applying at least one decoder or decoding method to the example image to read the code content within the example image. Depending on the steps in the setup, this reading attempt is performed using a physically recorded example image or another virtually generated example image. In the simplest case, the success or failure of the decoding attempt is evaluated in binary form, i.e., whether the code is readable (GoodRead) or unreadable (NoRead). Furthermore, preferably, a quality metric of the decoder is also determined, from which the additional quality loss that might still allow for reading can be estimated. Therefore, the corresponding operating point can be tested or verified at a real decoder used in later operations. Ultimately, this is the most relevant evaluation mechanism. In this way, the same setup method can be used to react very easily to changes in the decoder version (e.g., after a software update). Therefore, progress made through continuous improvement of the decoding algorithm is supported by an optimal operating point in every case.
[0018] Preferably, at least one recording parameter includes photosensitivity (gain), exposure time (shutter speed), image refresh rate, and / or the focal position of optics arranged upstream of the image sensor. These are important recording parameters, particularly for recording a sufficiently sharp image through an appropriate focal position, which affects other image parameters (such as contrast), and for recording a sufficiently bright and un-over-tuned image with as few motion artifacts as possible through photosensitivity and exposure time. For example, decoding parameters relate to the type of code to be read, the choice of decoder algorithm, module size, or possible preprocessing (e.g., noise filtering or super-resolution for improving resolution). The available decoder time between two recordings should be optimized. The faster the decoder, the higher the selectable recording frequency, thus providing more opportunities to record the corresponding code in a manner suitable for code reading.
[0019] Preferably, additional example images are generated for different object sizes, specifically for the minimum and maximum object heights expected in subsequent operations. The object size corresponds to the distance between the image sensor and the recorded object surface; the larger the object, the closer its surface is to the image sensor, and vice versa. This idea is typically guided by mounting the camera from above, where the decisive dimension of the object size is its height. The object height should be understood accordingly when mounted from another perspective. Additional example images for different object sizes are particularly preferred and relevant examples of computationally extended changes in the image dataset used to determine the working point, as different object sizes or heights significantly affect the focus position or deviation from the focus position and exposure, thereby affecting the center quality criterion of the image. The working point is optimized not only for the object size or height of the example object but also for all expected object sizes or heights. Specifically, additional example images are generated for the extreme values of the expected minimum and maximum object heights, again preferably exactly one example image for each. Then, a total of three example images are generated: two virtual example images showing the maximum distance to a low-sized (e.g., on the transport plane) object and the minimum distance to a high-sized object, and one example image showing a physical record of an object of intermediate size or height. It is assumed that the decoder can handle more intermediate states if it can handle extreme cases. However, it is also conceivable to generate more than two additional example images for other object sizes or heights, or for changes in other effects besides object size or height.
[0020] Preferably, additional sample images are generated by increasing or decreasing the resolution (also known as upsampling or downsampling). This then corresponds to virtual records obtained from larger or smaller distances based on an assumed object size or height. A particularly suitable method is bicubic interpolation. Preferably, the sample images are pre-centered onto the sample code and cropped after upsampling or padded at the edges with preset content without code structure after downsampling. Thus, the further sample images have a uniform format, and the relevant image content is preserved.
[0021] Preferably, additional sample images are generated with a blur corresponding to the expected defocus. Only a limited depth of field is associated with the focal position of the recorded physical sample image. Subsequent physical recordings of particularly small or large, low or high objects are located at the edges of this depth of field or outside the depth of field region. Preferably, this defocus is taken into account. For this purpose, the effect of the objective lens can be simulated computationally, for example, by convolving the additional sample image with a point spread function (PSF). Convolving with a Gaussian kernel having a standard deviation derived from the defocus is suitable as a preferred approximation. The point spread function or other filtering kernels, especially Gaussian kernels, can be pre-calculated and stored for different focal positions and deviations from the focal positions.
[0022] Evaluations of additional example images generated computationally for different object sizes may reveal that a single operating point cannot cover the entire range of desired object sizes. Therefore, setup personnel receive rapid feedback on whether desired object height variations can be handled, and, if necessary, indications of whether the object height variations can still be displayed, or possible upgrades or modifications to the barcode reader to enable the original specifications.
[0023] Preferably, additional sample images are generated by moving the image content. This simulates subsequent motion in the operation. Images are recorded at different relative positions between the image sensor or camera and the object. Preferably, additional sample images are generated for codes that are fully hit and codes at edge locations. The latter typically requires more decoder time until only partially detected codes can still be read. Therefore, the required decoder time can be determined, and thus the achievable frame rate or image refresh rate can be determined. It is conceivable to combine the movement of image content with assumed different object sizes or object heights.
[0024] Preferably, additional example images are generated with the desired motion blur. Motion during the operation not only creates different object and code locations in the image but also generates motion blur, making code reading difficult or hindering. Motion blur can be generated similarly to the blur already described for defocused recording, particularly by utilizing convolution with a Gaussian filter kernel. For the design of the filter kernel (e.g., the standard deviation of the Gaussian filter kernel), the deviation from the focus position is now not decisive, but rather, for example, chosen to be equal to the standard deviation of the module width in pixels per module (ppm).
[0025] Preferably, initial values for at least one recording parameter and / or decoding parameter are first determined such that the example code can be read. Therefore, as the basis for subsequent optimization in dynamic operating cases, it is first ensured that the example code can be fully read. This is also referred to as the first read. Depending on the implementation, the initial value can be understood as good enough, i.e., fully reading the example code, or having already been optimized for static cases using the methods outlined in the introduction. As an alternative to intelligent optimization for static cases, it is also conceivable to experiment with the parameters until the example code is fully or even optimally read. Sufficient time is available during setup for this brute-force approach.
[0026] Preferably, at least one recording parameter and / or decoding parameter is determined by an optimization method that tests within the parameter space of the recording and / or decoding parameters. Preferably, optimization begins with initial values from the previous step, as it can be assumed that optimal values can be found more reliably and quickly from here than with generic or random initial values. A simple optimization method iteratively tries the parameter space in predetermined steps around the initial values, then selects the set of parameters with the best results or interpolates such a set of parameters between test steps. Alternative optimization methods, such as hill climbing, are also conceivable, which moves in the parameter space toward better readouts and, in particular, shortens the step size. Parts of particular interest in the parameter space relate to the focal position and light sensitivity, so optimization can move at least within a sub-method while preserving other parameters in that sub-space.
[0027] Preferably, during setup, example images are recorded again based on at least one recording parameter to be tested. Thus, within the optimization cycle, a new image dataset is generated at the current test operating point, which has at least one real example image and an associated additional example image generated through computational changes (e.g., through upsampling / downsampling and / or movement of image content).
[0028] Preferably, multiple example images are recorded at a single focal location and under multiple light sensitivities. Therefore, the effect of light sensitivity is not predicted by calculation, but measured through multiple physical recordings. This allows for the detection of the diffuse reflection behavior of the example object. For an ideal reference object with known or fixed diffuse reflection behavior, the effect of different light sensitivities can be pre-simulated, calculated, or taught. This behavior can then be rescaled using the measured diffuse reflection behavior. This produces a combination of realistic effects and virtual alienation, particularly in the case of assumed different object sizes, significantly improving the prediction of computationally determined additional example images.
[0029] Preferably, setup is performed using only a single example object. This greatly simplifies and speeds up setup. According to existing techniques, an operating point is found that is optimized precisely for a single example object in its recording scenario. Typically, this would be an incorrect optimization for subsequent dynamic operation phases. Instead, according to the invention, by generating additional example images from the presentation of the single example object, subsequent dynamic scenarios, particularly those with different object sizes or heights and / or movements, can be generalized. The decoder's behavior also validates this dynamic scenario with further example images and finds a practically optimal operating point. Furthermore, the single example object can be recorded multiple times at different operating points within the optimized range, depending on the implementation method. This is an automated process and does not complicate the setup process for the operator, who only needs to initially ensure that the single example object is positioned within the image sensor's field of view.
[0030] In principle, it's conceivable to present multiple sample objects sequentially during setup, rather than just a single sample object. This makes the setup method more complex, but it more clearly illustrates which objects are needed in the operation. In particular, optimizations can be performed individually for each sample object. The results can cancel each other out, especially by averaging based on the expected subsequent object distribution. Furthermore, the initial values for the optimization of one sample object can be derived from the optimization results of another sample object.
[0031] Preferably, the example object is recorded in a static state, even if a flow of moving objects is to be detected in subsequent operations. The effect of motion can be considered by generating additional example images. It is not necessary to observe production operations with moving objects.
[0032] The camera-based barcode reader according to the invention includes an image sensor for recording image data and a control and evaluation unit. In one embodiment of the method according to the invention, the barcode reader is configured and constructed to detect an image of an object during operation and read the optical code attached thereto. The barcode reader may have one or more image sensors or one or more cameras, one or more computing units, and additional sensors, such as an encoder or volume measurement system for determining the feed speed of a conveyor. The control and evaluation unit can be distributed in any way across the camera and other computing units of the barcode reader. In particular, during setup, it is conceivable that control and evaluation functions can be provided externally, whether via a higher-level controller, a connected configuration computer, a network, or the cloud.
[0033] Preferably, the barcode reader is fixedly mounted at the flow of objects to be inspected, particularly at the conveyor. Therefore, the objects to be inspected and the barcode reader are in relative motion. Preferably, this motion, along with different object sizes or heights, is part of the operational dynamics considered through the operating point found according to the invention. As previously mentioned, preferably, this is set during the presentation of the example object when it is in a static state.
[0034] Preferably, the barcode reader has optics associated with an image sensor whose focus position can only be adjusted manually or more slowly than the expected sequence of objects (fixed focus, slow focus). In other words, there is no autofocus system. If autofocus were fully possible, adjusting to the next object in a timely manner would be too slow anyway. The focus position can be adapted within a suitable range of operating points only for longer operation phases. Such barcode readers are simpler, less expensive, and easier to maintain, and benefit particularly from the optimized operating point. Attached Figure Description
[0035] Other features and advantages of the invention will now be described in more detail, based on exemplary embodiments and with reference to the accompanying drawings. In the drawings:
[0036] Figure 1 A schematic cross-sectional view of a camera-based barcode reader is shown;
[0037] Figure 2 A three-dimensional view of a barcode reader device with a barcode reader is shown assembled on a conveyor belt.
[0038] Figure 3 An exemplary flowchart is shown to adapt focus position and light sensitivity by generating virtual example images with different assumed object heights from physical example images;
[0039] Figure 4An example image recorded using an image sensor with a barcode reader is shown;
[0040] Figure 5 It shows according to Figure 4 A magnified view of a portion of the code in the example image;
[0041] Figure 6 This shows the result based on the assumed maximum object height. Figure 4 A virtual example image generated from the example image;
[0042] Figure 7 It shows according to Figure 6 A magnified view of a portion of the code in the example image;
[0043] Figure 8 This shows the result under the assumption of a minimum object height, based on... Figure 4 A virtual example image generated from the example image;
[0044] Figure 9 It shows according to Figure 8 A magnified view of a portion of the code in the example image;
[0045] Figure 10 It shows according to Figure 4 An updated illustration of the example image, showing the identification of the center of the code and the shift required for centering;
[0046] Figure 11 It shows the result after centering is completed. Figure 10 Diagram;
[0047] Figure 12 An exemplary flowchart is shown to find and examine optimal parameters (in particular, recording frequency) by generating virtual example images with assumed motion;
[0048] Figure 13 Four different virtual example images are shown for complete and partial detection of the code, with different shifts in the code position; and
[0049] Figure 14 An exemplary flowchart is shown to optimize focus position and light sensitivity based on a virtual sample image.
[0050] Figure 1A schematic cross-sectional view of a camera-based reader 10 is shown. Received light 12 from detection area 14 strikes receiving optics 16, which guides the received light 12 onto image sensor 18. Preferably, the optical elements of receiving optics 16 are configured as an objective lens consisting of multiple lenses and other optical elements (e.g., apertures, prisms, etc.), but for simplicity, only one lens is represented here. Preferably, no autofocus system is provided, but the possibility of slow focusing (fixed focus, manual focus, or slow focus) is possible.
[0051] In order to illuminate the detection area 14 with emitted light 20 during recording by the barcode reader 10, the barcode reader 10 includes an optional illumination unit 22, which illuminates the detection area 14 during recording by the barcode reader 10. Figure 1 The illumination unit 22 is shown as a simple light source, and the emitting optics are not shown. In other embodiments, multiple light sources (e.g., LEDs or laser diodes) are arranged, for example, in a ring around the receiving path. These light sources may also be multi-colored and may be driven in groups or individually to suit the parameters of the illumination unit 22, such as the color, intensity, and direction of the illumination unit 22. Unlike the illustration, the illumination unit 22 may be external.
[0052] The control and evaluation unit 24 is connected to the image sensor 18 and the illumination unit 22, and is responsible for control, evaluation, and other coordination tasks within the barcode reader 10. This control and evaluation unit includes one or more processing modules, such as FPGAs and microprocessors, and evaluates the image data from the image sensor 18. Here, code regions in the image data are located and their codes are read. Contrary to the illustration, the control and evaluation functions can actually be distributed in any way across internal and external components, with external components also potentially connected via a network or cloud. In particular, external access for the control and evaluation functions can be envisioned for a setup phase, which will be further described below and may only temporarily provide computing and storage resources for this phase. The barcode reader 10 outputs information, such as the read codes or image data, via interface 26. If the control and evaluation unit 24 is not located or is not entirely located within the actual barcode reader 10, interface 26 also serves as a connection between internal and external control and evaluation.
[0053] Figure 2 A barcode reader 10 is shown mounted above a conveyor belt 28, as indicated by arrow 32, which conveys an object 30 through the detection area 14 of the barcode reader 10. The object 30 carries code areas 34 on its outer surface, which are detected and evaluated by the barcode reader 10. These code areas 34 can only be recognized by the barcode reader 10 if they are attached to the upper side or at least visible from above. Therefore, unlike... Figure 2The diagram illustrates that multiple barcode readers 10 can be mounted from different directions to read the codes 36 attached to the side or underneath, enabling so-called omnidirectional reading. In practice, multiple barcode readers 10 are typically arranged into a reading system as a reading channel. The reading system generally forms a barcode reading device, which may include other sensors not shown, such as a laser scanner for measuring volume or an encoder for determining the conveyor speed of the conveyor belt 28. An example of a distributed implementation of a higher-level controller 38 for control and evaluation functions is shown.
[0054] According to the present invention, a code reading device, as exemplarily described, is... Figure 2 The one shown in the document and having one or more of the following: Figure 1 The described reader 10 is automatically configured for subsequent operational phases, such as as part of debugging. Configuration refers to setting the recording parameters of the reader 10, the decoding parameters of the decoder used for reading, or the decoding parameters of the decoding method implemented in the reader 10. Such a set of parameters is also referred to as the operating point of the reading device. The optimal operating point takes into account the dynamics of the operation, particularly motion and different object heights. According to the invention, a virtual example image is generated, corresponding to a conceivable subsequent reading scenario, but which is not physically recorded during the reading. Here, object height always represents the size of the object 30 to be detected, which is decisive for the distance between the object 30 and the reader 10. This is guided by the idea of a top-down perspective, but corresponding correlations are also derived from other object dimensions from other perspectives, therefore the object height should be representative of these object sizes.
[0055] Figure 3 An exemplary flowchart is shown for generating and evaluating virtual sample images of objects 30 at assumed object heights. This illustrates to some extent a single optimization cycle in the setup phase, which tests a specific operating point, where two parameters are involved: focus position and light sensitivity (gain), with other parameters optimized or preset separately. A sufficiently sharp image is a fundamental requirement for high read rates, while also preventing over-excitation in the near-field range and under-excitation in the far-field range. Preferably, the exposure time is part of the operating point, but this exposure time can be relatively simply calculated at the start of the optimization process as a quotient of the module size and the transport speed. Optimization finds an operating point in which stable, reliable reads can be made for all expected object heights, or alternatively, determines that no operating point using the barcode reader can cover the entire range of desired object heights.
[0056] In step S1, a sample object with code is first placed in detection area 14. The sample object should represent the object 30 to be detected subsequently. Preferably, presentation is performed in a static state. This simplifies the procedure and allows records to be generated repeatedly with different parameters during optimization.
[0057] In step S2, an example image of the example object is recorded. Preferably, the parameters focus position and photosensitivity are set to the values to be tested during this optimization cycle. (See later...) Figure 14 This section details possible implementations of optimization. Initially, for example, the focus position and light sensitivity are set to average or other general values, or an initial pre-optimization is performed for a stationary state, known as the first readout. In subsequent optimization cycles, other focus positions and light sensitivity are tested, either incrementally in an iterative loop or using the corresponding current optimization results, which are then refined during the optimization cycle. In a fixed-focus system, the focus position is immutable, so only light sensitivity can be optimized. Alternatively, consider a slow-focus system that allows for slow focus changes. Another alternative is manual focus, which is adjusted by a user according to the precise specifications of the automatic focus method.
[0058] For illustrative purposes, Figure 4 This shows an example image recorded at the current focus position and light sensitivity settings. This is a real-world photograph, a physical image of the example object. Figure 5 A magnified view of a portion of the code area is shown.
[0059] Back Figure 3 In step S3, a virtual example image is generated from the physical example image. This virtual example image simulates the detection situation as if the example object had a minimum or maximum object height. The object height corresponds to the reading distance between the reader 10 and the object 30. The minimum and maximum object heights are application specifications. If this information is missing, the reading distance to the transport plane can be assumed to be the minimum object height, and the just-accessible near-field range that the reader 10 can handle can be assumed to be the maximum object height.
[0060] To accommodate the assumed minimum and maximum object heights, the resolution of the example image recorded in step S2 is adjusted using upsampling or downsampling. Preferably, the centroid of the code or code region is used as an anchor point. A suitable, exemplary interpolation algorithm is bicubic interpolation. Therefore, the basis for the alienation or generation of the virtual example image is the actual recorded example image of the example object. In addition to the pure resolution depending on the object height, different light energies for different reading distances are preferably considered. Specifically, in step S2, multiple recordings can be performed at different light sensitivities to account for the diffuse reflection characteristics of the example object. (See below for further details.) Figure 14 This section elaborates on which light sensitivity settings can be configured based on the minimum and maximum object heights.
[0061] For illustrative purposes, Figure 6 This shows a virtual example image generated from a physical example image, assuming the maximum object height. Figure 8 A corresponding virtual example image is shown, assuming a minimum object height. Figure 7 and Figure 9 A magnified view of the relevant code region is shown.
[0062] Back to Figure 3 In optional step S4, sharpness is also considered because the minimum and maximum object heights will typically be located at most in the edge region of the depth-of-field area at the set focal position. For realistic assumptions, the virtual example image should have a realistic sharpness that is still expected, rather than the sharpness of the physical example image obtained in step 2. One possibility for considering deviations from the ideal focal position or relative to the depth-of-field area is to use a Gaussian kernel for convolution. This represents a good approximation of the actual point spread function (PSF) of the objective or receiving optics 16. Appropriate standard deviations can be stored in a lookup table (LUT) or calculated for possible focal positions. Alternatively, it is conceivable to utilize a Gaussian approximation or a filter kernel pre-calculated from an alternative or more accurate model and store it in memory for later lookup.
[0063] In step S5, the virtual example image, and if necessary, the physical example image, are delivered to the decoder for evaluation. Preferably, those decoding methods that will also be used later in the operation are applied.
[0064] In step S6, based on the reading results from step S5, the focal position and photosensitivity used are evaluated. Here, it can only be determined in binary form whether the code was read (GoodRead) or not replaced (NoRead). Alternatively, the decoder generates a quantitative quality metric. As part of the optimization, where... Figure 3 The described optimization cycle is preferably run multiple times, and such a quality metric can be used to determine suitable values for the focus position and light sensitivity for a new optimization cycle. Alternatively, the focus position and light sensitivity are systematically tried one by one within a certain parameter range, and the optimal focus position and light sensitivity are ultimately found using the quality metric. The quality metric determines the reliability of the readout so that a reserve is preferably also made for poorer image quality. Another criterion is speed, because a shorter decoder time saves computational resources and enables a faster recording frequency (frame rate).
[0065] Therefore, in general, the additional virtual example images are generated from real example images, preferably from only a single example object, and preferably generated in a static state to reflect subsequent dynamic operation. The optimal operating point is found using the decoder engine, which is also used in operation, as an evaluation instance, particularly regarding the settings for focus position and light sensitivity. If the decoder engine is improved, for example as part of a firmware update, the operating point can be easily readjusted by running the optimization again, for example, when the new decoder engine handles blurred code better.
[0066] Figure 10 and Figure 11 This illustrates centering the recorded example image at the centroid of the code or code region to obtain a suitable anchor point for subsequently generated dummy images, especially with resolution variations. (See example...) Figure 10 As shown, the bounding box 40 is placed around the code, or if there are multiple codes, the bounding box 40 is placed around multiple codes. The offset of the bounding box relative to the center point should be compensated for by centering, as shown by arrow 42. Figure 11 An exemplary centering result is shown. Here, as on a torus, image content pushed out at one edge is re-inserted at the opposite edge (Wrap Around).
[0067] Figure 12 An exemplary flowchart is shown for generating and evaluating a virtual sample image of an object 30 in motion. These steps are similar in some places to... Figure 3The steps will therefore be explained only briefly in part, where further details can be omitted. Now, a virtual sample image should be generated from the recorded sample image, corresponding to a readout in motion, where the code moves across a preferred detection point and may only be partially recorded. To simulate this, the image content is moved, and preferably motion blur is simulated.
[0068] In steps S11 and S12, the example object with the code in the detection area 14 is first recorded again, and an example image is generated. Here, the working point for testing in this optimization cycle is set. As always, the working point means a specific setting for recording parameters (such as exposure time, focus position, or light sensitivity) and / or decoding parameters. If other virtual example images are generated at this working point, these steps only need to be performed once, for example, according to... Figure 3 Steps S1 and S2 and according to Figure 12 Steps S11 and S12 can overlap.
[0069] In step S13, at least one virtual example image is generated based on the simulated motion of the recorded example object. During subsequent readings, the code moves into detection area 14 on one side, passes a preferred recording point, and then moves out again on the other side. Multiple recordings can be generated during this timeframe. In some of these recordings, a single code, preferably all codes, is fully visible, while in others, only a portion of the code is fully visible. For example, virtual example images are now generated such that the code is detected completely at least once and at least once at the edge position, preferably twice each, thus achieving a good balance between cost and result. In the case of barcodes, attention can be paid to selecting the shift based on the orientation of its code elements, which is not important for 2D codes. However, preferably, in the virtual example image of the 2D code at the edge position, at least a portion of the finder pattern should still be visible, making the decoding method a very serious attempt at decoding, thus requiring actual processing time.
[0070] Figure 13 Examples of four such virtual sample images are shown, one of which could also be the image originally physically recorded. The code regions are located at the edges in the upper left and lower right corners, and are fully detected in the upper right and lower left corners. Preferably, the image content pushed out of the edges is re-inserted on the other side (Wrap Around).
[0071] Back Figure 12 In optional step S14, motion blur is now also simulated. The cause of the blur differs from that based on Figure 3The defocusing occurs in step S4. However, the calculation process can be very similar, for example, using a Gaussian kernel for convolution, where the standard deviation corresponds to the module width. This module width may be pre-given or known from previous setup steps. In particular, the module width can be reconstructed after each successful read attempt of the code, since the code image, its pixel regions, its dimensions, and knowledge about the code modules are all available.
[0072] In step S15, the virtual example image undergoes a process similar to that described by... Figure 3 The decoding method in step S5 preferably utilizes the decoder engine used in the operation.
[0073] However, in the evaluation in step S16, with Figure 3 Unlike step S6, the objective is preferably not to determine the suitability of the operating point for the code reading or to what extent it can still be improved. Instead, the required decoder time should be estimated, such as the average or maximum decoder time. During operation, only a finite amount of time is available between two recordings, making this decoder time an important metric. In particular, this allows us to find the optimal recording frequency. Codes at edge locations contribute significantly to the decoder time because the decoding method repeatedly attempts to read these codes. The realistic scenario for subsequent operations is predicted using virtual example images. The time estimation assumes that each code is read at least once (e.g., twice), and that the code is likely partially located at an edge, so random, favorable physical example images will never distort the decoder time too short.
[0074] against Figure 3 and Figure 12 The two processes described can be combined with each other. This means that, on the one hand, the two methods can be executed sequentially or nested within each other. However, it is also conceivable to generate a virtual example image that changes both in its recording parameters (e.g., focus position and light sensitivity) and according to motion.
[0075] Figure 14 A flowchart illustrating the optimization of the working point in an exemplary detailed implementation is shown. This explanation involves adjusting the optimal focus position and photosensitivity for different expected object heights, and is supplemented by... Figure 3 The explanation is as follows. However, other recording or decoding parameters are optimized in a very similar, transferable manner.
[0076] Preferably, various frame conditions are known in advance. These frame conditions include the expected minimum and maximum object height, the mounting height of the barcode reader 10, and the orientation or aperture adjustment of the barcode reader, which can alternatively be optimized using the method according to the invention. The imaging scale or readout field size is known or pre-calculated. The movement speed of the object 30 or conveyor belt 28 is also predetermined or pre-measured. The height of the presented example object can be predetermined or measured, for example, based on the optimal focal position. Here, the mounting height and orientation of the barcode reader 10 can be used for trigonometric transformation between the distance between the object 30 and the barcode reader 10 and the object height.
[0077] Preferably, two relationships are also known, which can be stored in any form, such as a function or a lookup table (LUT). These relationships can be modeled, simulated, or taught, for example, during the final fabrication of the reader 10. One relationship relates to the correlation between photosensitivity and the reading distance d, i.e., the gain (d) function of a standard object with known diffuse reflection behavior. The second relationship relates to blurring in the presence of a deviation from an optimal focal position, which in particular can be stored as the standard deviation of a Gaussian kernel or derived from objective lens characteristics.
[0078] In step S21, initial values are determined. These initial values can be fixed initialization values. Preferably, in the so-called first read, a known optimization is performed on a static example object. Unlike the core of the invention, a virtual example image is not generated here. In particular, in the first read, initial values for important recording parameters such as exposure time, focus position, and photosensitivity are found, using which the code of the example object can be read. Here, a decoding method or decoding parameters can also be selected. The better the initial values are tuned to the physical example image with its specific diffuse reflection characteristics, the faster the optimization according to the invention will succeed for dynamic operating conditions, and the less likely the optimization will get lost in the parameter space (e.g., in local extrema).
[0079] In step S22, the exposure time is set. This is relatively straightforward because the exposure time can be calculated as the quotient of the module size or module width and the motion speed. The motion speed is known or measurable, and the module size is also known or, at the latest, determined after a successful first read, provided that other mounting and recording parameters are known during the first read. Using this set exposure time, motion blur is limited to at most one module size, assuming the decoding method can still tolerate this. Incidentally, this consideration also... Figure 12 The reason for the degree of motion blur simulated in step S14.
[0080] In step S23, an example image of the presented example object is recorded. To do this, in the first run of the subsequent optimization, the recording parameters (specifically focus position and light sensitivity) are set to the initial values from the first read or alternatively, generic initial values, such as the focus position at the average object height. The recording parameters are varied in further loops. Decoding attempts can be performed directly, because if such an attempt fails, it's impossible to even process the current settings of the example image, which could not possibly be the optimal settings sought. The loop process is then shortened or the entire optimization is interrupted to try again with the new changes to the recording parameters or better initial values.
[0081] Now, in steps S24 and S25, additional physical example images can optionally be recorded at light sensitivity corresponding to the minimum and maximum object heights. In other words, example images that are as bright or dark as the example objects with the minimum or maximum object heights will be generated. In step S24, a suitable light sensitivity is first calculated for this purpose. The light sensitivity at the current focal position is known as an initial value, or is known in subsequent executions of the optimization loop by adapting it to the corresponding new focal position. The correlation gain (d) has been introduced above, which can be used to convert the light sensitivity to different distances for a reference object with fixed diffuse reflection characteristics. Therefore, the light sensitivity can be rescaled for the example object at the focal position to find a suitable light sensitivity for objects with minimum and maximum heights.
[0082] Now, in step S25, using the photosensitivity calculated at the same focal position, two additional physical example images are recorded for the objects with the minimum and maximum heights. As a precaution, the original example images can also be recorded again to eliminate the effects caused by motion during the process. Now, there are three physical example images with three different brightness levels.
[0083] Now, in step S26, a virtual example image is generated. This has already been targeted at... Figure 3 In particular, steps S3 and S4 are explained in principle. The resolution is increased and decreased (upsampling / downsampling) respectively, and the resulting virtual example image is cropped (cropped during upsampling) or padded at the edges (during downsampling). This can be done before centering the code's center of gravity. Preferably, the virtual example image is still adapted using blur corresponding to the deviation from the assumed focus position, see [link to relevant documentation]. Figure 3 Step S4 in the process.
[0084] Then, in step S27, the virtual example image is processed using a decoding method. The corresponding binary or digital quality measure is stored. It is conceivable that some code is unreadable (Noread), and this result is also stored. If this remains the case at the end of optimization, the entire desired object height range cannot be processed using any fixed set of recorded parameters.
[0085] In step S28, the decoding result is evaluated. This is used to find suitable changes for the next optimization cycle. In simple optimization methods, such as iterating the parameter range in step sizes, the evaluation during this period can be omitted.
[0086] Now, in step S29, the recording parameters, particularly the focus position and photosensitivity, are systematically changed for another optimization cycle starting from step S23. Here, interruption conditions are also checked, such as whether the available optimization time has elapsed, whether the predetermined number of optimization cycles has been completed, or whether the desired general quality metric has been achieved. All common optimizations can be conceived here. In the simplest case, the parameter range around the initial values is systematically tested with a determined step size. Based on the evaluation in step S28, other optimizations (e.g., hill climbing) are performed to change the recording parameters in the direction of expected improvement.
[0087] In the final step S30, the optimization ends after the termination condition is met. In a simple iterative method, the recording parameters for all tests can now be evaluated. This allows for the selection or interpolation of optimal values. These optimal values are then set to suit as many expected object heights as possible. Other optimization methods assume optimal values for the recording parameters during the optimization process, thus eliminating the need for a final evaluation after the termination condition is met. For example, if many flat or tall objects are expected, the optimization process or result may include weights on the expected objects or object heights. Using the recording parameters thus found, particularly the focus position and photosensitivity, the reader 10 is configured for the next operational phase.
[0088] If the barcode reader 10 does not have focus adjustment, the remaining parameters can still be optimized for its fixed single focus position. A combination with manual focus adjustment is also conceivable. Then, in step S29 or S30, the automatic optimization process can provide the setup personnel with detailed instructions on how to set the focus for the next optimization step or subsequent operations.
[0089] Figure 14 This involves more focus point and light sensitivity settings. However, the process of reading in motion is very similar, with supplementary references... Figure 12The explanation involves two aspects: optimization of the focal position and light sensitivity, and optimization of motion. These optimizations can be performed sequentially or in an interwoven manner. In steps S24 to S26, motion needs to be considered in addition to the virtual object height, i.e., as in... Figure 12 The image content is moved as described in steps S13 and S14. Preferably, a virtual example image is generated, containing complete and edge-positioned codes to provide the decoding method with the actual spectrum of the example image and thus a good estimate of the decoder time. The image sequence simulating motion can only be generated for a fixed object height, but can also be generated for a hypothetical minimum or maximum object height. This provides supplementary quality metrics for focal position and light sensitivity. The actual estimate of the decoder time allows determination of the achievable recording frequency (frame rate) for the corresponding test operating point. This can be used to adjust the recording frequency, but can also serve as a criterion for discarding operating points or at least reducing its evaluation in an optimization sense, since the decoder would be too slow here.
[0090] Module size intervals can be tested using a similar process, either integrated into or connected to it. To do this, a virtual sample image is generated using a scaling factor, resulting in the minimum and maximum module sizes or widths to be read. This is then attempted to be decoded. This ensures that module sizes are read within the interval, or that it can output which module sizes are readable.
[0091] In summary, optimization is achieved by a mixture of real-world effects (e.g., exposure time, focus position, and light sensitivity of physically recorded example images) and artificial or computational alienation of virtual example images. Furthermore, optimization can include different object heights and motions, i.e., dynamic effects of subsequent operations that do not actually exist during the presentation of the example object. Here, it is preferable that only a very small number of physical records of a single presented example object are sufficient, and the number of virtual example images generated thereby can also be kept small. Therefore, this is certainly not comparable to dynamically adapting to the detection of multiple real objects (as is partly the case in the prior art mentioned at the beginning) or even to the number of examples required for machine learning training.
[0092] Physical and / or realistic example images can be displayed to track the optimization process and intervene when necessary, such as excluding virtual example images if they are unrealistic or do not perform as expected during operation. In principle, the entire optimization process can be implemented using a lookup table. However, this is extremely complex and inflexible, for example, regarding changes to the decoder version.
Claims
1. A method for automatically setting up a barcode reader (10, 38), said barcode reader having an image sensor (18) and a control and evaluation unit (24, 38), wherein, The image sensor (18) records example images of example objects with example codes arranged in the field of view (14) of the image sensor (18), and determines at least one recording parameter and / or at least one decoding parameter for operating the code reading device (10, 38) based on the evaluation of the example images. Its features are, Another example image is generated from the example image through computational changes, and the at least one recording parameter and / or the at least one decoding parameter is determined based on the evaluation of the other example image.
2. The method according to claim 1, wherein, The evaluation of the example image includes decoding attempts.
3. The method according to claim 1, wherein, The at least one recording parameter includes photosensitivity, exposure time, image refresh rate and / or the focal position of an optical device (16) arranged upstream of the image sensor.
4. The method according to claim 2, wherein, The at least one recording parameter includes photosensitivity, exposure time, image refresh rate and / or the focal position of an optical device (16) arranged upstream of the image sensor.
5. The method according to any one of claims 1-4, wherein, Generate additional sample images for different object sizes.
6. The method according to claim 5, wherein, Additional sample images are generated for the expected minimum and maximum object heights in subsequent operations.
7. The method according to claim 5, wherein, The additional example images are generated by increasing or decreasing the resolution.
8. The method according to claim 7, wherein, The additional example image was generated using bicubic interpolation.
9. The method according to claim 5, wherein, The additional example image is generated with a blur corresponding to the expected out-of-focus state.
10. The method according to any one of claims 6-8, wherein, The additional example image is generated with a blur corresponding to the expected out-of-focus state.
11. The method according to any one of claims 1-4 and 6-9, wherein, Another example image is generated by moving the image content.
12. The method according to claim 11, wherein, The additional example image is generated with the expected motion blur.
13. The method according to any one of claims 1-4, 6-9, and 12, wherein, First, determine the initial values of the at least one recording parameter and / or the at least one decoding parameter so that the example code can be read.
14. The method according to any one of claims 1-4, 6-9 and 12, wherein, The at least one recording parameter and / or the at least one decoding parameter is determined by an optimized method that tests in the parameter space of the at least one recording parameter and / or the at least one decoding parameter.
15. The method according to claim 14, wherein, The example image is recorded again during setup based on at least one recording parameter to be tested.
16. The method of claim 14, wherein, Record multiple example images at a single focal point and multiple light sensitivities.
17. The method according to claim 15, wherein, Record multiple example images at a single focal point and multiple light sensitivities.
18. The method according to any one of claims 1-4, 6-9, 12, and 15-17, wherein, The settings described are performed using only a single example object.
19. A camera-based code reading device (10, 38) having an image sensor (18) for recording image data and a control and evaluation unit (24, 38) configured according to any one of claims 1-18 and designed to detect an image of an object (30) in operation and read an optical code (34) attached to the object.
20. The barcode reader (10, 38) according to claim 19, wherein the barcode reader is fixedly mounted at the flow of the object to be detected (30), and / or the barcode reader has an optical element (16) associated with the image sensor (18), the focal position of which can only be manually adjusted or adjusted slower than the expected object sequence.
21. The code reading device (10, 38) according to claim 20, wherein, The code reading device is fixedly installed at the conveying device (28).