CN109858303B - Scanning method and terminal equipment - Google Patents

Scanning method and terminal equipment Download PDF

Info

Publication number
CN109858303B
CN109858303B CN201811557207.3A CN201811557207A CN109858303B CN 109858303 B CN109858303 B CN 109858303B CN 201811557207 A CN201811557207 A CN 201811557207A CN 109858303 B CN109858303 B CN 109858303B
Authority
CN
China
Prior art keywords
area
pixel mode
scanning
terminal device
area ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811557207.3A
Other languages
Chinese (zh)
Other versions
CN109858303A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201811557207.3A priority Critical patent/CN109858303B/en
Publication of CN109858303A publication Critical patent/CN109858303A/en
Application granted granted Critical
Publication of CN109858303B publication Critical patent/CN109858303B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a scanning method and terminal equipment, relates to the technical field of terminals, and aims to solve the problem that the mode for adjusting the power consumption of the terminal equipment is not flexible enough. The method comprises the following steps: acquiring the area ratio of a scanning object in a preview frame in a preview mode, wherein the area ratio is the ratio of a first area to a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame; determining a first pixel mode corresponding to the area ratio according to the area ratio; the scan object is scanned in the first pixel pattern.

Description

Scanning method and terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of terminals, in particular to a scanning method and terminal equipment.
Background
With the development of terminal technology, the frequency of scanning the two-dimensional code by the user using the terminal device is higher and higher.
Generally, a user can scan and recognize a two-dimensional code in a preview mode through a camera of a terminal device. If the user does not change the pixels of the camera, the pixels used by the camera for each scanning are fixed (may be default pixels or pixels selected by the user). The camera can successfully scan the two-dimensional code by using high pixels or low pixels and identify the information indicated by the two-dimensional code.
However, since the power consumption of the camera using the high pixel scanning is higher than that of the camera using the low pixel scanning, when the camera scans the two-dimensional code in a short distance, if the camera uses the high pixel scanning, the power consumption of the camera is high; when the camera scans the two-dimensional code remotely, if the camera uses too low pixel scanning, the camera fails to acquire information; if the user wants to adjust, the user needs to manually adjust the pixel mode of the camera, so that the way of adjusting the power consumption of the terminal equipment is not flexible.
Disclosure of Invention
The embodiment of the invention provides a scanning method and terminal equipment, and aims to solve the problem that the mode for adjusting the power consumption of the terminal equipment is not flexible enough.
In order to solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a scanning method, where an area ratio of a scanned object in a preview frame is obtained in a preview mode, where the area ratio is a ratio of a first area to a second area, the first area is an area occupied by the scanned object in the preview frame, and the second area is an area of the preview frame; determining a first pixel mode corresponding to the area ratio according to the area ratio; the scan object is scanned in the first pixel pattern.
In a second aspect, an embodiment of the present invention further provides a terminal device, where the terminal device includes an obtaining module, a determining module, and a scanning module; the acquisition module is used for acquiring the area ratio of the scanning object in the preview frame under the preview module mode, wherein the area ratio is the ratio of a first area to a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame; the determining module is used for determining a first pixel mode corresponding to the area ratio according to the area ratio acquired by the acquiring module; the scanning module is used for scanning the scanning object in the first pixel mode determined by the determining module.
In a third aspect, an embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when executed by the processor, the computer program implements the steps of the scanning method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the scanning method according to the first aspect.
In the embodiment of the present invention, the terminal device first obtains the area ratio of the scanned object in the preview frame in the preview mode, then determines, according to the area ratio, that one pixel mode corresponding to the area ratio is the first pixel mode, and finally, the terminal device scans the scanned object according to the first pixel mode. The area ratio is the ratio of a first area and a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame. Since the terminal device selects the pixel mode of scanning according to the area ratio, for the same scanning object, when the scanning object is closer to the terminal equipment, the area of the scanning object in the preview frame is larger, the terminal equipment can select the pixel mode corresponding to the larger area ratio when the area is larger, and when the scanning object is farther from the terminal equipment, the smaller the area of the scanning object in the preview frame is, the smaller the area ratio can be selected, the pixel mode corresponding to the smaller area ratio can be selected without manual adjustment of a user, therefore, compared with the existing scanning mode with fixed power consumption, the scanning method provided by the embodiment of the invention, the power consumption of the terminal equipment can be flexibly adjusted, the power consumption of the terminal equipment for scanning a scanning object in a short distance can be reduced, and the accuracy of the terminal equipment for scanning the scanning object in a long distance can be improved.
Drawings
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a scanning method according to an embodiment of the present invention;
FIG. 3 is a schematic view of a scanning interface according to an embodiment of the present invention;
FIG. 4 is a logic diagram illustrating a pixel mode switching according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another possible terminal device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another possible terminal device according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a hardware structure of a terminal device according to various embodiments 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 some, not all, embodiments of the present invention. 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 "/" in this context means "or", for example, A/B may mean A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. "plurality" means two or more than two.
The terms "first" and "second," and the like, in the description and in the claims of the present invention are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first area and the second area, etc. are for distinguishing different areas, and are not for describing a particular order of the areas.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
The terminal device in the embodiment of the present invention may be a terminal device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present invention are not limited in particular.
The following describes a software environment applied to the scanning method provided by the embodiment of the present invention, taking an android operating system as an example.
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention. In fig. 1, the architecture of the android operating system includes 4 layers, which are respectively: an application layer, an application framework layer, a system runtime layer, and a kernel layer (specifically, a Linux kernel layer).
The application program layer comprises various application programs (including system application programs and third-party application programs) in an android operating system.
The application framework layer is a framework of the application, and a developer can develop some applications based on the application framework layer under the condition of complying with the development principle of the framework of the application.
The system runtime layer includes libraries (also called system libraries) and android operating system runtime environments. The library mainly provides various resources required by the android operating system. The android operating system running environment is used for providing a software environment for the android operating system.
The kernel layer is an operating system layer of an android operating system and belongs to the bottommost layer of an android operating system software layer. The kernel layer provides kernel system services and hardware-related drivers for the android operating system based on the Linux kernel.
Taking an android operating system as an example, in the embodiment of the present invention, a developer may develop a software program for implementing the scanning method provided in the embodiment of the present invention based on the system architecture of the android operating system shown in fig. 1, so that the scanning method may run based on the android operating system shown in fig. 1. That is, the processor or the terminal device may implement the scanning method provided by the embodiment of the present invention by running the software program in the android operating system.
The scanning method according to an embodiment of the present invention is described below with reference to fig. 2. Fig. 2 is a schematic flowchart of a scanning method according to an embodiment of the present invention, and as shown in fig. 2, the scanning method includes S201 to S203:
s201, the terminal device acquires the area ratio of the scanning object in the preview frame in the preview mode.
The area ratio is a ratio of a first area to a second area, the first area is an area occupied by the scanning object in the preview frame, and the second area is an area of the preview frame.
It can be understood that, for the same scanning object, the larger the distance of the scanning object from the terminal device, the smaller the area of the scanning object in the preview frame, and the smaller the distance of the scanning object from the terminal device, the larger the area of the scanning object in the same preview frame.
It should be noted that the preview frame is a scanning area displayed on the terminal device interface.
Optionally, the scanned object may include a barcode, a two-dimensional code, an article (for example, what article an article is scanned and identified), and the like, where in this embodiment of the present invention, the shape of the two-dimensional code may be a rectangle, and may also be other irregular shapes, which is not specifically limited in this embodiment of the present invention.
It should be noted that, the shapes of the preview frames in different applications of the terminal device may be the same or different, the areas of the preview frames in different applications may be the same or different, and the area of the code scanning frame of an application is used when the terminal device uses the scanning function in which application, which is not specifically limited in this embodiment of the present invention.
S202, the terminal device determines a first pixel mode corresponding to the area ratio according to the area ratio.
Optionally, the terminal device may include multiple pixel modes, where power consumption of each pixel mode is different, and the more pixels corresponding to one pixel mode, the higher the power consumption of the pixel mode.
The larger the area ratio of the scanning object in the preview frame is, the lower the pixel mode of the pixel can be selected by the terminal.
For example, when the area is large, a photographing mode of 30 ten thousand pixels may be selected, and when the area is small, a photographing mode of 300 ten thousand pixels may be selected.
S203, the terminal device scans the scanning object in the first pixel mode.
In the embodiment of the present invention, the terminal device first obtains the area ratio of the scanned object in the preview frame in the preview mode, then determines, according to the area ratio, that one pixel mode corresponding to the area ratio is the first pixel mode, and finally, the terminal device scans the scanned object according to the first pixel mode. The area ratio is the ratio of a first area and a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame. Since the terminal device selects the pixel mode of scanning according to the area ratio, for the same scanning object, when the scanning object is closer to the terminal equipment, the area of the scanning object in the preview frame is larger, the terminal equipment can select the pixel mode corresponding to the larger area ratio when the area is larger, and when the scanning object is farther from the terminal equipment, the smaller the area of the scanning object in the preview frame is, the smaller the area ratio can be selected, the pixel mode corresponding to the smaller area ratio can be selected without manual adjustment of a user, therefore, compared with the existing scanning mode with fixed power consumption, the scanning method provided by the embodiment of the invention, the power consumption of the terminal equipment can be flexibly adjusted, the power consumption of the terminal equipment for scanning a scanning object in a short distance can be reduced, and the accuracy of the terminal equipment for scanning the scanning object in a long distance can be improved.
In a possible implementation manner, in the scanning method provided in the embodiment of the present invention, the step S201 may be specifically implemented by steps S201a and S201 b.
S201a, the terminal device acquires the first area and the second area.
Wherein, the first area is the area of the area surrounded by the outline of the scanning object or the minimum area comprising the scanning object.
It should be noted that the terminal device may be configured with the size or area of each preview box, and the terminal device uses the area of the preview box in the application when using the code scanning area in that application.
S201b, the terminal device obtains the area ratio according to the first area and the second area.
Based on the scheme, the terminal device determines the area of the region surrounded by the outline of the scanning object or the area of the minimum region including the scanning object as the first area, and the terminal device can obtain the area ratio according to the first area and the second area, so that the terminal device can determine the corresponding pixel mode according to the area ratio.
Specifically, the terminal device may acquire the first area according to S201a1 and S201a 2.
S201a1, the terminal device determines the target area in the preview box.
The target area is an area surrounded by the outline of the scanning object or a minimum area including the scanning object.
Optionally, the terminal determines a rectangular area or a circular area where the boundary of the scanned object is located as the target area.
It should be noted that, in the embodiment of the present invention, the region including the scanning target may be a regular region or an irregular region, and this is not specifically limited in the embodiment of the present invention.
Fig. 3 is a schematic view of a scanning interface according to an embodiment of the present invention. As shown in fig. 3 (a), the area of the rectangular frame having the length X1 and the width Y1 is a preview frame, and the area S1 of the preview frame is X1 × Y1. If the two-dimensional code in the barcode scanning frame is a rectangular two-dimensional code, the terminal device may use a region where a dashed-line frame having a length of X2 and a width of Y2 is located as a target region, and if the area S2 of the region is X2 × Y2, the area ratio is (X2 × Y2)/(X1 × Y1). As shown in fig. 3 (b), the area of the rectangular frame having the length X1 and the width Y1 is a preview frame, and the area S1 of the preview frame is X1 × Y1. The two-dimensional code in the code scanning frame is a circular two-dimensional code (the effective area is a rectangle), the terminal device may use an area where a circle with a diameter of X3 is located as a target area, and the area of the area is S3 ═ X3)2/4, the area ratio is (X3)2/4(X1*Y1)。
In this embodiment of the present invention, the target area may be an area of an effective area of the two-dimensional code in (b) in fig. 3, which is not specifically limited in this embodiment of the present invention.
S201a2, the terminal device determines the area of the target region as a first area.
Specifically, the terminal may determine the area of the target region according to an existing image processing method.
Based on the scheme, the terminal device can determine a region surrounded by the outlines of the scanning objects in the preview frame or a minimum region including the target object as the target region, the terminal can use the area of the target region as a first area, the terminal can determine an area ratio by combining the area of the preview frame, and determine a pixel mode according to the area ratio, so that the terminal can determine a pixel mode with proper power according to the occupation ratio of the area of one scanning object in the preview frame actually, and scan one scanning object according to the pixel mode, and the power consumption of the terminal device can be reduced under the condition that recognition is guaranteed.
A possible implementation manner, in the scanning method provided in the embodiment of the present invention, the step S202 may specifically include steps S202a and S202 b:
s202a, the terminal device determines the first interval in which the area ratio is located according to the area ratio.
The first interval is one of a plurality of preset intervals, and each interval in the plurality of intervals corresponds to one pixel mode respectively.
Exemplarily, table 1 shows a correspondence relationship between an interval where an area ratio is located and a pixel mode according to an embodiment of the present invention.
TABLE 1
Pixel pattern Pixel parameter Interval of area ratio
30 ten thousand 640*480 Interval 1
50 ten thousand 800*600 Interval 2
80 ten thousand 1024*768 Interval 3
130 ten thousand 1280*960 Interval 4
200 ten thousand 1600*1200 Interval 5
310 ten thousand 2048*1800 Interval 6
430 ten thousand 2400*1800 Interval 7
500 ten thousand 2560*1920 Interval 8
600 ten thousand 3000*2000 Interval 9
800 ten thousand 3264*2488 Interval 10
1100 ten thousand 4080*2720 Interval 11
1400 thousand 4536*3024 Interval 12
It should be noted that table 1 is only for showing the pixel modes that are commonly used at present, specifically, some or all of the pixel modes may be selected in the terminal device, and if the pixel mode selected in the terminal device is the partial pixel mode, the number of the pixel modes selected in the terminal device is the number of the preset multiple intervals, and the lower limit of the first interval and the upper limit of the second interval between two adjacent intervals are consecutive, which is not specifically limited in this embodiment of the present invention.
In the embodiment of the present invention, the upper limit value of the interval in which the area ratio is located decreases as the number of pixels increases.
S202b, the terminal device determines the pixel pattern corresponding to the first interval as the first pixel pattern.
Based on the scheme, the terminal equipment can determine a pixel mode according to the interval where the area ratio is located, the pixel mode and the area ratio have a corresponding relation, when the area ratio is larger, the mode with smaller pixels is selected to reduce power consumption, and when the area ratio is smaller, the mode with larger pixels is selected to ensure the accuracy of identification.
Optionally, power consumption of the camera in the terminal device in the second pixel mode is less than power consumption of the camera in the third pixel mode, the second pixel mode is a pixel mode corresponding to a second interval of the multiple intervals, the third pixel mode is a pixel mode corresponding to a third interval of the multiple intervals, and a minimum value of the second interval is greater than a maximum value of the third interval.
Optionally, the first resolution of the camera is smaller than the second resolution of the camera; the first resolution is the resolution of the camera in the second pixel mode; the second resolution is the resolution of the camera in the third pixel mode.
It should be noted that, in the embodiment of the present invention, the resolution of the camera is defined by the pixel value of the picture obtained by shooting with the camera, and of course, other parameters may also be used to define the resolution of the camera, which is not specifically limited in the embodiment of the present invention.
Fig. 4 is a schematic diagram of a switching logic of a pixel mode according to an embodiment of the present invention. Exemplarily, (a) in fig. 4 and (b) in fig. 4 are schematic diagrams of the switching logic of the first pixel mode, where, (a) in fig. 4 is a "four-in-one" switching manner, that is, the photosensitive unit concentration processing for different color channels of the RGB color chip, and G00, G01, G10, and G11 in (a) in fig. 4 are one channel of green; g22, G23, G32, G33 are another channel of green; r02, R03, R12, R13 are one channel of red; b20, B21, B30, B31 are one channel of blue. Assuming that (a) in fig. 4 is pixel pattern 1 and (b) in fig. 4 is pixel pattern 2, when the pixel pattern used by the terminal device is pixel pattern 1, the terminal device collects data of 16 photosites and processes data of 4 × 4, and when the pixel pattern used by the terminal device is pixel pattern 2, the terminal device collects data of 16 photosites, but the terminal device may process only data of 2 × 2. Fig. 4 (c) and fig. 4 (d) are "crop mode", where fig. 4 (c) includes 16 photo-sensing units, and the terminal device collects data for each of the 16 photo-sensing units in mode 1, and collects data for only 4 photo-sensing units of the 16 photo-sensing units in mode 2.
It should be noted that fig. 4 is only an exemplary illustration, and a specific arrangement manner of the photosensitive units may be the same as that in fig. 4 or different from that in fig. 4, and this is not particularly limited in the embodiment of the present invention.
Optionally, the sampling frequency corresponding to the first resolution is smaller than the sampling frequency corresponding to the second resolution.
It should be noted that, in conjunction with (c) in fig. 4 and (d) in fig. 4, the terminal device corresponds to the data of 16 photosensitive units that can be shown in (c) in fig. 4 at the second resolution, that is, the data of each photosensitive unit needs to be processed once; when the terminal device scans at the first resolution, it is sufficient to sample only the data of the 4 light-sensitive cells shown in (d) of fig. 4, that is, only the data of all the light-sensitive cells of 1/4 for processing.
It can be understood that when the sampling frequency corresponding to the first resolution is less than the sampling frequency corresponding to the second resolution, the terminal device consumes less power when using the first resolution.
In a possible implementation manner, in the scanning method provided in the embodiment of the present invention, the step S203 may be performed by step S203 a.
And S203a, the terminal equipment scans and scans the scanning object in the first pixel mode when the terminal equipment is in the screen-off state.
It should be noted that, in the embodiment of the present invention, when the terminal is in the screen off state, the terminal may start the camera of the terminal according to a preset condition to acquire the size of the scan object in the code scanning frame, so that the terminal may determine whether to start the camera by detecting an input of a user in the screen off state. For example, a low power chip may be used, and the low power chip may scan the environment in the field of view when the terminal device is in the screen-off state.
Furthermore, the scanning method provided by the embodiment of the present invention further includes step S204:
s204, after the terminal device scans the scanning object, the terminal device is controlled to be switched to a bright screen state, and information of the scanning object is displayed on a display screen of the terminal device.
It should be noted that, after the terminal device successfully scans a scanned object in the off-screen state, the terminal device controls the terminal device to switch to the on-screen state, and may display information of the scanned object on a display screen of the terminal device, for example, if the scanned object is a two-dimensional code for collection, the terminal device may display a payment interface on the display screen.
Based on the scheme, the terminal device can firstly acquire the area ratio occupied by the scanning object in the code scanning frame in the screen off state, the terminal device can determine the first pixel mode according to the area ratio, then scan the scanning object according to the first pixel mode, and after scanning, the terminal device displays the content of the scanning object.
Optionally, after S202, the scanning method provided in the embodiment of the present invention further includes S205:
s205, if the power consumption of the target pixel mode is not equal to the power consumption of the first pixel mode, the terminal device switches the target pixel mode into the first pixel mode.
And using the target pixel mode as the pixel mode currently adopted by the terminal equipment.
It should be noted that the terminal device may restore to the default pixel mode after each scan is completed, or may maintain the current pixel mode, and when scanning again, may obtain the area ratio again, and re-determine the pixel mode according to the area, which is not specifically limited in this embodiment of the present invention.
Optionally, the target pixel mode may be the same low-power-consumption pixel mode each time, and the area ratio may be obtained in the low-power-consumption pixel mode in the preview mode, which is not specifically limited in this embodiment of the present invention.
Based on the scheme, after the terminal device determines the area ratio of the scanning object in the preview frame each time, if it is determined that the power consumption of the first pixel mode is different from that of the pixel mode currently adopted by the terminal device, the terminal device may switch the pixel mode currently adopted to the first pixel mode, and if the first pixel mode and the pixel mode currently adopted are the same mode or the power consumption is the same, the terminal device may directly scan the scanning object by adopting the first pixel mode.
Fig. 5 is a schematic diagram of a possible structure of a terminal device according to an embodiment of the present invention, as shown in fig. 5, the terminal device includes an obtaining module 501, a determining module 502, and a scanning module 503; an obtaining module 501, configured to obtain, in a preview mode, an area ratio of a scanned object in a preview frame, where the area ratio is a ratio of a first area to a second area, the first area is an area occupied by the scanned object in the preview frame, and the second area is an area of the preview frame; a determining module 502, configured to determine, according to the area ratio acquired by the acquiring module 501, a first pixel mode corresponding to the area ratio; a scanning module 503, configured to scan the scan object with the first pixel pattern determined by the determining module 502.
Optionally, the determining module 502 is specifically configured to: determining a first interval in which the area ratio is located according to the area ratio, wherein the first interval is one of a plurality of preset intervals, and each interval in the plurality of intervals corresponds to one pixel mode respectively; and determining the pixel mode corresponding to the first section as the first pixel mode.
Optionally, power consumption of the camera in the terminal device in the second pixel mode is less than power consumption of the camera in the third pixel mode, the second pixel mode is a pixel mode corresponding to a second interval of the multiple intervals, the third pixel mode is a pixel mode corresponding to a third interval of the multiple intervals, and a maximum value of the second interval is less than a minimum value of the third interval.
Optionally, the first resolution of the camera is smaller than the second resolution of the camera; the first resolution is the resolution of the camera in the second pixel mode; the second resolution is the resolution of the camera in the third pixel mode.
Optionally, the sampling frequency corresponding to the first resolution is smaller than the sampling frequency corresponding to the second resolution.
Optionally, with reference to fig. 5, as shown in fig. 6, the terminal device further includes a display module 504; a scanning module 503, specifically configured to scan, when the terminal device is in a screen-off state, a scanning object in the first pixel mode determined by the determining module 502; and a display module 504, configured to control the terminal device to switch to a bright screen state after the scanning module 503 scans the scanning object, and display information of the scanning object on a display screen of the terminal device.
Optionally, the obtaining module 501 is specifically configured to: acquiring a first area and a second area, wherein the first area is an area enclosed by the outline of the scanning object or an area of a minimum area including the scanning object; the area ratio is obtained according to the first area and the second area.
Optionally, with reference to fig. 5, as shown in fig. 7, the terminal device 500 further includes: a switching module 505; a switching module 505, configured to, after the determining module 502 determines the first pixel mode corresponding to the area ratio according to the area ratio, switch the target pixel mode to the first pixel mode if the power consumption of the target pixel module is not equal to the power consumption of the first pixel module; the target pixel mode is a pixel mode currently adopted by the terminal device 500.
The terminal device 500 provided in the embodiment of the present invention can implement each process implemented by the terminal device in the foregoing method embodiments, and for avoiding repetition, details are not described here again.
In the terminal device provided in the embodiment of the present invention, the terminal device first obtains an area ratio of a scanned object in a preview frame in a preview mode, then determines, according to the area ratio, that one pixel mode corresponding to the area ratio is a first pixel mode, and finally, the terminal device scans the scanned object according to the first pixel mode. The area ratio is the ratio of a first area and a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame. Since the terminal device selects the pixel mode of scanning according to the area ratio, for the same scanning object, when the scanning object is closer to the terminal equipment, the larger the area of the scanning object in the preview frame, the terminal equipment can select the pixel mode corresponding to the larger area ratio when the area is larger, and when the scanning object is farther from the terminal equipment, the smaller the area of the scanning object in the preview frame is, the smaller the area ratio can be selected, the pixel mode corresponding to the smaller area ratio can be selected without manual adjustment of a user, therefore, compared with the existing scanning mode with fixed power consumption, the scanning method provided by the embodiment of the invention, the power consumption of the terminal equipment can be flexibly adjusted, the power consumption of the terminal equipment for scanning a scanning object in a short distance can be reduced, and the accuracy of the terminal equipment for scanning the scanning object in a long distance can be improved.
Fig. 8 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, where the terminal device 100 includes, but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 8 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal device, a wearable device, a pedometer, and the like.
The processor 110 is configured to obtain an area ratio of the scanning object in the preview frame in the preview mode, where the area ratio is a ratio of a first area to a second area, the first area is an area occupied by the scanning object in the preview frame, and the second area is an area of the preview frame; determining a first pixel mode corresponding to the area ratio according to the acquired area ratio; a sensor 105 for scanning the scan object in a first pixel pattern.
In the terminal device provided in the embodiment of the present invention, the terminal device first obtains an area ratio of a scanned object in a preview frame in a preview mode, then determines, according to the area ratio, that one pixel mode corresponding to the area ratio is a first pixel mode, and finally, the terminal device scans the scanned object according to the first pixel mode. The area ratio is the ratio of a first area and a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame. Since the terminal device selects the pixel mode of scanning according to the area ratio, for the same scanning object, when the scanning object is closer to the terminal equipment, the larger the area of the scanning object in the preview frame, the terminal equipment can select the pixel mode corresponding to the larger area ratio when the area is larger, and when the scanning object is farther from the terminal equipment, the smaller the area of the scanning object in the preview frame is, the smaller the area ratio can be selected, the pixel mode corresponding to the smaller area ratio can be selected without manual adjustment of a user, therefore, compared with the existing scanning mode with fixed power consumption, the scanning method provided by the embodiment of the invention, the power consumption of the terminal equipment can be flexibly adjusted, the power consumption of the terminal equipment for scanning a scanning object in a short distance can be reduced, and the accuracy of the terminal equipment for scanning the scanning object in a long distance can be improved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 may be used for receiving and sending signals during a message transmission or call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides wireless broadband internet access to the user through the network module 102, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
The input unit 104 is used to receive an audio or video signal. The input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics processor 1041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the network module 102. The microphone 1042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode.
The terminal device 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the terminal device 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 105 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. Touch panel 1071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 1071 (e.g., operations by a user on or near touch panel 1071 using a finger, stylus, or any suitable object or attachment). The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and receives and executes commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 1071 may be overlaid on the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 8, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the terminal device, and is not limited herein.
The interface unit 108 is an interface for connecting an external device to the terminal apparatus 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 100 or may be used to transmit data between the terminal apparatus 100 and the external device.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program 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. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the terminal device. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The terminal device 100 may further include a power supply 111 (such as a battery) for supplying power to each component, and preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 100 includes some functional modules that are not shown, and are not described in detail here.
Optionally, an embodiment of the present invention further provides a terminal device, which, with reference to fig. 8, includes a processor 110, a memory 109, and a computer program that is stored in the memory 109 and is executable on the processor 110, where the computer program is executed by the processor 110 to implement each process of the foregoing scanning method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the scanning method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the particular illustrative embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but is intended to cover various modifications, equivalent arrangements, and equivalents thereof, which may be made by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (16)

