Camera interface circuit of barcode scanner
By using a camera interface circuit in the barcode scanner to perform binary conversion and alternate processing of image signals, the problems of excessive memory usage and long processing time in the existing technology are solved, and more efficient image processing and more compact are achieved. Circuit design.
Patent Information
- Application Number
- CN201810614301.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-06-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2038-06-14
AI Technical Summary
Existing barcode scanners require more memory and frequent read/write operations in image signal processing, resulting in increased costs, circuit size, and processing time.
The camera interface circuit is used to convert the pixel grayscale in the image frame into a binary code through the binary conversion module, and is alternately provided to the display module and decoder through the selection module, reducing the use of memory and read/write operations, and using calibration The module calculates a dynamic threshold based on the histogram of the image frame for binary conversion.
It reduces the cost and size of barcode scanners, improves processing efficiency, reduces the number of memory interactions, and improves preview image processing speed.
Smart Images

Figure CN110610108B
Abstract
Description
Technical Field
[0001] The present invention generally relates to bar code scanners and more particularly to camera interface circuits for bar code scanners. Background Art
[0002] The barcode scanner is used to scan barcodes, such as one-dimensional (1-Dimensional, 1D) barcodes, two-dimensional (2-Dimensional, 2D) barcodes, or QR (Quick Response) codes. The barcode scanner generally includes a camera to capture the barcode image. The camera also converts the captured image into an image signal and provides the image signal to a processor with embedded software. The processor converts the image signal into a binary signal and decodes the binary signal to recover the information contained in the barcode. The camera also provides the image signal to a display unit to preview the captured barcode image.
[0003] Typically, in the processing of image signals, a processor interacts with one or more memories. For example, the processor performs a write operation to store an intermediate signal in a memory, and performs a read operation to restore the stored intermediate signal and use it for the next process. The memory increases the cost of the scanner and increases the size of the circuit, and the read / write operation increases the processing time. Accordingly, a barcode scanner that requires less memory and performs fewer memory read / write operations is advantageous. Summary of the invention
[0004] This Summary is provided to introduce a selected, simplified version of the concepts that are detailed in the Detailed Description below. This Summary is not intended to identify key or essential features of the claims nor is it intended to limit the scope of the claims.
[0005] According to one embodiment, a camera interface circuit of a barcode scanner includes:
[0006] A binary conversion module, configured to receive an image signal of an image frame from a camera, and convert the grayscale of each pixel in the image frame into a binary code; and
[0007] The first selection module is connected to the binary conversion module and is configured to alternately provide the binary code of the image frame and the image signal of the subsequent image frame to the output.
[0008] Illustratively, the circuit further includes a decoder connected to the first selection module, the decoder receiving the output binary code and decoding it into information of the scanned barcode.
[0009] By way of example, the circuit further comprises a display module connected to the first selection module, and the display module previews the output image signal.
[0010] For example, the binary conversion module is configured as:
[0011] Extract the grayscale of each pixel in the image frame;
[0012] Comparing the grayscale of each pixel with a threshold value; and
[0013] A binary code 1 or 0 is generated based on the comparison of the grayscale of each pixel being higher or lower than a threshold.
[0014] Illustratively, the threshold has a predetermined value.
[0015] Illustratively, the threshold is adjustable.
[0016] By way of example, the circuit further comprises a calibration module, which receives an image signal of an image frame, generates an adjusted threshold value, and provides the adjusted threshold value to the binary conversion module for comparison.
[0017] Illustratively, the adjusted threshold is calculated using a histogram of pixel grayscale values of a previous image frame.
[0018] By way of example, the first selection module is a multiplexer having a first input terminal for receiving a binary code and a second input terminal for receiving an image signal.
[0019] Illustratively, the circuit further includes a buffer module coupled to the first selection module to buffer an output of the first selection module.
[0020] By way of example, the circuit further comprises a synchronization module, which synchronizes the image signal from the camera, and provides the synchronized image signal to the binary conversion module and the first selection module as the image signal.
[0021] Illustratively, the circuit further includes a packaging module connected to the binary conversion module, which is configured to package the binary code into a predetermined format.
[0022] According to one embodiment, a method for interfacing image signals for a barcode scanner includes:
[0023] receiving an image signal from a camera of a barcode scanner;
[0024] converting the image signal by converting the grayscale of each pixel in the selected image frame into a binary code; and
[0025] alternately providing a binary code of a selected image frame and an image signal of a subsequent image frame as a first output and a second output,
[0026] The first output is provided to a display device to preview an image represented by the image signal, and the second output is provided to a decoder to decode a barcode represented by the image signal.
[0027] For example, receiving an image signal from a camera of a barcode receiver includes:
[0028] Synchronize the image signal.
[0029] For example, converting the image signal into a binary code includes:
[0030] Extract the grayscale of each pixel in the image frame;
[0031] comparing the grayscale of the pixel to a threshold; and
[0032] A binary code 1 or 0 is generated based on the comparison of the grayscale of the pixel being above or below a threshold.
[0033] For example, the method further comprises:
[0034] analyzing the image signal to generate a histogram of pixel grayscale values;
[0035] calculating an adjusted threshold from the histogram; and
[0036] The adjusted threshold is provided as the threshold for comparison for a subsequent image frame.
[0037] For example, the method further comprises:
[0038] The binary code is packaged into a predetermined format.
[0039] According to one embodiment, a method for processing an image signal for a barcode scanner includes:
[0040] receiving a first image frame from a camera of a barcode scanner;
[0041] providing the image signal of the first image frame as a first output to a display module to display a preview of the image signal;
[0042] receiving a second image frame from the camera, the second image frame being continuous with the first image frame;
[0043] Converting the grayscale of the pixels of the second image frame into a binary code; and
[0044] The binary code is provided as a second output to the decoder.
[0045] For example, converting the grayscale of the pixel of the second image frame into a binary code includes:
[0046] Extracting the grayscale of each pixel of the second image frame;
[0047] Comparing the grayscale of the extracted pixel with a threshold value; and
[0048] A binary code 1 or 0 is generated based on the comparison of the grayscale of the pixel being above or below a threshold.
[0049] For example, the method further comprises:
[0050] Analyzing the first image frame to generate a histogram of pixel gray levels;
[0051] calculating an adjusted threshold using the histogram; and
[0052] An adjusted threshold was used for comparison. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:
[0054] Figure 1 is a schematic block diagram of a barcode scanner according to an embodiment of the present invention; and
[0055] Figure 2 is an exemplary block diagram of a camera interface circuit according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] Figure 1 1 is a schematic block diagram of a barcode scanner according to an exemplary embodiment. The barcode scanner 100 includes a camera 102 and a camera interface circuit 104. The camera 102 scans a target image or photographs a target image and generates an image signal of the target image. The camera 102 may be any type of image capture device, such as a camera constructed in a mobile device. The image signal is provided to the camera interface circuit 104. The camera interface circuit 104 receives the image signal and transmits the image signal for subsequent preview on the one hand and converts the image signal into a binary code on the other hand. The data generated by the camera interface circuit 104 is provided to a memory 108 and stored in the memory 108. In one embodiment, the memory 108 may be included in the barcode scanner 100; in another embodiment, the memory 108 and the barcode scanner 100 are independent of each other. Subsequently, the memory 108 provides the stored data to a decoder 110 to decode the scanned barcode image. In other embodiments, the stored data is provided to a display module or a preview module 112 to display a preview of the scanned image. In the present invention, every other frame of image is provided to the preview module 112, thereby reducing the processing burden by 50%, and since adjacent image frames usually have only a small difference, the resolution of the preview image will not be significantly reduced. Therefore, the processing speed of the preview module 112 is improved.
[0057] The camera 102 takes a picture of an image frame by frame, and the generated image signal is organized to describe the brightness and chrominance of the pixels in each image frame. An example of an image signal is the YVU format, which is defined in ITU-R Recommendation BT.709. For an image signal in the YVU format, each image frame has 24 bits of data, of which the first 8 bits represent the brightness component (Y) and the following 16 bits represent the chrominance component (UV). When converting the image signal into a binary code, the camera interface circuit 104 only takes the first 8 bits of data for each image frame to extract the grayscale value of the pixel in the scanned image and compare the grayscale value with a predetermined threshold. In this embodiment, the camera interface circuit 104 converts every other image frame into a binary value for decoding by the decoder 110; and the unconverted image frame, that is, the original YVU format data signal, is directly provided to the preview module 112. Thereby, the camera interface circuit 104 does not convert each image frame into a binary code, thereby improving the processing efficiency of the barcode scanner 100. In the preferred embodiment, odd-numbered image frames are provided to the preview module 112 , while even-numbered image frames are converted into binary codes and provided to the decoder 110 .
[0058] According to the present embodiment, the threshold value for performing binary conversion is adjustable. The calibration module 106 provides a dynamic threshold value for the camera interface circuit 104. The calibration module 106 receives the image signal from the camera 102 and performs statistical operations on the image signal to generate an adjusted threshold value, which is calculated based on the histogram of the grayscale values of the scanned image frame. The adjusted threshold value is provided to the camera interface circuit 104 for the binary conversion operation of one or more subsequent image frames. In the present preferred embodiment, the image signal of the odd-numbered frame is provided to the preview module 112 and is provided to be used for calculating the adjusted threshold value by the calibration module 106, so that the adjusted threshold value is used for the binary conversion of the subsequent even-numbered image frames. Since the continuous image frames usually have only very small differences, the calculated threshold value is accurate for the subsequent target image frame.
[0059] According to this embodiment, the binary conversion of the image frame is performed by the camera interface circuit 104 instead of a separate processor, so that very few processors or no processor is required. Therefore, both the size and cost of the barcode scanner 100 are saved. Further, excessive interaction with the memory is avoided, so that the image processing time is improved.
[0060] Reference now Figure 2, which shows an example block diagram of a camera interface circuit 200 according to an embodiment of the present invention. The camera interface circuit 200 includes a synchronization module 202, which receives an image signal from a camera and generates a synchronized image signal in response. The synchronization module 202 ensures that the image signal from the camera is synchronized with the operating frequency of the camera interface circuit 200. Since the camera and the interface circuit 200 have their own clocks, the signal from the camera may have different phases / frequencies, which need to be synchronized to ensure that it is suitable for processing by the camera interface circuit 200. The synchronization module 202 receives the clock signal of the camera interface circuit 200 and converts the image signal to the appropriate frequency / phase of the clock signal to become a synchronized image signal.
[0061] The camera interface circuit 200 further includes a first selection module 204, which receives the synchronized image signal from the synchronization module 202 at its first input terminal 204a and receives the packaged binary code generated based on the synchronized image signal at its second input terminal 204b. Based on the applied selection signal (SELECTION I), the first selection module 204 provides the synchronized image signal or the packaged binary code to a subsequent buffer 206. The buffer provides the synchronized image signal as an output signal of the camera interface circuit 200 to, for example, Figure 1 and providing the packaged binary code as an output signal of the camera interface circuit 200 to, for example, Figure 1 The decoder 110 is shown as a decoder.
[0062] like Figure 2 As shown in FIG. 1 , the selection module 204 can be implemented as a multiplexer (MUX). The first input terminal 204a and the second input terminal 204b are input lines of the MUX 204, and the selection signal (SELECTION I) is applied to the selection line of the MUX 204. As described above, the odd image frames are not converted into binary codes, and the odd image frames are provided as synchronized image signals to the control unit 100. Figure 1 On the other hand, the even image frames are converted into packed binary codes and provided to the display unit of the preview module 112 as shown in ( Figure 1 The selection signal can be generated in a variety of ways, such as from a controller or a register. Taking a register (not shown) as an example, the register can count the pixel data in the image frame transmitted to the selection module 204. When the count reaches a predetermined threshold indicating that all pixels in a frame have been transmitted, the register outputs a signal as a selection signal (SELECTIONI), which enables the selection module 204 to provide the synchronized image signal as an output.
[0063] The camera interface circuit 200 includes a binary converter 208, which receives a synchronized image signal from the synchronization module 202. As described above, the binary converter 208 extracts the grayscale component included in the image signal and compares the grayscale value of each pixel with a threshold value. Thereby, a binary code "0" or "1" is generated based on the comparison of the grayscale of the pixel being higher or lower than the threshold value. The optional second selection module 210 receives the binary code from the binary converter 208 at its first input terminal 210a, receives the synchronized image signal (unconverted data) at its other second input terminal 210b, and receives a selection signal (SELECTION II) at its selection terminal. When the barcode scanner is in standby mode, the selection signal (SELECTION II) causes the second selection module 210 to provide the unconverted image signal as an output, thereby bypassing the binary conversion and subsequent decoding. The unconverted image signal includes grayscale value data and is provided to the input terminal 210b and can be used for standby functions, such as verifying the binary conversion, etc. The camera interface circuit 200 includes a packaging module 212 to convert binary codes or unconverted grayscale data into a predetermined data format, such as 32 bits, 64 bits, or 128 bits per cycle. According to this embodiment, the exemplary 0.3M YUV422CMOS sensor camera providing a 600kB image will be converted into a 37.5kB binary code, which is only 1 / 16 of the original image data size, saving considerable memory space.
[0064] The camera interface circuit 200 also includes a calibration module 214, which receives a synchronized image signal from the synchronization module 202. The calibration module 214 extracts the grayscale of the pixels of each image frame, and the number of pixels having each corresponding grayscale value. In the present embodiment, the grayscale value is in the range of 0-255, and the calibration module 214 counts the number of pixels having each grayscale value. After the grayscale of all pixels is counted, a histogram is generated, which displays the grayscale distribution of the current image frame. The calibration module 214 receives the corridor diagram data and determines the threshold value therefrom. In an optional embodiment, the threshold value is determined using embedded software, which performs a specific algorithm on the histogram. During the vertical blank period between adjacent image frames, the threshold value is provided to the binary converter 208. The determined threshold value is provided to the binary converter 208 as the threshold value for the binary conversion of one or more subsequent image frames. Since consecutive image frames generally reflect similar grayscale distributions, the threshold value is dynamic and accurate. Figure 1 Similar to the calibration module 106, the calibration module 214 is also optional.
[0065] It has been described Figure 2The operation of the camera interface circuit 200 shown in the figure. The image signal from the camera is provided to the synchronization module 202, which generates a synchronized image signal. The first selection module 204 provides the image signal of the odd frame to the display for previewing the image. The calibration module 214 uses the grayscale histogram data of the pixels of the odd image frame to generate an adjusted threshold value during the vertical blank period between the odd frame and the subsequent even frame, and provides the adjusted threshold value to the binary converter 208. The subsequent even image frame is input to the binary converter 208 to extract the grayscale value and convert it into a binary code by comparing it with the adjusted threshold value. The second selection module 210 provides the generated binary code to the packaging module 212, which outputs the packaged binary code of the format described above as a response. The first selection module 204 provides the packaged binary code to the buffer 206, and then to the decoder. Optionally, the packaged grayscale value can be output for an alternative function.
[0066] The camera interface circuit 200 and the image signal processing method according to the embodiment described above provide consecutive image frames alternately to the preview module and the binary converter. Since consecutive image frames usually have only small differences, almost no distortion will occur in the preview or binary conversion. Furthermore, the camera interface circuit 200 requires very little memory and very little memory access, so that the camera interface circuit is compact in size and has a fast response.
[0067] Various exemplary embodiments are described herein with reference to specific illustrated examples. The illustrative examples are selected to assist those skilled in the art to form a clear understanding of and implement the various embodiments. However, the scope of systems, structures, and devices that can be constructed to include one or more embodiments, as well as the scope of methods implemented according to one or more embodiments, are not limited by the illustrative examples shown. On the contrary, those skilled in the art will understand based on this specification that many other configurations, structures, and methods can be implemented according to the various embodiments.
[0068] It should be understood that, with respect to the various positional indications used in the foregoing description of the present invention, such as top, bottom, upper, and lower, those indications are given only with reference to the corresponding drawings, and other positional relationships may be substituted when the orientation of the device changes during manufacture or operation. As mentioned above, those positional relationships are described only for the sake of clarity and are not limiting.
[0069] The foregoing description of this specification is with reference to specific embodiments and specific drawings, but the invention should not be limited thereto, but should be given by the claims. The various drawings described are exemplary and non-restrictive. In the drawings, the dimensions of the various elements may be exaggerated for illustrative purposes and may not be drawn to a specific scale. This description should also include discontinuous changes in tolerances and properties of various components and working methods. Various weakened implementations of the invention should also be included.
[0070] The word "comprising" as used in the present description and claims does not exclude other elements or steps. Unless otherwise specified, when the singular form such as "a", "an" is used to refer to a definite or indefinite element, the plural form of the element shall be included. Thus, the word "comprising" should not be understood as being limited to the items listed thereafter, nor should it be understood as excluding other elements or steps; the scope of the description "a device comprises items A and B" should not be limited to a device comprising only elements A and B. The description indicates that, for the purpose of this description, only elements A and B of the device are relevant.
[0071] It will be apparent to those skilled in the art that various detailed changes may be made without departing from the scope of the claims of the present invention.
Claims
1. A camera interface circuit for a barcode scanner, characterized in that: include: The binary conversion module is configured to receive an image signal of a second image frame from a camera, and convert the grayscale of each pixel in the second image frame into a binary code by: Extracting the grayscale of each pixel in the second image frame; Comparing the grayscale of each pixel with a threshold value; and Generate a binary code 1 or 0 based on the comparison of the gray level of each pixel being above or below a threshold, wherein the threshold is adjustable; A calibration module, which receives an image signal of a first image frame, generates an adjusted threshold value and provides the adjusted threshold value to a binary conversion module for comparison, wherein the adjusted threshold value is calculated using a histogram of pixel grayscale values of the first image frame; as well as The first selection module is connected to the binary conversion module and is configured to alternately provide the binary code of the second image frame and the image signal of the subsequent image frame to the output.
2. The circuit according to claim 1, characterized in that The first selection module is a multiplexer having a first input terminal for receiving a binary code and a second input terminal for receiving an image signal.
3. The circuit according to claim 1, characterized in that: The system further includes a synchronization module, which synchronizes the image signal from the camera and provides the synchronized image signal to the binary conversion module and the first selection module as the image signal.
4. The circuit according to claim 1, characterized in that: A buffer module is further included, coupled to the first selection module to buffer an output of the first selection module.
5. A method for interfacing image signals to a barcode scanner, characterized in that: include: receiving an image signal of a second image frame from a camera of the barcode scanner; Converting the image signal of the second image frame into binary by converting the grayscale of each pixel in the second image frame into a binary code; The conversion includes: Extract the grayscale of each pixel in the image frame; Comparing the grayscale of each pixel with a threshold value; and Generate a binary code 1 or 0 based on the comparison of the gray level of each pixel being higher or lower than a threshold, wherein the threshold is adjustable; The method further comprises: receiving an image signal of a first image frame from a camera; generating the threshold value for the comparison, wherein the threshold value is calculated using a histogram of pixel grayscale values of the first image frame; alternately providing the binary code of the second image frame and the image signal of the first image frame as a first output and a second output, The first output is provided to a display device to preview an image represented by the image signal, and the second output is provided to a decoder to decode a barcode represented by the image signal.
6. The method according to claim 5, characterized in that Receiving the image signals of the first image frame and the second image frame from the camera of the barcode receiver includes: The image signals of the first image frame and the second image frame are synchronized.
7. The method according to claim 6, characterized in that Further including: The binary code is packaged into a predetermined format.
8. A method for processing image signals for a barcode scanner, characterized in that: include: receiving a first image frame from a camera of a barcode scanner; providing the image signal of the first image frame as a first output to a display module to display a preview of the image signal; receiving a second image frame from the camera, the second image frame being continuous with the first image frame; Converting the grayscale of the pixel of the second image frame into a binary code comprises: Extracting the grayscale of each pixel of the second image frame; Comparing the grayscale of the extracted pixel with a threshold value; and Generate a binary code 1 or 0 based on a comparison of a grayscale of a pixel being above or below a threshold, wherein the threshold is adjustable; providing the binary code as a second output to a decoder; Wherein the method further comprises: Analyzing the first image frame to generate a histogram of pixel gray levels; calculating an adjusted threshold using the histogram; and An adjusted threshold was used for comparison.
9. The method according to claim 8, characterized in that Further including: The image signals of the first image frame and the second image frame are synchronized.
10. The method according to claim 9, characterized in that Further including: The binary code is packaged into a predetermined format.
