CN105049734B - It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt - Google Patents

It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt Download PDF

Info

Publication number
CN105049734B
CN105049734B CN201510547356.1A CN201510547356A CN105049734B CN 105049734 B CN105049734 B CN 105049734B CN 201510547356 A CN201510547356 A CN 201510547356A CN 105049734 B CN105049734 B CN 105049734B
Authority
CN
China
Prior art keywords
value
information
brightness
frame image
preview frame
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
CN201510547356.1A
Other languages
Chinese (zh)
Other versions
CN105049734A (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.)
GUANGZHOU XINGFU NETWORK TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU XINGFU NETWORK 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 GUANGZHOU XINGFU NETWORK TECHNOLOGY Co Ltd filed Critical GUANGZHOU XINGFU NETWORK TECHNOLOGY Co Ltd
Priority to CN201510547356.1A priority Critical patent/CN105049734B/en
Publication of CN105049734A publication Critical patent/CN105049734A/en
Application granted granted Critical
Publication of CN105049734B publication Critical patent/CN105049734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

Include shooting environmental data obtaining module, vertical state detection module, dither state detection module, brightness detection module, clarity detection module and chromaticity distortion detection module the invention discloses a kind of license camera carrying out shooting environmental shooting prompt and shooting environmental detection method, the license camera;The method includes:Obtain sensor parameters information and preview frame image information;According to gravity accelerometer parameter information and direction magnetic field sensor parameter information, judge whether intelligent terminal is in vertical state;According to gyro sensor parameter information, judge whether intelligent terminal has shake;According to the luminance information of luminance sensor parameter information and preview frame image, judge whether brightness is uniformly sufficient;According to the sharpness information of preview frame image, judge whether preview frame image is clear;According to the chromaticity distortion information of preview frame image, judge coloration whether deviation.The invention enables users to meet the photo of certificate photo standard by self-service shoot of intelligent terminal.

Description