1. A scanning method is applied to terminal equipment, and is characterized in that the method comprises the following steps:
acquiring an area ratio of a scanning object in a preview frame in a preview mode, wherein the area ratio is a ratio of a first area to a second area, the first area is an area occupied by the scanning object in the preview frame, and the second area is an area of the preview frame;
determining a first pixel mode corresponding to a first interval in which the area ratio is located according to the area ratio;
scanning the scan object in the first pixel pattern;
the determining, according to the area ratio, a first pixel pattern corresponding to a first interval in which the area ratio is located includes:
determining the first interval in which the area ratio is located according to the area ratio, wherein the first interval is one of a plurality of preset intervals, and each interval in the plurality of intervals corresponds to one pixel mode respectively;
and determining the pixel mode corresponding to the first interval as the first pixel mode.
2. The method according to claim 1, wherein power consumption of a camera in the terminal device in a second pixel mode is smaller than power consumption of the camera in a third pixel mode, the second pixel mode being a pixel mode corresponding to a second section of the plurality of sections, the third pixel mode being a pixel mode corresponding to a third section of the plurality of sections, a minimum value of the second section being larger than a maximum value of the third section.
3. The method of claim 2, wherein the first resolution of the camera is less than the second resolution of the camera; the first resolution is the resolution of the camera in the second pixel mode; the second resolution is a resolution of the camera in the third pixel mode.
4. The method of claim 3, wherein the sampling frequency corresponding to the first resolution is less than the sampling frequency corresponding to the second resolution.
5. The method of any one of claims 1 to 4, wherein said scanning the scan object in the first pixel pattern comprises:
scanning the scanning object in the first pixel mode when the terminal equipment is in a screen-off state;
the method further comprises the following steps:
and after the scanning object is scanned, controlling the terminal equipment to be switched into a bright screen state, and displaying the information of the scanning object on a display screen of the terminal equipment.
6. The method of claim 1, wherein obtaining the area ratio of the scanned object in the preview frame in the preview mode comprises:
acquiring the first area and the second area, wherein the first area is an area surrounded by the outline of the scanning object or an area including a minimum area of the scanning object;
and acquiring the area ratio according to the first area and the second area.
7. The method of claim 1, wherein after said determining, from said area ratio, a first pixel pattern corresponding to a first interval in which said area ratio is located, said method further comprises:
if the power consumption of the target pixel mode is not equal to the power consumption of the first pixel mode, switching the target pixel mode into the first pixel mode;
and the target pixel mode is a pixel mode currently adopted by the terminal equipment.
8. The terminal equipment is characterized by comprising an acquisition module, a determination module and a scanning module;
the acquisition module is used for acquiring the area ratio of a scanning object in a preview frame in a preview mode, wherein the area ratio is the ratio of a first area to a second area, the first area is the area occupied by the scanning object in the preview frame, and the second area is the area of the preview frame;
the determining module is configured to determine, according to the area ratio acquired by the acquiring module, a first pixel mode corresponding to a first interval in which the area ratio is located;
the scanning module is used for scanning the scanning object in the first pixel mode determined by the determining module;
the determining module is specifically configured to: determining the first interval in which the area ratio is located according to the area ratio, wherein the first interval is one of a plurality of preset intervals, and each interval in the plurality of intervals corresponds to one pixel mode respectively;
and determining the pixel mode corresponding to the first interval as the first pixel mode.
9. The terminal device according to claim 8, wherein power consumption of a camera in the terminal device in a second pixel mode is smaller than power consumption of the camera in a third pixel mode, the second pixel mode being a pixel mode corresponding to a second section of the plurality of sections, the third pixel mode being a pixel mode corresponding to a third section of the plurality of sections, a minimum value of the second section being larger than a maximum value of the third section.
10. The terminal device of claim 9, wherein the first resolution of the camera is less than the second resolution of the camera; the first resolution is the resolution of the camera in the second pixel mode; the second resolution is a resolution of the camera in the third pixel mode.
11. The terminal device according to claim 10, wherein the sampling frequency corresponding to the first resolution is smaller than the sampling frequency corresponding to the second resolution.
12. The terminal device according to any one of claims 8 to 11, characterized in that the terminal device further comprises a display module;
the scanning module is specifically configured to scan the scan object in the first pixel mode determined by the determining module when the terminal device is in a screen-off state;
and the display module is used for controlling the terminal equipment to be switched into a bright screen state after the scanning module scans the scanning object, and displaying the information of the scanning object on a display screen of the terminal equipment.
13. The terminal device of claim 8, wherein the obtaining module is specifically configured to:
acquiring the first area and the second area, wherein the first area is an area surrounded by the outline of the scanning object or an area including a minimum area of the scanning object;
and acquiring the area ratio according to the first area and the second area.
14. The terminal device according to claim 8, wherein the terminal device further comprises: a switching module;
after the user determines the first pixel mode corresponding to the first interval where the area ratio is located by the determination module, if the power consumption of the target pixel mode is not equal to the power consumption of the first pixel mode, the terminal device switches the target pixel mode to the first pixel mode;
and the target pixel mode is a pixel mode currently adopted by the terminal equipment.
15. A terminal device, characterized in that the terminal device comprises a processor, a memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the scanning method according to any one of claims 1 to 7.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the scanning method according to one of claims 1 to 7.
CN201811557207.3A 2018-12-19 2018-12-19 Scanning method and terminal equipment Active CN109858303B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811557207.3A CN109858303B (en) 2018-12-19 2018-12-19 Scanning method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811557207.3A CN109858303B (en) 2018-12-19 2018-12-19 Scanning method and terminal equipment

