Summary of the invention
The object of the present invention is to provide a kind of processing method and camera of image shot by camera, avoided causing the problem of light source color temperature information that can't the Obtaining Accurate scene because imageing sensor itself has larger color cross talk, thereby guaranteed the accuracy of selected correction parameter for shadow correction.
For solving the problems of the technologies described above, embodiments of the present invention provide a kind of processing method of image shot by camera, comprise following steps:
When camera is in preview mode, the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image first, again the image behind shadow correction being carried out Automatic white balance processes, obtain the light source color temperature information of this frame, and the light source color temperature information that obtains stored, be used for the shadow correction of next frame image;
When camera is in acquisition mode, according to the light source color temperature information of last frame of the preview mode of storage, the final image of taking under the acquisition mode is carried out shadow correction.
Embodiments of the present invention also provide a kind of camera, comprise:
The shadow correction module is used for when camera is in preview mode, and the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image first;
The Automatic white balance processing module is used for that the current frame image after proofreading and correct through the shadow correction module is carried out Automatic white balance and processes, and exports the light source color temperature information of this frame;
Memory module is used for the light source color temperature information of Automatic white balance processing module output is stored;
The shadow correction module also is used for when camera is in acquisition mode, according to the light source color temperature information of the last frame of the preview mode of storage, the final image of taking under the acquisition mode is carried out shadow correction.
Embodiment of the present invention compared with prior art, the main distinction and effect thereof are:
When being in preview mode, the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image first, again the image behind shadow correction is carried out Automatic white balance and process.The light source color temperature information that obtains after the storage Automatic white balance is processed is used for the next frame image is carried out shadow correction.When described camera is in acquisition mode, according to the light source color temperature information of last frame of the preview mode of storage, the final image of taking under the acquisition mode is carried out shadow correction.Because before image information being carried out the Automatic white balance processing, carried out shadow correction according to the lighting source characteristic of previous frame, so that being one, shadow correction and Automatic white balance interdepend, and along with the process of the continuous iteration of renewal of every two field picture, therefore can guarantee the accuracy of the light source color temperature information that obtains after Automatic white balance is processed, thereby guaranteed the accuracy according to the selected correction parameter of this light source color temperature information, greatly improve the shadow correction effect to photographic images, improved the Disposal quality of image.
Further, pre-stored one group of correction parameter that is used for shadow correction, when current frame image is the first two field picture that obtains by camera lens under the preview mode, according to pre-stored correction parameter the first two field picture that obtains by camera lens under the preview mode is carried out shadow correction.Efficiently solve the initialization problem of the first two field picture also being carried out shadow correction, so that the Automatic white balance of the first two field picture is processed the image also be based on behind shadow correction, thereby guaranteed the first two field picture is carried out the accuracy of the light source color temperature information that obtains after Automatic white balance is processed.
Further, pre-stored correction parameter is the correction parameter that is used for shadow correction under the D50 light source, because the correction parameter under the D50 light source is for all being unlikely to cause very large color error in the various light source situations, be one group of correction parameter that various light source scene equalization compromises are processed, therefore can be used as the initial parameter and the acquiescence correction parameter that can't stablize when finding the light source scene information of this iterative process.
Further, before the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image, whether saltus step greater than M time light source scene Recognition has occured in the N frame before judging, if do not have generation greater than the saltus step of M time light source scene Recognition, then according to the light source color temperature information of previous frame image current frame image is carried out shadow correction again, if the saltus step greater than M time light source scene Recognition has occured, then adopt pre-stored one group of correction parameter that is used for shadow correction, current frame image is carried out shadow correction.Effectively avoid the iteration renewal process of shadow correction and Automatic white balance not restrain and be in divergent state (as not stopping saltus step between each light source scene), and then guaranteed the stability of the light source color temperature information that gets access to.
Further, after obtaining the light source color temperature information of present frame, judge whether present frame and previous frame the saltus step of light source scene Recognition has occured, if the saltus step of light source scene Recognition has occured, then temporarily do not upgrade the light source color temperature information of current storage, until when continuously the light source color temperature information that obtains of L frame is light source color temperature information after the saltus step afterwards, be the light source color temperature information after the saltus step again with the light source color temperature information updating of storage, be used for the shadow correction of next frame image.When further having guaranteed the change scene, the change process of the corresponding shadow correction coefficient of light source judged result can be shown reposefully.
Embodiment
In the following description, in order to make the reader understand the application better many ins and outs have been proposed.But, persons of ordinary skill in the art may appreciate that even without these ins and outs with based on many variations and the modification of following each execution mode, also can realize each claim of the application technical scheme required for protection.
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing embodiments of the present invention are described in further detail.
First embodiment of the invention relates to a kind of processing method of image shot by camera, and idiographic flow as shown in Figure 1.
In step 110, obtain current frame image.As everyone knows, generally there is preview in a digitized camera and catches two mode of operations.The former offers continuous dynamic video information of user and is used for finding a view the common raising of using lower resolution to be used for demonstration and frame per second; And the latter uses full resolution image and complete image processing algorithm to be used for obtaining and storing the image of final shooting.This step is the step of obtaining current frame image under preview mode by camera lens.
Then, in step 120, according to canned data in the light source color temperature register current frame image is carried out shadow correction.
Specifically, canned data is the light source color temperature information that the previous frame image obtains after Automatic white balance is processed in the light source color temperature register.Can learn to adopt where organize correction parameter current frame image is carried out shadow correction according to light source color temperature information stored in the register.Correction parameters of the corresponding different lighting source types of the many groups of storage in camera how, and it is all same as the prior art how to carry out shadow correction according to the correction parameter of selecting, and does not repeat them here.
Then, in step 130, current frame image is carried out Automatic white balance process, obtain the light source color temperature information of this frame.The concrete mode of carrying out the Automatic white balance processing in this step is same as the prior art, does not repeat them here.Process picture frame for through the picture frame behind the shadow correction owing to carrying out Automatic white balance, therefore can guarantee Automatic white balance process in to the accurate judgement of illumination light Source Type.
Then, in step 140, with the light source color temperature information of light source color temperature information updating for obtaining in step 130 of preserving in the register, the light source color temperature information after the renewal is used for the shadow correction of next frame image.This shows, in the preview mode of operation, shadow correction and Automatic white balance be one and interdepend, and along with the process of the continuous iteration of renewal of every two field picture.
Need to prove, when camera enters preview mode and obtains the first frame image data and begin shadow correction, owing to there not being the light source color temperature information of previous frame in the register, can't judge the light source information of current scene.Therefore, in the present embodiment, pre-stored one group of correction parameter that is used for shadow correction in the light source color temperature register, so that the current frame image that obtains by camera lens when being the first two field picture that obtains by camera lens under the preview mode, can carry out shadow correction to the first two field picture that obtains by camera lens under the preview mode according to pre-stored correction parameter.Efficiently solve the initialization problem of the first two field picture also being carried out shadow correction, so that the Automatic white balance of the first two field picture is processed the image also be based on behind shadow correction, thereby guaranteed the first two field picture is carried out the accuracy of the light source color temperature information that obtains after Automatic white balance is processed.In addition, be appreciated that, in actual applications, can be not yet in camera pre-stored one group of correction parameter that is used for shadow correction, the first two field picture is directly carried out Automatic white balance to be processed, the light source color temperature information of the first frame that obtains after Automatic white balance processed stores in the register, is used for the shadow correction of next frame image.
In the present embodiment, pre-stored correction parameter is the correction parameter that is used for shadow correction under the D50 light source, because the correction parameter under the D50 light source is for all being unlikely to cause very large color error in the various light source situations, be one group of correction parameter that various light source scene equalization compromises are processed, therefore can be used as the initial parameter and the acquiescence correction parameter that can't stablize when finding the light source scene information of this iterative process.In addition, be appreciated that in actual applications, pre-stored correction parameter also can not be the correction parameter that is used for shadow correction under the D50 light source, but other can carry out the correction parameter that the equalization compromise is processed to various light source scenes.
Then, in step 150, judge whether to have entered acquisition mode.If entered acquisition mode, then enter step 160, according to the light source color temperature information of preserving in the register final image of taking under the acquisition mode is carried out shadow correction, after carrying out shadow correction, get back to step 110, obtain the image of next frame; If do not enter acquisition mode, then directly get back to step 110, obtain the image of next frame.
Because before taking a sub-picture, common camera must be introduced into preview mode and find a view, wait for after the user presses shutter key and enter acquisition mode photographing process final image, last sub-picture when generally leaving preview mode with finally catch image identical scene content arranged, therefore can judge and obtain light source information and the light source color temperature information of last sub-picture is passed to acquisition mode by in having the dynamic previewing pattern of higher frame per second, carrying out Automatic white balance, be used for selecting correct correction coefficient to carry out image shadow correction under this light source color temperature.
Be not difficult to find, in the present embodiment, when camera was in preview mode, what at first carry out in the image handling process was shadow correction, carried out and then Automatic white balance.So avoided the wrongheaded situation of light source color temperature to occurring after not processing through the image elder generation Automatic white balance of shadow correction among patent US20090251567A1 and the US20080198240A1.In preview mode, the selection of the correction parameter when each two field picture carries out shadow correction all is to select by the light source color temperature information that reads the previous frame preview image that stores in the light source color temperature register, Automatic white balance then is that each frame is carried out the judgement of light source color temperature information through the image of shadow correction, and the light source color temperature information of judging is constantly updated in the light source color temperature register.When the user presses soon behind the door, camera enters behind the acquisition mode and when beginning shadow correction, obtains light source information by reading the light source color temperature register, selects correct correction parameter to carry out shadow correction, as shown in Figure 2.
Because before image information being carried out the Automatic white balance processing, carried out shadow correction according to the lighting source characteristic of previous frame, so that being one, shadow correction and Automatic white balance interdepend, and along with the process of the continuous iteration of renewal of every two field picture, therefore can guarantee the accuracy of the light source color temperature information that obtains after Automatic white balance is processed, thereby guaranteed the accuracy according to the selected correction parameter of this light source color temperature information, greatly improve the shadow correction effect to photographic images, improved the Disposal quality of image.
It is worth mentioning that, in the present embodiment, be by light source color temperature information is stored in the register, after the light source color temperature information of the present frame that obtains, be the mode of the light source color temperature information of present frame with the content update of storing in the described register, realize the storage of light source color temperature information.But also can store the light source color temperature information that obtains after the Automatic white balance processing by other means in actual applications.
Second embodiment of the invention relates to a kind of processing method of image shot by camera.The second execution mode improves on the basis of the first execution mode, main improvements are: before the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image, whether saltus step greater than M time light source scene Recognition has occured in the N frame before judging, if do not have generation greater than the saltus step of M time light source scene Recognition, then according to the light source color temperature information of previous frame image current frame image carried out shadow correction again.If the saltus step greater than M time light source scene Recognition has occured, then adopt pre-stored one group of correction parameter (such as the correction parameter under the D50 light source) that is used for shadow correction, current frame image is carried out shadow correction.Wherein, M, N are default natural number.
Such as, because the high frame per second in the preview mode, whether the sequence image of pending certain hour by judging front N frame (such as front 10 frames) the repeatedly saltus step of light source scene Recognition has not occured so that can not upgrade immediately the light source color temperature register after initialization the first frame Automatic white balance is finished dealing with etc.Think that if transition times surpasses certain ratio the light source scene differentiates error, adopt the correction coefficient (such as one group of pre-stored correction parameter that is used for shadow correction) of acquiescence to carry out shadow correction, and do not upgrade register.Do not restrain and be in divergent state (as not stopping saltus step between each light source scene) with the iteration renewal process of effectively avoiding shadow correction and Automatic white balance, and then guaranteed the stability of the light source color temperature information that gets access to.
Third embodiment of the invention relates to a kind of processing method of image shot by camera.The 3rd execution mode improves on the basis of the first execution mode, main improvements are: after obtaining the light source color temperature information of present frame, judge whether present frame and previous frame the saltus step of light source scene Recognition has occured, if the saltus step of light source scene Recognition has occured, then temporarily do not upgrade the light source color temperature information of current storage, until when continuously the light source color temperature information that obtains of L frame is light source color temperature information after the saltus step afterwards, be the light source color temperature information after the saltus step again with the light source color temperature information updating of storing, the shadow correction that is used for the next frame image, wherein, L is default natural number.
By after continuous several two field pictures are all stably exported consistent new light source scene determination result after for the first time saltus step of affirmation generation, just register being upgraded, and shadow correction parameter etc. made a change, in the time of can further guaranteeing to change scene, the change process of the corresponding shadow correction coefficient of light source judged result can be shown reposefully.
Need to prove, each method execution mode of the present invention all can be realized in modes such as software, hardware, firmwares.No matter the present invention realizes with software, hardware or firmware mode, instruction code can be stored in the memory of computer-accessible of any type (for example permanent or revisable, volatibility or non-volatile, solid-state or non-solid-state, fixing or removable medium etc.).Equally, memory can for example be programmable logic array (Programmable ArrayLogic, be called for short " PAL "), random access memory (Random Access Memory, be called for short " RAM "), programmable read only memory (Programmable Read Only Memory, be called for short " PROM "), read-only memory (Read-Only Memory, be called for short " ROM "), Electrically Erasable Read Only Memory (Electrically Erasable Programmable ROM, be called for short " EEPROM "), disk, CD, digital versatile disc (Digital Versatile Disc is called for short " DVD ") etc.
Four embodiment of the invention relates to a kind of camera.As shown in Figure 3, this camera comprises:
The shadow correction module is used for when camera is in preview mode, and the current frame image that obtains by camera lens is carried out shadow correction according to the light source color temperature information of previous frame image first.
The Automatic white balance processing module is used for that the current frame image after proofreading and correct through the shadow correction module is carried out Automatic white balance and processes, and exports the light source color temperature information of this frame.
Memory module is used for the light source color temperature information of Automatic white balance processing module output is stored.Wherein, memory module is stored the light source color temperature information that obtains in the following manner: light source color temperature information is stored in the register, after the light source color temperature information of the present frame that obtains, be the light source color temperature information of present frame with the content update of storing in the register.
The shadow correction module also is used for when camera is in acquisition mode, according to the light source color temperature information of the last frame of the preview mode of storage, the final image of taking under the acquisition mode is carried out shadow correction.
Need to prove, in the present embodiment, the pre-stored one group of correction parameter that is used for shadow correction of memory module is as being used for the correction parameter of shadow correction under the D50 light source.When the current frame image that obtains by camera lens was the first two field picture that obtains by camera lens under the preview mode, the shadow correction module was carried out shadow correction according to pre-stored correction parameter to the first two field picture that obtains by camera lens under the preview mode.
Be not difficult to find, the first execution mode is the method execution mode corresponding with present embodiment, present embodiment can with the enforcement of working in coordination of the first execution mode.The correlation technique details of mentioning in the first execution mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in the present embodiment also can be applicable in the first execution mode.
Fifth embodiment of the invention relates to a kind of camera.The 5th execution mode improves on the basis of the 4th execution mode, main improvements are, the camera of present embodiment also comprises: the first judge module, be used for before the shadow correction module is carried out shadow correction to the current frame image that obtains by camera lens according to the light source color temperature information of previous frame image, whether saltus step greater than M time light source scene Recognition has occured in the N frame before judging, if do not have generation greater than the saltus step of M time light source scene Recognition, then indicate again the shadow correction module to carry out shadow correction according to the light source color temperature information of previous frame image.If the saltus step greater than M time light source scene Recognition has occured, then indicate the shadow correction module to adopt pre-stored one group of correction parameter that is used for shadow correction, current frame image is carried out shadow correction.M, N are default natural number.
Be not difficult to find, the second execution mode is the method execution mode corresponding with present embodiment, present embodiment can with the enforcement of working in coordination of the second execution mode.The correlation technique details of mentioning in the second execution mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in the present embodiment also can be applicable in the second execution mode.
Sixth embodiment of the invention relates to a kind of camera.The 6th execution mode improves on the basis of the 4th execution mode, main improvements are, camera in the present embodiment also comprises: the second judge module, be used for after the Automatic white balance processing module obtains the light source color temperature information of present frame, judge whether present frame and previous frame the saltus step of light source scene Recognition has occured, if the saltus step of light source scene Recognition has occured, then indicate memory module temporarily not upgrade the light source color temperature information of current storage, until when continuously the light source color temperature information that obtains of L frame is light source color temperature information after the saltus step afterwards, be the light source color temperature information after the saltus step again with the light source color temperature information updating of storing, the shadow correction that is used for the next frame image, L is default natural number.
Be not difficult to find, the 3rd execution mode is the method execution mode corresponding with present embodiment, present embodiment can with the enforcement of working in coordination of the 3rd execution mode.The correlation technique details of mentioning in the 3rd execution mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in the present embodiment also can be applicable in the 3rd execution mode.
Need to prove, each unit of mentioning in each equipment execution mode of the present invention all is logical block, physically, a logical block can be a physical location, it also can be the part of a physical location, can also realize with the combination of a plurality of physical locations, the physics realization mode of these logical blocks itself is not most important, and the combination of the function that these logical blocks realize is the key that just solves technical problem proposed by the invention.In addition, for outstanding innovation part of the present invention, above-mentioned each the equipment execution mode of the present invention will not introduced not too close unit with solving technical problem relation proposed by the invention, and this does not show that there is not other unit in the said equipment execution mode.
Although pass through with reference to some of the preferred embodiment of the invention, the present invention is illustrated and describes, but those of ordinary skill in the art should be understood that and can do various changes to it in the form and details, and without departing from the spirit and scope of the present invention.