CN110765799A - Client code scanning identification method, device, equipment and storage medium - Google Patents

Client code scanning identification method, device, equipment and storage medium Download PDF

Info

Publication number
CN110765799A
CN110765799A CN201910998113.8A CN201910998113A CN110765799A CN 110765799 A CN110765799 A CN 110765799A CN 201910998113 A CN201910998113 A CN 201910998113A CN 110765799 A CN110765799 A CN 110765799A
Authority
CN
China
Prior art keywords
camera
resolution
screen
code scanning
client
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
CN201910998113.8A
Other languages
Chinese (zh)
Other versions
CN110765799B (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.)
Gosuncn Technology Group Co Ltd
Original Assignee
Gosuncn Technology Group 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 Gosuncn Technology Group Co Ltd filed Critical Gosuncn Technology Group Co Ltd
Priority to CN201910998113.8A priority Critical patent/CN110765799B/en
Publication of CN110765799A publication Critical patent/CN110765799A/en
Application granted granted Critical
Publication of CN110765799B publication Critical patent/CN110765799B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1095Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices the scanner comprising adaptations for scanning a record carrier that is displayed on a display-screen or the like
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • H04N23/635Region indicators; Field of view indicators

Abstract

The invention discloses a client code scanning identification method, which is used for acquiring the resolution of a camera and the resolution of a screen when responding to code scanning operation; calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions; acquiring the resolution of the camera in which the difference value between the picture ratio of the camera and the picture ratio of the screen is greater than the preset minimum resolution difference value as an initial resolution; calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen; acquiring an initial resolution as a target resolution, wherein the difference between the imaging size of the camera under the initial resolution and the size of the screen is smaller than a preset maximum resolution difference; and performing code scanning identification operation of the client at the target resolution. The invention also discloses a client code scanning identification device and equipment. By adopting the embodiment of the invention, the problems of low recognition efficiency, deformed pictures and the like in the existing code scanning recognition technology can be effectively solved, and the code scanning experience of a user is improved.

Description

