CN109214225A - A kind of scan method, device, mobile terminal and the storage medium of figure bar code - Google Patents

A kind of scan method, device, mobile terminal and the storage medium of figure bar code Download PDF

Info

Publication number
CN109214225A
CN109214225A CN201810726479.5A CN201810726479A CN109214225A CN 109214225 A CN109214225 A CN 109214225A CN 201810726479 A CN201810726479 A CN 201810726479A CN 109214225 A CN109214225 A CN 109214225A
Authority
CN
China
Prior art keywords
image data
bar code
camera
focal length
destination image
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.)
Pending
Application number
CN201810726479.5A
Other languages
Chinese (zh)
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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201810726479.5A priority Critical patent/CN109214225A/en
Publication of CN109214225A publication Critical patent/CN109214225A/en
Priority to PCT/CN2019/082401 priority patent/WO2020007090A1/en
Pending legal-status Critical Current

Links

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/10712Fixed beam scanning
    • G06K7/10722Photodetector array or CCD scanning
    • 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/10712Fixed beam scanning
    • G06K7/10722Photodetector array or CCD scanning
    • G06K7/10732Light sources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps

Landscapes

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

Abstract

The embodiment of the invention provides scan method, device, mobile terminal and the storage mediums of a kind of figure bar code, which comprises when the barcode scanning for detecting application operates, calling camera acquisition includes the destination image data of figure bar code;Bar code image data locating for the figure bar code are determined in the destination image data;Calculate the image scaled that the bar code image data account for the destination image data;If described image ratio does not meet preset ratio condition, the focal length of the camera is adjusted, to improve the image scaled of the bar code image data;The destination image data is transmitted to the application, to scan the figure bar code.The focal length of camera can be dynamically adjusted according to ratio condition, to adjust suitable distance, so that figure bar code size is suitable, improved clarity, improved barcode scanning success rate.

Description