Publications (2)

Publication Number Publication Date
CN109858303A CN109858303A (en) 2019-06-07
CN109858303B true CN109858303B (en) 2022-05-06

Family

ID=66891591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811557207.3A Active CN109858303B (en) 2018-12-19 2018-12-19 Scanning method and terminal equipment

Country Status (1)

Country Link
CN (1) CN109858303B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000013549A (en) * 1998-06-19 2000-01-14 Olympus Optical Co Ltd Image capture device
KR20100002763A (en) * 2008-06-30 2010-01-07 삼성전자주식회사 Image processing apparatus and image processing method thereof
CN101908125A (en) * 2010-06-01 2010-12-08 福建新大陆电脑股份有限公司 QR (Quick Response) bar code decoding chip and decoding method thereof
CN104410785A (en) * 2014-11-17 2015-03-11 联想(北京)有限公司 An information processing method and electronic device
CN104794421A (en) * 2015-04-29 2015-07-22 华中科技大学 QR (quick response) code positioning and recognizing methods
CN107071264A (en) * 2017-01-13 2017-08-18 维沃移动通信有限公司 A kind of image resolution ratio method of adjustment and mobile terminal
CN109033912A (en) * 2018-07-25 2018-12-18 维沃移动通信有限公司 A kind of recognition methods of identification code and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000013549A (en) * 1998-06-19 2000-01-14 Olympus Optical Co Ltd Image capture device
KR20100002763A (en) * 2008-06-30 2010-01-07 삼성전자주식회사 Image processing apparatus and image processing method thereof
CN101908125A (en) * 2010-06-01 2010-12-08 福建新大陆电脑股份有限公司 QR (Quick Response) bar code decoding chip and decoding method thereof
CN104410785A (en) * 2014-11-17 2015-03-11 联想(北京)有限公司 An information processing method and electronic device
CN104794421A (en) * 2015-04-29 2015-07-22 华中科技大学 QR (quick response) code positioning and recognizing methods
CN107071264A (en) * 2017-01-13 2017-08-18 维沃移动通信有限公司 A kind of image resolution ratio method of adjustment and mobile terminal
CN109033912A (en) * 2018-07-25 2018-12-18 维沃移动通信有限公司 A kind of recognition methods of identification code and mobile terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于BP神经网络二维码区域提取;蓝杰等;《微型机与应用》;20150110(第01期);全文 *
用于远距离人脸识别的超分辨率图像恢复研究;刘晓晖;《中国优秀博硕士学位论文全文数据库(硕士)》;20111215(第S2期);全文 *

