CN110012235B - Imaging exposure control method and device, computer readable storage medium, system - Google Patents
Imaging exposure control method and device, computer readable storage medium, system Download PDFInfo
- Publication number
- CN110012235B CN110012235B CN201910438400.3A CN201910438400A CN110012235B CN 110012235 B CN110012235 B CN 110012235B CN 201910438400 A CN201910438400 A CN 201910438400A CN 110012235 B CN110012235 B CN 110012235B
- Authority
- CN
- China
- Prior art keywords
- image
- exposure
- cmos
- decoding
- control method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/73—Circuitry for compensating brightness variation in the scene by influencing the exposure time
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
Description
技术领域technical field
本发明涉及条码识读技术领域,特别涉及一种成像曝光控制方法及装置、计算机可读存储介质、系统。The present invention relates to the technical field of barcode reading, and in particular, to an imaging exposure control method and device, a computer-readable storage medium, and a system.
背景技术Background technique
现今,条码扫描器广泛应用于移动支付、快递仓储物流、图书服装医药等多个领域。在不同的使用场景下,由于条码显示介质的不同(主要是纸质条码和屏幕条码)、所处的光照环境不同、以及成像系统不同、被扫条码的运动状态不同等因素,为了得到高质量的成像效果,对条码扫描器的成像控制系统有很大的挑战。Today, barcode scanners are widely used in mobile payment, express warehousing and logistics, books, clothing, medicine and other fields. In different usage scenarios, due to different barcode display media (mainly paper barcodes and screen barcodes), different lighting environments, different imaging systems, and different movement states of scanned barcodes, in order to obtain high quality The imaging effect of the barcode scanner has a great challenge to the imaging control system of the barcode scanner.
目前大部分条码扫描器都是采用摄像头自带的自动曝光模式来采集图像,在这种模式下,当采集到的图像亮度过低时,摄像头会通过增加曝光时间或提高曝光增益等方式来提高采集图像的整体亮度,当采集到的图像亮度过高时,摄像头会通过减少曝光时间或降低曝光增益来降低采集图像的整体亮度,避免图像过度曝光。在实际应用中,当目标亮度设置较高时,虽然在扫描纸质条码时有较好的性能表现,但在扫描屏幕条码时,由于屏幕本身会发光,当屏幕条码稍微离摄像头远一点时,整个屏幕就会过度曝光,当屏幕条码从摄像头视角外快速进入视角内时也会出现过度曝光的情况,过了一段时间后采集的图像才会被调整至理想亮度。当目标亮度设置较低,在扫描屏幕条码时有更长的景深与更高的运动容差,纸质条码由于亮度太低而几乎完全不可识别。At present, most barcode scanners use the automatic exposure mode of the camera to capture images. In this mode, when the brightness of the captured image is too low, the camera will increase the exposure time or increase the exposure gain. The overall brightness of the captured image. When the brightness of the captured image is too high, the camera will reduce the overall brightness of the captured image by reducing the exposure time or reducing the exposure gain to avoid overexposure of the image. In practical applications, when the target brightness is set high, although it has better performance when scanning paper barcodes, when scanning barcodes on the screen, because the screen itself will emit light, when the barcodes on the screen are slightly farther away from the camera, The entire screen will be overexposed. When the barcode on the screen quickly enters the viewing angle from outside the camera's viewing angle, overexposure will also occur. After a period of time, the captured image will be adjusted to the ideal brightness. When the target brightness setting is low, there is a longer depth of field and higher motion tolerance when scanning barcodes on the screen, and paper barcodes are almost completely unrecognizable due to the low brightness.
中国发明专利申请CN106846670A公布了一种用于POS端的条码识读方法,该方法在条码识读的过程中设置在每间隔N帧的情况下,自动切换所述摄像头模组的参数。该摄像头模组的参数包括目标亮度与曝光值。在每次切换参数后,仍需要一段时间才能将图像亮度收敛至目标亮度。该方法在每隔N帧会切换摄像头模组的参数,当N取较大的值时,摄像头有足够的时间将图像亮度收敛至目标亮度,但如果当前是需要另一个目标亮度的场景时,就必须等到切换参数后再收敛至目标亮度时才能采集到理想图像,这样的方式效率较低,从触发到成功解码所花的时间太长,影响用户体验。当N取较小值时,摄像头没有足够的时间将图像亮度收敛至目标亮度就切换了参数,这使得条码扫描器只能在两个初始曝光值的适用范围内采集到可用的图像。Chinese invention patent application CN106846670A discloses a barcode reading method for the POS terminal, which automatically switches the parameters of the camera module at every N frame interval during the barcode reading process. The parameters of the camera module include target brightness and exposure value. After each parameter switching, it still takes some time for the image brightness to converge to the target brightness. This method switches the parameters of the camera module every N frames. When N takes a larger value, the camera has enough time to converge the image brightness to the target brightness, but if the current scene requires another target brightness, It is necessary to wait until the parameters are switched and then converge to the target brightness before the ideal image can be collected. This method is inefficient, and it takes too long from triggering to successful decoding, which affects the user experience. When N takes a small value, the camera does not have enough time to converge the image brightness to the target brightness and switches the parameters, which makes the barcode scanner only capture usable images within the applicable range of the two initial exposure values.
发明内容SUMMARY OF THE INVENTION
本发明要解决的技术问题是提供一种成像曝光控制方法及装置、计算机可读存储介质、系统,通过该成像曝光控制方法有助于在不同场景模式下采集有用图像,获取有效条码信息。The technical problem to be solved by the present invention is to provide an imaging exposure control method and device, a computer-readable storage medium, and a system, through which the imaging exposure control method helps to collect useful images and obtain valid barcode information in different scene modes.
为解决上述技术问题,本发明提供了一种成像曝光控制方法,适用于条码扫描器,包括:In order to solve the above technical problems, the present invention provides an imaging exposure control method, which is suitable for barcode scanners, including:
步骤S1,初始化CMOS;Step S1, initialize CMOS;
步骤S2,获取图像;Step S2, acquiring an image;
步骤S3,基于当前所获取的图像计算曝光参数a;Step S3, calculating the exposure parameter a based on the currently acquired image;
步骤S4,根据所述曝光参数a对所述CMOS进行配置,并获取图像;Step S4, configure the CMOS according to the exposure parameter a, and acquire an image;
步骤S5,对当前所获取的图像进行解码;Step S5, decoding the currently acquired image;
步骤S6,若解码成功则执行步骤S3;Step S6, if the decoding is successful, perform step S3;
步骤S7,判断是否超时,若未超时则执行步骤S3;Step S7, judging whether it has timed out, and if it has not timed out, go to step S3;
步骤S8,用一固定的曝光参数b对CMOS进行配置,并获取图像;Step S8, configure the CMOS with a fixed exposure parameter b, and acquire an image;
步骤S9,对当前所获取的图像进行解码;Step S9, decoding the currently acquired image;
步骤S10,若解码成功则执行步骤S8;Step S10, if the decoding is successful, perform step S8;
步骤S11,判断是否超时,若未超时则执行步骤S8,若超时,则返回步骤S3。In step S11 , it is judged whether it has timed out, and if it has not timed out, go to step S8 , and if it has timed out, go back to step S3 .
根据本发明的一个实施例,所述曝光参数a的计算方式如下:According to an embodiment of the present invention, the calculation method of the exposure parameter a is as follows:
其中,a’为曝光参数a上一次所设置的值,t为目标亮度,r为图像缩小尺度,i与j为横坐标和纵坐标,m与n为图像缩小后的宽和高。Among them, a' is the value set by the exposure parameter a last time, t is the target brightness, r is the image reduction scale, i and j are the abscissa and ordinate, and m and n are the width and height of the reduced image.
根据本发明的一个实施例,在步骤S7中,判断距离前次解码成功的时长是否超过N1秒,若未超过N1秒则执行步骤S3。According to an embodiment of the present invention, in step S7, it is determined whether the duration from the previous successful decoding exceeds N1 seconds, and if it does not exceed N1 seconds, step S3 is performed.
根据本发明的一个实施例,在步骤S11中,判断距离前次解码成功的时长是否超过N2秒,若未超过N2秒则执行步骤S8,若超过N2秒,则返回步骤S3。According to an embodiment of the present invention, in step S11, it is judged whether the duration from the previous successful decoding exceeds N2 seconds, if it does not exceed N2 seconds, execute step S8, if it exceeds N2 seconds, return to step S3.
根据本发明的一个实施例,N1=N2。According to an embodiment of the present invention, N1=N2.
根据本发明的一个实施例,根据所述CMOS的型号并结合屏幕条码在不同曝光参数下的表现来确定所述曝光参数b。According to an embodiment of the present invention, the exposure parameter b is determined according to the model of the CMOS and in combination with the performance of the screen barcode under different exposure parameters.
根据本发明的一个实施例,所述曝光参数b的数值小于所述曝光参数a的数值。According to an embodiment of the present invention, the value of the exposure parameter b is smaller than the value of the exposure parameter a.
根据本发明的一个实施例,在步骤S1中,根据所述CMOS的型号来初始化其相应的配置表,并关闭所述CMOS配置表中的自动曝光模式。According to an embodiment of the present invention, in step S1, the corresponding configuration table of the CMOS is initialized according to the model of the CMOS, and the automatic exposure mode in the CMOS configuration table is turned off.
本发明还提供了一种成像曝光控制装置,适用于前述成像曝光控制方法,包括,The present invention also provides an imaging exposure control device suitable for the aforementioned imaging exposure control method, comprising:
CMOS模块;CMOS module;
获取图像模块,适于获取图像;an image acquisition module, suitable for acquiring images;
曝光参数模块,适于获取曝光参数,以对所述CMOS模块进行配置;an exposure parameter module, adapted to obtain exposure parameters to configure the CMOS module;
图像解码模块,适于对当前所获取的图像进行解码;an image decoding module, adapted to decode the currently acquired image;
比较模块,适于判断解码是否成功;a comparison module, suitable for judging whether the decoding is successful;
超时模块,适于判断是否存在超时。The timeout module is suitable for judging whether there is a timeout.
本发明还提供了一种计算机可读存储介质,其上存储有计算机指令,所述计算机指令运行时执前述任一项所述成像曝光控制方法的步骤。The present invention also provides a computer-readable storage medium on which computer instructions are stored, and when the computer instructions are executed, the steps of any one of the imaging exposure control methods described above are executed.
本发明还提供了一种成像曝光控制系统,包括存储器和处理器,所述存储器上存储有能够在所述处理器上运行的计算机指令,其特征在于,所述处理器运行所述计算机指令时执行前述任一项所述成像曝光控制方法的步骤。The present invention also provides an imaging exposure control system, comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and is characterized in that when the processor runs the computer instructions The steps of any one of the imaging exposure control methods described above are performed.
本发明是通过控制CMOS的曝光在两种方式间不断切换来采集图像,一种方式是将图像亮度维持在一定程度的自动曝光,另一种方式是将曝光时间锁定在一个固定值,两种方式交叉进行,互不影响,从而获取有效条码信息。The invention collects images by controlling the exposure of CMOS to switch between two modes. One way is to maintain the image brightness at a certain level of automatic exposure, and the other way is to lock the exposure time at a fixed value. The methods are crossed and do not affect each other, so as to obtain valid barcode information.
附图说明Description of drawings
为让本发明的上述目的、特征和优点能更明显易懂,以下结合附图对本发明的具体实施方式作详细说明,其中:In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein:
图1是本发明一实施例的成像曝光控制方法的流程图;1 is a flowchart of an imaging exposure control method according to an embodiment of the present invention;
图2是本发明一实施例的成像曝光控制装置的结构示意图。FIG. 2 is a schematic structural diagram of an imaging exposure control device according to an embodiment of the present invention.
具体实施方式Detailed ways
为让本发明的上述目的、特征和优点能更明显易懂,以下结合附图对本发明的具体实施方式作详细说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是本发明还可以采用其它不同于在此描述的其它方式来实施,因此本发明不受下面公开的具体实施例的限制。Numerous specific details are set forth in the following description to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways than those described herein, and thus the present invention is not limited by the specific embodiments disclosed below.
如本申请和权利要求书中所示,除非上下文明确提示例外情形,“一”、“一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。一般说来,术语“包括”与“包含”仅提示包括已明确标识的步骤和元素,而这些步骤和元素不构成一个排它性的罗列,方法或者设备也可能包含其他的步骤或元素。As shown in this application and in the claims, unless the context clearly dictates otherwise, the words "a", "an", "an" and/or "the" are not intended to be specific in the singular and may include the plural. Generally speaking, the terms "comprising" and "comprising" only imply that the clearly identified steps and elements are included, and these steps and elements do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
在详述本申请实施例时,为便于说明,表示器件结构的剖面图会不依一般比例作局部放大,而且所述示意图只是示例,其在此不应限制本申请保护的范围。此外,在实际制作中应包含长度、宽度及深度的三维空间尺寸。When describing the embodiments of the present application in detail, for the convenience of explanation, the cross-sectional views showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of the protection of the present application. In addition, the three-dimensional spatial dimensions of length, width and depth should be included in the actual production.
为了方便描述,此处可能使用诸如“之下”、“下方”、“低于”、“下面”、“上方”、“上”等等的空间关系词语来描述附图中所示的一个元件或特征与其他元件或特征的关系。将理解到,这些空间关系词语意图包含使用中或操作中的器件的、除了附图中描绘的方向之外的其他方向。例如,如果翻转附图中的器件,则被描述为在其他元件或特征“下方”或“之下”或“下面”的元件的方向将改为在所述其他元件或特征的“上方”。因而,示例性的词语“下方”和“下面”能够包含上和下两个方向。器件也可能具有其他朝向(旋转90度或处于其他方向),因此应相应地解释此处使用的空间关系描述词。此外,还将理解,当一层被称为在两层“之间”时,它可以是所述两层之间仅有的层,或者也可以存在一个或多个介于其间的层。For convenience of description, spatially relative terms such as "below", "below", "below", "below", "above", "on", etc. may be used herein to describe an element shown in the figures or the relationship of a feature to other elements or features. It will be understood that these spatially relative terms are intended to encompass other directions of the device in use or operation than those depicted in the figures. For example, if the device in the figures is turned over, elements described as "below" or "beneath" or "beneath" other elements or features would then be oriented "above" the other elements or features. Thus, the exemplary words "below" and "below" can encompass both an orientation of above and below. Devices may also have other orientations (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein should be interpreted accordingly. In addition, it will also be understood that when a layer is referred to as being 'between' two layers, it can be the only layer between the two layers, or one or more intervening layers may also be present.
在本申请的上下文中,所描述的第一特征在第二特征之“上”的结构可以包括第一和第二特征形成为直接接触的实施例,也可以包括另外的特征形成在第一和第二特征之间的实施例,这样第一和第二特征可能不是直接接触。In the context of this application, descriptions of structures where a first feature is "on" a second feature can include embodiments in which the first and second features are formed in direct contact, as well as further features formed on the first and second features. Embodiments between the second features such that the first and second features may not be in direct contact.
图1是本发明一实施例的成像曝光控制方法的流程图。所谓曝光控制是指基于相机测光结果,通过光圈、快门和ISO等参数的合理配置,使目标画面准确曝光的过程。本发明提供的一种适用于条码扫描器的成像曝光控制方法,通过曝光参数对CMOS进行配置,从而控制CMOS的曝光强度并获取包含有清晰条码的目标图像,进而识读该条码。FIG. 1 is a flowchart of an imaging exposure control method according to an embodiment of the present invention. The so-called exposure control refers to the process of accurately exposing the target image through the reasonable configuration of parameters such as aperture, shutter and ISO based on the camera's metering results. The present invention provides an imaging exposure control method suitable for a barcode scanner. The CMOS is configured by exposure parameters, thereby controlling the exposure intensity of the CMOS and acquiring a target image containing a clear barcode, thereby recognizing the barcode.
本发明提供了一种成像曝光控制方法,包括:The present invention provides an imaging exposure control method, comprising:
步骤S1,初始化CMOS。CMOS(Complementary Metal-Oxide-Semiconductor),为互补金属氧化物半导体,主要是利用硅和锗这两种元素所做成的半导体,使其在CMOS上共存着带N(带-电)和P(带+电)级的半导体,保存了条码扫描器系统引导最基本的资料。Step S1, initialize the CMOS. CMOS (Complementary Metal-Oxide-Semiconductor), a complementary metal oxide semiconductor, is mainly a semiconductor made of silicon and germanium, which makes it coexist on CMOS with N (charged) and P ( The semiconductor with + electric) grade, saves the most basic information for the barcode scanner system to guide.
步骤S2,获取图像,通常所获取的图像中包含有条码。这里是CMOS初始化配置表生效后所采集到的第一帧图像。Step S2, acquiring an image, usually the acquired image contains a barcode. Here is the first frame of image collected after the CMOS initialization configuration table takes effect.
步骤S3,基于当前所获取的图像来计算曝光参数a。即可以根据当前所获取图像的亮度及大小尺寸来计算曝光参数a。Step S3, calculating the exposure parameter a based on the currently acquired image. That is, the exposure parameter a can be calculated according to the brightness and size of the currently acquired image.
步骤S4,根据曝光参数a对CMOS进行配置,从而控制CMOS的曝光强度并获取图像。Step S4, configure the CMOS according to the exposure parameter a, so as to control the exposure intensity of the CMOS and acquire an image.
步骤S5,对当前所获取的图像进行解码,以获取有用的条码信息,完成条码的识读。In step S5, the currently acquired image is decoded to obtain useful barcode information, and the barcode reading is completed.
步骤S6,若解码成功,能够获取有用的条码信息,则执行步骤S3。Step S6, if the decoding is successful and useful barcode information can be obtained, then step S3 is performed.
步骤S7,判断是否超时,若未超时则执行步骤S3。若解码失败且超时,则进入到下一步。In step S7, it is judged whether it has timed out, and if it has not timed out, step S3 is executed. If decoding fails and times out, go to the next step.
步骤S8,用一固定的曝光参数b对CMOS进行配置,控制CMOS的曝光强度,并获取图像。Step S8, configure the CMOS with a fixed exposure parameter b, control the exposure intensity of the CMOS, and acquire an image.
步骤S9,对当前所获取的图像进行解码,以获取有用的条码信息,完成条码的识读。In step S9, the currently acquired image is decoded to obtain useful barcode information, and the barcode reading is completed.
步骤S10,若解码成功,能够获取有用的条码信息,则执行步骤S8。In step S10, if the decoding is successful and useful barcode information can be obtained, step S8 is executed.
步骤S11,判断是否超时,若未超时则执行步骤S8。若解码失败且超时,则返回步骤S3,切换曝光参数。In step S11, it is judged whether it has timed out, and if it has not timed out, step S8 is executed. If the decoding fails and times out, return to step S3 to switch exposure parameters.
需要说明的是,条码扫描器扫描的场景通常包括纸质条码和屏幕条码。步骤S3至步骤S7可以理解为根据实时场景的亮度来控制CMOS的曝光强度,相对适用于扫描纸质条码的场景。通常将目标亮度调高一些可以使纸质条码的成像更清晰,亮度更高,通过当前所获取的图像来计算曝光参数a,使识别纸质条码时的曝光收敛速度更快,能更快速获取理想的纸质条码图像。在解码成功后由于短时间内场景不会有太大改变,于是保持解码成功时的曝光方法,进一步提升采集理想图像的效率。如果解码未成功且发生超时情况,可能进入屏幕条码场景,需要切换曝光方式。It should be noted that the scene scanned by the barcode scanner usually includes paper barcodes and screen barcodes. Steps S3 to S7 can be understood as controlling the exposure intensity of the CMOS according to the brightness of the real-time scene, which is relatively suitable for the scene of scanning paper barcodes. Usually, increasing the brightness of the target can make the image of the paper barcode clearer and brighter. The exposure parameter a is calculated by the currently acquired image, so that the exposure convergence speed when recognizing the paper barcode is faster and can be obtained more quickly. Ideal for paper barcode images. After the decoding is successful, the scene will not change much in a short period of time, so the exposure method when the decoding is successful is maintained to further improve the efficiency of collecting ideal images. If the decoding is unsuccessful and a timeout occurs, the screen barcode scene may be entered, and the exposure mode needs to be switched.
步骤S8至S11可以理解为适用于扫描屏幕条码的场景。扫描屏幕条码时,由于屏幕本身会发光,当屏幕条码稍微离摄像头远一点时,整个屏幕就会过度曝光,当屏幕条码从摄像头视角外快速进入视角内时也会出现过度曝光的情况,因此选用一个固定的曝光参数b,使识别屏幕条码时能快速获取理性的屏幕条码图像。在解码成功后由于短时间内场景不会有太大改变,于是保持解码成功时的曝光方法。如果解码未成功且发生超时情况,可能是进入了纸质条码场景,则需要切换曝光方式,返回步骤S3至步骤S7。Steps S8 to S11 can be understood as being applicable to the scenario of scanning barcodes on the screen. When scanning the barcode on the screen, since the screen itself will emit light, when the barcode on the screen is a little farther from the camera, the entire screen will be overexposed, and when the barcode on the screen quickly enters the viewing angle from outside the camera, overexposure will also occur. A fixed exposure parameter b makes it possible to quickly obtain rational screen barcode images when recognizing screen barcodes. After the decoding is successful, the scene will not change much in a short time, so the exposure method when the decoding is successful is maintained. If decoding is unsuccessful and a timeout occurs, it may be that a paper barcode scene has been entered, and the exposure mode needs to be switched, and the process returns to step S3 to step S7.
本发明提供的一种成像曝光控制方法主要是在纸质条码和屏幕条码的场景下来回切换,通过获取不断更新的曝光参数a及固定的曝光参数b以控制CMOS的曝光强度,从而获得更理想的可用条码图像,提升采集理想图像的效率。当遇到解码失败且超时的情况发生,则在两种场景下切换,使用该方法,不管是快速移动的手机屏幕条码还是亮度较暗的纸质条码,都可以通过场景快速切换来采集到理想的可用条码图像。The imaging exposure control method provided by the present invention mainly switches back and forth between the scene of paper barcode and screen barcode, and controls the exposure intensity of CMOS by acquiring continuously updated exposure parameters a and fixed exposure parameters b, so as to obtain a more ideal available barcode images, improving the efficiency of capturing ideal images. When the decoding fails and the timeout occurs, switch between two scenarios. Using this method, whether it is a fast-moving mobile phone screen barcode or a dimly lit paper barcode, you can quickly switch the scene to capture the ideal image. available barcode images.
较佳地,步骤S3中的曝光参数a的计算方式如下:Preferably, the calculation method of the exposure parameter a in step S3 is as follows:
计算曝光参数a时不需要对获取图像的所有像素点都进行计算,对图像缩小图进行计算即可。其中,a’为曝光参数a上一次所设置的值,t为目标亮度,r为图像缩小尺度,i与j为横坐标和纵坐标,m与n为图像缩小后的宽和高。其中函数f(x,y)表示图像中坐标为(x,y)的像素点,因为曝光参数a的值太大或太小就没有意义,通过上述计算方式能够把曝光参数a的值限定在合理的区间内。When calculating the exposure parameter a, it is not necessary to calculate all the pixels of the acquired image, but to calculate the reduced image. Among them, a' is the value set by the exposure parameter a last time, t is the target brightness, r is the image reduction scale, i and j are the abscissa and ordinate, and m and n are the width and height of the reduced image. The function f(x, y) represents the pixel point with the coordinates (x, y) in the image. Because the value of the exposure parameter a is too large or too small, it is meaningless. Through the above calculation method, the value of the exposure parameter a can be limited to within a reasonable range.
较佳地,在步骤S7中,判断距离前次解码成功的时长是否超过N1秒,若未超过N1秒则执行步骤S3。这里的N1秒可以理解为距离上次解码成功的时长。一旦超时,则进行曝光方法的切换,选用固定的曝光参数b对CMOS进行配置。使用该种方式,当亮度较暗的纸质条码转换为快速移动的手机屏幕条码,条码扫描器可以快速采集到理想的有用图像。Preferably, in step S7, it is judged whether the duration from the previous successful decoding exceeds N1 seconds, and if it does not exceed N1 seconds, step S3 is performed. The N1 seconds here can be understood as the time since the last successful decoding. Once it times out, the exposure method is switched, and a fixed exposure parameter b is selected to configure the CMOS. In this way, when the dimly lit paper barcode is converted into a fast-moving mobile phone screen barcode, the barcode scanner can quickly capture the ideal useful image.
较佳地,在步骤S11中,判断距离前次解码成功的时长是否超过N2秒,若未超过N2秒则执行步骤S8,继续以曝光参数b对CMOS进行配置。这里的N2秒可以理解为距离上次解码成功的时长。一旦超时,则进行曝光方法的切换,获取曝光参数a对CMOS进行配置。使用该种方式,当快速移动的手机屏幕条码转换为亮度较暗的纸质条码,条码扫描器可以快速采集到理想的有用图像。Preferably, in step S11, it is judged whether the time from the previous successful decoding exceeds N2 seconds, and if it does not exceed N2 seconds, step S8 is performed to continue to configure the CMOS with exposure parameter b. The N2 seconds here can be understood as the time since the last successful decoding. Once it times out, the exposure method is switched, and the exposure parameter a is obtained to configure the CMOS. In this way, when the fast-moving mobile phone screen barcode is converted into a paper barcode with dim brightness, the barcode scanner can quickly capture the ideal useful image.
作为举例而非限制,在步骤S7中时长N1秒和步骤S11中的时长N2秒可以根据实际需要选取具体数值。较佳地,N1=N2。当N1、N2取合理值时,采用本发明提供的成像曝光控制方法至多只需要等待1帧图像就可以切换曝光参数从而获取理想的有用条码图像。As an example and not a limitation, the duration of N1 seconds in step S7 and the duration of N2 seconds in step S11 may be selected according to actual needs. Preferably, N1=N2. When N1 and N2 take reasonable values, the imaging exposure control method provided by the present invention only needs to wait for at most one frame of image to switch exposure parameters to obtain an ideal useful barcode image.
由上,采用本发明的一种成像曝光控制方法,不管是快速移动的手机屏幕条码还是亮度较暗的纸质条码,都可以通过快速切换场景,选择不同的曝光参数来快速采集到理想的有用图像,提升条码识读效率。From the above, using an imaging exposure control method of the present invention, whether it is a fast-moving mobile phone screen barcode or a paper barcode with a dim brightness, it is possible to quickly switch scenes and select different exposure parameters to quickly collect ideal useful images. images to improve barcode reading efficiency.
较佳地,在步骤S8中,根据CMOS的型号并结合屏幕条码在不同曝光参数下的表现来确定曝光参数b。曝光参数b为一固定数值,确定后不再更改。更佳地,曝光参数b的数值小于曝光参数a的数值。易于理解,由于屏幕条码的亮度高,纸质条码的亮度低,两者对应的曝光参数b就小于曝光参数a。Preferably, in step S8, the exposure parameter b is determined according to the model of the CMOS and in combination with the performance of the screen barcode under different exposure parameters. Exposure parameter b is a fixed value and will not be changed after it is determined. More preferably, the value of the exposure parameter b is smaller than the value of the exposure parameter a. It is easy to understand that due to the high brightness of the screen barcode and the low brightness of the paper barcode, the exposure parameter b corresponding to the two is smaller than the exposure parameter a.
较佳地,在步骤S1中,根据CMOS的型号来初始化其相应的配置表,并关闭CMOS配置表中的自动曝光模式。在其后的步骤中,选用曝光参数a或曝光参数b。Preferably, in step S1, the corresponding configuration table of the CMOS is initialized according to the model of the CMOS, and the automatic exposure mode in the CMOS configuration table is turned off. In subsequent steps, exposure parameter a or exposure parameter b is selected.
需要说明的是,部分类型的CMOS在配置参数后不是立即生效,有可能是隔帧生效,即在拍摄下一帧图像后才启动新的曝光参数。如果忽略该下一帧图像,则对本方法不产生实质性影响。It should be noted that some types of CMOS do not take effect immediately after the parameters are configured, and may take effect every frame, that is, the new exposure parameters are started after the next frame of image is captured. If the next frame of image is ignored, this method has no substantial impact.
在上述实施例中的成像曝光方法是以获取曝光参数a为第一选择,然后在屏幕条码和纸质条码这两个场景之间切换,即在曝光参数b和曝光参数a之间切换。容易理解的,也可以先获取曝光参数b为第一选择,然后在纸质条码和屏幕条码这两个场景之间切换,两种方法的实质相同。具体的成像曝光方法如下:The imaging exposure method in the above embodiment is to obtain exposure parameter a as the first choice, and then switch between the two scenarios of screen barcode and paper barcode, that is, switch between exposure parameter b and exposure parameter a. It is easy to understand that it is also possible to obtain the exposure parameter b as the first choice, and then switch between the two scenarios of the paper barcode and the screen barcode. The essence of the two methods is the same. The specific imaging exposure method is as follows:
步骤V1,初始化CMOS;Step V1, initialize CMOS;
步骤V2,用一固定的曝光参数b对CMOS进行配置,并获取图像;Step V2, configure the CMOS with a fixed exposure parameter b, and acquire an image;
步骤V3,对当前所获取的图像进行解码;若解码成功则执行步骤V2;Step V3, decode the currently acquired image; if the decoding is successful, execute Step V2;
步骤V4,判断是否超时,若未超时则执行步骤V2;Step V4, judging whether it has timed out, and if it has not timed out, execute step V2;
步骤V5,基于当前所获取的图像计算曝光参数a;Step V5, calculating the exposure parameter a based on the currently acquired image;
步骤V6,根据所述曝光参数a对所述CMOS进行配置,并获取图像;Step V6, configure the CMOS according to the exposure parameter a, and acquire an image;
步骤V7,对当前所获取的图像进行解码,若解码成功则执行步骤V5;Step V7, decode the currently acquired image, and execute Step V5 if the decoding is successful;
步骤V8,判断是否超时,若未超时则执行步骤V5,若超时,则返回步骤V2。In step V8, it is judged whether it has timed out, and if it has not timed out, step V5 is executed, and if it has timed out, it returns to step V2.
图2是本发明一实施例的成像曝光控制装置的结构示意图。如图所示,一种成像曝光控制装置,适用于前述的成像曝光控制方法,包括,FIG. 2 is a schematic structural diagram of an imaging exposure control device according to an embodiment of the present invention. As shown in the figure, an imaging exposure control device, suitable for the aforementioned imaging exposure control method, includes:
CMOS模块210。
获取图像模块220,适于获取图像。用于执行步骤S2、S4和S8中的获取图像动作。An
曝光参数模块230,适于获取曝光参数a或曝光参数b,以对CMOS模块进行配置。The
图像解码模块240,适于对当前所获取的图像进行解码,以获取条码信息。The
比较模块250,适于判断解码是否成功。The
超时模块260,适于判断是否存在超时。The
本发明还提供了一种计算机可读存储介质,计算机可读存储介质为非易失性存储介质或非瞬态存储介质,其上存储有计算机指令,计算机指令运行时执行上述任一种成像曝光控制方法对应的步骤,此处不再赘述。The present invention also provides a computer-readable storage medium. The computer-readable storage medium is a non-volatile storage medium or a non-transitory storage medium, on which computer instructions are stored. When the computer instructions are run, any one of the above imaging exposures is performed. The steps corresponding to the control method are not repeated here.
本发明还提供了一种成像曝光控制系统,包括存储器和处理器,存储器上存储有能够在处理器上运行的计算机指令,处理器运行计算机指令时执行上述任一种成像曝光控制方法的步骤。The present invention also provides an imaging exposure control system, including a memory and a processor, the memory stores computer instructions that can run on the processor, and the processor executes the steps of any of the above imaging exposure control methods when running the computer instructions.
本申请使用了特定词语来描述本申请的实施例。如“一个实施例”、“一实施例”、和/或“一些实施例”意指与本申请至少一个实施例相关的某一特征、结构或特点。因此,应强调并注意的是,本说明书中在不同位置两次或多次提及的“一实施例”或“一个实施例”或“一替代性实施例”并不一定是指同一实施例。此外,本申请的一个或多个实施例中的某些特征、结构或特点可以进行适当的组合。This application uses specific terms to describe the embodiments of the application. Such as "one embodiment," "an embodiment," and/or "some embodiments" means a certain feature, structure, or characteristic associated with at least one embodiment of the present application. Therefore, it should be emphasized and noted that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in different places in this specification are not necessarily referring to the same embodiment . Furthermore, certain features, structures or characteristics of the one or more embodiments of the present application may be combined as appropriate.
本发明的成像曝光控制方法的一些方面可以完全由硬件执行、可以完全由软件(包括固件、常驻软件、微码等)执行、也可以由硬件和软件组合执行。以上硬件或软件均可被称为“数据块”、“模块”、“引擎”、“单元”、“组件”或“系统”。处理器可以是一个或多个专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理器件(DAPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器或者其组合。此外,本申请的各方面可能表现为位于一个或多个计算机可读介质中的计算机产品,该产品包括计算机可读程序编码。例如,计算机可读介质可包括,但不限于,磁性存储设备(例如,硬盘、软盘、磁带……)、光盘(例如,压缩盘CD、数字多功能盘DVD……)、智能卡以及闪存设备(例如,卡、棒、键驱动器……)。Some aspects of the imaging exposure control method of the present invention may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as a "data block", "module", "engine", "unit", "component" or "system". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors , controller, microcontroller, microprocessor, or a combination thereof. Furthermore, aspects of the present application may be embodied as a computer product comprising computer readable program code embodied in one or more computer readable media. For example, computer-readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, magnetic tapes, ...), optical disks (eg, compact discs, CDs, digital versatile disks, DVDs, ...), smart cards, and flash memory devices ( For example, cards, sticks, key drives...).
计算机可读介质可能包含一个内含有计算机程序编码的传播数据信号,例如在基带上或作为载波的一部分。该传播信号可能有多种表现形式,包括电磁形式、光形式等等、或合适的组合形式。计算机可读介质可以是除计算机可读存储介质之外的任何计算机可读介质,该介质可以通过连接至一个指令执行系统、装置或设备以实现通讯、传播或传输供使用的程序。位于计算机可读介质上的程序编码可以通过任何合适的介质进行传播,包括无线电、电缆、光纤电缆、射频信号、或类似介质、或任何上述介质的组合。A computer-readable medium may contain a propagated data signal with the computer program code embodied therein, for example, on baseband or as part of a carrier wave. The propagating signal may take a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium can be any computer-readable medium other than a computer-readable storage medium that can communicate, propagate, or transmit a program for use by being coupled to an instruction execution system, apparatus, or device. Program code on a computer readable medium may be propagated by any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or the like, or a combination of any of the foregoing.
此外,除非权利要求中明确说明,本申请所述处理元素和序列的顺序、数字字母的使用、或其他名称的使用,并非用于限定本申请流程和方法的顺序。尽管上述披露中通过各种示例讨论了一些目前认为有用的发明实施例,但应当理解的是,该类细节仅起到说明的目的,附加的权利要求并不仅限于披露的实施例,相反,权利要求旨在覆盖所有符合本申请实施例实质和范围的修正和等价组合。例如,虽然以上所描述的系统组件可以通过硬件设备实现,但是也可以只通过软件的解决方案得以实现,如在现有的服务器或移动设备上安装所描述的系统。Furthermore, unless explicitly stated in the claims, the order of processing elements and sequences described in the present application, the use of numbers and letters, or the use of other names are not intended to limit the order of the procedures and methods of the present application. While the foregoing disclosure discusses by way of various examples some embodiments of the invention that are presently believed to be useful, it is to be understood that such details are for purposes of illustration only and that the appended claims are not limited to the disclosed embodiments, but rather The requirements are intended to cover all modifications and equivalent combinations falling within the spirit and scope of the embodiments of the present application. For example, although the system components described above may be implemented by hardware devices, they may also be implemented by software-only solutions, such as installing the described systems on existing servers or mobile devices.
同理,应当注意的是,为了简化本申请披露的表述,从而帮助对一个或多个申请实施例的理解,前文对本申请实施例的描述中,有时会将多种特征归并至一个实施例、附图或对其的描述中。但是,这种披露方法并不意味着本申请对象所需要的特征比权利要求中提及的特征多。实际上,实施例的特征要少于上述披露的单个实施例的全部特征。Similarly, it should be noted that, in order to simplify the expressions disclosed in the present application and thus help the understanding of one or more embodiments of the present application, in the foregoing description of the embodiments of the present application, various features are sometimes combined into one embodiment, in the drawings or descriptions thereof. However, this method of disclosure does not imply that the subject matter of the application requires more features than those mentioned in the claims. Indeed, there are fewer features of an embodiment than all of the features of a single embodiment disclosed above.
一些实施例中使用了描述成分、属性数量的数字,应当理解的是,此类用于实施例描述的数字,在一些示例中使用了修饰词“大约”、“近似”或“大体上”来修饰。除非另外说明,“大约”、“近似”或“大体上”表明所述数字允许有±20%的变化。相应地,在一些实施例中,说明书和权利要求中使用的数值参数均为近似值,该近似值根据个别实施例所需特点可以发生改变。在一些实施例中,数值参数应考虑规定的有效数位并采用一般位数保留的方法。尽管本申请一些实施例中用于确认其范围广度的数值域和参数为近似值,在具体实施例中,此类数值的设定在可行范围内尽可能精确。Some examples use numbers to describe quantities of ingredients and attributes, it should be understood that such numbers used to describe the examples, in some examples, use the modifiers "about", "approximately" or "substantially" to retouch. Unless stated otherwise, "about", "approximately" or "substantially" means that a variation of ±20% is allowed for the stated number. Accordingly, in some embodiments, the numerical parameters set forth in the specification and claims are approximations that can vary depending upon the desired characteristics of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and use a general digit reservation method. Notwithstanding that the numerical fields and parameters used in some embodiments of the present application to confirm the breadth of their ranges are approximations, in particular embodiments such numerical values are set as precisely as practicable.
虽然本发明已参照当前的具体实施例来描述,但是本技术领域中的普通技术人员应当认识到,以上的实施例仅是用来说明本发明,在没有脱离本发明精神的情况下还可作出各种等效的变化或替换,因此,只要在本发明的实质精神范围内对上述实施例的变化、变型都将落在本申请的权利要求书的范围内。Although the present invention has been described with reference to the present specific embodiments, those of ordinary skill in the art will recognize that the above embodiments are only used to illustrate the present invention, and can be made without departing from the spirit of the present invention Various equivalent changes or substitutions, therefore, as long as the changes and modifications to the above-mentioned embodiments within the spirit and scope of the present invention will fall within the scope of the claims of the present application.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910438400.3A CN110012235B (en) | 2019-05-24 | 2019-05-24 | Imaging exposure control method and device, computer readable storage medium, system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910438400.3A CN110012235B (en) | 2019-05-24 | 2019-05-24 | Imaging exposure control method and device, computer readable storage medium, system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110012235A CN110012235A (en) | 2019-07-12 |
| CN110012235B true CN110012235B (en) | 2020-09-25 |
Family
ID=67177875
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910438400.3A Active CN110012235B (en) | 2019-05-24 | 2019-05-24 | Imaging exposure control method and device, computer readable storage medium, system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110012235B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111160056B (en) * | 2019-12-14 | 2023-10-03 | 无锡盈达聚力科技有限公司 | Data collection device and data collection method |
| CN113055596B (en) * | 2021-03-16 | 2023-01-17 | 上海商米科技集团股份有限公司 | Automatic night vision switching method for IPC |
| CN113630559B (en) * | 2021-08-06 | 2023-06-16 | 上海商米科技集团股份有限公司 | Exposure parameter adjustment method, system and computer readable medium for image sensor |
| CN120529206B (en) * | 2025-07-18 | 2025-10-24 | 深圳盈达信息科技有限公司 | Image exposure method based on CMOS built-in automatic exposure unit |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106846670A (en) * | 2016-12-27 | 2017-06-13 | 福建瑞之付微电子有限公司 | A kind of bar code reading method for being applied to POS terminal |
| CN106941579A (en) * | 2017-03-03 | 2017-07-11 | 东软集团股份有限公司 | The method and device of image scanning |
| CN106951813A (en) * | 2017-04-12 | 2017-07-14 | 上海汇尔通信息技术有限公司 | The coding/decoding method and system of a kind of bar code |
| CN107358135A (en) * | 2017-08-28 | 2017-11-17 | 北京奇艺世纪科技有限公司 | A kind of Quick Response Code barcode scanning method and device |
| CN109784113A (en) * | 2018-12-17 | 2019-05-21 | 深圳盈达信息科技有限公司 | Scanning means and its barcode scanning method |
| EP3629223A1 (en) * | 2015-04-21 | 2020-04-01 | Hand Held Products, Inc. | Capturing a graphic information presentation |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7475823B2 (en) * | 2006-05-26 | 2009-01-13 | Symbol Technologies, Inc. | Hand held bar code reader with improved image capture |
| US8083147B2 (en) * | 2008-12-17 | 2011-12-27 | Symbol Technologies, Inc. | Arrangement for and method of controlling image exposure in an imaging reader |
| US8646692B2 (en) * | 2011-09-30 | 2014-02-11 | Hand Held Products, Inc. | Devices and methods employing dual target auto exposure |
-
2019
- 2019-05-24 CN CN201910438400.3A patent/CN110012235B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP3629223A1 (en) * | 2015-04-21 | 2020-04-01 | Hand Held Products, Inc. | Capturing a graphic information presentation |
| CN106846670A (en) * | 2016-12-27 | 2017-06-13 | 福建瑞之付微电子有限公司 | A kind of bar code reading method for being applied to POS terminal |
| CN106941579A (en) * | 2017-03-03 | 2017-07-11 | 东软集团股份有限公司 | The method and device of image scanning |
| CN106951813A (en) * | 2017-04-12 | 2017-07-14 | 上海汇尔通信息技术有限公司 | The coding/decoding method and system of a kind of bar code |
| CN107358135A (en) * | 2017-08-28 | 2017-11-17 | 北京奇艺世纪科技有限公司 | A kind of Quick Response Code barcode scanning method and device |
| CN109784113A (en) * | 2018-12-17 | 2019-05-21 | 深圳盈达信息科技有限公司 | Scanning means and its barcode scanning method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110012235A (en) | 2019-07-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110012235B (en) | Imaging exposure control method and device, computer readable storage medium, system | |
| CN109167931B (en) | Image processing method, device, storage medium and mobile terminal | |
| KR102767735B1 (en) | Photographic methods, devices and electronic devices | |
| CN102088559B (en) | Digital photographing apparatus and method of controlling the same | |
| WO2019179283A1 (en) | Image recognition method and device | |
| WO2015081556A1 (en) | Photographing method for dual-camera device and dual-camera device | |
| WO2009082822A1 (en) | Method and apparatus with depth map generation | |
| CN105847674A (en) | Preview image processing method based on mobile terminal, and mobile terminal therein | |
| JP2011508268A5 (en) | ||
| CN108492266B (en) | Image processing method, device, storage medium and electronic device | |
| CN103703757B (en) | Method and device for taking pictures | |
| CN112822412B (en) | Exposure method, exposure device, electronic equipment and storage medium | |
| CN109729272B (en) | Shooting control method, terminal device and computer readable storage medium | |
| CN108513069B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
| CN107454322A (en) | Photographing method, device, computer storage medium and mobile terminal | |
| CN104754212A (en) | Electronic Apparatus And Method Of Capturing Moving Subject By Using The Same | |
| CN106210532A (en) | One is taken pictures processing method and terminal unit | |
| CN112422798A (en) | Photographing method and device, electronic equipment and storage medium | |
| CN113747067B (en) | Photography methods, devices, electronic equipment and storage media | |
| CN108495038B (en) | Image processing method, device, storage medium and electronic device | |
| CN113873160B (en) | Image processing method, device, electronic equipment and computer storage medium | |
| CN113873147B (en) | Video recording method, device and electronic equipment | |
| CN105872378A (en) | Control method, control device and electronic device | |
| CN113630559B (en) | Exposure parameter adjustment method, system and computer readable medium for image sensor | |
| CN113645409A (en) | Photographing processing method and device, photographing method, device and system and terminal equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Address after: 200433 Shanghai city Yangpu District Songhu Road No. 388 building 7, KIC 605 Applicant after: SHANGHAI SHANGMI SCIENCE AND TECHNOLOGY GROUP CO., LTD. Applicant after: Shenzhen Michelangelo Technology Co., Ltd. Address before: 200433 Shanghai city Yangpu District Songhu Road No. 388 building 7, KIC 605 Applicant before: Shanghai traders Technology Co., Ltd. Applicant before: Shenzhen Michelangelo Technology Co., Ltd. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |


