CN113542617A - Method and device for acquiring code scanning image, code scanning equipment and storage medium - Google Patents

Method and device for acquiring code scanning image, code scanning equipment and storage medium Download PDF

Info

Publication number
CN113542617A
CN113542617A CN202111071500.0A CN202111071500A CN113542617A CN 113542617 A CN113542617 A CN 113542617A CN 202111071500 A CN202111071500 A CN 202111071500A CN 113542617 A CN113542617 A CN 113542617A
Authority
CN
China
Prior art keywords
ratio coefficient
code scanning
image
preset
gain
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.)
Granted
Application number
CN202111071500.0A
Other languages
Chinese (zh)
Other versions
CN113542617B (en
Inventor
杨会峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Unigroup Tsingteng Microsystems Co Ltd
Original Assignee
Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Unigroup Tsingteng Microsystems Co Ltd filed Critical Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority to CN202111071500.0A priority Critical patent/CN113542617B/en
Publication of CN113542617A publication Critical patent/CN113542617A/en
Application granted granted Critical
Publication of CN113542617B publication Critical patent/CN113542617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1465Methods for optical code recognition the method including quality enhancement steps using several successive scans of the optical code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

The application relates to the technical field of image recognition, and discloses a method for acquiring a code scanning image, which comprises the following steps: acquiring a code image to be scanned through a camera; determining a first brightness value of an image to be coded; comparing the first brightness value with a preset second brightness value to obtain a comparison result; adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; and acquiring a code scanning image according to the adjusted code scanning parameters. Therefore, a comparison result is obtained by comparing the obtained first brightness value with the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the comparison result, so that the automation degree can be improved, a clear bar code image can be obtained, and the decoding success rate of the bar code image is improved. The application also discloses a device for acquiring the code scanning image, code scanning equipment and a storage medium.

Description

Method and device for acquiring code scanning image, code scanning equipment and storage medium
Technical Field
The present application relates to the field of image recognition technologies, and for example, to a method and an apparatus for acquiring a code scanning image, a code scanning device, and a storage medium.
Background
The bar code is a graphic symbol for representing various data information, and the code scanning device is a collecting and converting device for restoring the graphic symbol into the data information. Barcode identification technology has been developed for many years, and code scanning devices are rapidly becoming popular in many industries and applications.
In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
in the prior art, under the condition of poor illumination, the camera parameters of the code scanning device need to be manually adjusted to obtain clear bar code images, and the automation degree is poor.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method and a device for acquiring a code scanning image, code scanning equipment and a storage medium, so that the automation degree can be improved.
In some embodiments, the method for acquiring a code-scan image comprises: acquiring a code image to be scanned through a camera; determining a first brightness value of the image to be scanned; comparing the first brightness value with a preset second brightness value to obtain a comparison result; adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; and acquiring a code scanning image according to the adjusted code scanning parameters.
In some embodiments, the means for acquiring a code-scan image comprises: the first acquisition module is configured to acquire a code image to be scanned through a camera; a determining module configured to determine a first luminance value of the image to be scanned; the comparison module is configured to compare the first brightness value with a preset second brightness value to obtain a comparison result; the adjusting module is configured to adjust the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; a second obtaining module configured to obtain a code scanning image according to the adjusted code scanning parameter.
In some embodiments, the code scanning apparatus comprises: a processor and a memory storing program instructions, the processor being configured to, upon execution of the program instructions, perform the above-described method for acquiring a code-scan image.
In some embodiments, the storage medium stores program instructions that, when executed, perform the above-described method for acquiring a code-scan image.
The method and the device for acquiring the code scanning image, the code scanning device and the storage medium provided by the embodiment of the disclosure can realize the following technical effects: acquiring a code image to be scanned through a camera; determining a first brightness value of an image to be coded; comparing the first brightness value with a preset second brightness value to obtain a comparison result; adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; and acquiring a code scanning image according to the adjusted code scanning parameters. Therefore, a comparison result is obtained by comparing the obtained first brightness value with the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the comparison result, so that the automation degree can be improved, a clear bar code image can be obtained, and the decoding success rate of the bar code image is improved.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
FIG. 1 is a schematic diagram of a method for acquiring a code-scanning image according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of another method for acquiring a code-scanning image according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of another method for acquiring a code-scanning image according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a method for decoding provided by embodiments of the present disclosure;
FIG. 5 is a schematic diagram of an apparatus for acquiring a code-scanning image according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of another apparatus for acquiring a code-scanning image according to an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. For example, a and/or B, represents: a or B, or A and B.
The term "correspond" may refer to an association or binding relationship, and a corresponds to B refers to an association or binding relationship between a and B.
With reference to fig. 1, an embodiment of the present disclosure provides a method for acquiring a code-scanning image, including:
and S101, acquiring a code image to be scanned through a camera.
Step S102, determining a first brightness value of the image to be scanned.
Step S103, comparing the first brightness value with a preset second brightness value to obtain a comparison result.
Step S104, adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the scan parameters include gain and exposure values.
And step S105, acquiring a code scanning image according to the adjusted code scanning parameters.
By adopting the method for acquiring the code scanning image provided by the embodiment of the disclosure, the image to be code scanned is acquired through the camera; determining a first brightness value of an image to be coded; comparing the first brightness value with a preset second brightness value to obtain a comparison result; adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; and acquiring a code scanning image according to the adjusted code scanning parameters. Therefore, a comparison result is obtained by comparing the obtained first brightness value with the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the comparison result, so that the automation degree can be improved, a clear bar code image can be obtained, and the decoding success rate of the bar code image is improved.
Optionally, determining a first luminance value of the image to be scanned includes: and acquiring the average gray value of each pixel point in the image of the code to be scanned, and determining the average gray value as the first brightness value of the image of the code to be scanned.
Optionally, adjusting the code scanning parameter of the camera according to the comparison result includes: under the condition that the comparison result is that the first brightness value is larger than a preset second brightness value, acquiring a first ratio coefficient and a second ratio coefficient corresponding to the image of the code to be scanned; the first ratio coefficient is a ratio obtained by dividing a preset second brightness value by the first brightness value; the second ratio coefficient is the ratio obtained by dividing the preset minimum exposure value by the preset first exposure value; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the second ratio coefficient.
Optionally, the preset minimum exposure value is a minimum value of the preset exposure time range. Optionally, the preset exposure time ranges from 0 to 20 ms.
In some embodiments, the preset exposure time range is 0-20ms, and the preset minimum exposure value is 0ms and the preset maximum exposure value is 20 ms.
In some embodiments, the preset first exposure value is a default exposure value of the camera.
Optionally, with reference to fig. 2, an embodiment of the present disclosure provides a method for acquiring a code-scanning image, including:
step S201, acquiring an image to be scanned through a camera.
Step S202, determining a first brightness value of the image to be scanned.
Step S203, comparing the first brightness value with a preset second brightness value to obtain a comparison result.
Step S204, under the condition that the comparison result is that the first brightness value is larger than a preset second brightness value, acquiring a first ratio coefficient and a second ratio coefficient corresponding to the image of the code to be scanned; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the second ratio coefficient.
Step S205, acquiring a code scanning image according to the adjusted code scanning parameter.
By adopting the method for acquiring the code scanning image provided by the embodiment of the disclosure, the comparison result is obtained by comparing the acquired first brightness value with the preset second brightness value, the first ratio coefficient and the second ratio coefficient corresponding to the code scanning image are acquired under the condition that the first brightness value is greater than the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the first ratio coefficient and the second ratio coefficient, so that the brightness can be reduced by adjusting the code scanning parameter when the brightness value of the current image is too large, and a clearer bar code image can be acquired, the automatic degree is improved, and the code scanning parameter of the camera does not need to be manually adjusted by a user.
Optionally, the first ratio coefficient is a ratio obtained by dividing the preset second luminance value by the first luminance value.
Optionally, the second ratio coefficient is a ratio obtained by dividing the preset minimum exposure value by the preset first exposure value.
Optionally, the scan parameters include gain and exposure values.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting the code scanning parameter of the camera according to the first ratio coefficient and the second ratio coefficient includes: and determining the minimum exposure value as a second exposure value under the condition that the first ratio coefficient is less than or equal to the second ratio coefficient, and determining the second gain according to the preset first gain, the first ratio coefficient and the second ratio coefficient.
Optionally, determining the second gain according to a preset first gain, a preset first ratio coefficient, and a preset second ratio coefficient includes: and calculating by using a preset first gain, a preset first ratio coefficient and a preset second ratio coefficient according to a first preset algorithm to obtain a second gain.
Optionally, calculating by using a preset first gain, a preset first ratio coefficient, and a preset second ratio coefficient according to a preset algorithm to obtain a second gain, including: by calculation of
Figure 885262DEST_PATH_IMAGE001
Obtaining a second gain; wherein the content of the first and second substances,
Figure 842853DEST_PATH_IMAGE002
in order to achieve the second gain, the gain is,
Figure 907761DEST_PATH_IMAGE003
is a first ratio coefficient of the first ratio,
Figure 24622DEST_PATH_IMAGE004
is a coefficient of the second ratio,
Figure 923308DEST_PATH_IMAGE005
is a preset first gain.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting the code scanning parameter of the camera according to the first ratio coefficient and the second ratio coefficient includes: and determining a preset first gain as a second gain under the condition that the first ratio coefficient is larger than the second ratio coefficient, and determining a second exposure value according to the preset first exposure value and the first ratio coefficient.
Optionally, determining the second exposure value according to a preset first exposure value and a first ratio coefficient includes: and calculating by using a preset first exposure value and a first ratio coefficient according to a second preset algorithm to obtain a second exposure value.
Optionally, the calculating according to a second preset algorithm by using the preset first exposure value and the first ratio coefficient to obtain a second exposure value includes: by calculation of
Figure 492829DEST_PATH_IMAGE006
Obtaining a second exposure value; wherein the content of the first and second substances,
Figure 236794DEST_PATH_IMAGE007
is the value of the second exposure to the light,
Figure 966417DEST_PATH_IMAGE008
is a preset first exposure value and is a preset second exposure value,
Figure 629479DEST_PATH_IMAGE009
is a first scaling factor.
Optionally, adjusting the code scanning parameter of the camera according to the comparison result includes: under the condition that the comparison result is that the first brightness value is smaller than or equal to a preset second brightness value, acquiring a first ratio coefficient and a third ratio coefficient corresponding to the image of the code to be scanned; the first ratio coefficient is a ratio obtained by dividing a preset second brightness value by the first brightness value; the third ratio coefficient is a ratio obtained by dividing the preset maximum gain by the preset first gain; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the third ratio coefficient.
Optionally, the preset maximum gain is a maximum value of the preset gain range. Optionally, the preset gain range is 0-20.
In some embodiments, the predetermined gain range is 0-20, the predetermined maximum gain is 20, and the predetermined minimum gain is 0.
In some embodiments, the preset first gain is a default gain of the camera.
Optionally, with reference to fig. 3, an embodiment of the present disclosure provides a method for acquiring a code-scanning image, including:
and S301, acquiring a code image to be scanned through a camera.
Step S302, a first brightness value of the image to be scanned is determined.
Step S303, comparing the first brightness value with a preset second brightness value to obtain a comparison result.
Step S304, under the condition that the comparison result is that the first brightness value is smaller than or equal to a preset second brightness value, acquiring a first ratio coefficient and a third ratio coefficient corresponding to the image of the code to be scanned; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the third ratio coefficient.
Step S305, acquiring a code scanning image according to the adjusted code scanning parameters.
By adopting the method for acquiring the code scanning image provided by the embodiment of the disclosure, the comparison result is obtained by comparing the acquired first brightness value with the preset second brightness value, the first ratio coefficient and the third ratio coefficient corresponding to the code scanning image are acquired under the condition that the first brightness value is greater than the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the first ratio coefficient and the third ratio coefficient, so that the brightness can be increased by adjusting the code scanning parameter when the brightness value of the current image is too small, a clearer bar code image can be acquired, the automatic degree is improved, and the code scanning parameter of the camera does not need to be manually adjusted by a user.
Optionally, the first ratio coefficient is a ratio obtained by dividing the preset second luminance value by the first luminance value.
Optionally, the third ratio coefficient is a ratio obtained by dividing the preset maximum gain by the preset first gain.
Optionally, the scan parameters include gain and exposure values.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting the code scanning parameter of the camera according to the first ratio coefficient and the third ratio coefficient includes: and determining the maximum gain as a second gain when the first ratio coefficient is larger than or equal to a third ratio coefficient, and determining a second exposure value according to a preset first exposure value, the first ratio coefficient and the third ratio coefficient.
Optionally, determining the second gain according to a preset first gain, the first ratio coefficient and a third ratio coefficient includes: and calculating by using the preset first exposure value, the first ratio coefficient and the third ratio coefficient according to a third preset algorithm to obtain a second exposure value.
Optionally, the calculating according to a third preset algorithm by using the preset first exposure value, the first ratio coefficient and a third ratio coefficient to obtain a second exposure value includes: by calculation of
Figure 827242DEST_PATH_IMAGE010
Obtaining a second exposure value; wherein the content of the first and second substances,
Figure 499532DEST_PATH_IMAGE011
is the value of the second exposure to the light,
Figure 200772DEST_PATH_IMAGE012
is a preset first exposure value and is a preset second exposure value,
Figure 565894DEST_PATH_IMAGE013
is a first ratio coefficient of the first ratio,
Figure 985374DEST_PATH_IMAGE014
is the third coefficient of ratio.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting the code scanning parameter of the camera according to the first ratio coefficient and the third ratio coefficient includes: and under the condition that the first ratio coefficient is smaller than the third ratio coefficient, determining a preset first exposure value as a second exposure value, and determining a second gain according to a preset first gain and the first ratio coefficient.
Optionally, determining the second gain according to a preset first gain and a first ratio coefficient includes: and calculating by using the preset first gain and the first ratio coefficient according to a fourth preset algorithm to obtain a second gain.
Optionally, calculating according to a fourth preset algorithm by using a preset first gain and a first ratio coefficient, to obtain a second gain, including: by calculation of
Figure 697240DEST_PATH_IMAGE015
Obtaining a second gain; wherein the content of the first and second substances,
Figure 643200DEST_PATH_IMAGE016
in order to achieve the second gain, the gain is,
Figure 54589DEST_PATH_IMAGE017
the first gain is preset to a first value,
Figure 820420DEST_PATH_IMAGE018
is a first scaling factor.
Therefore, the comparison result is obtained by comparing the first brightness value with the preset second brightness value, the code scanning parameter of the camera is adjusted according to the comparison result, the image which accords with the code scanning brightness can be obtained under the condition that the code scanning parameter is adjusted once, the code scanning time is shortened, the automation degree is improved, the clear bar code image can be obtained, and the decoding success rate of the bar code image is improved.
Optionally, as shown in fig. 4, an embodiment of the present disclosure provides a method for decoding, including:
step S401, acquiring an image to be scanned through a camera.
Step S402, determining a first brightness value of the image to be scanned.
Step S403, comparing the first brightness value with a preset second brightness value to obtain a comparison result.
Step S404, adjusting the code scanning parameters of the camera according to the comparison result to obtain the adjusted code scanning parameters; the scan parameters include gain and exposure values.
Step S405, acquiring a code scanning image according to the adjusted code scanning parameters.
In step S406, a third luminance value of the code-scanned image is determined.
In step S407, the code-scanned image is decoded when the third luminance value is within the preset range.
By adopting the method for acquiring the code scanning image provided by the embodiment of the disclosure, the comparison result is obtained by comparing the acquired first brightness value with the preset second brightness value, the code scanning parameter of the camera is adjusted according to the comparison result, the code scanning image is acquired according to the adjusted code scanning parameter, and the code scanning image is decoded under the condition that the third brightness value of the code scanning image is within the preset range. Therefore, the scanning parameter of the camera can be adjusted when the illumination condition is poor, the bar code image with proper brightness can be obtained according to the adjusted scanning parameter, and the decoding success rate of the bar code image can be improved.
Optionally, the code scanning parameter is readjusted if the third luminance value is outside the preset range until the third luminance value of the code scanning image is within the preset range.
With reference to fig. 5, an apparatus for acquiring a code-scanning image according to an embodiment of the present disclosure includes: a first obtaining module 501, a determining module 502, a comparing module 503, an adjusting module 504 and a second obtaining module 505; the first obtaining module 501 is configured to obtain an image of a code to be scanned through a camera, and send the image of the code to be scanned to the determining module; the determining module 502 is configured to receive the image to be code-scanned sent by the first obtaining module, determine a first brightness value of the image to be code-scanned, and send the first brightness value to the comparing module; the comparison module 503 is configured to receive the first brightness value sent by the determination module, compare the first brightness value with a preset second brightness value to obtain a comparison result, and send the comparison result to the adjustment module; the adjusting module 504 is configured to receive the comparison result sent by the comparison module, adjust the code scanning parameter of the camera according to the comparison result, obtain an adjusted code scanning parameter, and send the adjusted code scanning parameter to the second obtaining module; the code scanning parameters comprise gain and exposure values; the second obtaining module 505 is configured to receive the adjusted code scanning parameters sent by the adjusting module, and obtain a code scanning image according to the adjusted code scanning parameters.
By adopting the device for acquiring the code scanning image, which is provided by the embodiment of the disclosure, the first acquisition module acquires the image to be code scanned through the camera; the determining module determines a first brightness value of an image to be scanned; the comparison module compares the first brightness value with a preset second brightness value to obtain a comparison result; the adjusting module adjusts the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; and the second acquisition module acquires a code scanning image according to the adjusted code scanning parameters. Therefore, a comparison result is obtained by comparing the obtained first brightness value with the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the comparison result, so that the automation degree can be improved, a clear bar code image can be obtained, and the decoding success rate of the bar code image is improved.
Optionally, the adjusting module is configured to adjust the code scanning parameter of the camera according to the comparison result by: under the condition that the comparison result is that the first brightness value is larger than the second brightness value, acquiring a first ratio coefficient and a second ratio coefficient corresponding to the image of the code to be scanned; the first ratio coefficient is a ratio obtained by dividing the second brightness value by the first brightness value; the second ratio coefficient is the ratio obtained by dividing the preset minimum exposure value by the preset first exposure value; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the second ratio coefficient.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting module is configured to adjust the code scanning parameter of the camera according to the first ratio coefficient and the second ratio coefficient by: and determining the minimum exposure value as a second exposure value under the condition that the first ratio coefficient is less than or equal to the second ratio coefficient, and determining the second gain according to the preset first gain, the first ratio coefficient and the second ratio coefficient.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting module is configured to adjust the code scanning parameter of the camera according to the first ratio coefficient and the second ratio coefficient by: and determining a preset first gain as a second gain under the condition that the first ratio coefficient is larger than the second ratio coefficient, and determining a second exposure value according to the preset first exposure value and the first ratio coefficient.
Optionally, the adjusting module is configured to adjust the code scanning parameter of the camera according to the comparison result by: under the condition that the comparison result is that the first brightness value is smaller than or equal to the second brightness value, acquiring a first ratio coefficient and a third ratio coefficient corresponding to the image of the code to be scanned; the first ratio coefficient is a ratio obtained by dividing the second brightness value by the first brightness value; the third ratio coefficient is a ratio obtained by dividing the preset maximum gain by the preset first gain; and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the third ratio coefficient.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting module is configured to adjust the code scanning parameter of the camera according to the first ratio coefficient and the third ratio coefficient by: and determining the maximum gain as a second gain when the first ratio coefficient is larger than or equal to a third ratio coefficient, and determining a second exposure value according to a preset first exposure value, the first ratio coefficient and the third ratio coefficient.
Optionally, the adjusted code scanning parameter includes a second gain and a second exposure value, and the adjusting module is configured to adjust the code scanning parameter of the camera according to the first ratio coefficient and the third ratio coefficient by: and under the condition that the first ratio coefficient is smaller than the third ratio coefficient, determining a preset first exposure value as a second exposure value, and determining a second gain according to a preset first gain and the first ratio coefficient.
As shown in fig. 6, an embodiment of the present disclosure provides a code scanning device, which includes a processor (processor) 600 and a memory (memory) 601. Optionally, the code scanning device may further include a Communication Interface 602 and a bus 603. The processor 600, the communication interface 602, and the memory 601 may communicate with each other via a bus 603. The communication interface 602 may be used for information transfer. The processor 600 may call logic instructions in the memory 601 to perform the method for acquiring a code-swept image of the above-described embodiments.
By adopting the code scanning equipment provided by the embodiment of the disclosure, a code image to be scanned is acquired through the camera; determining a first brightness value of an image to be coded; comparing the first brightness value with a preset second brightness value to obtain a comparison result; adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values; and acquiring a code scanning image according to the adjusted code scanning parameters. Therefore, a comparison result is obtained by comparing the obtained first brightness value with the preset second brightness value, and the code scanning parameter of the camera is adjusted according to the comparison result, so that the automation degree can be improved, a clear bar code image can be obtained, and the decoding success rate of the bar code image is improved.
Optionally, the yard scanning device comprises a hand-held yard scanning gun.
In addition, the logic instructions in the memory 601 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products.
The memory 601 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 600 executes functional applications and data processing by executing program instructions/modules stored in the memory 601, namely, implements the method for acquiring a code-scanning image in the above-described embodiment.
The memory 601 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. In addition, the memory 601 may include a high speed random access memory, and may also include a non-volatile memory.
The embodiment of the disclosure provides a storage medium, which stores program instructions, and when the program instructions are executed, the method for acquiring a code scanning image is executed.
The disclosed embodiments provide a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the above-described method for acquiring a code-scan image.
The computer-readable storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, where the computer software product is stored in a storage medium and includes one or more instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other like elements in a process, method or apparatus that comprises the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be merely a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for acquiring a code-swept image, comprising:
acquiring a code image to be scanned through a camera;
determining a first brightness value of the image to be scanned;
comparing the first brightness value with a preset second brightness value to obtain a comparison result;
adjusting the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values;
and acquiring a code scanning image according to the adjusted code scanning parameters.
2. The method of claim 1, wherein adjusting the scan parameter of the camera according to the comparison result comprises:
under the condition that the comparison result is that the first brightness value is larger than the second brightness value, acquiring a first ratio coefficient and a second ratio coefficient corresponding to the code image to be scanned; the first ratio coefficient is a ratio obtained by dividing the second luminance value by the first luminance value; the second ratio coefficient is a ratio obtained by dividing a preset minimum exposure value by a preset first exposure value;
and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the second ratio coefficient.
3. The method of claim 2, wherein the adjusted scan parameter comprises a second gain and a second exposure value, and wherein adjusting the scan parameter of the camera according to the first ratio coefficient and the second ratio coefficient comprises:
and determining the minimum exposure value as a second exposure value under the condition that the first ratio coefficient is less than or equal to the second ratio coefficient, and determining the second gain according to a preset first gain, the first ratio coefficient and the second ratio coefficient.
4. The method of claim 2, wherein the adjusted scan parameter comprises a second gain and a second exposure value, and wherein adjusting the scan parameter of the camera according to the first ratio coefficient and the second ratio coefficient comprises:
and determining a preset first gain as the second gain under the condition that the first ratio coefficient is larger than the second ratio coefficient, and determining the second exposure value according to the preset first exposure value and the first ratio coefficient.
5. The method of claim 1, wherein adjusting the scan parameter of the camera according to the comparison result comprises:
under the condition that the comparison result is that the first brightness value is smaller than or equal to the second brightness value, acquiring a first ratio coefficient and a third ratio coefficient corresponding to the code image to be scanned; the first ratio coefficient is a ratio obtained by dividing the second luminance value by the first luminance value; the third ratio coefficient is a ratio obtained by dividing a preset maximum gain by a preset first gain;
and adjusting the code scanning parameters of the camera according to the first ratio coefficient and the third ratio coefficient.
6. The method of claim 5, wherein the adjusted scan parameter comprises a second gain and a second exposure value, and wherein adjusting the scan parameter of the camera according to the first ratio coefficient and the third ratio coefficient comprises:
and determining the maximum gain as the second gain when the first ratio coefficient is greater than or equal to the third ratio coefficient, and determining the second exposure value according to a preset first exposure value, the first ratio coefficient and the third ratio coefficient.
7. The method of claim 5, wherein the adjusted scan parameter comprises a second gain and a second exposure value, and wherein adjusting the scan parameter of the camera according to the first ratio coefficient and the third ratio coefficient comprises:
and under the condition that the first ratio coefficient is smaller than the third ratio coefficient, determining a preset first exposure value as the second exposure value, and determining the second gain according to a preset first gain and the first ratio coefficient.
8. An apparatus for acquiring a code-swept image, comprising:
the first acquisition module is configured to acquire a code image to be scanned through a camera;
a determining module configured to determine a first luminance value of the image to be scanned;
the comparison module is configured to compare the first brightness value with a preset second brightness value to obtain a comparison result;
the adjusting module is configured to adjust the code scanning parameters of the camera according to the comparison result to obtain adjusted code scanning parameters; the code scanning parameters comprise gain and exposure values;
a second obtaining module configured to obtain a code scanning image according to the adjusted code scanning parameter.
9. A code scanning device comprising a processor and a memory storing program instructions, wherein the processor is configured to execute the method for acquiring a code scanning image according to any one of claims 1 to 7 when executing the program instructions.
10. A storage medium storing program instructions which, when executed, perform the method for acquiring a code-scan image according to any one of claims 1 to 7.
CN202111071500.0A 2021-09-14 2021-09-14 Method and device for acquiring code scanning image, code scanning equipment and storage medium Active CN113542617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111071500.0A CN113542617B (en) 2021-09-14 2021-09-14 Method and device for acquiring code scanning image, code scanning equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111071500.0A CN113542617B (en) 2021-09-14 2021-09-14 Method and device for acquiring code scanning image, code scanning equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113542617A true CN113542617A (en) 2021-10-22
CN113542617B CN113542617B (en) 2021-12-28

Family

ID=78092472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111071500.0A Active CN113542617B (en) 2021-09-14 2021-09-14 Method and device for acquiring code scanning image, code scanning equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113542617B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548135A (en) * 2022-04-28 2022-05-27 北京金朗维科技有限公司 Method and device for acquiring code scanning image and code scanning equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173347A1 (en) * 2010-12-30 2012-07-05 De Almeida Neves Gustavo Automatic System and Method for Tracking and Decoding Barcode by Means of Portable Devices having Digital Cameras
CN103888681A (en) * 2014-04-18 2014-06-25 四川华雁信息产业股份有限公司 Automatic exposure method and device
CN104202535A (en) * 2014-06-30 2014-12-10 杭州光典医疗器械有限公司 Automatic exposure method and device
CN107124561A (en) * 2016-12-27 2017-09-01 福建新大陆自动识别技术有限公司 A kind of bar code image exposure adjustment system and method based on CMOS
CN109033911A (en) * 2018-07-04 2018-12-18 青岛海信移动通信技术股份有限公司 A kind of scan method, device, mobile terminal and the storage medium of figure bar code
CN111881698A (en) * 2020-06-11 2020-11-03 上海祥承通讯技术有限公司 Wharf scanning module multithreading code scanning processing method based on android system
CN112489322A (en) * 2020-11-18 2021-03-12 上海商米科技集团股份有限公司 Quick code scanning method for POS machine product

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120173347A1 (en) * 2010-12-30 2012-07-05 De Almeida Neves Gustavo Automatic System and Method for Tracking and Decoding Barcode by Means of Portable Devices having Digital Cameras
CN103888681A (en) * 2014-04-18 2014-06-25 四川华雁信息产业股份有限公司 Automatic exposure method and device
CN104202535A (en) * 2014-06-30 2014-12-10 杭州光典医疗器械有限公司 Automatic exposure method and device
CN107124561A (en) * 2016-12-27 2017-09-01 福建新大陆自动识别技术有限公司 A kind of bar code image exposure adjustment system and method based on CMOS
CN109033911A (en) * 2018-07-04 2018-12-18 青岛海信移动通信技术股份有限公司 A kind of scan method, device, mobile terminal and the storage medium of figure bar code
CN111881698A (en) * 2020-06-11 2020-11-03 上海祥承通讯技术有限公司 Wharf scanning module multithreading code scanning processing method based on android system
CN112489322A (en) * 2020-11-18 2021-03-12 上海商米科技集团股份有限公司 Quick code scanning method for POS machine product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548135A (en) * 2022-04-28 2022-05-27 北京金朗维科技有限公司 Method and device for acquiring code scanning image and code scanning equipment
CN114548135B (en) * 2022-04-28 2022-07-08 北京金朗维科技有限公司 Method and device for acquiring code scanning image and code scanning equipment

Also Published As

Publication number Publication date
CN113542617B (en) 2021-12-28

Similar Documents

Publication Publication Date Title
CN109325491B (en) Identification code identification method and device, computer equipment and storage medium
EP3499410A1 (en) Image processing method and apparatus, and electronic device
CN105701834B (en) Automatic picture backup device and method
CN113673655B (en) Method and device for determining decoding direction of two-dimensional code, electronic equipment and medium
CN112651256A (en) Two-dimensional code identification method and device, computer equipment and storage medium
CN113542617B (en) Method and device for acquiring code scanning image, code scanning equipment and storage medium
CN109361927B (en) Image processing method and device
GB2517674A (en) Image capture using client device
CN111107361A (en) Video processing apparatus and method for determining motion metadata of encoded video
CN115511031A (en) Capacity-expansion two-dimensional code and three-dimensional code decoding method, system, equipment and medium
WO2007014014A2 (en) Adaptive contrast control systems and methods
US8705134B2 (en) Method of processing an image to clarify text in the image
CN111428732B (en) YUV image recognition method, system and computer equipment
US20180210691A1 (en) Image forming apparatus
CN111950562A (en) Picture processing method and device, terminal equipment and storage medium
JP2016012767A (en) Image processing system
EP0434005A1 (en) Image data compression method using a run prediction technique
JP4329429B2 (en) Image transfer apparatus, image transfer method, and image transfer program
KR20120035360A (en) Apparatus for recognizing character and method thereof
CN114627464A (en) Text recognition method and device, electronic equipment and storage medium
CN113760429A (en) Control method and control device
CN116432676B (en) Method and device for decoding bar code and electronic equipment
CN114205659A (en) Method, device and equipment for adjusting video picture
CN111447444A (en) Image processing method and device
CN111241365A (en) Table picture analysis method and system

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
GR01 Patent grant
GR01 Patent grant