It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt
Technical field
The present invention relates to a kind of license cameras and shooting environmental detection method carrying out shooting environmental shooting prompt, belong to Certificate photograph is shot and processing technology field.
Background technology
People, which are typically necessary to photo studio, to remove shooting certificate photograph (certificate photograph refers to that such as identity card, passport, Hong Kong are logical The photo that the legal certificate making such as row card, Macao's pass, the Taiwan pass, exit permit, residence permit, social security card uses), because There are the camera (adjustable setting exposure, aperture size, white balance etc.) and irradiation system of profession for photo studio, it is often more important that have The shooting personnel of profession shoot, and can hold the letters such as shooting angle, shooting brightness, clarity, the coloration of camera well Breath.
However, with the development of Internet era, people are in using intelligent terminal voluntarily shoots the demand of certificate photograph It is increasingly stronger, but currently without a professional license camera that can shoot prompt to user, therefore how so that user Also there are the shooting environmental prompt of profession, become industry personnel's urgent need to resolve one to ask in the self-service shooting photo of intelligent terminal Topic.
Invention content
The purpose of the present invention is to solve the defects of the above-mentioned prior art, and shooting environmental shooting can be carried out by providing one kind The license camera of prompt, the license camera can prompt the user to take a picture adjustment in time so that user is without learning profession Knowledge can meet the photo of certificate photo standard by self-service shoot of intelligent terminal.
Another object of the present invention is to provide a kind of shooting environmental detection methods.
The purpose of the present invention can be reached by adopting the following technical scheme that:
The license camera of shooting environmental shooting prompt can be carried out, the license camera includes:
Shooting environmental data obtaining module, gravity accelerometer parameter information, gyro for obtaining intelligent terminal Instrument sensor parameters information, direction magnetic field sensor parameter information and luminance sensor parameter information, and obtain preview frame figure Luminance information, sharpness information and the chromaticity distortion information of picture;
Vertical state detection module is used for the gravity accelerometer parameter information according to intelligent terminal and direction magnetic field Sensor parameters information, judges whether intelligent terminal is in vertical state, if so, by detection, if it is not, then transferring preset Information carries out shooting prompt;
Dither state detection module, for when intelligent terminal is in vertical state, being passed according to the gyroscope of intelligent terminal Sensor parameter information, judges whether intelligent terminal has shake, if it is not, then by detection, is carried out if so, transferring preset information Shooting prompt;
Brightness detection module, the brightness for luminance sensor parameter information and preview frame image according to intelligent terminal are believed Breath judges whether brightness is uniformly sufficient, if so, by detection, if it is not, then transferring preset information carries out shooting prompt;
Clarity detection module judges whether preview frame image is clear for the sharpness information according to preview frame image, If so, by detection, if it is not, then transferring preset information carries out shooting prompt;
Chromaticity distortion detection module, for according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, if It is no, then by detection, if so, transferring preset information carries out shooting prompt.
Further, the vertical state detection module includes:
Eulerian angles computing unit calculates the Eulerian angles of direction magnetic field sensor for the value according to direction magnetic field sensor;
Angle information value computing unit, for the value of the Eulerian angles of direction magnetic field sensor and gravity accelerometer As initialization perpendicular attitude value, the droop of acceleration of gravity is obtained, as correction value, calculates initialization perpendicular attitude value Between correction value and value or difference, the angle information value after being corrected;
Vertical angle judging unit, for calculating the angle information value after correcting and between preset standard vertical angle angle value Difference obtains angu-lar deviation, judges whether angu-lar deviation exceeds preset value, if it is not, then intelligent terminal is in vertical state, Pass through detection;If so, intelligent terminal is not in vertical state, transfers preset information and carry out shooting prompt.
Further, the dither state detection module includes:
Recording unit, for when intelligent terminal is in vertical state, the value of the gyro sensor of intelligent terminal to be remembered For initial value, counter values are denoted as 0;
Deviation judging unit, for when the value of gyro sensor changes, judging whether the numerical value of variation exceeds Preset deviation threshold, if so, counter values add 1, if it is not, counter values remain unchanged;
Judging unit is shaken, in certain acquisition time, judging whether counter values exceed preset number threshold Value, if it is not, then intelligent terminal non-jitter, passes through detection;If so, intelligent terminal has shake, transfers preset information and clapped Take the photograph prompt.
Further, the shooting environmental data obtaining module obtains the luminance information of preview frame image, specifically includes:
The brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates brightness exception coefficient K1With average luminance shift value DA;
The brightness detection module includes:
Luminance sensor detection unit, for the value of luminance sensor is default low with a default high level and one respectively Value is compared, if the value of luminance sensor it is default between high level and predetermined low level when, the value of luminance sensor conforms to It asks;If the value of luminance sensor is more than default high level, judge that ambient light is excessively bright;If the value of luminance sensor is less than default low When value, judge that ambient light is excessively dark;When ambient light is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
Preview frame brightness of image detection unit, for when the value of luminance sensor meets the requirements, judging brightness system extremely Number K1Whether it is less than 1, if so, brightness uniformity is sufficient, passes through detection;If it is not, when average luminance shift value DA is more than 0, sentence Disconnected ambient light is excessively bright, when average luminance shift value DA is less than 0, judges that ambient light is excessively dark;When ambient light is excessively bright or mistake When dark, transfer preset information and carry out shooting prompt.
Further, the brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates Brightness exception COEFFICIENT K1With average luminance shift value DA, specifically include:
The brightness value that each pixel is read from preview frame image matrix counts the number of pixels of each brightness 0~255, 128 be median, obtains the brightness histogram of preview frame image;
Data analysis is carried out to brightness histogram, calculates brightness integrated value:
Wherein, constant 128 is intensity deviation value;Col is the row of preview frame image matrix, and cols is maximum row;Row is The row of preview frame image matrix, rows are maximum row;Y (row, col) is the brightness value of certain point in preview frame image matrix; SumDA is intensity deviation summation of each pixel with respect to 128;
The intensity deviation summation acquired is averaging sum of all pixels, obtains average luminance shift value, is expressed as DA:
DA=SumDA/ (cols*rows)
The absolute value for taking average intensity deviation value DA, remembers D1
D1=abs (DA)
Brightness histogram is an array HIST [i], under be designated as brightness value, ranging from 0 to 255, cell value is the brightness The number of pixels of value, obtains:
Wherein, Mda is the intensity deviation value summation of each brightness degree of brightness histogram;
It takes absolute value, and averages to Mda:
M1=abs (Mda)/(cols*rows)
According to M1、D1, acquire brightness exception coefficient:
K1=D1/M1
Wherein, K1For brightness exception coefficient.
Further, the shooting environmental data obtaining module obtains the sharpness information of preview frame image, specifically includes:
The preview frame image of acquisition is converted into gray level image, obtains gray-scale map matrix, gray-scale map square is calculated using following formula The luminance difference average value with its consecutive points is each put in battle array:
Wherein, θ (row, col) be adjacent 4 points brightness change curvature both horizontally and vertically, Δ (row, Col) it is 2 points of luminance difference adjacent with certain point, col is gray-scale map matrix column, and cols is maximum row;Row is gray-scale map The row of matrix, rows are maximum row, and DR is sharpness factor;
The clarity detection module judges whether preview frame image is clear according to the sharpness information of preview frame image, It specifically includes:
Sharpness factor DR is compared with a predetermined low level and a default high level respectively, if sharpness factor DR When more than default high level, then preview frame image clearly is judged, pass through detection;If sharpness factor DR is less than predetermined low level, Judge that preview frame image is fuzzy, transfers preset information and carry out shooting prompt.
Further, the shooting environmental data obtaining module obtains the chromaticity distortion information of preview frame image, specific to wrap It includes:
Preview frame image is converted into Lab color space images, count each pixel Lab color space images a axis Colour cast COEFFICIENT K is calculated according to coloration average value Da and Db with coloration the average value Da and Db of b axis2
The chromaticity distortion detection module according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, tool Body includes:
Judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, passes through detection;If not, then it represents that exist Colour cast indicates partially red when coloration average value Da is more than 0, when coloration average value Da is less than 0, indicates partially green, average in coloration When value Db is more than 0, Huang partially is indicated, when coloration average value Db is less than 0, indicate partially blue, when coloration is partially red, partially green, partially yellow or inclined Lan Shi transfers preset information and carries out shooting prompt.
Further, described that preview frame image is converted into Lab color space images, each pixel is counted in Lab colors The a axis of spatial image and coloration the average value Da and Db of b axis calculate colour cast COEFFICIENT K according to coloration average value Da and Db2, specifically Including:
Preview frame image is converted into Lab color space images, each pixel is counted in Lab color space figures using following formula The a axis of picture and coloration the average value Da and Db of b axis:
Wherein, Vec3b (row, col) is the structure read on the Lab color spaces of a pixel, its first is Brightness value, second are a axis values of Lab, and third position is the b axis values of Lab;Col is Lab color space image matrix columns, Cols is maximum row;Row is the row of Lab color space images, and rows is maximum row;Constant 128 is intensity deviation value;
Calculate the variance yields D of a axis and b axis average values2
Brightness histogram HIST_A and HIST_B of the image on a axis and b axis are calculated, two groups of brightness histograms have respectively 256 statistical values;
Ask the average value Ma and Mb of a axis and b axis aberration:
Seek colour cast total value M2
According to variance yields D2With colour cast total value M2, acquire colour cast coefficient:
K2=D2/M2
Wherein, K2For colour cast coefficient.
Another object of the present invention can be reached by adopting the following technical scheme that:
Shooting environmental detection method is applied in license camera, the method includes:
The license camera obtains the gravity accelerometer parameter information of intelligent terminal, gyro sensor parameter letter Breath, direction magnetic field sensor parameter information and luminance sensor parameter information, and obtain the luminance information, clear of preview frame image Clear degree information and chromaticity distortion information;
The license camera is joined according to the gravity accelerometer parameter information and direction magnetic field sensor of intelligent terminal Number information, judges whether intelligent terminal is in vertical state, if so, by detection, is carried out if it is not, then transferring preset information Shooting prompt;
The license camera is believed when intelligent terminal is in vertical state according to the gyro sensor parameter of intelligent terminal Breath, judges whether intelligent terminal has shake, if it is not, then by detection, if so, transferring preset information carries out shooting prompt;
The license camera is sentenced according to the luminance information of the luminance sensor parameter information and preview frame image of intelligent terminal Whether disconnected brightness is uniformly sufficient, if so, by detection, if it is not, then transferring preset information carries out shooting prompt;
The license camera judges whether preview frame image is clear according to the sharpness information of preview frame image, if so, By detection, if it is not, then transferring preset information carries out shooting prompt;
The license camera according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, if it is not, then passing through Detection, if so, transferring preset information carries out shooting prompt.
Further, gravity accelerometer parameter information and direction magnetic field of the license camera according to intelligent terminal Sensor parameters information, judges whether intelligent terminal is in vertical state, specifically includes:
According to the value of direction magnetic field sensor, the Eulerian angles of direction magnetic field sensor are calculated;
Using the Eulerian angles of direction magnetic field sensor and the value of gravity accelerometer as initialization perpendicular attitude value, obtain The droop for obtaining acceleration of gravity calculates between initialization perpendicular attitude value and correction value and value or poor as correction value Value, the angle information value after being corrected;
The angle information value after correcting and the difference between preset standard vertical angle angle value are calculated, angu-lar deviation is obtained, Judge whether angu-lar deviation beyond preset value passes through detection if it is not, then intelligent terminal is in vertical state;If so, intelligence Terminal is not in vertical state, transfers preset information and carries out shooting prompt.
Further, the license camera is passed when intelligent terminal is in vertical state according to the gyroscope of intelligent terminal Sensor parameter information, judges whether intelligent terminal has shake, specifically includes:
When intelligent terminal is in vertical state, the value of the gyro sensor of intelligent terminal is denoted as initial value, will be counted Number device numerical value is denoted as 0;
When the value of gyro sensor changes, judge whether the numerical value of variation exceeds preset deviation threshold, if It is that then counter values add 1, if it is not, counter values remain unchanged;
In certain acquisition time, judge whether counter values exceed preset frequency threshold value, if it is not, then intelligent terminal Non-jitter passes through detection;If so, intelligent terminal has shake, transfers preset information and carry out shooting prompt.
Further, the license camera obtains the luminance information of preview frame image, specifically includes:
The brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates brightness exception coefficient K1With average luminance shift value DA;
The license camera is sentenced according to the luminance information of the luminance sensor parameter information and preview frame image of intelligent terminal Whether disconnected brightness is uniformly sufficient, specifically includes:
The value of luminance sensor is compared with a default high level and a predetermined low level respectively, if luminance sensor Value it is default between high level and predetermined low level when, then the value of luminance sensor meets the requirements;If the value of luminance sensor is more than When default high level, judge that ambient light is excessively bright;If the value of luminance sensor is less than predetermined low level, judge that ambient light is excessively dark; When ambient light is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
When the value of luminance sensor meets the requirements, brightness exception COEFFICIENT K is judged1Whether 1 is less than, if so, brightness is equal Even abundance passes through detection;If it is not, when average luminance shift value DA is more than 0, judge that ambient light is excessively bright, it is inclined in average brightness When shifting value DA is less than 0, judge that ambient light is excessively dark;When ambient light is excessive lightness or darkness, transfers preset information and shot Prompt.
Further, the brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates Brightness exception COEFFICIENT K1With average luminance shift value DA, specifically include:
The brightness value that each pixel is read from preview frame image matrix counts the number of pixels of each brightness 0~255, 128 be median, obtains the brightness histogram of preview frame image;
Data analysis is carried out to brightness histogram, calculates brightness integrated value:
Wherein, constant 128 is intensity deviation value;Col is the row of preview frame image matrix, and cols is maximum row;Row is The row of preview frame image matrix, rows are maximum row;Y (row, col) is the brightness value of certain point in preview frame image matrix; SumDA is intensity deviation summation of each pixel with respect to 128;
The intensity deviation summation acquired is averaging sum of all pixels, obtains average luminance shift value, is expressed as DA:
DA=SumDA/ (cols*rows)
The absolute value for taking average intensity deviation value DA, remembers D1
D1=abs (DA)
Brightness histogram is an array HIST [i], under be designated as brightness value, ranging from 0 to 255, cell value is the brightness The number of pixels of value, obtains:
Wherein, Mda is the intensity deviation value summation of each brightness degree of brightness histogram;
It takes absolute value, and averages to Mda:
M1=abs (Mda)/(cols*rows)
According to M1、D1, acquire brightness exception coefficient:
K1=D1/M1
Wherein, K1For brightness exception coefficient.
Further, the license camera obtains the sharpness information of preview frame image, specifically includes:
The preview frame image of acquisition is converted into gray level image, obtains gray-scale map matrix, gray-scale map square is calculated using following formula The luminance difference average value with its consecutive points is each put in battle array:
Wherein, θ (row, col) be adjacent 4 points brightness change curvature both horizontally and vertically, Δ (row, Col) it is 2 points of luminance difference adjacent with certain point, col is gray-scale map matrix column, and cols is maximum row;Row is gray-scale map The row of matrix, rows are maximum row, and DR is sharpness factor;
The license camera judges whether preview frame image is clear, specially according to the sharpness information of preview frame image:
Sharpness factor DR is compared with a predetermined low level and a default high level respectively, if sharpness factor DR When more than default high level, then preview frame image clearly is judged, pass through detection;If sharpness factor DR is less than predetermined low level, Judge that preview frame image is fuzzy, transfers preset information and carry out shooting prompt.
Further, the license camera obtains the chromaticity distortion information of preview frame image, specifically includes:
Preview frame image is converted into Lab color space images, count each pixel Lab color space images a axis Colour cast COEFFICIENT K is calculated according to coloration average value Da and Db with coloration the average value Da and Db of b axis2
The license camera according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, specifically include:
Judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, passes through detection;If not, then it represents that exist Colour cast indicates partially red when coloration average value Da is more than 0, when coloration average value Da is less than 0, indicates partially green, average in coloration When value Db is more than 0, Huang partially is indicated, when coloration average value Db is less than 0, indicate partially blue, when coloration is partially red, partially green, partially yellow or inclined Lan Shi transfers preset information and carries out shooting prompt.
Further, described that preview frame image is converted into Lab color space images, each pixel is counted in Lab colors The a axis of spatial image and coloration the average value Da and Db of b axis calculate colour cast COEFFICIENT K according to coloration average value Da and Db2, specifically Including:
Preview frame image is converted into Lab color space images, each pixel is counted in Lab color space figures using following formula The a axis of picture and coloration the average value Da and Db of b axis:
Wherein, Vec3b (row, col) is the structure read on the Lab color spaces of a pixel, its first is Brightness value, second are a axis values of Lab, and third position is the b axis values of Lab;Col is Lab color space image matrix columns, Cols is maximum row;Row is the row of Lab color space images, and rows is maximum row;Constant 128 is intensity deviation value;
Calculate the variance yields D of a axis and b axis average values2
Brightness histogram HIST_A and HIST_B of the image on a axis and b axis are calculated, two groups of brightness histograms have respectively 256 statistical values;
Ask the average value Ma and Mb of a axis and b axis aberration:
Seek colour cast total value M2
According to variance yields D2With colour cast total value M2, acquire colour cast coefficient:
K2=D2/M2
Wherein, K2For colour cast coefficient.
The present invention has following advantageous effect compared with the existing technology:
1, whether license camera of the invention and method are vertical by intelligent terminal, whether intelligent terminal is shaken, brightness is No uniform sufficient, image whether clear, coloration detection whether devious, adjustment can be prompted the user to take a picture in time, made Knowledge of the user without learning profession, the photo of certificate photo standard can be met by self-service shoot of intelligent terminal.
2, license camera of the invention and method are according to the gravity accelerometer parameter information of intelligent terminal and direction Magnetic field sensor parameter information can detect whether intelligent terminal is vertical, and prompt user will be intelligent when intelligent terminal is not vertical Terminal is adjusted to vertical state;When intelligent terminal is vertical, can be examined according to the gyro sensor parameter information of intelligent terminal It surveys whether intelligent terminal has shake, shooting prompt is carried out to user when there is shake, prompt user that intelligent terminal is adjusted to quiet Only state carries out adequate preparation by adjusting undesirable intelligent terminal state for the shooting of certificate photograph.
3, license camera of the invention and method are according to the luminance sensor parameter information and preview frame image of intelligent terminal Luminance information, it is whether uniformly sufficient that brightness can be detected;According to the sharpness information of preview frame image, can be with detection image It is no clear;According to the chromaticity distortion information of preview frame image, can detect whether coloration has deviation, brightness it is excessively bright/excessively dark, figure When having deviation as fuzzy or coloration, user can be all prompted to adjust shooting environmental, to shoot the certificate photograph of high quality.
Description of the drawings
Fig. 1 is the license camera function module map of the embodiment of the present invention 1.
Fig. 2 is the brightness histogram of the embodiment of the present invention 1.
Fig. 3 is the vertical state detection module structure chart of the embodiment of the present invention 1.
Fig. 4 is the dither state detection module structure chart of the embodiment of the present invention 1.
Fig. 5 is the brightness detection module structure chart of the embodiment of the present invention 1.
Fig. 6 is the shooting environmental detection method flow chart of the embodiment of the present invention 2.
Specific implementation mode
Present invention will now be described in further detail with reference to the embodiments and the accompanying drawings, but embodiments of the present invention are unlimited In this.
Embodiment 1:
License camera is mounted in APP (Application, application on intelligent terminal (mobile phone, PDA, tablet computer etc.) Program), it can have Android versions and iOS versions, be responsible for shooting a width and meet the license artwork that certificate making uses, License artwork refers to cutting the useful region of image, and color according to license standard by user as obtained by license camera captured in real-time Image data of the image informations such as coloured silk, brightness, background, personage's biological characteristic without any processing.
And the license camera of the present embodiment is the shooting environmental detection being directed in shooting process, it can be according to shooting ring The testing result in border carries out shooting prompt.
In shooting process, the license camera of the present embodiment obtains the sensor parameters information of intelligent terminal, these sensings Device parameter information includes gravity accelerometer parameter information, gyro sensor parameter information, direction magnetic field sensor ginseng Number information and luminance sensor parameter information, and preview frame image information is obtained, these image informations include the brightness letter of image Breath, sharpness information and chromaticity distortion information, it is and preset according to obtained sensor parameters information and preview frame image information Certificate photograph standard acquisition parameters are compared, and judge whether all to meet the requirements, if all meeting the requirements, prompt user can be into Row shooting, if there are undesirable, transfer preset information and carries out shooting prompt.
Therefore, the license camera of the present embodiment includes shooting environmental data obtaining module, vertical state detection module, shake State detection module, brightness detection module, clarity detection module and chromaticity distortion detection module, as shown in Figure 1;Modules Concrete function it is as follows:
The shooting environmental data obtaining module, for obtain intelligent terminal gravity accelerometer parameter information, Gyro sensor parameter information, direction magnetic field sensor parameter information, luminance sensor parameter information, and obtain preview frame Luminance information, sharpness information and the chromaticity distortion information of image;
In shooting environmental data obtaining module, the luminance information for obtaining preview frame image specifically includes:
1) brightness value (Y-component, Y (n)) that each pixel is read from preview frame image matrix, count each brightness 0~ 255 number of pixels, 128 be median, obtains the brightness histogram of preview frame image, as shown in Figure 2;
2) data analysis is carried out to brightness histogram, calculates brightness integrated value:
Wherein, constant 128 is intensity deviation value;Col is the row of preview frame image matrix, and cols is maximum row;Row is The row of preview frame image matrix, rows are maximum row;Y (row, col) is the brightness value of certain point in preview frame image matrix; SumDA is intensity deviation summation of each pixel with respect to 128;
3) the intensity deviation summation acquired is averaging sum of all pixels, obtains average luminance shift value, is expressed as DA:
DA=SumDA/ (cols*rows)
The absolute value for taking average intensity deviation value DA, remembers D1
D1=abs (DA)
4) brightness histogram is an array HIST [i], under be designated as brightness value, ranging from 0 to 255, cell value is that this is bright The number of pixels of angle value, obtains:
Wherein, Mda is the intensity deviation value summation of each brightness degree of brightness histogram;
5) it takes absolute value, and averages to Mda:
M1=abs (Mda)/(cols*rows)
6) according to M1、D1, acquire brightness exception coefficient:
K1=D1/M1
Wherein, K1For brightness exception coefficient.
In shooting environmental data obtaining module, the sharpness information for obtaining preview frame image specifically includes:
1) the preview frame image of acquisition is converted into gray level image, sharpness meter is based on implementing meter on the basis of gray scale at last Calculate, clarity can also be expressed as sharpness of vision, be feeling of the people to the sharp keen degree of the image seen, by largely testing and Research and analyse, it is recognized that concept be that sharpness of vision is made of two factors of resolution ratio and object edge profile contrast.Sharpness of vision It is the steepness (slope) of transition, is equal to the variation of output brightness divided by the variation of position;
In order to simplify calculate, using two adjacent pixels of calculated level the excessive slope of brightness and vertically adjacent to four The average value of the brightness interpolating of pixel, the measurement index as evaluation clarity;
2) for a gray level image, it is assumed that pixel is following matrix:
Consecutive points are A, B, C and D;
3) it using adjacent 4 points of luminance differences both horizontally and vertically as two right-angle sides of right angled triangle, calculates Adjacent 4 points brightness change curvature both horizontally and vertically:
And 2 points of luminance difference adjacent with A:
Δ 1=abs (B-A)+abs (C-A)
4) following formula is used to calculate the luminance difference average value each put in gray-scale map matrix with its consecutive points:
Wherein, θ (row, col) be adjacent 4 points brightness change curvature both horizontally and vertically, Δ (row, Col) it is 2 points of luminance difference adjacent with certain point, col is gray-scale map matrix column, and cols is maximum row;Row is gray-scale map The row of matrix, rows are maximum row, and DR is sharpness factor.
In shooting environmental data obtaining module, the chromaticity distortion information for obtaining preview frame image specifically includes:
1) preview frame image is converted into Lab color space images, each pixel is counted in Lab color spaces using following formula The a axis of image and the coloration average value Da (red green colour cast estimated value) of b axis and Db (yellow blue colour cast estimated value):
Wherein, Vec3b (row, col) is the structure read on the Lab color spaces of a pixel, its first is Brightness value, second are a axis values of Lab, and third position is the b axis values of Lab;Col is Lab color space image matrix columns, Cols is maximum row;Row is the row of Lab color space images, and rows is maximum row;Constant 128 is intensity deviation value;
2) the variance yields D of a axis and b axis average values is calculated2
3) brightness histogram HIST_A and HIST_B of the image on a axis and b axis are calculated, two groups of brightness histograms have respectively 256 statistical values;
4) the average value Ma and Mb of a axis and b axis aberration are asked:
5) colour cast total value M is sought2
6) according to variance yields D2With colour cast total value M2, acquire colour cast coefficient:
K2=D2/M2
Wherein, K2For colour cast coefficient.
The vertical state detection module, for according to the gravity accelerometer parameter information of intelligent terminal and direction Magnetic field sensor parameter information, judges whether intelligent terminal is in vertical state, if so, by detection, if it is not, then transferring pre- If information carry out shooting prompt (such as voice, word or figure prompt);In shooting process, the vertical shape of intelligent terminal is kept State is quite important, because the eyes of certificate photograph photographing request people will face camera, if intelligent terminal is not vertical, shoots and Or portrait bow or come back or tilt, do not comply with legal certificate making photo standard requirement, because Whether this, need to be that vertical state detects to intelligent terminal, pass through direction magnetic field sensor and acceleration of gravity when shooting Sensor gets the angle information of intelligent terminal, and (XYZ axis informations, are placed vertically with intelligent terminal, and that perpendicular to the ground is Z Axis is X-axis with screen vertical, and parallel with screen is Y-axis, constitutes 3 dimension coordinate systems), it, can using gravity accelerometer To measure the vertical state of intelligent terminal.It is learnt from experiment, the reading that gravity accelerometer obtains is extremely sensitive (in other words Numerical value beating scope is bigger), and (a few tens of milliseconds to several seconds) can be arranged in the acquisition frequency read, can acquire multiple reading Number, is averaged, to obtain metastable reading;Further, since the precision of mounting process can be because intelligent terminal be different And have differences, cause the practical posture of the reading for XYZ values occur and intelligent terminal to have fixed deviation, analyze its reason, is In manufacturing process, there is site error in soldered sensor.Therefore, the vertical state detection module is as shown in figure 3, include:
Eulerian angles computing unit calculates the Eulerian angles of direction magnetic field sensor for the value according to direction magnetic field sensor;
Angle information value computing unit, for the value of the Eulerian angles of direction magnetic field sensor and gravity accelerometer As initialization perpendicular attitude value, the droop of acceleration of gravity is obtained, as correction value, calculates initialization perpendicular attitude value Between correction value and value or difference, the angle information value after being corrected;
Vertical angle judging unit, for calculating the angle information value after correcting and between preset standard vertical angle angle value Difference obtains angu-lar deviation, judges whether angu-lar deviation exceeds preset value (can freely set), if it is not, then intelligence is whole End is in vertical state, passes through detection;If so, intelligent terminal is not in vertical state, transfers preset information and clapped Prompt is taken the photograph, if mobile phone is tilted to the left 25 degree, please be adjust the angle.
The dither state detection module is used for when intelligent terminal is in vertical state, according to the gyro of intelligent terminal Instrument sensor parameters information, judges whether intelligent terminal has shake, if it is not, then by detection, if so, transferring preset information Carry out shooting prompt (such as voice, word or figure prompt);In shooting process, intelligent terminal is kept to remain static It is quite important, if intelligent terminal is shaken, shoots the photo come and will appear situation that is fuzzy, focusing inaccuracy, cannot meet The standard requirement of legal certificate making photo.Therefore it needs to detect whether intelligent terminal is shaken.Therefore, the dither state inspection Module is surveyed as shown in figure 4, including:
Recording unit, for when intelligent terminal is in vertical state, the value of the gyro sensor of intelligent terminal to be remembered For initial value, counter values are denoted as 0;
Deviation judging unit changes for the value (obtaining at a certain time interval) when gyro sensor When, judge whether the numerical value of variation exceeds preset deviation threshold, if so, counter values add 1, if it is not, counter values It remains unchanged;
Judging unit is shaken, in certain acquisition time (such as 5 seconds), judging counter values whether beyond preset Frequency threshold value (such as 5 times), if it is not, then intelligent terminal non-jitter, passes through detection;If so, intelligent terminal has shake, transfer default Information carry out shooting prompt, if mobile phone shake, mobile phone location please be keep to fix.
Brightness detection module, the brightness for luminance sensor parameter information and preview frame image according to intelligent terminal are believed Breath judges whether brightness is uniformly sufficient, if so, by detection, if it is not, then transferring preset information carries out shooting prompt (such as The prompts such as voice, word or figure);The one of which standard requirement of legal certificate making photo is that lightness uniformly fills Foot disclosure satisfy that this requirement to ensure to shoot the photo come, need when shooting to be detected brightness, what is found a view In the process, the numerical value detection for individually carrying out luminance sensor is not sufficient to ensure that the brightness of photo meets the requirement of certificate photo, therefore The brightness detection module of the present embodiment takes the method that luminance sensor detection and picture luminance detection combine, and ensures acquisition Brightness of image meets certificate as requested;The brightness detection module is as shown in figure 5, include:
Luminance sensor detection unit, for (such as 50000 to flow with a default high level respectively by the value of luminance sensor It is bright) and a predetermined low level (such as 100 lumens) be compared, if the value of luminance sensor is default between high level and predetermined low level When, then the value of luminance sensor meets the requirements;If the value of luminance sensor is more than default high level, judge that ambient light is excessively bright; If the value of luminance sensor is less than predetermined low level, judge that ambient light is excessively dark;When ambient light is excessive lightness or darkness, transfer pre- If information carry out shooting prompt;From the experimental results showed that, the value of luminance sensor is more satisfactory between 400~20000 Shooting light environment, in order to ensure the final mass of photo, it is preliminary bright that the present embodiment takes the value between 100-50000 to carry out Degree screening.
Preview frame brightness of image detection unit, for when the value of luminance sensor meets the requirements, judging brightness system extremely Number K1Whether it is less than 1, if so, brightness uniformity is sufficient, passes through detection;If it is not, when average luminance shift value DA is more than 0, sentence Disconnected ambient light is excessively bright, when average luminance shift value DA is less than 0, judges that ambient light is excessively dark;When ambient light is excessively bright or mistake When dark, transfer preset information and carry out shooting prompt.
The detection of combining environmental brightness detection unit and preview frame brightness of image detection unit, obtains following judging result:
As L < 100, ambient light is excessively dark;
As L > 50000, ambient light is excessively bright;
When L is between 100-50000, and work as K1When >=1:If DA > 0, ambient light is excessively bright;If DA < 0, ambient light It crosses dark.
When L is between 100-50000, and work as K1When < 1, brightness uniformity is sufficient, meets the requirements, that is, passes through detection.
Clarity detection module judges whether preview frame image is clear for the sharpness information according to preview frame image, If so, by detection, if it is not, then transferring preset information carries out shooting prompt (such as voice, word or figure prompt);Its In, the sharpness information according to preview frame image judges whether preview frame image is clear, specifically includes:
Sharpness factor DR is compared with a predetermined low level and a default high level respectively, if sharpness factor DR When more than default high level, then preview frame image clearly is judged, pass through detection;If sharpness factor DR is less than predetermined low level, Judge that preview frame image is fuzzy, transfers preset information and carry out shooting prompt;Under normal circumstances, predetermined low level is set as 10, in advance If high level is set as 14.
Chromaticity distortion detection module, for according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, if It is no, then by detection, if so, transferring preset information carries out shooting prompt (such as voice, word or figure prompt);Its In, the chromaticity distortion detection module according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, it is specific to wrap It includes:
Judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, passes through detection;If not, then it represents that exist Colour cast indicates partially red when coloration average value Da is more than 0, when coloration average value Da is less than 0, indicates partially green, average in coloration When value Db is more than 0, Huang partially is indicated, when coloration average value Db is less than 0, indicate partially blue, when coloration is partially red, partially green, partially yellow or inclined Lan Shi transfers preset information and carries out shooting prompt.
By the detection of chromaticity distortion detection module, following judging result is obtained:
K2< 1, it is normal that coloration is compared in expression;
K2>=1 indicates, there are colour cast, Da > 0, to indicate partially red;Da < 0 indicate partially green, Db > 0, indicate partially yellow;0 tables of Db < Show partially blue.
Embodiment 2:
As shown in fig. 6, present embodiments providing shooting environmental detection method, this method is applied in license camera, including Following steps:
S1, gravity accelerometer parameter information, gyro sensor parameter information, the direction magnetic for obtaining intelligent terminal Field sensor parameter information and luminance sensor parameter information;
S2, luminance information, sharpness information and the chromaticity distortion information for obtaining preview frame image;Luminance information, that is, brightness is different Constant coefficient K1With average luminance shift value DA, sharpness information, that is, sharpness factor DR, chromaticity distortion information, that is, coloration average value Da and Db, colour cast COEFFICIENT K2
S3, gravity accelerometer parameter information and direction magnetic field sensor parameter information according to intelligent terminal, sentence Whether disconnected intelligent terminal is in vertical state, specifically includes:
S31, according to the value of direction magnetic field sensor, calculate the Eulerian angles of direction magnetic field sensor;
S32, using the Eulerian angles of direction magnetic field sensor and the value of gravity accelerometer as initialization perpendicular attitude Value, obtains the droop of acceleration of gravity, as correction value, calculates between initialization perpendicular attitude value and correction value and value Or difference, the angle information value after being corrected;
S33, the angle information value after correcting and the difference between preset standard vertical angle angle value are calculated, obtains angular deviation Value, judges whether angu-lar deviation beyond preset value enters step S4 if it is not, then intelligent terminal is in vertical state;If so, Then intelligent terminal is not in vertical state, transfers preset information and carries out shooting prompt;
S4, the gyro sensor parameter information according to intelligent terminal, judge whether intelligent terminal has shake, specific to wrap It includes:
S41, the value of the gyro sensor of intelligent terminal is denoted as initial value, counter values is denoted as 0;
S42, when the value of gyro sensor changes, judge variation numerical value whether exceed preset deviation threshold Value, if so, counter values add 1, if it is not, counter values remain unchanged;
S43, in certain acquisition time, judge counter values whether exceed preset frequency threshold value, if it is not, then intelligence Terminal non-jitter, enters step S5;If so, intelligent terminal has shake, transfers preset information and carry out shooting prompt;
If the value of S5, luminance sensor is between 100 and 50000, S6 is entered step;If the value of luminance sensor is more than When 50000, judge that ambient light is excessively bright;If the value of luminance sensor is less than 100, judge that ambient light is excessively dark;Work as ambient light When line is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
S6, judge brightness exception COEFFICIENT K1Whether it is less than 1, if so, brightness uniformity is sufficient, enters step S7;If it is not, When average luminance shift value DA is more than 0, judge that ambient light is excessively bright, when average luminance shift value DA is less than 0, judges ambient light Line is excessively dark;When ambient light is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
If S7, sharpness factor DR are more than 14, judge preview frame image clearly, enter step S8;If clarity system When number DR is less than 10, then judges that preview frame image is fuzzy, transfer preset information and carry out shooting prompt;
S8, judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, enters step S9;If not, then it represents that There are colour casts, when coloration average value Da is more than 0, indicate partially red, when coloration average value Da is less than 0, indicate partially green, in coloration It when average value Db is more than 0, indicates partially yellow, when coloration average value Db is less than 0, indicates partially blue, when coloration is partially red, partially green, partially yellow Or it when partially blue, transfer preset information and carries out shooting prompt;
S9, prompt user can shoot.
In conclusion the license camera and method of the present invention by intelligent terminal whether vertical, intelligent terminal whether shake, Brightness whether uniformly sufficient, image whether clear, coloration detection whether devious, tune can be prompted the user to take a picture in time It is whole so that knowledge of the user without learning profession can meet the photograph of certificate photo standard by self-service shoot of intelligent terminal Piece.
The above, patent preferred embodiment only of the present invention, but the protection domain of patent of the present invention is not limited to This, any one skilled in the art is in the range disclosed in patent of the present invention, according to the skill of patent of the present invention Art scheme and its inventive concept are subject to equivalent substitution or change, belong to the protection domain of patent of the present invention.