Also Published As

Publication number Publication date
CN109858303A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN108513070B (en) Image processing method, mobile terminal and computer readable storage medium
CN110913132B (en) Object tracking method and electronic equipment
CN107977144B (en) Screen capture processing method and mobile terminal
CN107977652B (en) Method for extracting screen display content and mobile terminal
CN111142991A (en) Application function page display method and electronic equipment
CN111142723B (en) Icon moving method and electronic equipment
CN109257505B (en) Screen control method and mobile terminal
CN110750189B (en) Icon display method and device
CN110231972B (en) Message display method and terminal equipment
CN109901761B (en) Content display method and mobile terminal
CN109413264B (en) Background picture adjusting method and terminal equipment
CN111031178A (en) Video stream clipping method and electronic equipment
CN110944113B (en) Object display method and electronic equipment
CN110753155A (en) Proximity detection method and terminal equipment
CN111124231B (en) Picture generation method and electronic equipment
CN110597437A (en) Screen capturing method and terminal equipment
CN110908750B (en) Screen capturing method and electronic equipment
CN110868546B (en) Shooting method and electronic equipment
CN110209324B (en) Display method and terminal equipment
CN110022551B (en) Information interaction method and terminal equipment
CN109859718B (en) Screen brightness adjusting method and terminal equipment
CN109639981B (en) Image shooting method and mobile terminal
CN108419283B (en) WIFI hotspot scanning method and mobile terminal
CN111770275B (en) Shooting method and device, electronic equipment and readable storage medium
CN110769162B (en) Electronic equipment and focusing method

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