A kind of scan method, device, mobile terminal and the storage medium of figure bar code
Technical field
The present invention relates to the technical fields of communication, eventually more particularly to a kind of scan method of figure bar code, device, movement End and storage medium.
Background technique
With the development of science and technology, user uses the business of the figures bar codes such as mobile scanning terminal bar code, two dimensional code Handle it is more and more, for example, payment, login user account number, starting shared bicycle, etc..
User be lined up payment, figure bar code be posted in eminence when, user figure bar code remote position into Row scans, and figure bar code is smaller in acquired image data, and details is more fuzzy, causes barcode scanning success rate lower or even nothing Method identification.
Summary of the invention
The embodiment of the present invention proposes scan method, device, mobile terminal and the storage medium of a kind of figure bar code, with solution Certainly long-range scanning figure bar code causes to scan the lower problem of success rate.
According to one aspect of the present invention, a kind of scan method of figure bar code is provided, using in the terminal, institute The method of stating includes:
When the barcode scanning for detecting application operates, calling camera acquisition includes the destination image data of figure bar code;
Bar code image data locating for the figure bar code are determined in the destination image data;
Calculate the image scaled that the bar code image data account for the destination image data;
If described image ratio does not meet preset ratio condition, the focal length of the camera is adjusted, described in improving The image scaled of bar code image data;
The destination image data is transmitted to the application, to scan the figure bar code.
It is optionally, described to call destination image data of the camera acquisition comprising figure bar code, comprising:
Camera is called to acquire preview image data;
Gray processing is carried out to the preview image data;
Figure bar code is identified in the image data after gray processing.
If identifying successfully, it is determined that the preview image data is the destination image data comprising figure bar code.
Optionally, described that bar code image data locating for the figure bar code, packet are determined in the destination image data It includes:
Binaryzation is carried out to the destination image data;
Foreground image data is marked off from the destination image data after binaryzation, as locating for the figure bar code Bar code image data.
Optionally, the image scaled for calculating the bar code image data and accounting for the destination image data, comprising:
If the figure bar code is rectangle, angle point is positioned in the bar code image data;
The first area of the destination image data is calculated based on the angle point;
Calculate the second area of the destination image data;
The ratio between first area and the second area is calculated, as image scaled.
Optionally, the focal length of the adjustment camera, comprising:
Focal length grade is set based on described image ratio, wherein described image ratio and the focal length grade are negatively correlated;
According to the focal length of camera described in the focal length level adjustment.
It is optionally, described that focal length grade is set based on described image ratio, comprising:
Determine proportional region belonging to described image ratio;
Inquire the corresponding focal length grade of the proportional region.
Optionally, the focal length according to camera described in the focal length level adjustment, comprising:
Judge whether the camera includes focal length camera;
If so, by the Focussing of the focal length camera to the focal length grade;
If it is not, then by the Focussing of the camera to the focal length grade.
Optionally, further includes:
If the camera reaches focal length upper limit value, destination image data processing will be merged described at least two frames.
Optionally, further includes:
Count the brightness value of the destination image data;
If the brightness value does not meet preset brightness conditions, the light filling brightness of flash lamp is adjusted;
The flash lamp is driven to carry out light filling to the figure bar code according to the light filling brightness, to improve the target figure As the brightness value of data.
Optionally, the light filling brightness of the adjustment flash lamp, comprising:
According to the benefit of the brightness value and/or the distance between the mobile terminal and the figure bar code setting flash lamp Brightness;
Wherein, the luminance information and the light filling brightness are negatively correlated, and the distance is positively correlated with the light filling brightness.
Optionally, the driving flash lamp carries out light filling to the figure bar code according to the light filling brightness, comprising:
Identify that the type of the flash lamp, the type include double color temperature lamps, single color temperature lamp, double color temperature lamps include warm Light lamp and cold light lamp;
If the flash lamp is double color temperature lamps, drive the warm light lamp according to the light filling brightness to the figure bar code Execute light filling operation;
If the warm light lamp has been adjusted to brightness upper limit, drive the cold light lamp according to the light filling brightness to described Figure bar code executes light filling;
If the flash lamp is single color temperature lamp, drive single color temperature lamp according to the light filling brightness to the graphic bar Code executes light filling.
Optionally, further includes:
If the flash lamp has been adjusted to brightness upper limit, following at least one figure is carried out to the destination image data As processing:
Yield value gain is improved, brightness value is improved, enhancing acutance, improves contrast.
According to another aspect of the present invention, a kind of scanning means of figure bar code is provided, using in the terminal, institute The method of stating includes:
Destination image data acquisition module, for when the barcode scanning for detecting application operates, calling camera acquisition to include The destination image data of figure bar code;
Bar code image data determining module, for determining item locating for the figure bar code in the destination image data Code image data;
Image scaled computing module accounts for the image ratio of the destination image data for calculating the bar code image data Example;
Focussing module adjusts the camera if not meeting preset ratio condition for described image ratio Focal length, to improve the image scaled of the bar code image data;
Barcode scanning module, for the destination image data to be transmitted to the application, to scan the figure bar code.
Optionally, the destination image data acquisition module includes:
Preview image data acquires submodule, for calling camera to acquire preview image data;
Gray processing submodule, for carrying out gray processing to the preview image data;
Figure bar code identifies submodule, for identifying figure bar code in the image data after gray processing.
Destination image data determines submodule, if for identifying successfully, it is determined that the preview image data is comprising figure The destination image data of shape bar code.
Optionally, the bar code image data determining module includes:
Binaryzation submodule, for carrying out binaryzation to the destination image data;
Foreground partition submodule is made for marking off foreground image data from the destination image data after binaryzation For bar code image data locating for the figure bar code.
Optionally, described image ratio computing module includes:
Corner character submodule, if being rectangle, the orientation angle in the bar code image data for the figure bar code Point;
First areal calculation submodule, for calculating the first area of the destination image data based on the angle point;
Second area computational submodule, for calculating the second area of the destination image data;
Area ratio computational submodule, for calculating the ratio between first area and the second area, as Image scaled.
Optionally, the Focussing module includes:
Focal length grade sets submodule, for setting focal length grade based on described image ratio, wherein described image ratio It is negatively correlated with the focal length grade;
Focal length level adjustment submodule, for the focal length according to camera described in the focal length level adjustment.
Optionally, the focal length grade setting submodule includes:
Proportional region determination unit, for determining proportional region belonging to described image ratio;
Focal length ranked queries unit, for inquiring the corresponding focal length grade of the proportional region.
Optionally, the focal length level adjustment submodule includes:
Focal length camera judging unit, for judging whether the camera includes focal length camera;If so, calling the One adjustment unit, if it is not, then calling second adjustment unit;
The first adjustment unit, for by the Focussing of the focal length camera to the focal length grade;
Second adjustment unit, for by the Focussing of the camera to the focal length grade.
Optionally, further includes:
Image merging module will target image described at least two frames if reaching focal length upper limit value for the camera Data merge processing.
Optionally, further includes:
Brightness value statistical module, for counting the brightness value of the destination image data;
Light filling brightness adjusting section adjusts flash lamp if not meeting preset brightness conditions for the brightness value Light filling brightness;
Supplementary lighting module, for driving the flash lamp to carry out light filling to the figure bar code according to the light filling brightness, with Improve the brightness value of the destination image data.
Optionally, the light filling brightness adjusting section includes:
Range measurement submodule, for measuring the distance between the mobile terminal and the figure bar code;
Light filling brightness settings submodule, for according to the brightness value and/or the mobile terminal and the figure bar code The distance between setting flash lamp light filling brightness;
Wherein, the luminance information and the light filling brightness are negatively correlated, and the distance is positively correlated with the light filling brightness.
Optionally, the supplementary lighting module includes:
Category identification submodule, the type of the flash lamp, the type include double color temperature lamps, monochromatic temperature for identification Lamp, double color temperature lamps include warm light lamp and cold light lamp;
Warm light lamp light filling submodule drives the warm light lamp according to described if being double color temperature lamps for the flash lamp Light filling brightness executes light filling operation to the figure bar code;
Cold light lamp light filling submodule drives the cold light lamp if having adjusted for the warm light lamp to brightness upper limit Light filling is executed to the figure bar code according to the light filling brightness;
Single color temperature lamp light filling submodule, if being single color temperature lamp for the flash lamp, drive single color temperature lamp according to The light filling brightness executes light filling to the figure bar code.
Optionally, further includes:
Image processing module, if having adjusted for the flash lamp to brightness upper limit, to the destination image data Carry out following at least one image procossing:
Yield value gain is improved, brightness value is improved, enhancing acutance, improves contrast.
According to another aspect of the present invention, it provides a kind of mobile terminal, including processor, memory and is stored in described It is real when the computer program is executed by the processor on memory and the computer program that can run on the processor The step of scan method of the existing figure bar code.
According to another aspect of the present invention, a kind of computer readable storage medium, the computer-readable storage are provided Computer program is stored on medium, and the scan method of the figure bar code is realized when the computer program is executed by processor The step of.
The embodiment of the present invention includes following advantages:
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, in destination image data determine figure bar code locating for bar code image data, calculate bar code image number The focal length of camera is adjusted if image scaled does not meet preset ratio condition according to the image scaled for accounting for destination image data, To improve the image scaled of bar code image data, destination image data is transmitted to application, with scanning patter bar code, camera Focal length can be dynamically adjusted according to ratio condition, to adjust suitable distance, so that figure bar code size is suitable, be mentioned Fine definition improves barcode scanning success rate.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of the scan method of figure bar code of one embodiment of the invention;
Fig. 2 is the step flow chart of the scan method of another figure bar code of one embodiment of the invention;
Fig. 3 is a kind of structural block diagram of the scanning means of figure bar code of one embodiment of the invention;
Fig. 4 is the structural block diagram of the scanning means of another figure bar code of one embodiment of the invention;
A kind of hardware structural diagram of Fig. 5 mobile terminal of each embodiment to realize the present invention.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Referring to Fig.1, a kind of step flow chart of the scan method of figure bar code of one embodiment of the invention is shown, is had Body may include steps of:
Step 101, when the barcode scanning for detecting application operates, calling camera acquisition includes the target image of figure bar code Data.
In the concrete realization, the embodiment of the present invention can be applied in the terminal, for example, mobile phone, tablet computer, intelligence Wearable device (such as Intelligent bracelet, smartwatch, intelligent glasses), etc..
The operating system of these mobile terminals may include Android (Android), IOS, Windows Phone, Windows Etc., it can support to run a plurality of types of applications, for example, shopping application, browser, immediate communication tool, shared bicycle visitor Family end, etc..
These are applied in payment, login user account number, start in the business processings such as shared bicycle, starting barcode scanning operation, this When, which calls camera to acquire preview image data, and therefrom scanning patter bar code, for example, bar code, two dimensional code, etc. Deng.
It in embodiments of the present invention, can be from camera before being transmitted to preview image data using progress barcode scanning In the preview image data of acquisition, identification includes the destination image data of figure bar code, is optimized so as to subsequent, and barcode scanning is improved Success rate.
It should be noted that camera acquisition includes the destination image data of figure bar code, it is the operation of a duration, I.e. whithin a period of time, camera can include the destination image data of figure bar code with continuous collecting multiframe.
In one embodiment of the invention, step 101 may include following sub-step:
Sub-step S11 calls camera to acquire preview image data.
Sub-step S12 carries out gray processing to the preview image data.
Sub-step S13 identifies figure bar code in the image data after gray processing.
Sub-step S14, if identifying successfully, it is determined that the preview image data is the target image number comprising figure bar code According to.
In embodiments of the present invention, preview image data collected for camera can carry out gray processing, in The modes such as value filtering remove useless noise, to identify figure bar code therein, if identifying figure bar code, can set The fixed preview image data is the destination image data comprising figure bar code.
In the concrete realization, since the coding mode of figure bar code is numerous, identify that the mode of figure bar code is different, this Inventive embodiments are without restriction to this.
For example, the structure that can use QR bar code is special if two dimensional code is QR (Quick Response, fast reaction) bar code Sign quickly positions three position sensing figures, so that it is determined that including two dimensional code in preview image data.
Step 102, the brightness value of the destination image data is counted.
In the concrete realization, GRB (red, green, blue) component that destination image data can be counted, be transformed into HSL (form and aspect, Saturation degree, lightness) space, mean value twice is carried out to L * component, can be obtained the average brightness of destination image data, as brightness Value.
Step 103, if the brightness value does not meet preset brightness conditions, the light filling brightness of flash lamp is adjusted.
For camera, it is bright environment can be detected by sensor (sensor, such as camera, photosensitive sensors) Degree acquires image data according to the initial value of the light filling brightness of ambient brightness setting flash lamp with this initial value.
Using the embodiment of the present invention, brightness conditions (such as luminance threshold), under the brightness conditions, target can be preset Figure bar code in image data can obtain preferable barcode scanning effect.
For the brightness value of current target image data, it can be determined that its whether compound brightness conditions.
If do not met, the light filling brightness of flash lamp is adjusted, to the brightness value of the destination image data of subsequent acquisition Meet the brightness conditions.
It should be noted that different types of mobile terminal is directed to, due to camera, ISP (Image Signal Processing, image signal process) etc. hardware specifications it is different, therefore, image condition is also different, can be for not It is arranged with mobile terminal, the embodiments of the present invention are not limited thereto.
In one embodiment of the invention, step 103 may include following sub-step:
Sub-step S21 is set according to the brightness value and/or the distance between the mobile terminal and the figure bar code The light filling brightness of flash lamp.
In the concrete realization, the camera lens of camera is driven by motor, is positioned the position of the motor, can be calculated movement The distance between terminal and figure bar code.
Wherein, brightness value and light filling brightness are negatively correlated, i.e. the brightness value of destination image data is higher, then light filling brightness is got over Low, conversely, the brightness value of destination image data is lower, then light filling brightness is higher.
In addition, distance is positively correlated with light filling brightness, i.e., the distance between mobile terminal and figure bar code are bigger, then light filling is bright Degree is higher, conversely, the distance between mobile terminal and figure bar code are smaller, then light filling brightness is lower.
The distance between brightness value, mobile terminal and figure bar code of destination image data can be used with monomer, can also be with It is applied in combination, when being applied in combination, corresponding weight can be respectively configured to brightness value, distance, so that it is determined that the benefit of flash lamp Brightness.
Step 104, the flash lamp is driven to carry out light filling to the figure bar code according to the light filling brightness, to improve State the brightness value of destination image data.
If it is determined that the light filling intensity of flash lamp, then accordingly adjust the electric current of flash lamp, so that the brightness of flash lamp is adjusted, Carrying out light filling to figure bar code can be improved the brightness value of destination image data under conditions of light filling.
In one embodiment of the invention, step 104 may include following sub-step:
Sub-step S31 identifies the type of the flash lamp.
Wherein, the type of flash lamp includes double color temperature lamps, single color temperature lamp, and double color temperature lamps include warm light lamp and cold light lamp.
Sub-step S32 drives the warm light lamp according to the light filling brightness to institute if the flash lamp is double color temperature lamps It states figure bar code and executes light filling operation.
Sub-step S33 drives the cold light lamp according to the light filling if the warm light lamp has been adjusted to brightness upper limit Brightness executes light filling to the figure bar code.
If flash lamp is double color temperature lamps, the brightness of warm light lamp can be first adjusted, the reflected light of figure bar code is reduced, is increasing While adding the brightness value of destination image data, avoids destination image data entirety overexposure or whiten, improve the success rate of barcode scanning.
If warm light lamp has been adjusted to brightness upper limit, then adjusts the brightness of cold light lamp, destination image data is continued growing Brightness value.
If cold light lamp has been adjusted to brightness upper limit, show that flash lamp has been adjusted to brightness upper limit.
Sub-step S34 drives single color temperature lamp according to the light filling brightness pair if the flash lamp is single color temperature lamp The figure bar code executes light filling.
If flash lamp is single color temperature lamp, the brightness of the list color temperature lamp can be directly adjusted, thus directly to graphic bar Code carries out light filling.
If single color temperature lamp has been adjusted to brightness upper limit, show that flash lamp has been adjusted to brightness upper limit.
In one embodiment of the invention, if flash lamp has been adjusted to brightness upper limit, to destination image data into The following at least one image procossing of row:
Yield value gain is improved, brightness value is improved, enhancing acutance, improves contrast.
By carrying out above-mentioned processing, the quality of destination image data is improved, to improve barcode scanning success rate.
Step 105, the destination image data is transmitted to the application, to scan the figure bar code.
It is normally carried out barcode scanning in order to guarantee to apply, destination image data collected for camera, either brightness value Meet brightness conditions, either, brightness value does not meet brightness conditions, can be transmitted to the application, this is applied in the target image Scanning patter bar code in data carries out corresponding business processing.
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, count the brightness value of destination image data, if brightness value does not meet preset brightness conditions, adjust sudden strain of a muscle The light filling brightness of light lamp, driving flash lamp carries out light filling to figure bar code according to light filling brightness, to improve destination image data Destination image data is transmitted to application by brightness value, and with scanning patter bar code, the brightness value of flash lamp can be according to brightness conditions It is dynamically adjusted, to adapt to environment, reduces the reflection of light, to improve the clarity of figure bar code, avoid graphic bar The whole overexposure of code whitens, and improves barcode scanning success rate, and further, user reduces the frequency for manually adjusting position, to reduce The barcode scanning time.
Referring to Fig. 2, the step flow chart of the scan method of another figure bar code of one embodiment of the invention is shown, It can specifically include following steps:
Step 201, when the barcode scanning for detecting application operates, calling camera acquisition includes the target image of figure bar code Data.
In the concrete realization, the embodiment of the present invention can be applied in the terminal, for example, mobile phone, tablet computer, intelligence Wearable device (such as Intelligent bracelet, smartwatch, intelligent glasses), etc..
The operating system of these mobile terminals may include Android (Android), IOS, Windows Phone, Windows Etc., it can support to run a plurality of types of applications, for example, shopping application, browser, immediate communication tool, shared bicycle visitor Family end, etc..
These are applied in payment, login user account number, start in the business processings such as shared bicycle, starting barcode scanning operation, this When, which calls camera to acquire preview image data, and therefrom scanning patter bar code, for example, bar code, two dimensional code, etc. Deng.
It in embodiments of the present invention, can be from camera before being transmitted to preview image data using progress barcode scanning In the preview image data of acquisition, identification includes the destination image data of figure bar code, is optimized so as to subsequent, and barcode scanning is improved Success rate.
It should be noted that camera acquisition includes the destination image data of figure bar code, it is the operation of a duration, I.e. whithin a period of time, camera can include the destination image data of figure bar code with continuous collecting multiframe.
In one embodiment of the invention, step 201 may include following sub-step:
Sub-step S41 calls camera to acquire preview image data.
Sub-step S42 carries out gray processing to the preview image data.
Sub-step S43 identifies figure bar code in the image data after gray processing.
Sub-step S44, if identifying successfully, it is determined that the preview image data is the target image number comprising figure bar code According to.
In embodiments of the present invention, preview image data collected for camera can carry out gray processing, in The modes such as value filtering remove useless noise, to identify figure bar code therein, if identifying figure bar code, can set The fixed preview image data is the destination image data comprising figure bar code.
In the concrete realization, since the coding mode of figure bar code is numerous, identify that the mode of figure bar code is different, this Inventive embodiments are without restriction to this.
For example, the structure feature that can use QR bar code quickly positions three position sensing figures if two dimensional code is QR bar code Shape, so that it is determined that including two dimensional code in preview image data.
Step 202, bar code image data locating for the figure bar code are determined in the destination image data.
For destination image data, detect that graphic bar hereafter can be precisely located comprising destination image data roughly Bar code image data locating for code.
In one embodiment of the invention, step 202 includes following sub-step:
Sub-step S51 carries out binaryzation to the destination image data.
Sub-step S52 marks off foreground image data from the destination image data after binaryzation, as the figure Bar code image data locating for bar code.
In embodiments of the present invention, the modes such as Otsu algorithm can be used, binaryzation is carried out to destination image data, is found Destination image data comprising figure bar code is divided into foreground image data, background image data two by one suitable threshold value Part, and using foreground image data as bar code image data locating for figure bar code.
It should be noted that may include whole figure bar codes in foreground image data, it is also possible to the figure comprising part Shape bar code, the embodiments of the present invention are not limited thereto.
For example, generally comprising black and white two parts data for two dimensional code, remaining with black in foreground image data Part, and in background image data include white portion.
Step 203, the image scaled that the bar code image data account for the destination image data is calculated.
On the one hand, it calculates the first area of bar code image data and on the other hand calculates the second face of destination image data Product, and then the ratio between the first area and second area is calculated, it can be obtained image scaled.
In one example of an embodiment of the present invention, step 203 may include following sub-step:
Sub-step S61 positions angle point in the bar code image data if the figure bar code is rectangle.
Sub-step S62 calculates the first area of the destination image data based on the angle point.
Sub-step S63 calculates the second area of the destination image data.
Sub-step S64 calculates the ratio between first area and the second area, as image scaled.
In this example, for the figures bar code such as two dimensional code, shape is rectangle, the corresponding bar code image data of bar code graphics In also to be rendered as rectangle, at this point it is possible to position the angle point of bar code image data, point, the point in the upper right corner, lower-left such as the upper left corner The point at angle, the lower right corner point.
Angle point is connected, to draw out the shape of destination image data, i.e. rectangle, the of destination image data is calculated with this One area.
Hereafter, the second area of destination image data is calculated, and then calculates the ratio between the first area and second area, As image scaled.
Certainly, the mode of above-mentioned the first area of calculating is intended only as example, in implementing the embodiments of the present invention, can basis Actual conditions are arranged other modes for calculating the first area and position in bar code image data if figure bar code is circle The center of circle, measurement radius, calculate first area, etc. with this, the embodiments of the present invention are not limited thereto.In addition, in addition to above-mentioned Outside the mode for calculating the first area, those skilled in the art can also be according to actual needs using other sides for calculating the first area Formula, the embodiment of the present invention are also without restriction to this.
Step 204, if described image ratio does not meet preset ratio condition, the focal length of the camera is adjusted, with Improve the image scaled of the bar code image data.
It, can be by sensor (sensor, such as range sensor) detecting distance, according to the distance for camera The initial value of focal length zoom is set, image data is acquired with this initial value.
For example, in the range of 0.5m-1m, the focal length of 1 grade of setting, in the range of 1.5m-3m, the focal length of 3 grades of setting, Etc..
Using the embodiment of the present invention, ratio condition (such as proportion threshold value), under the conditions of the ratio, target can be preset Figure bar code in image data can obtain preferable barcode scanning effect.
For the image scaled of bar image data in current target image data, it can be determined that its whether compound ratio Condition.
If do not met, the focal length zoom of camera is adjusted, to bar chart in the destination image data of subsequent acquisition As data improve image scaled.
It should be noted that it is directed to different types of mobile terminal, since the hardware specifications such as camera, ISP are different, Also, for different applications, the barcode scanning frame for scanning patter coding is also different, and therefore, ratio condition is not yet Together, can for different mobile terminal, different application and be arranged, the embodiments of the present invention are not limited thereto.
In one embodiment of the invention, step 204 may include following sub-step:
Sub-step S71 sets focal length grade based on described image ratio.
In embodiments of the present invention, camera is according to focal length level adjustment focal length,
Wherein, image scaled and focal length grade are negatively correlated, i.e., image scaled is bigger, and focal length lower grade, conversely, image ratio Example is smaller, and focal length higher grade.
In the concrete realization, multiple proportional regions can be divided in advance, and a corresponding focal length is arranged in each proportional region Grade, to establish the mapping relations between proportional region and focal length grade.
Wherein, proportional region and focal length grade are negatively correlated, i.e., proportional region is bigger, and focal length lower grade, conversely, ratio model Enclose smaller, focal length higher grade.
Therefore, for the image scaled of current bar code image data, image scaled can be determined in multiple proportional regions Affiliated proportional region inquires the corresponding focal length grade of proportional region in mapping relations.
Sub-step S72, according to the focal length of camera described in the focal length level adjustment.
In the concrete realization, it is determined that focal length grade, it can be by the Focussing of camera to the focal length grade.
Furthermore, it can be determined that whether camera includes focal length camera, if so, by the focal length of focal length camera It adjusts to the focal length grade, if it is not, then by the Focussing of camera to the focal length grade.
When camera is dual camera, possible configuration focal length camera, focal length camera supports optical zoom, Shooting effect is preferable, if being configured with focal length camera, can preferentially adjust its focal length, if not configuring focal length camera shooting IR (infrared) camera, RGB (colour) camera are configured in head, such as single camera, dual camera, then normal adjustment camera shooting The focal length of head.
In one embodiment of the invention, can be by modes such as interpolation if camera reaches focal length upper limit value, it will At least two frame destination image datas merge processing, improve the resolution ratio of destination image data, to improve target image number According to clarity, so as to improve the success rate of barcode scanning.
Step 205, the destination image data is transmitted to the application, to scan the figure bar code.
It is normally carried out barcode scanning in order to guarantee to apply, destination image data collected for camera, either bar code figure As the image scaled of data meets ratio condition, either, the image scaled of bar code image data does not meet ratio condition, It is transmitted to the application, this applies the scanning patter bar code in the destination image data, carries out corresponding business processing.
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, in destination image data determine figure bar code locating for bar code image data, calculate bar code image number The focal length of camera is adjusted if image scaled does not meet preset ratio condition according to the image scaled for accounting for destination image data, To improve the image scaled of bar code image data, destination image data is transmitted to application, with scanning patter bar code, camera Focal length can be dynamically adjusted according to ratio condition, to adjust suitable distance, so that figure bar code size is suitable, be mentioned Fine definition improves barcode scanning success rate.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented Necessary to example.
Referring to Fig. 3, a kind of structural block diagram of the scanning means of figure bar code of one embodiment of the invention is shown, is applied In the terminal, it can specifically include following module:
Destination image data acquisition module 301, for calling camera acquisition packet when the barcode scanning for detecting application operates The destination image data of the bar code containing figure;
Brightness value statistical module 302, for counting the brightness value of the destination image data;
Light filling brightness adjusting section 303 adjusts flash lamp if not meeting preset brightness conditions for the brightness value Light filling brightness;
Supplementary lighting module 304, for driving the flash lamp to carry out light filling to the figure bar code according to the light filling brightness, To improve the brightness value of the destination image data;
Barcode scanning module 305, for the destination image data to be transmitted to the application, to scan the figure bar code.
In one embodiment of the invention, the destination image data acquisition module 301 includes:
Preview image data acquires submodule, for calling camera to acquire preview image data;
Gray processing submodule, for carrying out gray processing to the preview image data;
Figure bar code identifies submodule, for identifying figure bar code in the image data after gray processing;
Destination image data determines submodule, if for identifying successfully, it is determined that the preview image data is comprising figure The destination image data of shape bar code.
In one embodiment of the invention, the light filling brightness adjusting section 303 includes:
Range measurement submodule, for measuring the distance between the mobile terminal and the figure bar code;
Light filling brightness settings submodule, for according to the brightness value and/or the mobile terminal and the figure bar code The distance between setting flash lamp light filling brightness;
Wherein, the brightness value and the light filling brightness are negatively correlated, and the distance is positively correlated with the light filling brightness.
In one embodiment of the invention, the supplementary lighting module 304 includes:
Category identification submodule, the type of the flash lamp, the type include double color temperature lamps, monochromatic temperature for identification Lamp, double color temperature lamps include warm light lamp and cold light lamp;
Warm light lamp light filling submodule drives the warm light lamp according to described if being double color temperature lamps for the flash lamp Light filling brightness executes light filling operation to the figure bar code;
Cold light lamp light filling submodule drives the cold light lamp if having adjusted for the warm light lamp to brightness upper limit Light filling is executed to the figure bar code according to the light filling brightness;
Single color temperature lamp light filling submodule, if being single color temperature lamp for the flash lamp, drive single color temperature lamp according to The light filling brightness executes light filling to the figure bar code.
In one embodiment of the invention, further includes:
Image processing module, if having adjusted for the flash lamp to brightness upper limit, to the destination image data Carry out following at least one image procossing:
Yield value gain is improved, brightness value is improved, enhancing acutance, improves contrast.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, count the brightness value of destination image data, if brightness value does not meet preset brightness conditions, adjust sudden strain of a muscle The light filling brightness of light lamp, driving flash lamp carries out light filling to figure bar code according to light filling brightness, to improve destination image data Destination image data is transmitted to application by brightness value, and with scanning patter bar code, the brightness value of flash lamp can be according to brightness conditions It is dynamically adjusted, to adapt to environment, reduces the reflection of light, to improve the clarity of figure bar code, avoid graphic bar The whole overexposure of code whitens, and improves barcode scanning success rate, and further, user reduces the frequency for manually adjusting position, to reduce The barcode scanning time.
Referring to Fig. 4, the structural block diagram of the scanning means of another figure bar code of one embodiment of the invention is shown, is answered With in the terminal, following module can specifically include:
Destination image data acquisition module 401, for calling camera acquisition packet when the barcode scanning for detecting application operates The destination image data of the bar code containing figure;
Bar code image data determining module 402, for being determined locating for the figure bar code in the destination image data Bar code image data;
Image scaled computing module 403 accounts for the image of the destination image data for calculating the bar code image data Ratio;
Focussing module 404 adjusts the camera shooting if not meeting preset ratio condition for described image ratio The focal length of head, to improve the image scaled of the bar code image data;
Barcode scanning module 405, for the destination image data to be transmitted to the application, to scan the figure bar code.
In one embodiment of the invention, the destination image data acquisition module 401 includes:
Preview image data acquires submodule, for calling camera to acquire preview image data;
Gray processing submodule, for carrying out gray processing to the preview image data;
Figure bar code identifies submodule, for identifying figure bar code in the image data after gray processing;
Destination image data determines submodule, if for identifying successfully, it is determined that the preview image data is comprising figure The destination image data of shape bar code.
In one embodiment of the invention, the bar code image data determining module 402 includes:
Binaryzation submodule, for carrying out binaryzation to the destination image data;
Foreground partition submodule is made for marking off foreground image data from the destination image data after binaryzation For bar code image data locating for the figure bar code.
In one example of an embodiment of the present invention, described image ratio computing module 403 includes:
Corner character submodule, if being rectangle, the orientation angle in the bar code image data for the figure bar code Point;
First areal calculation submodule, for calculating the first area of the destination image data based on the angle point;
Second area computational submodule, for calculating the second area of the destination image data;
Area ratio computational submodule, for calculating the ratio between first area and the second area, as Image scaled.
In one embodiment of the invention, the Focussing module 404 includes:
Focal length grade sets submodule, for setting focal length grade based on described image ratio, wherein described image ratio It is negatively correlated with the focal length grade;
Focal length level adjustment submodule, for the focal length according to camera described in the focal length level adjustment.
In one embodiment of the invention, the focal length grade setting submodule includes:
Proportional region determination unit, for determining proportional region belonging to described image ratio;
Focal length ranked queries unit, for inquiring the corresponding focal length grade of the proportional region.
In one embodiment of the invention, the focal length level adjustment submodule includes:
Focal length camera judging unit, for judging whether the camera includes focal length camera;If so, calling the One adjustment unit, if it is not, then calling second adjustment unit;
The first adjustment unit, for by the Focussing of the focal length camera to the focal length grade;
Second adjustment unit, for by the Focussing of the camera to the focal length grade.
In one embodiment of the invention, further includes:
Image merging module will target image described at least two frames if reaching focal length upper limit value for the camera Data merge processing.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, count the brightness value of destination image data, if brightness value does not meet preset brightness conditions, adjust sudden strain of a muscle The light filling brightness of light lamp, driving flash lamp carries out light filling to figure bar code according to light filling brightness, to improve destination image data Destination image data is transmitted to application by brightness value, and with scanning patter bar code, the brightness value of flash lamp can be according to brightness conditions It is dynamically adjusted, to adapt to environment, reduces the reflection of light, to improve the clarity of figure bar code, avoid graphic bar The whole overexposure of code whitens, and improves barcode scanning success rate, and further, user reduces the frequency for manually adjusting position, to reduce The barcode scanning time.
A kind of hardware structural diagram of Fig. 5 mobile terminal of each embodiment to realize the present invention.
The mobile terminal 500 includes but is not limited to: radio frequency unit 501, network module 502, audio output unit 503, defeated Enter unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, processor 510, the components such as camera 511, flash lamp 512 and power supply 513.It will be understood by those skilled in the art that shown in Fig. 5 Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram, Perhaps certain components or different component layouts are combined.In embodiments of the present invention, mobile terminal includes but is not limited to hand Machine, tablet computer, laptop, palm PC, car-mounted terminal, wearable device and pedometer etc..
Wherein, processor 510, for when the barcode scanning for detecting application operates, calling camera acquisition to include graphic bar The destination image data of code;Bar code image data locating for the figure bar code are determined in the destination image data;It calculates The bar code image data account for the image scaled of the destination image data;If described image ratio does not meet preset scale bar Part then adjusts the focal length of the camera, to improve the image scaled of the bar code image data;By the destination image data It is transmitted to the application, to scan the figure bar code.
In embodiments of the present invention, when the barcode scanning for detecting application operates, calling camera acquisition includes figure bar code Destination image data, in destination image data determine figure bar code locating for bar code image data, calculate bar code image number The focal length of camera is adjusted if image scaled does not meet preset ratio condition according to the image scaled for accounting for destination image data, To improve the image scaled of bar code image data, destination image data is transmitted to application, with scanning patter bar code, camera Focal length can be dynamically adjusted according to ratio condition, to adjust suitable distance, so that figure bar code size is suitable, be mentioned Fine definition improves barcode scanning success rate.
It should be understood that the embodiment of the present invention in, radio frequency unit 501 can be used for receiving and sending messages or communication process in, signal Send and receive, specifically, by from base station downlink data receive after, to processor 510 handle;In addition, by uplink Data are sent to base station.In general, radio frequency unit 501 includes but is not limited to antenna, at least one amplifier, transceiver, coupling Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 501 can also by wireless communication system and network and other set Standby communication.
Mobile terminal provides wireless broadband internet by network module 502 for user and accesses, and such as user is helped to receive It sends e-mails, browse webpage and access streaming video etc..
Audio output unit 503 can be received by radio frequency unit 501 or network module 502 or in memory 509 The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 503 can also be provided and be moved The relevant audio output of specific function that dynamic terminal 500 executes is (for example, call signal receives sound, message sink sound etc. Deng).Audio output unit 503 includes loudspeaker, buzzer and receiver etc..
Input unit 504 is for receiving audio or video signal.Input unit 504 may include graphics processor (Graphics Processing Unit, GPU) 5041 and microphone 5042, graphics processor 5041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 506.Through graphics processor 5041, treated that picture frame can be deposited Storage is sent in memory 509 (or other storage mediums) or via radio frequency unit 501 or network module 502.Mike Wind 5042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be The format output that mobile communication base station can be sent to via radio frequency unit 501 is converted in the case where telephone calling model.
Mobile terminal 500 further includes at least one sensor 505, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 5061, and proximity sensor can close when mobile terminal 500 is moved in one's ear Display panel 5061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify mobile terminal posture (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);It passes Sensor 505 can also include fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, wet Meter, thermometer, infrared sensor etc. are spent, details are not described herein.
Display unit 506 is for showing information input by user or being supplied to the information of user.Display unit 506 can wrap Display panel 5061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 5061.
User input unit 507 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family setting and the related key signals input of function control.Specifically, user input unit 507 include touch panel 5071 and Other input equipments 5072.Touch panel 5071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 5071 or in touch panel 5071 Neighbouring operation).Touch panel 5071 may include both touch detecting apparatus and touch controller.Wherein, touch detection Device detects the touch orientation of user, and detects touch operation bring signal, transmits a signal to touch controller;Touch control Device processed receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 510, receiving area It manages the order that device 510 is sent and is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch panel 5071.In addition to touch panel 5071, user input unit 507 can also include other input equipments 5072.Specifically, other input equipments 5072 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, operating stick, details are not described herein.
Further, touch panel 5071 can be covered on display panel 5061, when touch panel 5071 is detected at it On or near touch operation after, send processor 510 to determine the type of touch event, be followed by subsequent processing device 510 according to touching The type for touching event provides corresponding visual output on display panel 5061.Although in Fig. 5, touch panel 5071 and display Panel 5061 is the function that outputs and inputs of realizing mobile terminal as two independent components, but in some embodiments In, can be integrated by touch panel 5071 and display panel 5061 and realize the function that outputs and inputs of mobile terminal, it is specific this Place is without limitation.
Interface unit 508 is the interface that external device (ED) is connect with mobile terminal 500.For example, external device (ED) may include having Line or wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, storage card end Mouth, port, the port audio input/output (I/O), video i/o port, earphone end for connecting the device with identification module Mouthful etc..Interface unit 508 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and By one or more elements that the input received is transferred in mobile terminal 500 or can be used in 500 He of mobile terminal Data are transmitted between external device (ED).
Memory 509 can be used for storing software program and various data.Memory 509 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 509 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 510 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 509, and calls and is stored in storage Data in device 509 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Managing device 510 may include one or more processing units;Preferably, processor 510 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 510.
Mobile terminal 500 can also include the power supply 511 (such as battery) powered to all parts, it is preferred that power supply 511 Can be logically contiguous by power-supply management system and processor 510, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
Camera 511 may include single camera, also may include two cameras, when including two cameras, One of camera can be focal length camera.
Flash lamp 512 may include single color temperature lamp, also may include double color temperature lamp, wherein double color temperature lamps include warm light lamp with Cold light lamp.
In addition, mobile terminal 500 includes some unshowned functional modules, details are not described herein.
Preferably, the embodiment of the present invention also provides a kind of mobile terminal, including processor 510, and memory 509 is stored in On memory 509 and the computer program that can run on the processor 510, the computer program are executed by processor 510 Each process of the scan method embodiment of the above-mentioned figure bar code of Shi Shixian, and identical technical effect can be reached, to avoid weight Multiple, which is not described herein again.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium Calculation machine program, the computer program realize each mistake of the scan method embodiment of above-mentioned figure bar code when being executed by processor Journey, and identical technical effect can be reached, to avoid repeating, which is not described herein again.Wherein, the computer-readable storage medium Matter, such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic or disk etc..
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form belongs within protection of the invention.