Client code scanning identification method, device, equipment and storage medium
Technical Field
The invention relates to the field of mobile terminal equipment, in particular to a client code scanning identification method, device, equipment and storage medium.
Background
At present, a relatively mature open source tool library exists in a mobile terminal code scanning recognition technology, for example, zxing proposed by google official, zbar used in the industry for the first time, and the like can realize a code scanning recognition function based on a mobile terminal. Although widely used by many internet companies or software companies, it is undeniable that some problems and disadvantages still exist. zxing realizes a barcode graphic processing library with various formats, and can complete scanning and identification of barcodes or two-dimensional codes by packaging related functions of Camera and using a mobile phone Camera. zbar is also an open source tool library, is developed based on C language, and also realizes the function of scanning and reading bar codes and two-dimensional codes.
At present, although the functions of zxing and zbar of the existing code scanning identification scheme are complete, the code scanning details and the identification efficiency, including the adaptation of a plurality of machine types, are not complete enough, and still have some problems, which not only troubles the integration of most developers, but also brings the influence on experience and performance to the using customers. zxing generally has the problems of low code scanning recognition rate, inaccurate code scanning area, difficult regulation and control, deformation and stretching of preview pictures on certain machine types and the like. Since zbar is a C language development, decoding efficiency is higher than zxing, but there are still problems in machine type adaptation and code scanning region control.
Disclosure of Invention
The embodiment of the invention aims to provide a client code scanning identification method, a client code scanning identification device, client code scanning identification equipment and a storage medium, which can effectively solve the problems of low identification efficiency, image deformation and the like in the existing code scanning identification technology and improve the code scanning experience of a user.
In order to achieve the above object, an embodiment of the present invention provides a client code scanning identification method, including:
when responding to the code scanning operation, acquiring the resolution of a camera and the resolution of a screen;
calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions;
acquiring the resolution of the camera in which the difference value between the picture ratio of the camera and the picture ratio of the screen is greater than the preset minimum resolution difference value as an initial resolution;
calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen;
acquiring an initial resolution as a target resolution, wherein the difference between the imaging size of the camera under the initial resolution and the size of the screen is smaller than a preset maximum resolution difference;
and performing code scanning identification operation of the client at the target resolution.
Compared with the prior art, the client code scanning identification method disclosed by the embodiment of the invention comprises the steps of firstly, calculating the difference value between the picture ratio of each camera and the picture ratio of a screen, and obtaining the resolution of the camera, which is greater than the preset minimum resolution difference value, as the initial resolution, so as to obtain the resolution set of the camera with the uniform ratio between the picture of the camera and the picture of the screen; then, calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen, and acquiring the initial resolution as the target resolution in the case that the difference value between the imaging size of the camera under the initial resolution and the size of the screen is smaller than the preset maximum resolution difference value, so as to filter a set of camera resolutions with the camera size closest to the screen size from the result of the first step as the final filtered camera preview resolution; and finally, performing code scanning identification operation of the client at the target resolution. The client code scanning identification method disclosed by the embodiment of the invention not only solves the problem of preview stretching deformation during code scanning identification in the prior art, adapts to the resolutions of different machine types, can ensure the coordination of preview proportion under the resolutions of different machine types, has clear preview picture and improves the code scanning identification rate.
As an improvement of the above solution, when the client is in the portrait screen state, before performing the code scanning identification operation of the client at the target resolution, the method further includes:
and rotating the imaging interface of the camera until the imaging interface is positioned in the same direction with the screen.
As an improvement of the above scheme, the picture ratio is an aspect ratio or an aspect ratio; when the client is in a vertical screen state, the calculating a difference between the picture ratio of the camera and the picture ratio of the screen at different resolutions specifically includes:
when the camera is not rotated, calculating the difference between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions;
and when the camera is rotated to form vertical screen imaging, calculating the difference value between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions.
As an improvement of the above scheme, when the client is in a vertical screen state, the imaging size of the camera is the width value of the camera, and the size of the screen is the height value of the screen; then, the calculating a difference between the imaging size of the camera at the initial resolution and the size of the screen specifically includes:
and calculating the difference value between the width value of the camera at the initial resolution and the high value of the screen.
As an improvement of the above, the method further comprises:
when responding to the code scanning operation, determining the position information of the code scanning frame on the screen;
determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
and performing code scanning identification operation of the client according to the effective area.
As an improvement of the above scheme, the determining an effective area of the camera in the preview interface according to the position information of the code scanning frame specifically includes:
when the resolution of the camera is greater than that of the screen, carrying out reduction operation on the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
and when the resolution of the camera is smaller than that of the screen, carrying out amplification operation on the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame.
In order to achieve the above object, an embodiment of the present invention further provides a client code scanning identification apparatus, including:
the basic information acquisition unit is used for acquiring the resolution of the camera and the resolution of the screen when responding to the code scanning operation;
the first calculating unit is used for calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions;
an initial resolution obtaining unit, configured to obtain, as an initial resolution, a resolution of the camera in which a difference between a picture ratio of the camera and a picture ratio of the screen is greater than a preset minimum resolution difference;
the second calculating unit is used for calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen;
a target resolution obtaining unit, configured to obtain an initial resolution as a target resolution, where a difference between an imaging size of the camera at the initial resolution and a size of the screen is smaller than a preset maximum resolution difference;
and the code scanning identification unit is used for carrying out code scanning identification operation of the client side according to the target resolution.
As an improvement of the above scheme, the apparatus further includes a position information acquisition unit and an effective area acquisition unit; wherein the content of the first and second substances,
the position information acquisition unit is used for determining the position information of the code scanning frame on the screen when responding to the code scanning operation;
the effective area acquisition unit is used for determining the effective area of the camera in the preview interface according to the position information of the code scanning frame;
and the code scanning identification unit is also used for carrying out code scanning identification operation of the client according to the effective area.
In order to achieve the above object, an embodiment of the present invention further provides a client code scanning identification device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the client code scanning identification device implements the client code scanning identification method according to any of the above embodiments.
In order to achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the client code scanning identification method according to any of the above embodiments.
Drawings
FIG. 1 is a schematic diagram of the matching between different camera resolutions and screen resolutions;
FIG. 2 is a flowchart of a client code scanning identification method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for client code scanning identification according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of selecting an active area according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a client code-scanning recognition apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a client code scanning identification device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that most applications have a problem of stretching deformation during camera preview, including preview turning deformation on some special models, and the most suitable camera preview resolution is often not calculated. Most of mobile phone cameras in the current market have an automatic zooming function, which means that pictures with different resolutions can be shot. When the camera preview is turned on, the resolution of the mobile phone screen is fixed (currently, the mainstream is 720x1280,1080x1920, etc.), and then a set of appropriate camera resolution needs to be dynamically calculated to adapt to the screen resolution, so as to ensure that the picture cannot be stretched and deformed during the preview. Fig. 1 shows a schematic diagram of matching between different camera resolutions and screen resolutions. Therefore, when the ratio of the screen resolution to the camera resolution is not suitable, the preview interface is widened or lengthened; when the ratio of the screen resolution to the camera resolution is suitable, the preview interface displays normally and does not deform in a stretching manner.
Referring to fig. 2, fig. 2 is a flowchart of a client code scanning identification method according to an embodiment of the present invention; the client code scanning identification method comprises the following steps:
s11, when responding to the code scanning operation, acquiring the resolution of the camera and the resolution of the screen;
s12, calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions;
s13, acquiring the resolution of the camera in which the difference value between the picture ratio of the camera and the picture ratio of the screen is larger than the preset minimum resolution difference value as an initial resolution;
s14, calculating the difference between the imaging size of the camera under the initial resolution and the size of the screen;
s15, acquiring an initial resolution as a target resolution, wherein the difference between the imaging size of the camera under the initial resolution and the size of the screen is smaller than a preset maximum resolution difference;
and S16, performing code scanning identification operation of the client at the target resolution.
Specifically, in step S11, the screen resolution screen is first obtained, and since there are a plurality of resolutions supported by the cameras, all the camera resolutions cameras are traversed.
Specifically, in steps S12 to S13, the difference between the screen ratio of the camera and the screen at different resolutions is calculated, illustratively, the screen ratio is an aspect ratio or an aspect ratio. And acquiring the resolution of the camera in which the difference value between the picture ratio of the camera and the picture ratio of the screen is greater than the preset minimum resolution difference value as an initial resolution, so as to acquire a resolution set of the camera with a uniform ratio of the picture of the camera to the picture of the screen.
It should be noted that, because the default height of the vertical screen of the mobile phone is larger than the width of the screen, when the mobile phone is in the vertical screen state (the camera defaults to horizontal screen imaging), the difference between the aspect ratio of the camera and the aspect ratio of the screen is calculated, and if the camera is in the vertical screen state after being rotated, the difference between the aspect ratio of the camera and the aspect ratio of the screen is calculated. Namely, when the client is in a vertical screen state, the calculating the difference between the picture ratio of the camera and the picture ratio of the screen at different resolutions specifically includes:
s121, when the camera is not rotated, calculating the difference value between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions; the following formula is satisfied:
Math.abs(cameraSize.w/cameraSize.h–screenSize.h/screenSize.w)>minTolerance;
wherein, camera size.w represents the camera width, camera size.h represents the camera height, screen size.h represents the screen height, screen size.w represents the screen width, and minTolerance represents the minimum resolution difference;
s122, when the camera is rotated to form vertical screen imaging, calculating the difference value between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions; the following formula is satisfied:
Math.abs(cameraSize.w/cameraSize.h–screenSize.w/screenSize.h)>minTolerance。
specifically, in steps S14 to S15, the difference between the imaging size of the camera at the initial resolution and the size of the screen is calculated, and the initial resolution in which the difference between the imaging size of the camera at the initial resolution and the size of the screen is smaller than a preset maximum resolution difference is obtained is the target resolution. Illustratively, when the client is in a vertical screen state, the imaging size of the camera is the wide value of the camera, and the size of the screen is the high value of the screen; then, the calculating a difference between the imaging size of the camera at the initial resolution and the size of the screen specifically includes:
calculating the difference value between the width value of the camera at the initial resolution and the high value of the screen; the following formula is satisfied:
Math.abs(cameraSize.w–screenSize.h)<maxTolerance;
wherein maxTolerance represents the maximum resolution difference. The purpose is to re-filter out the set of camera resolutions whose camera width is closest to the screen height as the final filtered camera preview resolution previewSize in the result of step S13.
Specifically, in step S16, a code scanning recognition operation of the client is performed at the target resolution.
Taking the screen resolution as a reference, taking a preview resolution set with the aspect ratio of the camera and the aspect ratio of the screen smaller than a certain fixed value, and calculating a camera resolution set with a uniform ratio to the screen resolution; under the premise, the set of camera resolution closest to the screen resolution is taken out as the final preview resolution. The problem of preview stretching deformation is solved, different machine type resolutions are adapted, the preview proportion coordination can be ensured under different machine type resolutions, and the preview picture is clear.
Further, when the client is in a vertical screen state and the camera is in a horizontal screen imaging state, before performing the code scanning identification operation of the client at the target resolution, the method further includes: and rotating the imaging interface of the camera until the imaging interface is positioned in the same direction with the screen. If the mobile phone screen is displayed in a horizontal screen mode, the direction of the camera does not need to be rotated.
Illustratively, the codes of steps S11-S15 are expressed as follows:
screen size// screen resolution (unit: px)
Camera systems// camera supported resolution set
minTolerance// defining the ratio difference between the camera and the screen resolution
MaxTolerance// defines wide and high difference of camera and screen resolution
PreviewSize// Final filtered Camera Preview resolution
for(Size cameraSize:cameraSizes){
if(Math.abs(cameraSize.w/cameraSize.h–screenSize.h/screenSize.w)>minTolerance);
coutinue;
if(Math.abs(cameraSize.w–screenSize.h)<maxTolerance)
maxTolerance=Math.abs(cameraSize.w–screenSize.h);
previewSize=cameraSize;
}
return previewSize;
Furthermore, the prior art also has the problem of inaccurate code scanning area, which seriously affects the code scanning efficiency and brings illusion to users. This is also due to the fact that the width and height of the inner part of the screen frame do not correspond to the width and height of the imaging information of the camera. Because the resolution of the camera may not be consistent with the resolution of the screen, how to make the key imaging information and the drawing scanning frame completely coincide through precise scaling is an urgent problem to be solved.
Referring to fig. 3, fig. 3 is a flowchart of another client code scanning identification method according to an embodiment of the present invention; the client code scanning identification method comprises the following steps:
s21, when responding to the code scanning operation, determining the position information of the code scanning frame on the screen;
s22, determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
and S23, performing code scanning identification operation of the client according to the effective area.
Specifically, in step S21, position information of the scan frame on the screen is first determined, where the position information includes an origin coordinate and a width and a height of the scan frame, and the specific position coordinate of the scan frame can be obtained, for example, by the screen resolution. The middle of the screen is used as a code scanning frame in general.
Specifically, in step S22, referring to fig. 4, fig. 4 is a schematic diagram of selecting an effective area according to an embodiment of the present invention; wherein, the right one of the figure is the size of the scanning frame generated under the screen resolution; the second image on the right is an overlapped image of scanning frame areas under the resolution of the camera and the resolution of the screen, a small frame represents a scanning frame generated under the resolution of the camera, and a large frame represents the scanning frame generated under the resolution of the screen; after geometric magnification, the size of the scanning frame generated under the resolution of the camera is shown in the right three of the figure, and is consistent with the size of the scanning frame generated under the resolution of the screen.
And calculating the actual effective area of the camera in the preview according to the coordinate position of the code scanning frame in the screen (the size of the scanning frame in the right three of the figure is the effective area), and realizing the effective ratio of the resolution of the camera to the resolution of the screen. The specific implementation code is as follows:
cameraRect.left=rect.left*camera.y/screen.x;
cameraRect.right=rect.right*camera.y/screen.x;
cameraRect.top=rect.top*camera.x/screen.y;
cameraRect.bottom=rect.bottom*camera.x/screen.y;
the rect is a code scanning frame rectangle in the screen, the camera area is an effective area in the actual camera, the camera.x is the camera width, the camera.y is the camera height, the screen.x is the screen width, and the screen.y is the screen height.
Further, with the actual coordinates of the code scanning frame as a reference, determining the effective area of the camera in the preview interface according to the position information of the code scanning frame specifically includes:
s221, when the resolution of the camera is larger than that of the screen, reducing the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
s222, when the resolution of the camera is smaller than that of the screen, carrying out amplification operation on the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame.
Specifically, in step S23, a code scanning identification operation of the client is performed according to the effective area. And calculating the effective area previewed by the camera according to the corresponding aspect ratio of the camera and the screen. When the code is scanned, the code can be recognized only when the code completely enters the region, a user can accurately adapt to the target region of the preview picture by scanning the code frame to perceive the effective region, only the effective data is cut and compressed when the effective region is decoded, the data processing amount is reduced, and the recognition rate is improved.
The client code scanning identification method disclosed by the embodiment of the invention not only solves the problem of preview stretching deformation during code scanning identification in the prior art, adapts to the resolutions of different machine types, can ensure the coordination of preview proportion under the resolutions of different machine types, has clear preview picture and improves the code scanning identification rate.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a client code-scanning recognition apparatus 10 according to an embodiment of the present invention; the client code scanning recognition device 10 includes:
a basic information acquisition unit 11, configured to acquire a resolution of the camera and a resolution of the screen in response to the code scanning operation;
a first calculating unit 12, configured to calculate a difference between a picture ratio of the camera and a picture ratio of the screen at different resolutions;
an initial resolution obtaining unit 13, configured to obtain, as an initial resolution, a resolution of the camera in which a difference between a picture ratio of the camera and a picture ratio of the screen is greater than a preset minimum resolution difference;
a second calculation unit 14, configured to calculate a difference between an imaging size of the camera at the initial resolution and a size of the screen;
a target resolution obtaining unit 15, configured to obtain, as a target resolution, an initial resolution in a case where a difference between an imaging size of the camera at the initial resolution and a size of the screen is smaller than a preset maximum resolution difference;
and the code scanning identification unit 16 is used for carrying out code scanning identification operation of the client at the target resolution.
Preferably, the apparatus further includes a position information acquisition unit 17 and an effective area acquisition unit 18; wherein the content of the first and second substances,
the position information acquiring unit 17 is configured to determine position information of a code scanning frame on the screen when a code scanning operation is responded;
the effective area obtaining unit 18 is configured to determine an effective area of the camera in the preview interface according to the position information of the code scanning frame;
the code scanning identification unit 16 is further configured to perform a code scanning identification operation of the client according to the effective area.
For details, please refer to the working process of the code scanning identification method in the above embodiment for the working process of each unit in the code scanning identification device 10 of the client, which is not described herein again.
The client code scanning recognition device 10 disclosed by the embodiment of the invention not only solves the problem of preview stretching deformation during code scanning recognition in the prior art, adapts to the resolutions of different machine types, can ensure the coordination of preview proportion under the resolutions of different machine types, has clear preview pictures, and improves the code scanning recognition rate.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a client code scanning identification device 20 according to an embodiment of the present invention. The client code scanning identification device 20 of this embodiment includes: a processor 21, a memory 22 and a computer program stored in said memory 22 and executable on said processor 21. The processor 21, when executing the computer program, implements the steps in the above embodiments of the method for identifying a user-side scan code, such as steps S11 to S16 shown in fig. 2. Alternatively, the processor 21, when executing the computer program, implements the functions of the modules/units in the above-described device embodiments, such as the basic information acquiring unit 11.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in the memory 22 and executed by the processor 21 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the client code scanning and identifying device 20. For example, the computer program may be divided into a basic information obtaining unit 11, a first calculating unit 12, an initial resolution obtaining unit 13, a second calculating unit 14, a target resolution obtaining unit 15, a code scanning identification unit 16, a position information obtaining unit 17, and an effective area obtaining unit 18, and specific functions of each module refer to working processes of each unit in the client code scanning identification apparatus 10 in the foregoing embodiment, which are not described herein again.
The client code scanning identification device 20 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The client code scanning identification device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will appreciate that the diagram is merely an example of the client code scanning device 20 and does not constitute a limitation of the client code scanning device 20, and may include more or less components than those shown, or some components may be combined, or different components, for example, the client code scanning device 20 may further include an input/output device, a network access device, a bus, etc.
The Processor 21 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, and the processor 21 is a control center of the client code scanning identification device 20, and various interfaces and lines are used to connect various parts of the whole client code scanning identification device 20.
The memory 22 may be used to store the computer programs and/or modules, and the processor 21 may implement various functions of the client code scanning identification device 20 by running or executing the computer programs and/or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory 22 may include a high speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The modules/units integrated with the client code scanning identification device 20 may be stored in a computer readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by the processor 21 to implement the steps of the above embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A client code scanning identification method is characterized by comprising the following steps:
when responding to the code scanning operation, acquiring the resolution of a camera and the resolution of a screen;
calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions;
acquiring the resolution of the camera in which the difference value between the picture ratio of the camera and the picture ratio of the screen is greater than the preset minimum resolution difference value as an initial resolution;
calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen;
acquiring an initial resolution as a target resolution, wherein the difference between the imaging size of the camera under the initial resolution and the size of the screen is smaller than a preset maximum resolution difference;
and performing code scanning identification operation of the client at the target resolution.
2. The client code-scanning identification method of claim 1, wherein before the client code-scanning identification operation at the target resolution when the client is in a portrait screen state, the method further comprises:
and rotating the imaging interface of the camera until the imaging interface is positioned in the same direction with the screen.
3. The client-side code-scanning identification method of claim 1, wherein the picture ratio is an aspect ratio or an aspect ratio; when the client is in a vertical screen state, the calculating a difference between the picture ratio of the camera and the picture ratio of the screen at different resolutions specifically includes:
when the camera is not rotated, calculating the difference between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions;
and when the camera is rotated to form vertical screen imaging, calculating the difference value between the aspect ratio of the camera and the aspect ratio of the screen under different resolutions.
4. The client code-scanning identification method of claim 1, wherein when the client is in a vertical screen state, the imaging size of the camera is the wide value of the camera, and the size of the screen is the high value of the screen; then, the calculating a difference between the imaging size of the camera at the initial resolution and the size of the screen specifically includes:
and calculating the difference value between the width value of the camera at the initial resolution and the high value of the screen.
5. The client code-scanning identification method of claim 1, wherein the method further comprises:
when responding to the code scanning operation, determining the position information of the code scanning frame on the screen;
determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
and performing code scanning identification operation of the client according to the effective area.
6. The client code-scanning identification method of claim 5, wherein the determining the effective area of the camera in the preview interface according to the position information of the code-scanning frame specifically comprises:
when the resolution of the camera is greater than that of the screen, carrying out reduction operation on the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame;
and when the resolution of the camera is smaller than that of the screen, carrying out amplification operation on the code scanning frame, and determining an effective area of the camera in a preview interface according to the position information of the code scanning frame.
7. The utility model provides a sign indicating number recognition device is swept to client, its characterized in that includes:
the basic information acquisition unit is used for acquiring the resolution of the camera and the resolution of the screen when responding to the code scanning operation;
the first calculating unit is used for calculating the difference value between the picture ratio of the camera and the picture ratio of the screen under different resolutions;
an initial resolution obtaining unit, configured to obtain, as an initial resolution, a resolution of the camera in which a difference between a picture ratio of the camera and a picture ratio of the screen is greater than a preset minimum resolution difference;
the second calculating unit is used for calculating the difference value between the imaging size of the camera under the initial resolution and the size of the screen;
a target resolution obtaining unit, configured to obtain an initial resolution as a target resolution, where a difference between an imaging size of the camera at the initial resolution and a size of the screen is smaller than a preset maximum resolution difference;
and the code scanning identification unit is used for carrying out code scanning identification operation of the client side according to the target resolution.
8. The client code-scanning recognition device of claim 7, further comprising a location information acquisition unit and an effective area acquisition unit; wherein the content of the first and second substances,
the position information acquisition unit is used for determining the position information of the code scanning frame on the screen when responding to the code scanning operation;
the effective area acquisition unit is used for determining the effective area of the camera in the preview interface according to the position information of the code scanning frame;
and the code scanning identification unit is also used for carrying out code scanning identification operation of the client according to the effective area.
9. A client code scanning identification device, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the client code scanning identification method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls a device to execute the client code scanning identification method according to any one of claims 1 to 6.
CN201910998113.8A 2019-10-21 2019-10-21 Client code scanning identification method, device, equipment and storage medium Active CN110765799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910998113.8A CN110765799B (en) 2019-10-21 2019-10-21 Client code scanning identification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910998113.8A CN110765799B (en) 2019-10-21 2019-10-21 Client code scanning identification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110765799A true CN110765799A (en) 2020-02-07
CN110765799B CN110765799B (en) 2023-05-02

Family

ID=69331224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910998113.8A Active CN110765799B (en) 2019-10-21 2019-10-21 Client code scanning identification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110765799B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911152A (en) * 2021-01-29 2021-06-04 北京乐学帮网络技术有限公司 Preview image generation method, device, equipment and storage medium
CN113422906A (en) * 2021-06-22 2021-09-21 平安普惠企业管理有限公司 Method and device for setting resolution, computer equipment and storage medium
CN113505685A (en) * 2021-07-06 2021-10-15 浙江大华技术股份有限公司 Monitoring equipment installation positioning method and device, electronic equipment and storage medium
CN113919382A (en) * 2021-04-29 2022-01-11 荣耀终端有限公司 Code scanning method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104008361A (en) * 2014-06-16 2014-08-27 北京握奇智能科技有限公司 Two-dimensional code scanning, locating and prompting method and system
CN106293589A (en) * 2016-08-31 2017-01-04 宇龙计算机通信科技(深圳)有限公司 A kind of the method for preview resolution, device and terminal are set
CN106570437A (en) * 2016-10-19 2017-04-19 乐视控股(北京)有限公司 Two-dimensional code scanning processing method and mobile terminal thereof
CN107886020A (en) * 2017-10-17 2018-04-06 北京三快在线科技有限公司 A kind of method and apparatus of barcode scanning
CN110209266A (en) * 2019-04-23 2019-09-06 平安科技(深圳)有限公司 A kind of size fit method and device of image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104008361A (en) * 2014-06-16 2014-08-27 北京握奇智能科技有限公司 Two-dimensional code scanning, locating and prompting method and system
CN106293589A (en) * 2016-08-31 2017-01-04 宇龙计算机通信科技(深圳)有限公司 A kind of the method for preview resolution, device and terminal are set
CN106570437A (en) * 2016-10-19 2017-04-19 乐视控股(北京)有限公司 Two-dimensional code scanning processing method and mobile terminal thereof
CN107886020A (en) * 2017-10-17 2018-04-06 北京三快在线科技有限公司 A kind of method and apparatus of barcode scanning
CN110209266A (en) * 2019-04-23 2019-09-06 平安科技(深圳)有限公司 A kind of size fit method and device of image

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911152A (en) * 2021-01-29 2021-06-04 北京乐学帮网络技术有限公司 Preview image generation method, device, equipment and storage medium
CN113919382A (en) * 2021-04-29 2022-01-11 荣耀终端有限公司 Code scanning method and device
CN113919382B (en) * 2021-04-29 2023-04-28 荣耀终端有限公司 Code scanning method and device
CN113422906A (en) * 2021-06-22 2021-09-21 平安普惠企业管理有限公司 Method and device for setting resolution, computer equipment and storage medium
CN113505685A (en) * 2021-07-06 2021-10-15 浙江大华技术股份有限公司 Monitoring equipment installation positioning method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110765799B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN110765799A (en) Client code scanning identification method, device, equipment and storage medium
CN109543489B (en) Positioning method and device based on two-dimensional code and storage medium
US20180253852A1 (en) Method and device for locating image edge in natural background
CN111290684B (en) Image display method, image display device and terminal equipment
CN113126937B (en) Display terminal adjusting method and display terminal
CN106599758A (en) Image quality processing method and terminal
CN110781823B (en) Screen recording detection method and device, readable medium and electronic equipment
CN103702032A (en) Image processing method, device and terminal equipment
CN108805799B (en) Panoramic image synthesis apparatus, panoramic image synthesis method, and computer-readable storage medium
CN108322658B (en) Photographing method and device
CN112651953A (en) Image similarity calculation method and device, computer equipment and storage medium
CN110248165B (en) Label display method, device, equipment and storage medium
CN111464760A (en) Dynamic image generation method and device and terminal equipment
CN114359048A (en) Image data enhancement method and device, terminal equipment and storage medium
CN111797642B (en) Bar code identification method and terminal
CN114493988A (en) Image blurring method, image blurring device and terminal equipment
CN110610178A (en) Image recognition method, device, terminal and computer readable storage medium
CN109522532B (en) Method and device for calculating selection range of line drawing frame
CN113947529B (en) Image enhancement method, model training method, component identification method and related equipment
CN113379768A (en) Image processing method, image processing device, storage medium and computer equipment
CN113391779A (en) Parameter adjusting method, device and equipment for paper-like screen
CN109213515B (en) Multi-platform lower buried point normalization method and device and electronic equipment
CN112669351A (en) Rapid movement detection method and device
CN113362351A (en) Image processing method and device, electronic equipment and storage medium
CN109286798B (en) Frame position identification method and system of projection screen 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
GR01 Patent grant
GR01 Patent grant