The calibration method and system of camera in mobile terminal
Technical field
The present invention relates to a kind of calibration method of the camera in technical field of electronic equipment, more particularly to mobile terminal and
System.
Background technology
With the development of mobile communication, camera module is designed with most mobile terminal, due to camera module
There is the tolerance in terms of machine-building, physical property in process of production so that the same a batch of camera mould produced
It can be had differences in terms of shooting quality between group.The method for solving those differences in the prior art is typically in camera module
In increase extra storage chip to store unified calibration information, however, more or less all can with a batch of mobile terminal
There is the difference in terms of photographic quality, therefore, the unified calibration information of storage is still difficult to ensure that the mobile terminal after assembling is shining
Uniformity in phase quality, also, for the camera module of low and middle-end, it is contemplated that the cost factor of storage chip, its
This species diversity can be more caused to increase.
The content of the invention
The technical problem to be solved in the present invention is to be deposited to overcome between the camera module of the mobile terminal of prior art
In the difference of photographic quality, it is difficult to which ensureing the defect of uniformity of the mobile terminal on photographic quality, there is provided a kind of mobile terminal
The calibration method and system of interior camera.
The present invention is to solve above-mentioned technical problem by following technical proposals:
A kind of calibration method of camera in mobile terminal, including:
Mobile terminal shoots the colour atla under setting light source irradiation, and the picture transfer of the colour atla of shooting to processing is set
It is standby;
The processing equipment is contrasted the picture with a default picture, and generates the calibration parameter of the picture
Value, the calibration parameter value includes white balance calibration value and Lens Shading Compensation value;
The processing equipment transmits the calibration parameter value to the mobile terminal to store.
In this programme, white balance refers to that white can show white under any scene, and camera lens shade refers to shine
The unnecessary shade produced during the lens shooting picture of camera, white balance calibration value refers to carry out white balance calibration generation
Calibration value, and Lens Shading Compensation value refers to that compensation is taken pictures picture dash area through camera lens so that the brightness of overall picture becomes
In average value., can be pointedly by shooting colour atla in the case of having there is photograph difference between camera module
The adaptable calibration information of the practical photograph shot with the mobile terminal is generated to each mobile terminal, even if each mobile terminal sheet
There is photographic quality difference in body, but the calibration of practical photograph is all carried out to each mobile terminal so that each mobile terminal is in photograph
High consistency can be finally kept in quality.
It is preferred that the processing equipment is contrasted the picture with a default picture, and generate the school of the picture
Quasi- parameter value includes:
The processing equipment extracts the color parameter and luminance parameter of the picture, and by the color parameter and described bright
Spend color parameter and luminance parameter of the parameter respectively with the default picture to be contrasted, and generate the calibration parameter of the picture
Value.
In this programme, color parameter refers under certain color mode, and the color of the picture is under the color mode
Component value, and luminance parameter is the parameter extracted for Lens Shading Compensation value, the luminance parameter refers to whole picture Nei Ge areas
The set of the brightness value in domain, because the picture of shooting there may be the dash area that should not occur, causes the picture shot to exist
The brightness in each region is inconsistent, and such as bright surrounding in center is dark so that overall picture brightness disproportionation one.The application extracts luminance parameter
Purpose is aiming at the phenomenon of brightness disproportionation one to compensate so that overall picture brightness reaches unanimity.In the way of extracting parameter
To generate calibration information, pointedly defect of the picture in terms of some parameters can be calibrated, can quickly obtain figure
The calibration information of those parameters is directed in piece.
It is preferred that the processing equipment is contrasted the picture with a default picture, and generate the school of the picture
Quasi- parameter value includes:
First ratio of three components of RGB in the white balance of the processing equipment extraction picture;
Ratio is corresponding with first ratio is multiplied to obtain the white of the default picture by an adjustment for the processing equipment
Second ratio of three components of RGB in balance, and it regard the adjustment ratio as the white balance calibration value.
Wherein, the ratio of the color component in the color parameter by extracting picture, can quickly obtain white balance calibration
Value.
It is preferred that the mobile terminal starts camera after the shooting instruction that the processing equipment is sent is received, and
Shoot the colour atla under setting light source irradiation.
Shot by peripheral equipment control, enable to the picture of the colour atla shot to be more suitable for the picture of calibration.
It is preferred that the mobile terminal stores the calibration parameter value to nvram memories (Non-Volatile
Random Access Memory, nonvolatile random access memory refers to a kind of RAM for remaining to keep data after power-off)
In, and/or, the colour atla (is that one kind is used to assess to camera, camera and correction provides standard sources environment for DNP light boxs
Equipment) gray card that provides or white card.
When calibration parameter value is stored in nvram memories, without adding, extra chip stores calibration parameter value,
Only need the flash memory of mobile terminal itself to store, reduce the occupancy of storage chip.And the color provided using DNP light boxs
Card, using the teaching of the invention it is possible to provide better calibration environment, to generate more accurate calibration parameter value.
It is preferred that the calibration parameter value is stored in local file by the processing equipment, and to transmit file
The mode of folder transmits the calibration parameter value to the mobile terminal to store.And in the way of file is transmitted, can
Ensure the data integrity of transmission calibration parameter value.
The present invention also provides a kind of calibration system of the camera in mobile terminal, including mobile terminal and processing equipment,
The mobile terminal includes taking module and the first transport module, and the processing equipment includes generation module and the second transmission mould
Block;
The taking module is used to shoot the colour atla under setting light source irradiation;
First transport module is used for the picture transfer of the colour atla of shooting to the processing equipment;
The generation module is used to be contrasted the picture with a default picture, and generates the calibration ginseng of the picture
Numerical value;
Second transport module is used to transmit the calibration parameter value to the mobile terminal to store;
The calibration parameter value includes white balance calibration value and Lens Shading Compensation value.
It is preferred that the generation module includes extraction module and contrast module;
The extraction module is used for the color parameter and luminance parameter for extracting the picture;
The contrast module is used for the color by the color parameter and the luminance parameter respectively with the default picture
Parameter and luminance parameter are contrasted, and generate the calibration parameter value of the picture.
It is preferred that the extraction module is used for the first ratio for extracting three components of RGB in the white balance of the picture
Value;
For one to be adjusted, ratio is corresponding with first ratio to be multiplied to obtain the default picture contrast module
White balance in three components of RGB the second ratio, and using it is described adjustment ratio be used as the white balance calibration value.
It is preferred that first transport module be additionally operable to receive called after the shooting instruction that the processing equipment is sent it is described
Taking module.
The positive effect of the present invention is:, can be pointedly to each mobile whole by shooting specific colour atla
The end generation calibration information adaptable with the practical photograph that the mobile terminal is shot so that each mobile terminal on photographic quality most
High consistency can be kept eventually, and pointedly defect of the picture in terms of some parameters is calibrated, and can quickly be obtained
Obtain the calibration information that those parameters are directed in picture.In addition, storing calibration parameter value using the flash memory of mobile terminal itself, subtract
The occupancy of extra storage chip is lacked.
Brief description of the drawings
Fig. 1 is the flow chart of the calibration method of the camera in the mobile terminal of the embodiment of the present invention 1.
Fig. 2 is the flow chart of the calibration method of the camera in the mobile terminal of the embodiment of the present invention 2.
Fig. 3 is the flow chart of the calibration method of the camera in the mobile terminal of the embodiment of the present invention 3.
Fig. 4 uses the calibration method of embodiment 1 for the calibration system of the camera in the mobile terminal of the embodiment of the present invention 4
The structural representation being operated.
Fig. 5 uses the calibration method of embodiment 2 for the calibration system of the camera in the mobile terminal of the embodiment of the present invention 4
The structural representation being operated.
Fig. 6 is the schematic diagram of the part-structure in mobile phone and PC in the calibration system of the embodiment of the present invention 4.
Embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to described reality
Apply among a scope.
Embodiment 1
The present embodiment provides a kind of calibration method of the camera in mobile terminal, as shown in figure 1, including:
Step 101, mobile terminal shoot the colour atla under setting light source irradiation, and by the picture transfer of the colour atla of shooting
To processing equipment.
Step 102, the processing equipment are contrasted the picture with a default picture, and generate the school of the picture
Quasi- parameter value.
The calibration parameter value includes white balance calibration value and Lens Shading Compensation value;
Step 103, the processing equipment transmit the calibration parameter value to mobile terminal to store.
The camera module of mobile terminal generally includes camera, motor and flexible PCB of photograph etc..At present, greatly
Part mobile terminal simply assembles camera module on mobile terminals when production line is assembled, due to production in production
There is photograph difference in the camera module gone out, therefore, need to carry out school to the camera module in the mobile terminal after assembling
Standard, is actually also that the taking module in mobile terminal is calibrated.
In the case that the present embodiment has had photograph difference between camera module, by shooting colour atla, Neng Gouzhen
The adaptable calibration information of the practical photograph shot with the mobile terminal is generated to each mobile terminal to property, even if each movement
There is photographic quality difference in terminal, but the calibration of practical photograph is all carried out to each mobile terminal in itself so that each mobile terminal
High consistency can be finally kept on photographic quality.
Embodiment 2
The present embodiment provides a kind of calibration method of the camera in mobile terminal, as shown in Fig. 2 the present embodiment and implementation
The difference of example 1 is that step 102 is:
Step 102a, the processing equipment generate the calibration parameter of the picture by way of extracting the parameter in picture
Value.
Specifically, the processing equipment extracts the color parameter and luminance parameter of the picture, and by the color parameter
Color parameter and luminance parameter with the luminance parameter respectively with the default picture are contrasted, and generate the picture
Calibration parameter value.
Wherein, color parameter refers under certain color mode, the component value of the color of the picture under the color mode,
Such as, under RGB patterns, R component in the color of picture, G components and the respective colour of B component, under CMYK patterns, the face of picture
C components in color, M components, Y-component and the respective colour of K components.The present embodiment color mode can for RGB patterns, CMYK patterns,
HSB patterns, Lab color modes, pattern bitmap, grayscale mode, Indexed Color mode, duotone mode and multi-channel mode.
The luminance parameter refers to the set of the brightness value in each region in whole picture, because the picture of shooting there may be not
The dash area that should occur, causes the picture shot to there is a situation where that the brightness in each region is inconsistent, and the bright surrounding in such as center is dark, makes
Obtain overall picture brightness disproportionation one.The application extract luminance parameter purpose aiming at the phenomenon of brightness disproportionation one to compensate,
So that overall picture brightness reaches unanimity.When being contrasted with the luminance parameter of default picture, then the camera lens institute by camera is can compensate for
The defect of brightness disproportionation one in the picture of generation.
Difference is also resided in, and the mobile terminal stores the calibration parameter value into nvram memories, and the colour atla
The calibration parameter value is stored in local file by the gray card provided for DNP light boxs, the processing equipment, and to transmit
The mode of file transmits the calibration parameter value to mobile terminal to store.
The present embodiment can increase DNP light boxs, DNP light boxs can provide use when implementing on the production line of mobile terminal
In the specific light source of calibration, to form specific luminous environment so that can more accurately obtain calibration parameter value during calibration,
DNP light boxs are provided with gray card, in calibration, mobile terminal complete machine is placed on the fixture of light box, passes through wired (such as USB) or nothing
The mode of line connection connects mobile terminal and processing equipment, then restarts DNP light boxs, mobile terminal-opening simultaneously starts photograph
Machine shoots the gray card under the luminous environment, and the picture of shooting is the picture of raw forms, that is to say the original graph without any processing
Piece.And processing equipment can then generate calibration parameter value and transmit according to the original image.
The present embodiment generates calibration information while the effect of embodiment 1 is reached in the way of extracting parameter, can
Pointedly defect of the picture in terms of some parameters is calibrated, such as, can in terms of the color performance and in terms of brightness
It is quick to obtain the calibration parameter value that those parameters are directed in picture.Also, the present embodiment in camera module without increasing volume
Outer storage chip stores calibration parameter value, need to only be stored using the nvram memories of mobile terminal itself, reduction
The occupancy of storage chip.And in the way of file is transmitted, ensure that the data integrity of transmission calibration parameter value.
Embodiment 3
The present embodiment provides a kind of calibration method of the camera in mobile terminal, as shown in figure 3, the present embodiment and implementation
The difference of example 2 is that step 102a is:
Step 102b, the processing equipment by way of three components of RGB for extracting picture generating the picture
White balance calibration value.
Specifically, the processing equipment extracts first ratio of three components of RGB in the white balance of the picture;Institute
State processing equipment and be multiplied to obtain red green in the white balance of the default picture by an adjustment ratio is corresponding with first ratio
Second ratio of blue three components, and it regard the adjustment ratio as the white balance calibration value.
Such as, the first ratio of the picture that mobile terminal is shot is 1:1.2:1.5, and the second ratio is 1:1:1, therefore,
The adjustment ratio that can be generated is 6:5:4, obtain 6 to cause adjustment ratio to be multiplied respectively with the first ratio:6:6, so as to be equivalent to
1:1:1.In consideration of it, under the premise of distortionless, the adjustment ratio can also be 6:5:4 small several times or integral multiple, due to default
Second ratio of picture is it has been determined that in order that white balance calibration value is more accurate, it will usually use the least common multiple of the first ratio
Count to calibrate, 6 in such as the present embodiment:5:4.
And the implementation of the white balance calibration value of the present embodiment also can transform to calculate the ratio of two components in rgb value
Value, such as after tri- component values of RGB are obtained, obtains that (G/R) * 512 is designated as RG_ratio and (G/B) * 512 is designated as BG_ratio,
And the ratio of two components in the white balance of default picture in RGB, it can also derive from by statistical analysis, with normal distribution side
The G/R ratios and G/B ratios set in the standard camera module that formula is obtained, such as obtains the RGB that picture is preset in standard module
Value is represented with R_golden, G_golden, B_golden respectively, is obtained (G_golden/R_golden) * 512, is designated as
RGgolden_ratio, and (G_golden/B_golden) * 512, are designated as BGgolden_ratio.Finally, white balance calibration value
The programs of acquisition modes judge to be in the following manner:
R_gain=(RGgolden_ratio*512)/RG_ratio;
B_gain=(BGgolden_ratio*512)/BG_ratio;
G_gain=512;
Ratio is amplified, calculating is more convenient.
Above-mentioned judgement is used to obtain the minimum value in ratio R _ gain, B_gain and G_gain, is represented with Base_gain.
R_gain=0x200*R_gain/Base_gain
B_gain=0x200*B_gain/Base_gain
G_gain=0x200*G_gain/Base_gain
Wherein, 0x200 is the numerical value that 16 systems are represented, changes decimal system duration into 512, finally gives white balance calibration value
R_gain, B_gain and G_gain.
That is, being in the side of the ratio of three components above by the mode of the ratio of two components in rgb value
The corresponding conversion done on the basis of formula, and the acquisition for white balance calibration value is parameter value with standard value and photo current
The proportionate relationship formed is what Computing Principle was obtained, and the implementation does not limit the protection domain of the application, and only
The white balance calibration value to be obtained according to the Computing Principle of the present embodiment, in the protection domain of the application.
Difference is also resided in:Also include before step 101:
Step 100, the mobile terminal start camera after the shooting instruction that the processing equipment is sent is received, and
Shoot the colour atla under setting light source irradiation.
The present embodiment is while the effect of embodiment 2 is reached, moreover it is possible to by extracting three points of RGB under RGB patterns
The ratio of amount, can quickly obtain white balance calibration value, and be shot by peripheral equipment control, enable to the figure of colour atla shot
Piece is more suitable for the picture of calibration.
Embodiment 4
The present embodiment provides a kind of calibration system of the camera in mobile terminal, as shown in figure 4, including mobile terminal 1
With processing equipment 2, the mobile terminal includes the transport module 12 of taking module 11 and first, and the processing equipment includes generation mould
The transport module 22 of block 21 and second;
The taking module 11 is used to shoot the colour atla under setting light source irradiation;
First transport module 12 is used for the picture transfer of the colour atla of shooting to the processing equipment;
The generation module 21 is used to be contrasted the picture with a default picture, and generates the calibration of the picture
Parameter value;
Second transport module 22 is used to transmit the calibration parameter value to mobile terminal to store;
The calibration parameter value includes white balance calibration value and Lens Shading Compensation value.
Calibration system in the present embodiment can both use any one calibration method in above-described embodiment 1-3 to be operated,
In the case where not producing contradiction, any combination of embodiment 1-3 technical scheme, or the skill that the present invention is protected can be also used
Any combinations of art scheme are operated, and it is not limited the scope of the invention.
When being operated using the calibration method of embodiment 1, pointedly each mobile terminal can be generated with being somebody's turn to do
The calibration information that the practical photograph that mobile terminal is shot is adapted so that each mobile terminal, particularly with the movement of same batch
Terminal, can finally keep high consistency on photographic quality.
When being operated using the calibration method of embodiment 2, as shown in figure 5, the generation module 21 includes extracting mould
Block 211 and contrast module 212;
The extraction module 211 is used for the color parameter and luminance parameter for extracting the picture;
The contrast module 212 is used for the face by the color parameter and the luminance parameter respectively with the default picture
Color parameter and luminance parameter are contrasted, and generate the calibration parameter value of the picture.
The technique effect of acquisition is:Pointedly defect of the picture in terms of some parameters can be calibrated, and nothing
Extra storage chip need to be increased in camera module to store calibration parameter value, mobile terminal itself need to be only utilized
Nvram memories are stored, and reduce the occupancy of storage chip, moreover it is possible to ensure in the way of file is transmitted transmission calibration
The data integrity of parameter value.
When being operated using the calibration method of embodiment 3, the extraction module 211 is used to extract the white of the picture
First ratio of three components of RGB in balance;
For one to be adjusted, ratio is corresponding with first ratio to be multiplied to obtain the default figure contrast module 212
Second ratio of three components of RGB in the white balance of piece, and it regard the adjustment ratio as the white balance calibration value.
First transport module 12 is additionally operable to call the shooting after receiving the shooting instruction that the processing equipment is sent
Module 11.
The technique effect of acquisition is:By extracting RGB component value, white balance calibration value can be quickly obtained, and by outside
Equipment control is shot, and enables to the picture of the colour atla shot to be more suitable for the picture of calibration.
In above-described embodiment 1-4, the mobile terminal can be to include mobile phone, tablet personal computer, PDA (Personal
Digital Assistant, personal digital assistant), POS (Point of Sales, point-of-sale terminal), the terminal such as vehicle-mounted computer set
Standby, the mobile terminal needs camera module.And processing equipment can be PC, the equipment that server etc. has data processing function.
Using mobile terminal as mobile phone, processing equipment is exemplified by PC, Fig. 6 is illustrated that and movement provided in an embodiment of the present invention
The system that the block diagram of the block diagram of the part-structure of the related mobile phone 1 of terminal and PC2 part-structure is constituted.
Mobile phone 1 may include controller 13, transceiver 14, communication interface 15, camera module 16 and memory 17, memory
17 can be nvram memories, and the taking module 11 in embodiment 4 can have the camera module 16 including camera
Function, to be taken pictures, the first transport module 12 can have the function of transceiver 14 and communication interface 15, to realize the biography of data
Defeated, controller 13 is the control centre of mobile phone 1, using various interfaces and the various pieces of connection whole mobile phone, passes through fortune
Row performs the software program and/or module being stored in memory 17, and calls the data being stored in memory 17, holds
The various functions and processing data of row mobile phone 1, so as to carry out integral monitoring to mobile phone.In example 4, in the transmitting-receiving of mobile phone 1
Device 14 and communication interface 15 are received after the shooting instruction of processing equipment 2, and the photograph in camera module is controlled by controller 13
The startup of machine, so that the shooting of picture is performed, also, when mobile phone is shot, controller 13 then can be by the calibration parameter value
It is automatically applied in the efficacy parameter of camera, to realize the consistent of photographic effect.And the calibration parameter value in mobile phone is then stored
In the nvram memories.
And PC2 may include processor 23, transceiver 24, communication interface 25 and memory 26, and the generation mould in embodiment 4
Block 21 can have the function of processor 23, and to generate corresponding calibration parameter value to the picture of shooting, the second transport module 22 can
Function with transceiver 24 and communication interface 25, to realize the transmission of data, and the memory 26 of processing equipment is then used to deposit
The default picture of storage, device for processing calls and generates calibration parameter value.
It will be understood by those skilled in the art that the handset structure that is shown in Fig. 6 and processing equipment only do implementation
Citing, does not constitute the restriction to mobile phone and processing equipment, can include parts more more or less than diagram, or combine certain
A little parts, or different part arrangements.
Although the foregoing describing the embodiment of the present invention, it will be appreciated by those of skill in the art that these
It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back
On the premise of principle and essence from the present invention, various changes or modifications can be made to these embodiments, but these are changed
Protection scope of the present invention is each fallen within modification.