Claims (10)

1. a kind of scan method of figure bar code, which is characterized in that application is in the terminal, which comprises
When the barcode scanning for detecting application operates, calling camera acquisition includes the destination image data of figure bar code;
Bar code image data locating for the figure bar code are determined in the destination image data;
Calculate the image scaled that the bar code image data account for the destination image data;
If described image ratio does not meet preset ratio condition, the focal length of the camera is adjusted, to improve the bar code The image scaled of image data;
The destination image data is transmitted to the application, to scan the figure bar code.
2. the method according to claim 1, wherein described call target of the camera acquisition comprising figure bar code Image data, comprising:
Camera is called to acquire preview image data;
Gray processing is carried out to the preview image data;
Figure bar code is identified in the image data after gray processing.
If identifying successfully, it is determined that the preview image data is the destination image data comprising figure bar code.
3. the method according to claim 1, wherein described determine the figure in the destination image data Bar code image data locating for bar code, comprising:
Binaryzation is carried out to the destination image data;
Foreground image data is marked off from the destination image data after binaryzation, as bar code locating for the figure bar code Image data.
4. the method according to claim 1, wherein the calculating bar code image data account for the target figure As the image scaled of data, comprising:
If the figure bar code is rectangle, angle point is positioned in the bar code image data;
The first area of the destination image data is calculated based on the angle point;
Calculate the second area of the destination image data;
The ratio between first area and the second area is calculated, as image scaled.
5. method according to claim 1-4, which is characterized in that the focal length of the adjustment camera, packet It includes:
Focal length grade is set based on described image ratio, wherein described image ratio and the focal length grade are negatively correlated;
According to the focal length of camera described in the focal length level adjustment.
6. according to the method described in claim 5, it is characterized in that, described according to camera described in the focal length level adjustment Focal length, comprising:
Judge whether the camera includes focal length camera;
If so, by the Focussing of the focal length camera to the focal length grade;
If it is not, then by the Focussing of the camera to the focal length grade.
7. method according to claim 1-4, which is characterized in that further include:
Count the brightness value of the destination image data;
If the brightness value does not meet preset brightness conditions, the light filling brightness of flash lamp is adjusted;
The flash lamp is driven to carry out light filling to the figure bar code according to the light filling brightness, to improve the target image number According to brightness value.
8. a kind of scanning means of figure bar code, which is characterized in that in the terminal, described device includes: for application
Destination image data acquisition module, for when the barcode scanning for detecting application operates, calling camera acquisition to include figure The destination image data of bar code;
Bar code image data determining module, for determining bar code figure locating for the figure bar code in the destination image data As data;
Image scaled computing module accounts for the image scaled of the destination image data for calculating the bar code image data;
Focussing module adjusts the coke of the camera if not meeting preset ratio condition for described image ratio Away to improve the image scaled of the bar code image data;
Barcode scanning module, for the destination image data to be transmitted to the application, to scan the figure bar code.
9. a kind of mobile terminal, which is characterized in that including processor, memory and be stored on the memory and can be described The computer program run on processor is realized when the computer program is executed by the processor as in claim 1 to 7 The step of scan method of described in any item figure bar codes.
10. a kind of computer readable storage medium, which is characterized in that store computer journey on the computer readable storage medium Sequence realizes the scanning of the figure bar code as described in any one of claims 1 to 7 when the computer program is executed by processor The step of method.
CN201810726479.5A 2018-07-04 2018-07-04 A kind of scan method, device, mobile terminal and the storage medium of figure bar code Pending CN109214225A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810726479.5A CN109214225A (en) 2018-07-04 2018-07-04 A kind of scan method, device, mobile terminal and the storage medium of figure bar code
PCT/CN2019/082401 WO2020007090A1 (en) 2018-07-04 2019-04-12 Scanning of graphic barcode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810726479.5A CN109214225A (en) 2018-07-04 2018-07-04 A kind of scan method, device, mobile terminal and the storage medium of figure bar code

Publications (1)

Publication Number Publication Date
CN109214225A true CN109214225A (en) 2019-01-15

Family

ID=64989925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810726479.5A Pending CN109214225A (en) 2018-07-04 2018-07-04 A kind of scan method, device, mobile terminal and the storage medium of figure bar code

Country Status (1)

Country Link
CN (1) CN109214225A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213456A (en) * 2019-06-10 2019-09-06 Oppo广东移动通信有限公司 Scan document bearing calibration, electronic device and computer readable storage medium
CN110264180A (en) * 2019-05-31 2019-09-20 安徽中科智链信息科技有限公司 A kind of scanning payment system and method based on long-focus camera
WO2020007090A1 (en) * 2018-07-04 2020-01-09 青岛海信移动通信技术股份有限公司 Scanning of graphic barcode
CN110807383A (en) * 2019-10-24 2020-02-18 维沃移动通信有限公司 Scanning method and electronic equipment
CN111753823A (en) * 2019-09-10 2020-10-09 广东小天才科技有限公司 Fixed focus scanning method and smart watch
CN111797643A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Method and terminal for recognizing bar code
CN111797642A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code identification method and terminal
CN111832555A (en) * 2019-04-19 2020-10-27 泰州腾翔信息科技有限公司 Navigation data based serial number identification method
CN112036199A (en) * 2020-07-17 2020-12-04 福建联迪商用设备有限公司 Two-stage scanning method and scanning gun
CN113496133A (en) * 2020-04-07 2021-10-12 深圳爱根斯通科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN113919382A (en) * 2021-04-29 2022-01-11 荣耀终端有限公司 Code scanning method and device
WO2023280285A1 (en) * 2021-07-08 2023-01-12 杭州海康机器人股份有限公司 Focusing method and apparatus, and storage medium
CN116301459A (en) * 2023-02-27 2023-06-23 荣耀终端有限公司 Code scanning method and related device
CN116703718A (en) * 2022-09-08 2023-09-05 荣耀终端有限公司 Image amplification method and electronic equipment
CN117576617A (en) * 2024-01-16 2024-02-20 杭州长河智信科技有限公司 Decoding system based on automatic adjustment of different environments

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693409A (en) * 2012-05-18 2012-09-26 四川大学 Method for quickly identifying two-dimension code system type in images
CN105138940A (en) * 2015-08-14 2015-12-09 福建联迪商用设备有限公司 Light supplementing method in two-dimensional code scanning and system thereof
CN105574457A (en) * 2015-12-15 2016-05-11 东软集团股份有限公司 Light supplementing method and device for scanning terminal
CN106056027A (en) * 2016-05-25 2016-10-26 努比亚技术有限公司 Terminal, system and method for achieving long-range two-dimensional code scanning
US20160321482A1 (en) * 2015-04-28 2016-11-03 The Code Corporation Barcode reader
CN106599758A (en) * 2016-11-29 2017-04-26 努比亚技术有限公司 Image quality processing method and terminal
CN106657799A (en) * 2017-03-02 2017-05-10 苏州摩比力特电子科技有限公司 Bar code scanning device and method based on phase detection
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693409A (en) * 2012-05-18 2012-09-26 四川大学 Method for quickly identifying two-dimension code system type in images
US20160321482A1 (en) * 2015-04-28 2016-11-03 The Code Corporation Barcode reader
CN105138940A (en) * 2015-08-14 2015-12-09 福建联迪商用设备有限公司 Light supplementing method in two-dimensional code scanning and system thereof
CN105574457A (en) * 2015-12-15 2016-05-11 东软集团股份有限公司 Light supplementing method and device for scanning terminal
CN106056027A (en) * 2016-05-25 2016-10-26 努比亚技术有限公司 Terminal, system and method for achieving long-range two-dimensional code scanning
CN106599758A (en) * 2016-11-29 2017-04-26 努比亚技术有限公司 Image quality processing method and terminal
CN106657799A (en) * 2017-03-02 2017-05-10 苏州摩比力特电子科技有限公司 Bar code scanning device and method based on phase detection
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵荣椿等: "《数字图像处理》", 30 April 2016, 西北工业大学出版社 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020007090A1 (en) * 2018-07-04 2020-01-09 青岛海信移动通信技术股份有限公司 Scanning of graphic barcode
CN111832555A (en) * 2019-04-19 2020-10-27 泰州腾翔信息科技有限公司 Navigation data based serial number identification method
CN110264180A (en) * 2019-05-31 2019-09-20 安徽中科智链信息科技有限公司 A kind of scanning payment system and method based on long-focus camera
CN110213456A (en) * 2019-06-10 2019-09-06 Oppo广东移动通信有限公司 Scan document bearing calibration, electronic device and computer readable storage medium
CN111753823A (en) * 2019-09-10 2020-10-09 广东小天才科技有限公司 Fixed focus scanning method and smart watch
CN110807383A (en) * 2019-10-24 2020-02-18 维沃移动通信有限公司 Scanning method and electronic equipment
CN110807383B (en) * 2019-10-24 2023-10-17 维沃移动通信有限公司 Scanning method and electronic equipment
CN113496133A (en) * 2020-04-07 2021-10-12 深圳爱根斯通科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN113496133B (en) * 2020-04-07 2024-03-29 深圳爱根斯通科技有限公司 Two-dimensional code identification method and device, electronic equipment and storage medium
CN111797643A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Method and terminal for recognizing bar code
CN111797642B (en) * 2020-07-08 2021-06-29 北京京东振世信息技术有限公司 Bar code identification method and terminal
CN111797643B (en) * 2020-07-08 2022-04-26 北京京东振世信息技术有限公司 Method and terminal for recognizing bar code
CN111797642A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code identification method and terminal
CN112036199A (en) * 2020-07-17 2020-12-04 福建联迪商用设备有限公司 Two-stage scanning method and scanning gun
CN113919382A (en) * 2021-04-29 2022-01-11 荣耀终端有限公司 Code scanning method and device
WO2023280285A1 (en) * 2021-07-08 2023-01-12 杭州海康机器人股份有限公司 Focusing method and apparatus, and storage medium
CN116703718A (en) * 2022-09-08 2023-09-05 荣耀终端有限公司 Image amplification method and electronic equipment
CN116703718B (en) * 2022-09-08 2024-03-22 荣耀终端有限公司 Image amplification method and electronic equipment
CN116301459A (en) * 2023-02-27 2023-06-23 荣耀终端有限公司 Code scanning method and related device
CN116301459B (en) * 2023-02-27 2023-10-20 荣耀终端有限公司 Code scanning method and related device
CN117576617A (en) * 2024-01-16 2024-02-20 杭州长河智信科技有限公司 Decoding system based on automatic adjustment of different environments
CN117576617B (en) * 2024-01-16 2024-04-16 杭州长河智信科技有限公司 Decoding system based on automatic adjustment of different environments