Claims (14)

1. the license camera of shooting environmental shooting prompt can be carried out, it is characterised in that:The license camera includes:
Shooting environmental data obtaining module, for obtaining the gravity accelerometer parameter information of intelligent terminal, gyroscope passes Sensor parameter information, direction magnetic field sensor parameter information and luminance sensor parameter information, and obtain preview frame image Luminance information, sharpness information and chromaticity distortion information;Wherein, the luminance information for obtaining preview frame image, specifically includes:
The brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates brightness exception COEFFICIENT K1Peace Equal intensity deviation value DA;
Vertical state detection module, for the gravity accelerometer parameter information and direction magnetic field sensing according to intelligent terminal Device parameter information, judges whether intelligent terminal is in vertical state, if so, by detection, if it is not, then transferring preset information Carry out shooting prompt;
Dither state detection module is used for when intelligent terminal is in vertical state, according to the gyro sensor of intelligent terminal Parameter information, judges whether intelligent terminal has shake, if it is not, then being shot by detection if so, transferring preset information Prompt;
Brightness detection module is used for the luminance information of the luminance sensor parameter information and preview frame image according to intelligent terminal, Judge whether brightness is uniformly sufficient, if so, by detection, if it is not, then transferring preset information carries out shooting prompt;
Clarity detection module judges whether preview frame image is clear for the sharpness information according to preview frame image, if It is, then by detection, if it is not, then transferring preset information carries out shooting prompt;
Chromaticity distortion detection module, for according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, if it is not, Then by detection, if so, transferring preset information carries out shooting prompt;
The brightness detection module, including:
Luminance sensor detection unit, for by the value of luminance sensor respectively with a default high level and a predetermined low level into Row compare, if the value of luminance sensor it is default between high level and predetermined low level when, the value of luminance sensor meets the requirements;If When the value of luminance sensor is more than default high level, judge that ambient light is excessively bright;If the value of luminance sensor is less than predetermined low level, Judge that ambient light is excessively dark;When ambient light is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
Preview frame brightness of image detection unit, for when the value of luminance sensor meets the requirements, judging brightness exception COEFFICIENT K1It is It is no to be less than 1, if so, brightness uniformity is sufficient, pass through detection;If it is not, when average luminance shift value DA is more than 0, environment is judged Light is excessively bright, when average luminance shift value DA is less than 0, judges that ambient light is excessively dark;When ambient light is excessive lightness or darkness, adjust Preset information is taken to carry out shooting prompt.
2. the license camera according to claim 1 for carrying out shooting environmental shooting prompt, it is characterised in that:It is described vertical State detection module includes:
Eulerian angles computing unit calculates the Eulerian angles of direction magnetic field sensor for the value according to direction magnetic field sensor;
Angle information value computing unit, for using the Eulerian angles of direction magnetic field sensor and the value of gravity accelerometer as Perpendicular attitude value is initialized, the droop of acceleration of gravity is obtained, as correction value, initialization perpendicular attitude value is calculated and entangles Between positive value and value or difference, the angle information value after being corrected;
Vertical angle judging unit, for calculating the angle information value after correcting and the difference between preset standard vertical angle angle value Value, obtains angu-lar deviation, judges whether angu-lar deviation exceeds preset value, if it is not, then intelligent terminal is in vertical state, leads to Cross detection;If so, intelligent terminal is not in vertical state, transfers preset information and carry out shooting prompt.
3. the license camera according to claim 1 for carrying out shooting environmental shooting prompt, it is characterised in that:The shake State detection module includes:
Recording unit, for when intelligent terminal is in vertical state, the value of the gyro sensor of intelligent terminal to be denoted as just Counter values are denoted as 0 by initial value;
Deviation judging unit, for when the value of gyro sensor changes, judging the numerical value of variation whether beyond default Deviation threshold, if so, counter values add 1, if it is not, counter values remain unchanged;
Judging unit is shaken, in certain acquisition time, judging whether counter values exceed preset frequency threshold value, if No, then intelligent terminal non-jitter, passes through detection;If so, intelligent terminal has shake, transfers preset information and carry out shooting and carry Show.
4. the license camera according to claim 1 for carrying out shooting environmental shooting prompt, it is characterised in that:The acquisition The brightness histogram of preview frame image carries out data analysis to brightness histogram, calculates brightness exception COEFFICIENT K1And average brightness Deviant DA, specifically includes:
The brightness value that each pixel is read from preview frame image matrix counts the number of pixels of each brightness 0~255, and 128 are Median obtains the brightness histogram of preview frame image;
Data analysis is carried out to brightness histogram, calculates brightness integrated value:
Wherein, constant 128 is intensity deviation value;Col is the row of preview frame image matrix, and cols is maximum row;Row is preview The row of frame image matrix, rows are maximum row;Y (row, col) is the brightness value of certain point in preview frame image matrix; SumDA is intensity deviation summation of each pixel with respect to 128;
The intensity deviation summation acquired is averaging sum of all pixels, obtains average luminance shift value, is expressed as DA:
DA=SumDA/ (cols*rows)
The absolute value for taking average intensity deviation value DA, remembers D1
D1=abs (DA)
Brightness histogram is an array HIST [i], under be designated as brightness value, ranging from 0 to 255, cell value is the brightness value Number of pixels obtains:
Wherein, Mda is the intensity deviation value summation of each brightness degree of brightness histogram;
It takes absolute value, and averages to Mda:
M1=abs (Mda)/(cols*rows)
According to M1、D1, acquire brightness exception coefficient:
K1=D1/M1
Wherein, K1For brightness exception coefficient.
5. the license camera according to claim 1 for carrying out shooting environmental shooting prompt, it is characterised in that:The shooting Environment information acquisition module obtains the sharpness information of preview frame image, specifically includes:
The preview frame image of acquisition is converted into gray level image, obtains gray-scale map matrix, is calculated in gray-scale map matrix using following formula Luminance difference average value of each point with its consecutive points:
Wherein, θ (row, col) is adjacent 4 points brightness change curvature both horizontally and vertically, and Δ (row, col) is 2 points of luminance difference adjacent with certain point, col are gray-scale map matrix column, and cols is maximum row;Row is gray-scale map matrix Row, rows are maximum row, and DR is sharpness factor;
The clarity detection module judges whether preview frame image is clear, specifically according to the sharpness information of preview frame image Including:
Sharpness factor DR is compared with a predetermined low level and a default high level respectively, if sharpness factor DR is more than When default high level, then judges preview frame image clearly, pass through detection;If sharpness factor DR is less than predetermined low level, judge Preview frame image is fuzzy, transfers preset information and carries out shooting prompt.
6. the license camera according to claim 1 for carrying out shooting environmental shooting prompt, it is characterised in that:The shooting Environment information acquisition module obtains the chromaticity distortion information of preview frame image, specifically includes:
Preview frame image is converted into Lab color space images, count each pixel Lab color space images a axis and b axis Coloration average value Da and Db colour cast COEFFICIENT K is calculated according to coloration average value Da and Db2
The chromaticity distortion detection module according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, it is specific to wrap It includes:
Judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, passes through detection;If not, then it represents that there are colour cast, It when coloration average value Da is more than 0, indicates partially red, when coloration average value Da is less than 0, indicates partially green, in coloration average value Db When more than 0, indicate partially yellow, when coloration average value Db is less than 0, indicate partially blue, when coloration is partially red, it is partially green, partially yellow or partially blue when, It transfers preset information and carries out shooting prompt.
7. the license camera according to claim 6 for carrying out shooting environmental shooting prompt, it is characterised in that:It is described will be pre- Frame image of looking at is converted to Lab color space images, and it is flat in a axis of Lab color space images and the coloration of b axis to count each pixel Mean value Da and Db calculate colour cast COEFFICIENT K according to coloration average value Da and Db2, specifically include:
Preview frame image is converted into Lab color space images, each pixel is counted in Lab color space images using following formula Coloration the average value Da and Db of a axis and b axis:
Wherein, Vec3b (row, col) is the structure read on the Lab color spaces of a pixel, its first is brightness Value, second is a axis values of Lab, and third position is the b axis values of Lab;Col is Lab color space image matrix columns, and cols is Maximum row;Row is the row of Lab color space images, and rows is maximum row;Constant 128 is intensity deviation value;
Calculate the variance yields D of a axis and b axis average values2
Brightness histogram HIST_A and HIST_B of the image on a axis and b axis are calculated, two groups of brightness histograms there are 256 respectively Statistical value;
Ask the average value Ma and Mb of a axis and b axis aberration:
Seek colour cast total value M2
According to variance yields D2With colour cast total value M2, acquire colour cast coefficient:
K2=D2/M2
Wherein, K2For colour cast coefficient.
8. shooting environmental detection method is applied in license camera, it is characterised in that:The method includes:
The license camera obtain the gravity accelerometer parameter information of intelligent terminal, gyro sensor parameter information, Direction magnetic field sensor parameter information and luminance sensor parameter information, and obtain the luminance information, clear of preview frame image Spend information and chromaticity distortion information;Wherein, the luminance information for obtaining preview frame image, specifically includes:
The brightness histogram for obtaining preview frame image carries out data analysis to brightness histogram, calculates brightness exception COEFFICIENT K1Peace Equal intensity deviation value DA;
The license camera is believed according to the gravity accelerometer parameter information and direction magnetic field sensor parameter of intelligent terminal Breath, judges whether intelligent terminal is in vertical state, if so, by detection, is shot if it is not, then transferring preset information Prompt;
The license camera is when intelligent terminal is in vertical state, according to the gyro sensor parameter information of intelligent terminal, Judge whether intelligent terminal has shake, if it is not, then by detection, if so, transferring preset information carries out shooting prompt;
The license camera judges bright according to the luminance information of the luminance sensor parameter information and preview frame image of intelligent terminal Whether degree is uniformly sufficient, if so, by detection, if it is not, then transferring preset information carries out shooting prompt;
The license camera judges whether preview frame image is clear, if so, passing through according to the sharpness information of preview frame image Detection, if it is not, then transferring preset information carries out shooting prompt;
The license camera according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, if it is not, then passing through inspection It surveys, if so, transferring preset information carries out shooting prompt;
The license camera judges bright according to the luminance information of the luminance sensor parameter information and preview frame image of intelligent terminal Whether degree is uniformly sufficient, specifically includes:
The value of luminance sensor is compared with a default high level and a predetermined low level respectively, if the value of luminance sensor It is default between high level and predetermined low level when, then the value of luminance sensor meets the requirements;If the value of luminance sensor is more than default When high level, judge that ambient light is excessively bright;If the value of luminance sensor is less than predetermined low level, judge that ambient light is excessively dark;Work as ring When border light is excessive lightness or darkness, transfers preset information and carry out shooting prompt;
When the value of luminance sensor meets the requirements, brightness exception COEFFICIENT K is judged1Whether 1 is less than, if so, brightness uniformity fills Foot, passes through detection;If it is not, when average luminance shift value DA is more than 0, judge that ambient light is excessively bright, in average luminance shift value When DA is less than 0, judge that ambient light is excessively dark;When ambient light is excessive lightness or darkness, transfers preset information and carry out shooting prompt.
9. shooting environmental detection method according to claim 8, it is characterised in that:The license camera is according to intelligent terminal Gravity accelerometer parameter information and direction magnetic field sensor parameter information, judge intelligent terminal whether be in vertical shape State specifically includes:
According to the value of direction magnetic field sensor, the Eulerian angles of direction magnetic field sensor are calculated;
Using the Eulerian angles of direction magnetic field sensor and the value of gravity accelerometer as initialization perpendicular attitude value, weighed The droop of power acceleration calculates between initialization perpendicular attitude value and correction value and value or difference, obtains as correction value Angle information value after to correction;
The angle information value after correcting and the difference between preset standard vertical angle angle value are calculated, angu-lar deviation is obtained, is judged Whether angu-lar deviation beyond preset value passes through detection if it is not, then intelligent terminal is in vertical state;If so, intelligent terminal It is not in vertical state, preset information is transferred and carries out shooting prompt.
10. shooting environmental detection method according to claim 8, it is characterised in that:The license camera is in intelligent terminal When in vertical state, according to the gyro sensor parameter information of intelligent terminal, judge whether intelligent terminal has shake, specifically Including:
When intelligent terminal is in vertical state, the value of the gyro sensor of intelligent terminal is denoted as initial value, by counter Numerical value is denoted as 0;
When the value of gyro sensor changes, judge whether the numerical value of variation exceeds preset deviation threshold, if so, Counter values add 1, if it is not, counter values remain unchanged;
In certain acquisition time, judge whether counter values exceed preset frequency threshold value, if it is not, then intelligent terminal is without trembling It is dynamic, pass through detection;If so, intelligent terminal has shake, transfers preset information and carry out shooting prompt.
11. shooting environmental detection method according to claim 8, it is characterised in that:It is described to obtain the bright of preview frame image Histogram is spent, data analysis is carried out to brightness histogram, calculates brightness exception COEFFICIENT K1It is specific to wrap with average luminance shift value DA It includes:
The brightness value that each pixel is read from preview frame image matrix counts the number of pixels of each brightness 0~255, and 128 are Median obtains the brightness histogram of preview frame image;
Data analysis is carried out to brightness histogram, calculates brightness integrated value:
Wherein, constant 128 is intensity deviation value;Col is the row of preview frame image matrix, and cols is maximum row;Row is preview The row of frame image matrix, rows are maximum row;Y (row, col) is the brightness value of certain point in preview frame image matrix; SumDA is intensity deviation summation of each pixel with respect to 128;
The intensity deviation summation acquired is averaging sum of all pixels, obtains average luminance shift value, is expressed as DA:
DA=SumDA/ (cols*rows)
The absolute value for taking average intensity deviation value DA, remembers D1
D1=abs (DA)
Brightness histogram is an array HIST [i], under be designated as brightness value, ranging from 0 to 255, cell value is the brightness value Number of pixels obtains:
Wherein, Mda is the intensity deviation value summation of each brightness degree of brightness histogram;
It takes absolute value, and averages to Mda:
M1=abs (Mda)/(cols*rows)
According to M1、D1, acquire brightness exception coefficient:
K1=D1/M1
Wherein, K1For brightness exception coefficient.
12. shooting environmental detection method according to claim 8, it is characterised in that:The license camera obtains preview frame The sharpness information of image, specifically includes:
The preview frame image of acquisition is converted into gray level image, obtains gray-scale map matrix, is calculated in gray-scale map matrix using following formula Luminance difference average value of each point with its consecutive points:
Wherein, θ (row, col) is adjacent 4 points brightness change curvature both horizontally and vertically, and Δ (row, col) is 2 points of luminance difference adjacent with certain point, col are gray-scale map matrix column, and cols is maximum row;Row is gray-scale map matrix Row, rows are maximum row, and DR is sharpness factor;
The license camera judges whether preview frame image is clear, specially according to the sharpness information of preview frame image:
Sharpness factor DR is compared with a predetermined low level and a default high level respectively, if sharpness factor DR is more than When default high level, then judges preview frame image clearly, pass through detection;If sharpness factor DR is less than predetermined low level, judge Preview frame image is fuzzy, transfers preset information and carries out shooting prompt.
13. shooting environmental detection method according to claim 8, it is characterised in that:The license camera obtains preview frame The chromaticity distortion information of image, specifically includes:
Preview frame image is converted into Lab color space images, count each pixel Lab color space images a axis and b axis Coloration average value Da and Db colour cast COEFFICIENT K is calculated according to coloration average value Da and Db2
The license camera according to the chromaticity distortion information of preview frame image, judge coloration whether deviation, specifically include:
Judge colour cast COEFFICIENT K2Whether it is less than 1, if so, indicating that coloration is normal, passes through detection;If not, then it represents that there are colour cast, It when coloration average value Da is more than 0, indicates partially red, when coloration average value Da is less than 0, indicates partially green, in coloration average value Db When more than 0, indicate partially yellow, when coloration average value Db is less than 0, indicate partially blue, when coloration is partially red, it is partially green, partially yellow or partially blue when, It transfers preset information and carries out shooting prompt.
14. shooting environmental detection method according to claim 13, it is characterised in that:It is described to be converted to preview frame image Lab color space images count each pixel in a axis of Lab color space images and coloration the average value Da and Db of b axis, root According to coloration average value Da and Db, colour cast COEFFICIENT K is calculated2, specifically include:
Preview frame image is converted into Lab color space images, each pixel is counted in Lab color space images using following formula Coloration the average value Da and Db of a axis and b axis:
Wherein, Vec3b (row, col) is the structure read on the Lab color spaces of a pixel, its first is brightness Value, second is a axis values of Lab, and third position is the b axis values of Lab;Col is Lab color space image matrix columns, and cols is Maximum row;Row is the row of Lab color space images, and rows is maximum row;Constant 128 is intensity deviation value;
Calculate the variance yields D of a axis and b axis average values2
Brightness histogram HIST_A and HIST_B of the image on a axis and b axis are calculated, two groups of brightness histograms there are 256 respectively Statistical value;
Ask the average value Ma and Mb of a axis and b axis aberration:
Seek colour cast total value M2
According to variance yields D2With colour cast total value M2, acquire colour cast coefficient:
K2=D2/M2
Wherein, K2For colour cast coefficient.
CN201510547356.1A 2015-08-31 2015-08-31 It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt Active CN105049734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510547356.1A CN105049734B (en) 2015-08-31 2015-08-31 It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510547356.1A CN105049734B (en) 2015-08-31 2015-08-31 It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt

Publications (2)

Publication Number Publication Date
CN105049734A CN105049734A (en) 2015-11-11
CN105049734B true CN105049734B (en) 2018-08-24

Family

ID=54455899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510547356.1A Active CN105049734B (en) 2015-08-31 2015-08-31 It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt

Country Status (1)

Country Link
CN (1) CN105049734B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933606B (en) * 2016-05-24 2019-09-20 青岛海信移动通信技术股份有限公司 The method, device and mobile terminal taken pictures
CN106454089A (en) * 2016-10-08 2017-02-22 广东小天才科技有限公司 Photographing reminding method and device for camera
CN106652228A (en) * 2016-11-24 2017-05-10 广州市华标科技发展有限公司 Self-service type snapshooting equipment and method
CN108307142A (en) * 2017-01-12 2018-07-20 中兴通讯股份有限公司 A kind of video recording method, device and terminal
CN106843706B (en) * 2017-01-19 2020-02-07 北京小米移动软件有限公司 Shutdown control method and device and terminal equipment
CN107690049A (en) * 2017-02-20 2018-02-13 深圳红瓜子文化传媒科技有限公司 The preparation method and system of panoramic pictures
CN107424128B (en) * 2017-06-20 2020-12-29 南京泰立瑞信息科技有限公司 Method and system for extracting clear image frame from recorded eye fundus video
CN107508942A (en) * 2017-10-11 2017-12-22 上海展扬通信技术有限公司 A kind of image capturing method and image capturing apparatus based on intelligent terminal
CN109587403A (en) * 2019-01-30 2019-04-05 北京朗镜科技有限责任公司 A kind of shooting bootstrap technique and device
CN110113538B (en) * 2019-06-12 2021-07-16 北京百度网讯科技有限公司 Intelligent shooting equipment, intelligent control method and device
CN110996004A (en) * 2019-12-17 2020-04-10 深圳前海环融联易信息科技服务有限公司 Standard imaging method and device based on WeChat applet
CN111327831B (en) * 2020-03-30 2021-09-10 北京智美智学科技有限公司 Image acquisition method and device for UGC, electronic equipment and system
CN112351199A (en) * 2020-09-30 2021-02-09 深圳点猫科技有限公司 Test paper image acquisition method, device and equipment
CN112215232B (en) * 2020-10-10 2023-10-24 平安科技(深圳)有限公司 Certificate verification method, device, equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1133633A (en) * 1993-10-26 1996-10-16 旭化成工业株式会社 Method of and apparatus for measuring nonuniformity of glossiness and thickness of printed image
CN101216881A (en) * 2007-12-28 2008-07-09 北京中星微电子有限公司 A method and device for automatic image acquisition
CN1831519B (en) * 2005-03-10 2010-05-12 富士施乐株式会社 Brightness measuring apparatus and measuring method thereof
CN103051836A (en) * 2012-12-14 2013-04-17 中兴通讯股份有限公司 Anti-shake photographing method and anti-shake photographing device for mobile terminal
CN103813103A (en) * 2014-03-10 2014-05-21 厦门美图之家科技有限公司 Method and device for anti-shaking picture taking of mobile terminal
CN103945043A (en) * 2013-01-21 2014-07-23 联想(北京)有限公司 Photographic method and electronic device
CN104092938A (en) * 2014-06-26 2014-10-08 刘永健 Gravity-sensing photographing method and system
CN104427114A (en) * 2013-09-03 2015-03-18 中兴通讯股份有限公司 Shooting method, shooting device and mobile terminal
WO2015039816A1 (en) * 2013-09-19 2015-03-26 Selex Es Ltd Camera
CN104655403A (en) * 2014-01-29 2015-05-27 广西科技大学 Luminance uniformity test method of dot-matrix light source
CN104796619A (en) * 2015-05-05 2015-07-22 深圳市欧珀通信软件有限公司 Photographing method and device and mobile terminal
CN104869317A (en) * 2015-06-02 2015-08-26 广东欧珀移动通信有限公司 Intelligent device shooting method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1133633A (en) * 1993-10-26 1996-10-16 旭化成工业株式会社 Method of and apparatus for measuring nonuniformity of glossiness and thickness of printed image
CN1831519B (en) * 2005-03-10 2010-05-12 富士施乐株式会社 Brightness measuring apparatus and measuring method thereof
CN101216881A (en) * 2007-12-28 2008-07-09 北京中星微电子有限公司 A method and device for automatic image acquisition
CN103051836A (en) * 2012-12-14 2013-04-17 中兴通讯股份有限公司 Anti-shake photographing method and anti-shake photographing device for mobile terminal
CN103945043A (en) * 2013-01-21 2014-07-23 联想(北京)有限公司 Photographic method and electronic device
CN104427114A (en) * 2013-09-03 2015-03-18 中兴通讯股份有限公司 Shooting method, shooting device and mobile terminal
WO2015039816A1 (en) * 2013-09-19 2015-03-26 Selex Es Ltd Camera
CN104655403A (en) * 2014-01-29 2015-05-27 广西科技大学 Luminance uniformity test method of dot-matrix light source
CN103813103A (en) * 2014-03-10 2014-05-21 厦门美图之家科技有限公司 Method and device for anti-shaking picture taking of mobile terminal
CN104092938A (en) * 2014-06-26 2014-10-08 刘永健 Gravity-sensing photographing method and system
CN104796619A (en) * 2015-05-05 2015-07-22 深圳市欧珀通信软件有限公司 Photographing method and device and mobile terminal
CN104869317A (en) * 2015-06-02 2015-08-26 广东欧珀移动通信有限公司 Intelligent device shooting method and device