Similar Documents

Publication Publication Date Title
CN109214225A (en) A kind of scan method, device, mobile terminal and the storage medium of figure bar code
CN109033911A (en) A kind of scan method, device, mobile terminal and the storage medium of figure bar code
CN107665697B (en) A kind of adjusting method and mobile terminal of screen intensity
WO2021057267A1 (en) Image processing method and terminal device
CN108427876A (en) A kind of fingerprint identification method and mobile terminal
CN107707827A (en) A kind of high-dynamics image image pickup method and mobile terminal
CN110300267B (en) Photographing method and terminal equipment
CN107895352A (en) A kind of image processing method and mobile terminal
CN109068116B (en) Image processing method and device based on supplementary lighting, mobile terminal and storage medium
CN108965728B (en) Brightness adjusting method and terminal
CN107506732A (en) Method, equipment, mobile terminal and the computer-readable storage medium of textures
CN108965666B (en) Mobile terminal and image shooting method
CN108710833B (en) User identity authentication method and mobile terminal
CN108960179A (en) A kind of image processing method and mobile terminal
CN110113528A (en) A kind of parameter acquiring method and terminal device
CN107172349B (en) Mobile terminal shooting method, mobile terminal and computer readable storage medium
CN107888765A (en) A kind of method of handoff scenario pattern, mobile terminal
CN110110571A (en) A kind of barcode scanning method and mobile terminal
CN109379539A (en) A kind of screen light compensation method and terminal
CN108881544A (en) A kind of method taken pictures and mobile terminal
CN109727212A (en) A kind of image processing method and mobile terminal
CN109819166A (en) A kind of image processing method and electronic equipment
CN109033913A (en) A kind of recognition methods of identification code and mobile terminal
CN109639981B (en) Image shooting method and mobile terminal
CN108280405A (en) A kind of method and apparatus of vehicle obstacle-avoidance

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190115

RJ01 Rejection of invention patent application after publication