Also Published As

Publication number Publication date
CN105049734A (en) 2015-11-11

Similar Documents

Publication Publication Date Title
CN105049734B (en) It can carry out the license camera and shooting environmental detection method of shooting environmental shooting prompt
CN106596073B (en) Method and system for detecting image quality of optical system and test target
CN108537155B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110717942B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN111885311B (en) Method and device for adjusting exposure of infrared camera, electronic equipment and storage medium
WO2019011147A1 (en) Human face region processing method and apparatus in backlight scene
Jakubiec et al. Accurate measurement of daylit interior scenes using high dynamic range photography
CN109685853B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN105812790B (en) Method for evaluating verticality between photosensitive surface and optical axis of image sensor and optical test card
US11233948B2 (en) Exposure control method and device, and electronic device
CN107481186A (en) Image processing method, device, computer-readable recording medium and computer equipment
CN109242794B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111323125B (en) Temperature measurement method and device, computer storage medium and electronic equipment
WO2019029573A1 (en) Image blurring method, computer-readable storage medium and computer device
CN108053438A (en) Depth of field acquisition methods, device and equipment
CN113545028B (en) Gain control for facial authentication
CN108769505A (en) A kind of image procossing set method and electronic equipment
CN105913414A (en) Calibration device for infrared camera visual system and calibration method
Wilburn et al. Radiometric calibration using temporal irradiance mixtures
CN112544076B (en) Method and system for mapping non-uniformities of image sensors
US20030012435A1 (en) Apparatus and method for machine vision
US20040151486A1 (en) Camera with indication of measure of focus as a function of focal distance
CN102209202B (en) Gamma correction curve extraction method for camera
CN116439652A (en) Diopter detection method, diopter detection device, upper computer and diopter detection system
CN109561292A (en) A kind of white balancing treatment method and device for camera system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant