WO2017197865A1 - Method and apparatus for detecting state of lens - Google Patents

Method and apparatus for detecting state of lens Download PDF

Info

Publication number
WO2017197865A1
WO2017197865A1 PCT/CN2016/107732 CN2016107732W WO2017197865A1 WO 2017197865 A1 WO2017197865 A1 WO 2017197865A1 CN 2016107732 W CN2016107732 W CN 2016107732W WO 2017197865 A1 WO2017197865 A1 WO 2017197865A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
lens
brightness
determining
feature information
Prior art date
Application number
PCT/CN2016/107732
Other languages
French (fr)
Chinese (zh)
Inventor
晁目力
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017197865A1 publication Critical patent/WO2017197865A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • Embodiments of the present invention relate to image processing technologies in the field of communication technologies, and in particular, to a lens state detection method and apparatus.
  • the camera developer considers the user's various usage scenarios as much as possible, and the algorithm considers the mode of the fully automatic adaptive scene.
  • Most of the techniques are based on objective weather, lighting, environment, etc. sexual treatment. Therefore, the related art ignores the degradation of the quality of photographs caused by the artificial contamination of the lens. That is to say, since the mobile phone is often held in the hand, the lens of the camera will inevitably be affected by perspiration and oil stains.
  • the lens stain will often make the video or photo color of the film dim, the texture is blurred, if it encounters the illumination source (such as Light-emitting diode billboards, headlights, street lights, etc.)
  • the halo will also become larger. At this time, the quality of the photos taken by the fully automatic camera is still very poor.
  • the embodiment of the present invention provides a lens state detecting method and device, which can automatically detect the lens state, prompt the user to perform processing when determining the lens abnormality, and improve the quality of the captured photo.
  • an embodiment of the present invention provides a lens state detecting method, where the method includes:
  • the user is prompted to perform processing when it is determined that the lens is abnormal.
  • the determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
  • the method further includes:
  • Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
  • Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
  • the method further includes:
  • the determining, according to the correspondence between the pre-acquired luminance information and the nonlinear compensation information, the nonlinear compensation information corresponding to the first luminance information including:
  • the gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
  • an embodiment of the present invention provides a lens state detecting device, where the device includes:
  • a detecting module configured to determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition
  • An acquiring module configured to acquire first brightness information and first feature information of the target block
  • the determining module is configured to determine whether the lens is abnormal according to the first brightness information and the first feature information;
  • the first response module is configured to prompt the user to perform processing when the lens is abnormal.
  • the determining module is specifically configured as:
  • the determining module is specifically configured as:
  • Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
  • Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
  • the device further includes:
  • the second response module determines, according to the correspondence between the previously acquired luminance information and the nonlinear compensation information, nonlinear compensation information corresponding to the first luminance information;
  • the second response module is specifically configured as:
  • the gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the lens state detection method in the foregoing embodiment.
  • the present invention by determining, from each block of the captured image, that the feature information meets the target block of the first preset condition, determining whether the lens is abnormal based on the first brightness information and the first feature information of the target block, determining When the lens is abnormal, the user is prompted to perform processing, which realizes automatic detection of the lens state, prompts the user to process when determining the lens abnormality or nonlinearly compensates for the captured image, thereby avoiding photo distortion caused by lens stain/scratch. Can improve the quality of the photos taken.
  • FIG. 1 is an optional schematic flowchart of a lens state detecting method according to an embodiment of the present invention
  • FIG. 2 is another schematic flow chart of a lens state detecting method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an apparatus for detecting a lens state according to an embodiment of the present invention.
  • FIG. 4 is an optional schematic diagram of a storage format of a LUT table according to an embodiment of the present invention.
  • FIG. 5 is still another schematic flow chart of a lens state detecting method according to an embodiment of the present invention.
  • FIG. 6 is another schematic structural diagram of a lens state detecting device according to an embodiment of the present invention.
  • FIG. 7 is still another schematic structural diagram of a lens state detecting device according to an embodiment of the present invention.
  • the lens state detecting device from the various blocks of the captured image Determining, in the target block, that the feature information meets the first preset condition, acquiring the first brightness information and the first feature information of the target block, determining whether the lens is abnormal according to the first brightness information and the first feature information, and determining that the lens is abnormal Prompt the user to process.
  • the embodiment provides a lens state detecting method, which can be applied to a scene in which the quality of the photographed photograph may be degraded due to the user's neglect of the lens abnormality (such as stains/scratches of the lens); the lens state detection in this embodiment
  • the execution body of the method may be a lens state detecting device, and the lens state detecting device may be implemented in the following manner, for example, implementing components of the lens state detecting device in a mobile terminal, a photographing device or a monitoring device, or in a mobile terminal or a photographing device.
  • the monitoring device side implements components of the lens state detecting device in a coupled manner, wherein the camera device can be, for example, a camera, a camera, a DV, or the like having a camera/camera function.
  • FIG. 1 is an optional schematic flowchart of a lens state detecting method according to an embodiment of the present invention. As shown in FIG. 1 , a lens state detecting method includes:
  • Step 101 Determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition.
  • the captured image may be, for example, an image captured by a lens of a mobile terminal such as a mobile phone, a notebook, or a tablet;
  • the feature information is a characteristic parameter that reflects the quality of the captured image, and may be, for example, a sharpness (a color difference closely related to sharpness), and a brightness.
  • the contrast and the noise are not specifically limited in this embodiment of the present invention.
  • the target block of the first preset condition may be a block with the largest contrast value and the sharpness value in the captured image, and the size of the block is determined according to the reference standard image; the sharpness value of the captured image may be in the frequency domain range.
  • the calculation method calculates the spatial frequency according to the ISO12233 standard, and the image sharpness is expressed by the spatial frequency of MTF50 or MTF50P; the image contrast can be the sum of the square of the difference between the gray value of the central pixel and the gray value of the surrounding neighboring pixels, except In the embodiment of the present invention, the number of the squared terms is not specifically limited.
  • Step 102 Acquire first brightness information and first feature information of the target block.
  • the first brightness information may be the first brightness value and the first brightness level corresponding to the first brightness value, which is not specifically limited in this embodiment.
  • the first feature information may be a parameter or an element for describing an image characteristic such as a sharpness, a contrast, or the like, which is not specifically limited in this embodiment.
  • Step 103 Determine whether the lens is abnormal according to the first brightness information and the first feature information.
  • a possible implementation manner of the step 103 includes: determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information; and calculating the first feature information and the second feature information.
  • the difference value is determined whether the difference satisfies the second preset condition; if yes, the lens abnormality is determined; otherwise, the lens is determined to be normal.
  • the lens abnormality may include: a factor/state in which the lens is stained, the lens is scratched, the lens is blocked, and the like;
  • the second preset condition may be a preset threshold or a difference range.
  • the second feature information may be sharpness and contrast, which is not specifically limited in this embodiment.
  • the process of determining the second feature information is: selecting an object with an angular shape as a standard image, and obtaining a sharp image with different brightness values.
  • the degree value and the contrast value are used as an index mark, and a mapping relationship between the brightness value and the sharpness value and the contrast value is established, and is stored as an associated index table.
  • Another possible implementation manner of the step 103 includes: obtaining the atmospheric visibility information after determining the feasible implementation manner; and determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
  • the above-mentioned feasible implementation method for determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information and the first feature information comprises: obtaining atmospheric visibility information; determining whether the atmospheric visibility value is higher than a preset condition; the atmospheric visibility value is higher than The lens abnormality is determined when the third preset condition is met.
  • the third preset condition may be a range of the difference between the preset atmospheric visibility threshold, the current atmospheric visibility, and the preset atmospheric visibility value, which is not specifically limited in this embodiment.
  • the visibility information of the atmosphere can be obtained, for example, by detecting the smog detector installed in the mobile terminal, or by receiving the atmospheric visibility information sent by the server by the mobile terminal, which is not limited in this embodiment.
  • Step 104 Prompt the user to perform processing when determining that the lens is abnormal.
  • the lens state detecting method in the real-time example of the present invention may automatically detect the lens state in real time every time the camera is photographed; or may preset a sleep timer to determine the lens abnormality, start the sleep timer, and determine that the sleep timer exceeds the preset wake-up.
  • the threshold is used, the function of automatic detection of the lens state is turned off.
  • the first brightness information and the first feature information of the target block satisfying the first preset condition are obtained by detecting the feature information in each block of the lens captured image, and according to the first brightness information and the first The feature information determines whether the lens is abnormal, and prompts the user to perform processing when determining that the lens is abnormal, thereby avoiding the degradation of the quality of the photographed photo caused by the user's neglect of the lens abnormality, thereby improving the quality of the photograph taken by the user.
  • the embodiment is based on the first embodiment and can be applied to improve the image captured by the lens state detecting device without requiring the user to detect whether the lens has stains/scratches in advance, or the user does not completely treat the lens stain/scratch. Take a picture of the quality of the scene.
  • the detection of the lens state by the lens state detecting device can be detected in real time or periodically according to the user's requirements, which is not limited in this embodiment.
  • FIG. 2 is a schematic diagram of another optional flow of a lens state detecting method according to an embodiment of the present invention; the method shown in FIG. 2 supplements the process of correcting a captured image after prompting the user to perform processing when determining a lens abnormality,
  • the method includes:
  • Step 201 Determine nonlinear compensation information corresponding to the first brightness information according to a correspondence between the previously acquired brightness information and the nonlinear compensation information.
  • step 201 can be any of the following:
  • the brightness level corresponding to the first brightness information is determined according to the correspondence between the first brightness information and the brightness level; and the brightness level is determined according to the correspondence between the brightness level and the gamma correction information acquired in advance.
  • Gamma correction information is determined according to the correspondence between the first brightness information and the brightness level.
  • the first brightness information and the first feature information of the target block are acquired; and the index table corresponding to the first brightness information is searched according to the first brightness information. Determining, in the index table corresponding to the first brightness information, the first gamma correction information; wherein the first index table is used to indicate the associated index table with the mapping relationship established by the preset brightness information and the gamma correction information;
  • the second mode determines the brightness level corresponding to the first brightness information according to the correspondence between the first brightness information and the brightness level; and determines the number corresponding to the brightness level according to the correspondence between the brightness level and the feature information acquired in advance
  • the second feature information is calculated; the difference between the first feature information and the second feature information is calculated; and the second gamma correction information corresponding to the difference is determined according to the correspondence between the previously acquired difference and the gamma correction information.
  • the first brightness information and the first feature information of the target block are acquired; and the brightness information of the target block is determined according to the first brightness information.
  • a brightness level searching for a second index table corresponding to the brightness level according to the brightness level, determining gamma correction information in the second index table corresponding to the brightness level; wherein the second index table is used to indicate different preset brightness levels and presets
  • An association index table having a mapping relationship established by gamma correction information
  • the method 3 determining a brightness level corresponding to the first brightness information according to a correspondence between the first brightness information and the brightness level; determining a number corresponding to the brightness level according to a correspondence between the brightness level and the feature information acquired in advance
  • the second feature information is calculated; the difference between the first feature information and the second feature information is calculated; and the second gamma correction information corresponding to the difference is determined according to the correspondence between the previously acquired difference and the gamma correction information.
  • the lens abnormality After the lens abnormality is determined, when the user does not respond to the lens abnormality or the lens still has an abnormality, the first brightness information and the first feature information of the target block are acquired; and the brightness level corresponding to the brightness information is determined according to the brightness information; And searching for a third index table corresponding to the brightness level, determining a sharpness value and a contrast value in the third index table corresponding to the brightness level; wherein the third index table is used to indicate the sharpness of the image of the standard version of the different preset brightness levels
  • the block that determines the sharpness value and the contrast value is the target block, obtains the sharpness value and the contrast value of the target block, and compares the sharpness value and the contrast value of the target block with the corresponding third index table.
  • the sharpness value and the contrast value are matched, and the difference between the sharpness value and the contrast value of the target block and the sharpness value and the contrast value in the third index table are calculated; according to the difference, the fourth index table corresponding to the difference value is searched And determining gamma correction information in the fourth index table corresponding to the difference, wherein the fourth index table is used to indicate a correlation index table having a mapping relationship established by the difference value and the gamma correction information.
  • the determination of the above-mentioned standard image may be, for example, when the lens is clean, the object with a sharp angle of about 3 meters is selected as the shooting condition, and in a scene of taking a series of photographs of the object with strong contrast and sharp edges under different brightness,
  • the selection of the brightness can be obtained by adjusting the brightness gain and adjusting the exposure compensation, which is not specifically limited in this embodiment.
  • Step 202 Perform nonlinear compensation processing on the captured image according to the nonlinear compensation information.
  • the nonlinear compensation information may be a preset gamma value, and gamma correction of the captured image compensates for a difference in image color due to lens stain/damage.
  • the lens state detecting device determines the nonlinear compensation information corresponding to the first brightness information according to the correspondence between the previously acquired brightness information and the nonlinear compensation information, and according to the nonlinear compensation information,
  • the captured image is automatically subjected to nonlinear compensation processing, which avoids the difference between the input image and the output image color, thereby avoiding the photo quality caused by the user ignoring the detection of the lens state, or the lens is not wiped clean, or the lens is scratched.
  • the drop in the image quality is improved.
  • the embodiment is based on the first embodiment and can be applied to a scenario in which it is desired to prompt the user to wipe clean when the camera lens of the terminal device is stained or damaged, and correct the taken photo to improve the quality of the photo.
  • the lens state detecting device provided by the present invention is a system for smudging and correcting the camera lens of the terminal device, and is divided into a corresponding hardware component part and a software part.
  • the camera module includes lens, motor and image sensor.
  • the image processor is used to complete the processing of captured image data, including lens shading correction (LSC, lens shading), color correction, color conversion, gamma correction. And other modules.
  • the LCD is for previewing the captured image.
  • the storage unit is for the storage of the last photo.
  • the sharpness and contrast of a typical scene taken at a certain distance (about 3m) under different brightness are arranged into a table for storage.
  • This scene requires strong contrast and sharp edges and corners.
  • the sorted table can be stored in a certain format and used as a display lookup table (LUT, Look-Up-Table).
  • LUT display lookup table
  • the mobile phone automatically detects the area with high contrast in the current scene, and selects the area through the MTF calculation unit in the image processing unit. Obtain the corresponding sharpness value, and find the LUT prepared in advance according to the current brightness.
  • the software automatically increases the contrast by modifying the gamma to enhance the visual clarity.
  • the exposure is adjusted to reduce the halo of the light caused by the lens stain, so as to correct the negative effect of the stain on the photo.
  • the embodiment provides a lens state detecting device for detecting and reminding a stain of a camera lens.
  • the device includes:
  • the main processor 301 is an access point (AP, Access Point) in the mobile phone, and is applied to respond to the request of the image processor, simultaneously displays to the LCD, reads and writes data of the storage unit, and sounds the corresponding prompt of the audio system. In the scene.
  • AP Access Point
  • the image processor 302 is configured to perform image color space conversion, color correction, gamma correction, noise reduction, and the like in the image signal.
  • Lens and module 303 set to convert the light of the scene being shot into a field of image signals In the scenery.
  • LCD display 304 Set to the scene in which the processed data is previewed.
  • Audio output 305 Set to the scene in which the prompting sound is emitted during the photographing process.
  • Storage unit 306 Set in a scene to compress the processed data.
  • the MTF calculation unit located in the image processor, can of course also be implemented in pure software. The reason why it is placed in the image processor is because the hardware is calculated faster and the real-time performance can be guaranteed. You need to take a series of photos with sharp contrasts and sharp edges at different brightnesses with the camera lens clean beforehand.
  • the selected image contains the area of the corner of the object to calculate the MTF, and the MTF50 is obtained as the sharpness value.
  • the current brightness value, sharpness value, contrast, etc. are arranged into a LUT table according to the following format, and stored in the storage unit for software to call.
  • the LUT table storage format is as shown in FIG.
  • the data 1_1 may represent the luminance value Lux, or the index value of the exposure table
  • the data 1_2 may represent the MTF50 value obtained by the MTF calculation unit, and the value may be obtained by extracting the edge according to IS012233. And perform Fourier transform to find the spatial frequency and find the value at the spatial frequency 50; the data 1_3 can be the contrast value.
  • the LUT table may indicate the correspondence between the luminance value and the gamma correction; or the correspondence between the luminance value and the sharpness value and the contrast value corresponding to the luminance value; or the gamma correction and the difference (the sharpness of the target block)
  • the correspondence between the degree value, the contrast value, and the difference between the preset sharpness value and the contrast value is not specifically limited in this embodiment.
  • the lens state detecting method of this embodiment includes:
  • Step 501 When using the mobile phone, turn on the camera and aim at an object around a certain distance (such as 3m);
  • Step 502 At this time, the mobile phone automatically detects the area with the highest contrast and sharpness in the captured picture, and the size of the area can be set in advance.
  • Step 503 Next, the MTF calculation unit in the image processor automatically calculates the MTF50 value and the contrast value of an edge of the edge-cleared area, and the value can be calculated according to the ISO12233 standard, and the spatial frequency is calculated by Fourier transform. Further, MTF50 is obtained. At the same time, the corresponding contrast value can also be obtained.
  • Step 504 The MTF50 value and the contrast value obtained in the above steps are not subject to before The contaminated lens is compared with the LUTs at different brightnesses to determine whether the difference is greater than a certain threshold. If yes, go to step 505; otherwise, go to step 510.
  • Step 505 When the difference between the sharpness (MTF50) and the contrast value in the LUT and the current MTF 50 and the contrast value is greater than a certain threshold, when it is greater than a certain threshold, step 506 is performed, otherwise step 511 is performed.
  • Step 506 determining the current weather, which may be obtained by the PM2.5 detector provided by the mobile phone or the real-time networked weather forecast; when the weather is foggy, skip the steps for prompting and correcting, and perform step 511, otherwise Go to step 507.
  • Step 507 When the weather is good, the lens may be judged to be contaminated, and the audio prompts a voice or a prompt message pops up on the LCD;
  • Step 508 Determine whether the user wipes clean. When the user wipes but does not wipe clean or does not respond, step 509 is performed; otherwise, step 511 is performed.
  • Step 509 At this time, the built-in, tested gamma and exposure values can be used to improve the contrast of the photo and improve the picture quality.
  • Step 510 Take the normal photo taking process.
  • Step 511 Finally save the photo. At this point, the lens stain prompting and correction system software is completed.
  • the obtained MTF 50 at the current brightness and the difference between the contrast value and the response value in the LUT may be divided into multiple levels, and each level corresponds to a group of gamma prepared in advance.
  • the gamma is arranged according to the contrast from high to low.
  • Each level is selected, corresponding to a group of gamma.
  • the LCD will preview in real time, and the user selects a photo with better effect.
  • the adjustment of the exposure can be adjusted according to the brightness change of the gamma modified screen. If a certain level is selected, the screen is found to be dark. At this time, the exposure amount can be appropriately increased manually, so that the brightness of the screen is moderate, and it can also be based on the lamp, the street lamp, etc.
  • Light source select the area focus to adjust the exposure.
  • Scene 1 when the user is outdoors during the day, as long as the camera is turned on, the captured image contains sharp edges, strong contrast tree branches, street light poles, utility poles, or street signs, etc., and the system can be used to determine whether the lens has been It is contaminated or not cleaned. If it has not been wiped clean, you can use this method to make special corrections to the photos you take to ensure the shooting.
  • Scene 2 special weather, such as foggy weather, can be triggered by the real-time weather forecast of the network or the dust detector provided by the mobile phone. When a certain threshold is reached, the lens pollution reminding function is automatically turned off. In addition, scenes with dark lighting cannot use lens contamination to alert this feature.
  • the mobile phone camera lens stain correction system is also applicable to the scratches caused by the sharpening of the camera lens by the sharp object, and the scratches also cause the photo quality to deteriorate. Scratch tips and corrections can be achieved with this system.
  • the user can also bring a small card that can be put into the wallet.
  • the card is half-divided in black and white, half black, half white, and can be placed one meter away from the camera when in use.
  • the system can also be used to achieve contamination prompts and corrections.
  • the embodiment of the invention obtains the brightness value of the target block of the captured image, and finds the preset gamma correction information according to the brightness value, thereby realizing the adjustment of the contrast of the captured image, and simultaneously adjusting the exposure to reduce the light caused by the lens stain.
  • the halo at the place improves the quality of the photos taken.
  • FIG. 6 is a schematic diagram of another optional structure of a lens state detection processing device according to an embodiment of the present invention.
  • the lens state detection processing device provided by the embodiment includes:
  • the detecting module 601 is configured to determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
  • the obtaining module 602 is configured to acquire first brightness information and first feature information of the target block;
  • the determining module 603 is configured to determine whether the lens is abnormal according to the first brightness information and the first feature information;
  • the first response module 604 is configured to prompt the user to perform processing when determining that the lens is abnormal.
  • the first brightness information and the first feature information of the target block are obtained by determining the target block that the feature information meets the first preset condition from the respective blocks of the captured image, according to the first brightness information and the first A feature information is used to determine whether the lens is abnormal, and the user is prompted to perform processing when determining that the lens is abnormal, thereby preventing the user from detecting the state of the lens in real time, preventing the quality of the photographed image from being degraded when the lens is abnormal, and realizing automatic detection of the lens state. Can improve the quality of the photos taken.
  • the determining module 603 is specifically configured to: determine, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information; and calculate the first feature information and The difference of the second feature information; determining whether the difference satisfies the second preset condition; if yes, determining the lens abnormality; otherwise determining that the lens is normal.
  • the determining module 603 is specifically configured to: obtain atmospheric visibility information; determine whether the lens is abnormal according to the first brightness information and the first feature information, including: according to atmospheric visibility information, first brightness information, and The first feature information determines whether the lens is abnormal.
  • FIG. 7 is still another optional structural diagram of the lens state detecting device according to the embodiment of the present invention.
  • the lens state detecting device shown in FIG. 7 also includes a detecting module 601, an obtaining module 602, and a judgment.
  • the module 603, the first response module 604, and the modules also have the corresponding functions described in the above embodiments.
  • the lens state detecting device shown in FIG. 7 further includes:
  • the second response module 605 determines nonlinear compensation information corresponding to the first brightness information according to the correspondence between the previously acquired brightness information and the nonlinear compensation information; and performs nonlinear compensation processing on the captured image according to the nonlinear compensation information. .
  • the second response module 605 is specifically configured to: determine, according to a correspondence between the first brightness information and the brightness level, a brightness level corresponding to the first brightness information; according to the pre-acquired brightness level and The correspondence between the gamma correction information determines the gamma correction information corresponding to the brightness level.
  • the detecting module 601, the obtaining module 602, the determining module 603, the first response module 604, and the second response module 605 can all be processed by the central processing unit located in the communication number processing device.
  • the central processing unit located in the communication number processing device.
  • a CPU CPU
  • MPU microprocessor
  • DSP digital signal processor
  • FPGA field programmable gate array
  • This embodiment describes a computer readable medium, which may be a ROM (eg, a read only memory, a FLASH memory, a transfer device, etc.), a magnetic storage medium (eg, a magnetic tape, a disk drive, etc.), an optical storage medium (eg, a CD- ROM, DVD-ROM, paper card, paper tape, etc.) and other well-known types of program memory; computer-readable medium storing computer-executable instructions that, when executed, cause at least one processor to perform operations including:
  • the detecting module determines, from each block of the captured image, that the feature information meets the target block of the first preset condition; the acquiring module acquires the first brightness information and the first feature information of the target block; The determining module determines whether the lens is abnormal according to the first brightness information and the first feature information; the first response module prompts the user to perform processing when determining that the lens is abnormal, and prompts the user to perform processing when determining the lens abnormality due to automatic detection of the lens state. It avoids the user shooting in the scene of ignoring the lens state, which improves the quality of the photos taken by the user.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the present invention is directed to a method, apparatus (system), and computer program in accordance with an embodiment of the present invention.
  • the flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the present invention by determining, from each block of the captured image, that the feature information meets the target block of the first preset condition, determining whether the lens is abnormal based on the first brightness information and the first feature information of the target block, determining When the lens is abnormal, the user is prompted to perform processing, which realizes automatic detection of the lens state, prompts the user to process when determining the lens abnormality or nonlinearly compensates for the captured image, thereby avoiding photo distortion caused by lens stain/scratch. Can improve the quality of the photos taken.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

Disclosed are a method and an apparatus for detecting the state of the lens, the method comprising: determining, from respective blocks of a captured image, a target block, the characteristic information of which satisfies a first preset condition; acquiring first luminance information and first characteristic information of the target block; determining whether a lens is abnormal according to the first luminance information and the first characteristic information; prompting a user to process the state of the lens if it is determined that the lens is abnormal. The present invention implements the automatic detection of the state of the lens, and prompts the user to process the state of the lens when the lens is determined to be abnormal, improving the quality of photographs taken.

Description

镜头状态检测方法及装置Lens state detection method and device 技术领域Technical field
本发明实施例涉及通信技术领域的图像处理技术,尤其涉及一种镜头状态检测方法及装置。Embodiments of the present invention relate to image processing technologies in the field of communication technologies, and in particular, to a lens state detection method and apparatus.
背景技术Background technique
随着智能终端的快速发展和移动设备拍照的便利性,手机拍照已经成为人们网络社交的新宠,因此,手机的相机系统对照片质量的要求也越来越高,而照片质量的保证除了通过对传感器(sensor)以及图像处理器(ISP,Image Signal Processor)性能的调试优化外,还需要从拍摄者角度考虑,例如相机镜头表面是否没有污渍、拍摄环境。With the rapid development of smart terminals and the convenience of taking pictures of mobile devices, mobile phone photography has become the new favorite of people's online social communication. Therefore, the camera system of mobile phones has higher and higher requirements for photo quality, and the guarantee of photo quality is not only In addition to the debugging optimization of the performance of the sensor and the image processor (ISP), it is also necessary to consider from the perspective of the photographer, for example, whether the surface of the camera lens is free of stains and the shooting environment.
相关的技术中,相机开发人员尽可能考虑到用户的各种使用场景,算法考虑全自动自适应场景的模式,大部分技术都是基于客观的天气、灯光、环境等做出检测而进行的针对性处理。因此,相关技术忽略了镜头的人为污染而引起的拍摄照片质量的下降。也就是说,由于手机经常会拿在手里,相机的镜头不可避免的会受到汗渍和油污的影响,镜头污渍往往会让拍摄的视频或照片色彩暗淡,纹理模糊,如果遇到照明光源(如发光二极管广告牌,车灯,路灯等)光晕也会变大,这时候相关的全自动拍照拍摄出的照片质量依然很差。In the related technology, the camera developer considers the user's various usage scenarios as much as possible, and the algorithm considers the mode of the fully automatic adaptive scene. Most of the techniques are based on objective weather, lighting, environment, etc. Sexual treatment. Therefore, the related art ignores the degradation of the quality of photographs caused by the artificial contamination of the lens. That is to say, since the mobile phone is often held in the hand, the lens of the camera will inevitably be affected by perspiration and oil stains. The lens stain will often make the video or photo color of the film dim, the texture is blurred, if it encounters the illumination source (such as Light-emitting diode billboards, headlights, street lights, etc.) The halo will also become larger. At this time, the quality of the photos taken by the fully automatic camera is still very poor.
发明内容Summary of the invention
为解决相关存在的技术问题,本发明实施例提供一种镜头状态检测方法及装置,能实现对镜头状态的自动检测,在确定镜头异常时提示用户进行处理,提高了拍摄照片的质量。In order to solve the related technical problem, the embodiment of the present invention provides a lens state detecting method and device, which can automatically detect the lens state, prompt the user to perform processing when determining the lens abnormality, and improve the quality of the captured photo.
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
第一方面,本发明实施例提供一种镜头状态检测方法,方法包括:In a first aspect, an embodiment of the present invention provides a lens state detecting method, where the method includes:
从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区 块;Determining a target area in which the feature information satisfies the first preset condition from each block of the captured image Piece;
获取所述目标区块的第一亮度信息及第一特征信息;Obtaining first brightness information and first feature information of the target block;
根据所述第一亮度信息及第一特征信息,确定镜头是否异常;Determining whether the lens is abnormal according to the first brightness information and the first feature information;
确定所述镜头异常时提示用户进行处理。The user is prompted to perform processing when it is determined that the lens is abnormal.
在上述方案中,所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:In the above solution, the determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
根据预设的亮度信息与特征信息之间的对应关系,确定与所述第一亮度信息对应的第二特征信息;Determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information;
计算所述第一特征信息与所述第二特征信息的差值;Calculating a difference between the first feature information and the second feature information;
判定所述差值是否满足第二预设条件;Determining whether the difference satisfies a second preset condition;
若是,则确定所述镜头异常;否则确定所述镜头正常。If yes, it is determined that the lens is abnormal; otherwise, the lens is determined to be normal.
在上述方案中,所述方法还包括:In the above solution, the method further includes:
获取大气能见度信息;Obtaining atmospheric visibility information;
所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
根据所述大气能见度信息、所述第一亮度信息及第一特征信息,确定所述镜头是否异常。Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
在上述方案中,所述确定所述镜头异常时提示用户进行处理之后,所述方法还包括:In the above solution, after the determining that the lens is abnormal, prompting the user to perform processing, the method further includes:
根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息;Determining nonlinear compensation information corresponding to the first brightness information according to a correspondence between the previously acquired brightness information and the nonlinear compensation information;
根据所述非线性补偿信息,对所述捕获图像进行非线性补偿处理。And performing nonlinear compensation processing on the captured image according to the nonlinear compensation information.
在上述方案中,所述根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息,包括:In the above solution, the determining, according to the correspondence between the pre-acquired luminance information and the nonlinear compensation information, the nonlinear compensation information corresponding to the first luminance information, including:
根据所述第一亮度信息与亮度等级之间的对应关系,确定与所述第一 亮度信息对应的亮度等级;Determining the first relationship according to the correspondence between the first brightness information and the brightness level The brightness level corresponding to the brightness information;
根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与所述亮度等级对应的伽马校正信息。The gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
第二方面,本发明实施例提供了一种镜头状态检测装置,装置包括:In a second aspect, an embodiment of the present invention provides a lens state detecting device, where the device includes:
检测模块,设置为从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;a detecting module, configured to determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
获取模块,设置为获取所述目标区块的第一亮度信息及第一特征信息;An acquiring module, configured to acquire first brightness information and first feature information of the target block;
判断模块,设置为根据所述第一亮度信息及第一特征信息,确定镜头是否异常;The determining module is configured to determine whether the lens is abnormal according to the first brightness information and the first feature information;
第一响应模块,设置为确定所述镜头异常时提示用户进行处理。The first response module is configured to prompt the user to perform processing when the lens is abnormal.
在上述方案中,所述判断模块,具体设置为:In the above solution, the determining module is specifically configured as:
根据预设的亮度信息与特征信息之间的对应关系,确定与所述第一亮度信息对应的第二特征信息;Determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information;
计算所述第一特征信息与所述第二特征信息的差值;Calculating a difference between the first feature information and the second feature information;
判定所述差值是否满足第二预设条件;Determining whether the difference satisfies a second preset condition;
若是,则确定所述镜头异常;否则确定所述镜头正常。If yes, it is determined that the lens is abnormal; otherwise, the lens is determined to be normal.
在上述方案中,所述判断模块,具体设置为:In the above solution, the determining module is specifically configured as:
获取大气能见度信息;Obtaining atmospheric visibility information;
所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
根据所述大气能见度信息、所述第一亮度信息及第一特征信息,确定所述镜头是否异常。Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
在上述方案中,所述装置还包括:In the above solution, the device further includes:
第二响应模块,根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息; The second response module determines, according to the correspondence between the previously acquired luminance information and the nonlinear compensation information, nonlinear compensation information corresponding to the first luminance information;
根据所述非线性补偿信息,对所述捕获图像进行非线性补偿处理。And performing nonlinear compensation processing on the captured image according to the nonlinear compensation information.
在上述方案中,所述第二响应模块,具体设置为:In the above solution, the second response module is specifically configured as:
根据所述第一亮度信息与亮度等级之间的对应关系,确定与所述第一亮度信息对应的亮度等级;Determining a brightness level corresponding to the first brightness information according to a correspondence between the first brightness information and a brightness level;
根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与所述亮度等级对应的伽马校正信息。The gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的镜头状态检测方法。In the embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the lens state detection method in the foregoing embodiment.
本发明实施例中,通过从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块,基于目标区块的第一亮度信息及第一特征信息确定镜头是否异常,在确定镜头异常时提示用户进行处理,实现了对镜头状态的自动检测,在确定镜头异常时提示用户进行处理或通过对捕获图像的非线性补偿,避免了因镜头污渍/刮伤引起的照片失真,如此,能提高拍摄照片的质量。In the embodiment of the present invention, by determining, from each block of the captured image, that the feature information meets the target block of the first preset condition, determining whether the lens is abnormal based on the first brightness information and the first feature information of the target block, determining When the lens is abnormal, the user is prompted to perform processing, which realizes automatic detection of the lens state, prompts the user to process when determining the lens abnormality or nonlinearly compensates for the captured image, thereby avoiding photo distortion caused by lens stain/scratch. Can improve the quality of the photos taken.
附图说明DRAWINGS
图1为本发明实施例中镜头状态检测方法的一种可选的流程示意图;1 is an optional schematic flowchart of a lens state detecting method according to an embodiment of the present invention;
图2为本发明实施例中镜头状态检测方法的另一种可选的流程示意图;2 is another schematic flow chart of a lens state detecting method according to an embodiment of the present invention;
图3为本发明实施例中镜头状态检测装置的一种可选的结构示意图;3 is a schematic structural diagram of an apparatus for detecting a lens state according to an embodiment of the present invention;
图4为本发明实施例中LUT表存储格式的一种可选的示意图;4 is an optional schematic diagram of a storage format of a LUT table according to an embodiment of the present invention;
图5为本发明实施例中镜头状态检测方法的又一种可选的流程示意图;FIG. 5 is still another schematic flow chart of a lens state detecting method according to an embodiment of the present invention; FIG.
图6为本发明实施例中镜头状态检测装置的另一种可选的结构示意图;6 is another schematic structural diagram of a lens state detecting device according to an embodiment of the present invention;
图7为本发明实施例中镜头状态检测装置的又一种可选的结构示意图。FIG. 7 is still another schematic structural diagram of a lens state detecting device according to an embodiment of the present invention.
具体实施方式detailed description
在本发明的各种实施例中:镜头状态检测装置从捕获图像的各个区块 中确定特征信息满足第一预设条件的目标区块,获取目标区块的第一亮度信息及第一特征信息,根据第一亮度信息及第一特征信息,确定镜头是否异常,确定镜头异常时提示用户进行处理。In various embodiments of the invention: the lens state detecting device from the various blocks of the captured image Determining, in the target block, that the feature information meets the first preset condition, acquiring the first brightness information and the first feature information of the target block, determining whether the lens is abnormal according to the first brightness information and the first feature information, and determining that the lens is abnormal Prompt the user to process.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
实施例一Embodiment 1
本实施例提供了一种镜头状态检测方法,可以应用于因用户对镜头异常(如镜头有污渍/刮伤等因素)的忽略而可能引起拍摄照片质量下降的场景中;本实施例镜头状态检测方法的执行主体可以为镜头状态检测装置,镜头状态检测装置可以采用下列方式来实施,例如:在移动终端、拍照设备或监控设备中实施镜头状态检测装置的组件,也可以在移动终端、拍照设备或监控设备侧以耦合的方式实施镜头状态检测装置的组件,其中,拍照设备例如可以是照相机、摄像机、DV等具有拍照/摄像功能的设备。The embodiment provides a lens state detecting method, which can be applied to a scene in which the quality of the photographed photograph may be degraded due to the user's neglect of the lens abnormality (such as stains/scratches of the lens); the lens state detection in this embodiment The execution body of the method may be a lens state detecting device, and the lens state detecting device may be implemented in the following manner, for example, implementing components of the lens state detecting device in a mobile terminal, a photographing device or a monitoring device, or in a mobile terminal or a photographing device. Or the monitoring device side implements components of the lens state detecting device in a coupled manner, wherein the camera device can be, for example, a camera, a camera, a DV, or the like having a camera/camera function.
图1为本发明实施例中镜头状态检测方法的一种可选的流程示意图;如图1所示,镜头状态检测方法包括:FIG. 1 is an optional schematic flowchart of a lens state detecting method according to an embodiment of the present invention; as shown in FIG. 1 , a lens state detecting method includes:
步骤101:从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块。Step 101: Determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition.
捕获图像,例如可以是手机、笔记本、平板电脑等移动终端的镜头所捕获的图像;特征信息为反映拍摄图像质量的特征参数,例如,可以是锐度(与锐度密切相关的色差)、亮度和对比度、噪声,本发明实施例对此并不具体限定。The captured image may be, for example, an image captured by a lens of a mobile terminal such as a mobile phone, a notebook, or a tablet; the feature information is a characteristic parameter that reflects the quality of the captured image, and may be, for example, a sharpness (a color difference closely related to sharpness), and a brightness. And the contrast and the noise are not specifically limited in this embodiment of the present invention.
第一预设条件的目标区块可以为该捕获图像中对比度值和锐度值最大的区块,区块的大小根据参照标准图像自定义确定;对捕获图像的锐度值可以按频域范围来计算,计算方法按照ISO12233标准计算空间频率,图像锐度用MTF50或MTF50P的空间频率来表示;图像对比度可以为中心像素灰度值与周围4近邻像素灰度值之差的平方之和,除以以上平方项的个数,本发明实施例对此并不具体限定。 The target block of the first preset condition may be a block with the largest contrast value and the sharpness value in the captured image, and the size of the block is determined according to the reference standard image; the sharpness value of the captured image may be in the frequency domain range. To calculate, the calculation method calculates the spatial frequency according to the ISO12233 standard, and the image sharpness is expressed by the spatial frequency of MTF50 or MTF50P; the image contrast can be the sum of the square of the difference between the gray value of the central pixel and the gray value of the surrounding neighboring pixels, except In the embodiment of the present invention, the number of the squared terms is not specifically limited.
步骤102:获取目标区块的第一亮度信息及第一特征信息。Step 102: Acquire first brightness information and first feature information of the target block.
第一亮度信息可以为第一亮度值、第一亮度值所对应的第一亮度等级,本实施例对此并不具体限定。The first brightness information may be the first brightness value and the first brightness level corresponding to the first brightness value, which is not specifically limited in this embodiment.
第一特征信息可以为锐度、对比度等用于对图像特性进行描述的参数或要素,本实施例对此并不具体限定。The first feature information may be a parameter or an element for describing an image characteristic such as a sharpness, a contrast, or the like, which is not specifically limited in this embodiment.
步骤103:根据第一亮度信息及第一特征信息,确定镜头是否异常。Step 103: Determine whether the lens is abnormal according to the first brightness information and the first feature information.
步骤103的一种可行的实现方式包括:根据预设的亮度信息与特征信息之间的对应关系,确定与第一亮度信息对应的第二特征信息;计算第一特征信息与第二特征信息的差值;判定差值是否满足第二预设条件;若是,则确定镜头异常;否则确定镜头正常。A possible implementation manner of the step 103 includes: determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information; and calculating the first feature information and the second feature information. The difference value is determined whether the difference satisfies the second preset condition; if yes, the lens abnormality is determined; otherwise, the lens is determined to be normal.
这里,镜头异常可以包括:镜头有污渍、镜头被刮伤、镜头被阻挡等因素/状态;上述第二预设条件可以为预置的阈值或差值范围。第二特征信息可以为锐度、对比度,本实施例对此并不具体限定,确定第二特征信息过程为:选取棱角分明的物体为标版图像,获取标版图像在不同亮度值下的锐度值、对比度值,将亮度值做为索引标识,建立亮度值与锐度值、对比度值的映射关系,存储为关联索引表。Here, the lens abnormality may include: a factor/state in which the lens is stained, the lens is scratched, the lens is blocked, and the like; the second preset condition may be a preset threshold or a difference range. The second feature information may be sharpness and contrast, which is not specifically limited in this embodiment. The process of determining the second feature information is: selecting an object with an angular shape as a standard image, and obtaining a sharp image with different brightness values. The degree value and the contrast value are used as an index mark, and a mapping relationship between the brightness value and the sharpness value and the contrast value is established, and is stored as an associated index table.
步骤103的另一种可行的实现方式包括:上述一种可行的实现方式之后还包括:获取大气能见度信息;根据大气能见度信息、第一亮度信息及第一特征信息,确定镜头是否异常。Another possible implementation manner of the step 103 includes: obtaining the atmospheric visibility information after determining the feasible implementation manner; and determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
上述根据大气能见度信息、第一亮度信息及第一特征信息,确定镜头是否异常的一种可行的实现方式包括:获取大气能见度信息;确定大气能见度值是否高于预设条件;大气能见度值高于第三预设条件时,确定镜头异常。The above-mentioned feasible implementation method for determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information and the first feature information comprises: obtaining atmospheric visibility information; determining whether the atmospheric visibility value is higher than a preset condition; the atmospheric visibility value is higher than The lens abnormality is determined when the third preset condition is met.
上述第三预设条件可以为预置的大气能见度阈值、当前大气能见度与预置大气能见度值的差值范围,本实施例对此不具体限定。大气的能见度信息例如可以通过移动终端安装的雾霾探测器探测获得,也可以通过移动终端接收服务器发送的大气能见度信息获得,本实施例对此并不限定。 The third preset condition may be a range of the difference between the preset atmospheric visibility threshold, the current atmospheric visibility, and the preset atmospheric visibility value, which is not specifically limited in this embodiment. The visibility information of the atmosphere can be obtained, for example, by detecting the smog detector installed in the mobile terminal, or by receiving the atmospheric visibility information sent by the server by the mobile terminal, which is not limited in this embodiment.
步骤104:确定镜头异常时提示用户进行处理。Step 104: Prompt the user to perform processing when determining that the lens is abnormal.
本发明实时例中镜头状态检测方法可以是每次拍照时自动实时检测镜头状态;也可以是预设一个休眠定时器,确定镜头异常时,启动休眠定时器,确定休眠定时器超出预置的唤醒阈值时,关闭镜头状态自动检测的功能。The lens state detecting method in the real-time example of the present invention may automatically detect the lens state in real time every time the camera is photographed; or may preset a sleep timer to determine the lens abnormality, start the sleep timer, and determine that the sleep timer exceeds the preset wake-up. When the threshold is used, the function of automatic detection of the lens state is turned off.
本发明实施例通过对镜头捕获图像的各个区块中特征信息的检测,获取满足第一预设条件的目标区块的第一亮度信息及第一特征信息,并根据第一亮度信息及第一特征信息,确定镜头是否异常,确定镜头异常时提示用户进行处理,避免了因用户对镜头异常的忽略所引起的拍摄照片质量的下降,如此,能提高用户拍摄照片的质量。In the embodiment of the present invention, the first brightness information and the first feature information of the target block satisfying the first preset condition are obtained by detecting the feature information in each block of the lens captured image, and according to the first brightness information and the first The feature information determines whether the lens is abnormal, and prompts the user to perform processing when determining that the lens is abnormal, thereby avoiding the degradation of the quality of the photographed photo caused by the user's neglect of the lens abnormality, thereby improving the quality of the photograph taken by the user.
实施例二Embodiment 2
本实施例基于实施例一,可以应用于希望在无需用户预先检测镜头是否有污渍/刮伤,或用户对镜头污渍/刮伤处理不彻底,镜头状态检测装置自动对其捕获的图像修正,提高拍摄照片质量的场景中。The embodiment is based on the first embodiment and can be applied to improve the image captured by the lens state detecting device without requiring the user to detect whether the lens has stains/scratches in advance, or the user does not completely treat the lens stain/scratch. Take a picture of the quality of the scene.
镜头状态检测装置对镜头状态的检测可以根据用户需求实时检测或者周期性检测,本实施例对此并不限定。The detection of the lens state by the lens state detecting device can be detected in real time or periodically according to the user's requirements, which is not limited in this embodiment.
图2为本发明实施例中镜头状态检测方法的另一种可选的流程示意图;图2示出的方法对确定镜头异常时提示用户进行处理之后,对捕获图像进行修正实现过程进行了补充,该方法包括:2 is a schematic diagram of another optional flow of a lens state detecting method according to an embodiment of the present invention; the method shown in FIG. 2 supplements the process of correcting a captured image after prompting the user to perform processing when determining a lens abnormality, The method includes:
步骤201:根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与第一亮度信息对应的非线性补偿信息。Step 201: Determine nonlinear compensation information corresponding to the first brightness information according to a correspondence between the previously acquired brightness information and the nonlinear compensation information.
步骤201的可行的实现方式可以为以下任意一种:The feasible implementation of step 201 can be any of the following:
方式1、根据第一亮度信息与亮度等级之间的对应关系,确定与第一亮度信息对应的亮度等级;根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与亮度等级对应的伽马校正信息。 In the first mode, the brightness level corresponding to the first brightness information is determined according to the correspondence between the first brightness information and the brightness level; and the brightness level is determined according to the correspondence between the brightness level and the gamma correction information acquired in advance. Gamma correction information.
确定镜头异常后,检测到用户对镜头异常没有响应或者镜头依然存在异常时,获取目标区块的第一亮度信息及第一特征信息;根据第一亮度信息,查找第一亮度信息对应的索引表,确定第一亮度信息对应的索引表中的第一伽马校正信息;其中,第一索引表用于指示预设亮度信息与伽马校正信息建立的具有映射关系的关联索引表;After the lens abnormality is determined, when the user does not respond to the lens abnormality or the lens still has an abnormality, the first brightness information and the first feature information of the target block are acquired; and the index table corresponding to the first brightness information is searched according to the first brightness information. Determining, in the index table corresponding to the first brightness information, the first gamma correction information; wherein the first index table is used to indicate the associated index table with the mapping relationship established by the preset brightness information and the gamma correction information;
方式2、根据第一亮度信息与亮度等级之间的对应关系,确定与第一亮度信息对应的亮度等级;根据预先获取的亮度等级与特征信息之间的对应关系,确定与亮度等级对应的第二特征信息;计算第一特征信息与第二特征信息的差值;根据预先获取的差值与伽马校正信息之间的对应关系,确定与差值对应的第二伽马校正信息。The second mode determines the brightness level corresponding to the first brightness information according to the correspondence between the first brightness information and the brightness level; and determines the number corresponding to the brightness level according to the correspondence between the brightness level and the feature information acquired in advance The second feature information is calculated; the difference between the first feature information and the second feature information is calculated; and the second gamma correction information corresponding to the difference is determined according to the correspondence between the previously acquired difference and the gamma correction information.
确定镜头异常后,检测到用户对镜头异常没有响应或者镜头依然存在异常时,获取目标区块的第一亮度信息及第一特征信息;根据第一亮度信息,确定目标区块的亮度信息对应的亮度等级;根据亮度等级,查找亮度等级对应的第二索引表,确定亮度等级对应的第二索引表中的伽马校正信息;其中,第二索引表用于指示不同预设亮度等级与预设伽马校正信息建立的具有映射关系的关联索引表;After the lens abnormality is determined, when the user does not respond to the lens abnormality or the lens still has an abnormality, the first brightness information and the first feature information of the target block are acquired; and the brightness information of the target block is determined according to the first brightness information. a brightness level; searching for a second index table corresponding to the brightness level according to the brightness level, determining gamma correction information in the second index table corresponding to the brightness level; wherein the second index table is used to indicate different preset brightness levels and presets An association index table having a mapping relationship established by gamma correction information;
方式3、根据第一亮度信息与亮度等级之间的对应关系,确定与第一亮度信息对应的亮度等级;根据预先获取的亮度等级与特征信息之间的对应关系,确定与亮度等级对应的第二特征信息;计算第一特征信息与第二特征信息的差值;根据预先获取的差值与伽马校正信息之间的对应关系,确定与差值对应的第二伽马校正信息。The method 3: determining a brightness level corresponding to the first brightness information according to a correspondence between the first brightness information and the brightness level; determining a number corresponding to the brightness level according to a correspondence between the brightness level and the feature information acquired in advance The second feature information is calculated; the difference between the first feature information and the second feature information is calculated; and the second gamma correction information corresponding to the difference is determined according to the correspondence between the previously acquired difference and the gamma correction information.
确定镜头异常后,检测到用户对镜头异常没有响应或者镜头依然存在异常时,获取目标区块的第一亮度信息及第一特征信息;根据亮度信息,确定亮度信息对应的亮度等级;根据亮度等级,查找亮度等级对应的第三索引表,确定亮度等级对应的第三索引表中的锐度值和对比度值;其中,第三索引表用于指示不同预设亮度等级下标版图像的锐度值、对比度值与预设亮度等级建立的具有映射关系的关联索引表;从捕获图像的各个区块 中确定锐度值和对比度值最大的区块为目标区块,获取目标区块的锐度值和对比度值,并将目标区块的锐度值和对比度值与对应的第三索引表中的锐度值和对比度值进行匹配,计算目标区块的锐度值和对比度值与第三索引表中的锐度值和对比度值的差值;根据差值,查找差值对应的第四索引表,确定差值对应的第四索引表中的伽马校正信息,其中,第四索引表用于指示差值与伽马校正信息建立的具有映射关系的关联索引表。After the lens abnormality is determined, when the user does not respond to the lens abnormality or the lens still has an abnormality, the first brightness information and the first feature information of the target block are acquired; and the brightness level corresponding to the brightness information is determined according to the brightness information; And searching for a third index table corresponding to the brightness level, determining a sharpness value and a contrast value in the third index table corresponding to the brightness level; wherein the third index table is used to indicate the sharpness of the image of the standard version of the different preset brightness levels A relational index table with a mapping relationship between the value, the contrast value, and the preset brightness level; from the blocks of the captured image The block that determines the sharpness value and the contrast value is the target block, obtains the sharpness value and the contrast value of the target block, and compares the sharpness value and the contrast value of the target block with the corresponding third index table. The sharpness value and the contrast value are matched, and the difference between the sharpness value and the contrast value of the target block and the sharpness value and the contrast value in the third index table are calculated; according to the difference, the fourth index table corresponding to the difference value is searched And determining gamma correction information in the fourth index table corresponding to the difference, wherein the fourth index table is used to indicate a correlation index table having a mapping relationship established by the difference value and the gamma correction information.
上述标版图像的确定例如可以为在确定镜头干净时,选取距离3米左右棱角分明的物体为拍摄条件,应用在不同亮度下,拍一系列对比度强烈,棱角分明的物体的照片的场景中,亮度的选择可以通过调节亮度增益、调节曝光补偿得到,本实施例对此并不具体限定。The determination of the above-mentioned standard image may be, for example, when the lens is clean, the object with a sharp angle of about 3 meters is selected as the shooting condition, and in a scene of taking a series of photographs of the object with strong contrast and sharp edges under different brightness, The selection of the brightness can be obtained by adjusting the brightness gain and adjusting the exposure compensation, which is not specifically limited in this embodiment.
步骤202:根据非线性补偿信息,对捕获图像进行非线性补偿处理。Step 202: Perform nonlinear compensation processing on the captured image according to the nonlinear compensation information.
非线性补偿信息可以为预设的伽马值,通过对捕获图像进行伽马校正补偿由于镜头污渍/损伤引起的图像颜色的差异。The nonlinear compensation information may be a preset gamma value, and gamma correction of the captured image compensates for a difference in image color due to lens stain/damage.
本发明实施例的镜头状态检测方法,镜头状态检测装置根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与第一亮度信息对应的非线性补偿信息,根据非线性补偿信息,对捕获图像自动进行非线性补偿处理,避免了输入图像与输出图像颜色的差异,从而可以避免因用户忽略对镜头状态的检测,或镜头没有擦干净,或镜头的有刮伤而引起的照片质量的下降,提高了捕获图像质量。In the lens state detecting method of the embodiment of the present invention, the lens state detecting device determines the nonlinear compensation information corresponding to the first brightness information according to the correspondence between the previously acquired brightness information and the nonlinear compensation information, and according to the nonlinear compensation information, The captured image is automatically subjected to nonlinear compensation processing, which avoids the difference between the input image and the output image color, thereby avoiding the photo quality caused by the user ignoring the detection of the lens state, or the lens is not wiped clean, or the lens is scratched. The drop in the image quality is improved.
实施例三Embodiment 3
本实施例基于实施例一,可以应用于希望在终端设备的相机镜头有污渍或损伤时,提示用户擦拭干净,并对所拍照片进行修正,提高照片质量的场景中。The embodiment is based on the first embodiment and can be applied to a scenario in which it is desired to prompt the user to wipe clean when the camera lens of the terminal device is stained or damaged, and correct the taken photo to improve the quality of the photo.
本发明提供的镜头状态检测装置,是一种终端设备相机镜头污点提示以及修正的系统,分为相应的硬件组件部分和软件部分。The lens state detecting device provided by the present invention is a system for smudging and correcting the camera lens of the terminal device, and is divided into a corresponding hardware component part and a software part.
硬件部分,除了相关手机的照相机模块所相关的模块(包括摄像头模 组,图像处理器,音频,发光二极管(LCD,Light Emitting Diode)显示,存储单元等)外,还需要在图像处理器中增加专门的模量传递函数(MTF,Modulation Transfer Function)的计算单元,以方便计算出相关的空间频率,进而对图像的锐度进行评估。摄像头模组包含镜头,马达和图像传感器,图像处理器是为了完成对捕捉到的图像数据处理,包括镜头阴影校正(LSC,lens shading)的补偿,色彩校正,色彩转换,伽马(gamma)校正等模块。LCD则是为了预览捕捉到的图像画面。存储单元则是为了实现对最后照片的存储。Hardware part, except for the module related to the camera module of the relevant mobile phone (including the camera mode) In addition to the group, image processor, audio, light-emitting diode (LCD, Light Emitting Diode) display, storage unit, etc., it is also necessary to add a special modulus transfer function (MTF) calculation unit to the image processor. In order to easily calculate the relevant spatial frequency, the sharpness of the image is evaluated. The camera module includes lens, motor and image sensor. The image processor is used to complete the processing of captured image data, including lens shading correction (LSC, lens shading), color correction, color conversion, gamma correction. And other modules. The LCD is for previewing the captured image. The storage unit is for the storage of the last photo.
软件部分,把没有污染的镜头,在一定距离下(3m左右)不同亮度下拍摄的典型场景的锐度和对比度整理成表进行存储,该场景要求对比度强烈,且棱角比较分明。整理出的表可按照一定格式进行存储,作为显示查找表(LUT,Look-Up-Table)使用。当用户使用时,只要拿着手机去拍照片时(距离同样为3m左右),手机自动会检测出当前场景下对比度较高的区域,并且选定该区域通过图像处理单元中的MTF计算单元,得到相应的锐度值,结合当前的亮度去查找事先准备好的LUT,如果当前的锐度或对比度值低于LUT中的值一定范围,认为锐度和对比度下降严重,发出镜头污染的提示,提醒用户擦拭干净。如果用户没能及时擦拭,则软件自动通过修改gamma来增加对比度来提升视觉清晰感,同时调整曝光来减小镜头污渍带来的灯光处的光晕,来达到修正污渍带给照片的负面效果。In the software part, the sharpness and contrast of a typical scene taken at a certain distance (about 3m) under different brightness are arranged into a table for storage. This scene requires strong contrast and sharp edges and corners. The sorted table can be stored in a certain format and used as a display lookup table (LUT, Look-Up-Table). When the user uses, as long as the mobile phone is used to take a photo (the distance is also about 3m), the mobile phone automatically detects the area with high contrast in the current scene, and selects the area through the MTF calculation unit in the image processing unit. Obtain the corresponding sharpness value, and find the LUT prepared in advance according to the current brightness. If the current sharpness or contrast value is lower than the value in the LUT, it is considered that the sharpness and contrast are seriously degraded, and the lens contamination is prompted. Remind users to wipe clean. If the user fails to wipe in time, the software automatically increases the contrast by modifying the gamma to enhance the visual clarity. At the same time, the exposure is adjusted to reduce the halo of the light caused by the lens stain, so as to correct the negative effect of the stain on the photo.
本实施例提供一种镜头状态检测装置,用于对相机镜头的污渍检测和提醒,参见图3,该装置包括:The embodiment provides a lens state detecting device for detecting and reminding a stain of a camera lens. Referring to FIG. 3, the device includes:
1、主处理器301:是手机中的访问接入点(AP,Access Point),应用于响应图像处理器的请求,同时向LCD显示,存储单元数据读写,音频系统提示音发出相应命令的场景中。1. The main processor 301 is an access point (AP, Access Point) in the mobile phone, and is applied to respond to the request of the image processor, simultaneously displays to the LCD, reads and writes data of the storage unit, and sounds the corresponding prompt of the audio system. In the scene.
2、图像处理器302:设置为将图像信号进行图像色彩空间转换,颜色校正,gamma校正,降噪等处理的场景中。2. The image processor 302 is configured to perform image color space conversion, color correction, gamma correction, noise reduction, and the like in the image signal.
3、镜头及模组303:设置为将所拍场景的光线转换成为图像信号的场 景中。3. Lens and module 303: set to convert the light of the scene being shot into a field of image signals In the scenery.
4、LCD显示304:设置为将处理过的数据预览的场景中。4. LCD display 304: Set to the scene in which the processed data is previewed.
5、音频输出305:设置为拍照过程发出提示音的场景中。5. Audio output 305: Set to the scene in which the prompting sound is emitted during the photographing process.
6、存储单元306:设置为将处理过的数据进行压缩的场景中。6. Storage unit 306: Set in a scene to compress the processed data.
MTF计算单元,位于图像处理器中,当然也可以纯软件实现,之所以放在图像处理器中是因为硬件计算得更快,可以保证实时性。需要事先在相机镜头干净的前提下,在不同亮度下,拍一系列对比度强烈,棱角分明的物体的照片。选定照片中包含该物体棱角的区域计算MTF,得到MTF50作为锐度值,按照下面格式将当前的亮度值,锐度值,对比度等整理成LUT表,存储在存储单元,供软件调用。LUT表存储格式如图4所示:例如数据1_1可代表亮度值Lux,或曝光表的索引值,数据1_2可以代表MTF计算单元得出的MTF50值,该数值的得出可以按照IS012233通过提取边缘并进行傅里叶变换,求得空间频率,并找出空间频率50处的数值;数据1_3可以是对比度值。LUT表中可以表示亮度值和伽马校正的对应关系;或表示亮度值与该亮度值下对应的锐度值、对比度值的对应关系;或表示伽马校正与差值(目标区块的锐度值、对比度值和预设的锐度值、对比度值的差值)的对应关系,本实施例对此并不具体限定。The MTF calculation unit, located in the image processor, can of course also be implemented in pure software. The reason why it is placed in the image processor is because the hardware is calculated faster and the real-time performance can be guaranteed. You need to take a series of photos with sharp contrasts and sharp edges at different brightnesses with the camera lens clean beforehand. The selected image contains the area of the corner of the object to calculate the MTF, and the MTF50 is obtained as the sharpness value. The current brightness value, sharpness value, contrast, etc. are arranged into a LUT table according to the following format, and stored in the storage unit for software to call. The LUT table storage format is as shown in FIG. 4: for example, the data 1_1 may represent the luminance value Lux, or the index value of the exposure table, and the data 1_2 may represent the MTF50 value obtained by the MTF calculation unit, and the value may be obtained by extracting the edge according to IS012233. And perform Fourier transform to find the spatial frequency and find the value at the spatial frequency 50; the data 1_3 can be the contrast value. The LUT table may indicate the correspondence between the luminance value and the gamma correction; or the correspondence between the luminance value and the sharpness value and the contrast value corresponding to the luminance value; or the gamma correction and the difference (the sharpness of the target block) The correspondence between the degree value, the contrast value, and the difference between the preset sharpness value and the contrast value is not specifically limited in this embodiment.
软件处理流程,参见图5,本实施例的镜头状态检测方法包括:Software processing flow, referring to FIG. 5, the lens state detecting method of this embodiment includes:
步骤501:在使用手机时,打开相机,对准周围一定距离(如3m)左右的物体;Step 501: When using the mobile phone, turn on the camera and aim at an object around a certain distance (such as 3m);
步骤502:这时手机会自动检测所摄画面中对比度和锐度最大的区域,区域的大小可以事先设定。Step 502: At this time, the mobile phone automatically detects the area with the highest contrast and sharpness in the captured picture, and the size of the area can be set in advance.
步骤503:接下来图像处理器中的MTF计算单元会自动计算出边缘分明区域的某个边缘的MTF50值和对比度值,该值的计算可以根据ISO12233标准,通过傅里叶变换计算出空间频率,进而求出MTF50。同时也可以得到相应的对比度值。Step 503: Next, the MTF calculation unit in the image processor automatically calculates the MTF50 value and the contrast value of an edge of the edge-cleared area, and the value can be calculated according to the ISO12233 standard, and the spatial frequency is calculated by Fourier transform. Further, MTF50 is obtained. At the same time, the corresponding contrast value can also be obtained.
步骤504:将上述步骤中得到的MTF50值和对比度值和之前没有受 到污染的镜头在不同亮度下的LUT进行比较,判断差值是否大于一定阈值,若是,执行步骤505;否则执行步骤510。Step 504: The MTF50 value and the contrast value obtained in the above steps are not subject to before The contaminated lens is compared with the LUTs at different brightnesses to determine whether the difference is greater than a certain threshold. If yes, go to step 505; otherwise, go to step 510.
步骤505:当LUT中的锐度(MTF50)和对比度值和当前的MTF50以及对比度值之差是否大于一定阈值时,当大于一定阈值时,执行步骤506,否则执行步骤511。Step 505: When the difference between the sharpness (MTF50) and the contrast value in the LUT and the current MTF 50 and the contrast value is greater than a certain threshold, when it is greater than a certain threshold, step 506 is performed, otherwise step 511 is performed.
步骤506:判断当前的天气,可以由手机自带的PM2.5探测器或者实时联网的天气预报得到;当天气是雾霾时,直接跳过用于提示和修正的步骤,执行步骤511,否则执行步骤507。Step 506: determining the current weather, which may be obtained by the PM2.5 detector provided by the mobile phone or the real-time networked weather forecast; when the weather is foggy, skip the steps for prompting and correcting, and perform step 511, otherwise Go to step 507.
步骤507:当天气良好时,则可判断镜头污染,音频发出提示语音或LCD上弹出提示语;Step 507: When the weather is good, the lens may be judged to be contaminated, and the audio prompts a voice or a prompt message pops up on the LCD;
步骤508:确定用户是否擦干净,当用户擦拭但没擦干净或没响应时,执行步骤509;否则执行步骤511。Step 508: Determine whether the user wipes clean. When the user wipes but does not wipe clean or does not respond, step 509 is performed; otherwise, step 511 is performed.
步骤509:这时可以采用内置的,经过试验的gamma和曝光值,提高照片的对比度,改善图片质量。Step 509: At this time, the built-in, tested gamma and exposure values can be used to improve the contrast of the photo and improve the picture quality.
步骤510:走普通拍照流程。Step 510: Take the normal photo taking process.
步骤511:最后将照片保存。至此,镜头污渍提示及修正系统的软件完毕。Step 511: Finally save the photo. At this point, the lens stain prompting and correction system software is completed.
关于509环节,具体可以按如下方案实施,可以将当前亮度下的所得的MTF50以及对比度值与LUT中响应值的差值分成多个等级,每个等级下对应一组事先准备好的gamma,该gamma依据对比度的不同由高到低排列,每选一项等级,对应一组gamma,用户选择gamma后,LCD会实时预览,用户选出效果较好的照片。曝光的调整可以根据gamma修改后的画面亮度变化进行调整,如选择某一等级后,发现画面比较暗,这时可以适当手动适当增加曝光量,使画面亮度适中,也可以根据车灯,路灯等灯源,选择区域重点来调整曝光。For the 509 link, the specific implementation may be implemented as follows. The obtained MTF 50 at the current brightness and the difference between the contrast value and the response value in the LUT may be divided into multiple levels, and each level corresponds to a group of gamma prepared in advance. The gamma is arranged according to the contrast from high to low. Each level is selected, corresponding to a group of gamma. After the user selects gamma, the LCD will preview in real time, and the user selects a photo with better effect. The adjustment of the exposure can be adjusted according to the brightness change of the gamma modified screen. If a certain level is selected, the screen is found to be dark. At this time, the exposure amount can be appropriately increased manually, so that the brightness of the screen is moderate, and it can also be based on the lamp, the street lamp, etc. Light source, select the area focus to adjust the exposure.
本发明实施例也可以应用于下述场景中: The embodiments of the present invention can also be applied to the following scenarios:
场景1、用户在室外白天,只要打开相机,捕捉到的画面中含有棱角分明,对比度较强的树木枝干,路灯杆,电线杆,或者路牌边缘等,就可以利用该系统去判断镜头是否已受污染或没擦干净,如果擦了还没擦干净同样可利用本方法对所拍照片进行特别修正,以保证拍摄效果。Scene 1, when the user is outdoors during the day, as long as the camera is turned on, the captured image contains sharp edges, strong contrast tree branches, street light poles, utility poles, or street signs, etc., and the system can be used to determine whether the lens has been It is contaminated or not cleaned. If it has not been wiped clean, you can use this method to make special corrections to the photos you take to ensure the shooting.
场景2、特殊天气,如雾霾天气,可以由网络实时天气预报或手机自带的尘埃探测器,当达到一定阈值后,自动关闭该镜头污染提醒功能。除此之外,光线暗的场景也不能使用镜头污染提醒该功能。Scene 2, special weather, such as foggy weather, can be triggered by the real-time weather forecast of the network or the dust detector provided by the mobile phone. When a certain threshold is reached, the lens pollution reminding function is automatically turned off. In addition, scenes with dark lighting cannot use lens contamination to alert this feature.
本发明实施例中手机相机镜头污渍修正系统也同样适用于相机镜头被利物刮擦造成的刮痕,刮痕同样也会使得照片质量下降。利用该系统可以达到刮痕提示与修正。In the embodiment of the invention, the mobile phone camera lens stain correction system is also applicable to the scratches caused by the sharpening of the camera lens by the sharp object, and the scratches also cause the photo quality to deteriorate. Scratch tips and corrections can be achieved with this system.
本发明实施例用户也可以带一个可以放入钱包的小卡片,该卡片黑白对半分割,一半黑,一半白,使用时可以置于相机一米远位置。同样可以利用该系统达到污染提示和修正的目的。In the embodiment of the present invention, the user can also bring a small card that can be put into the wallet. The card is half-divided in black and white, half black, half white, and can be placed one meter away from the camera when in use. The system can also be used to achieve contamination prompts and corrections.
本发明实施例通过获取捕获图像目标区块的亮度值,根据亮度值查找到预先设置的伽马校正信息,实现了对捕获图像对比度的调节,同时结合调整曝光来减小镜头污渍带来的灯光处的光晕,提高了拍摄的照片质量。The embodiment of the invention obtains the brightness value of the target block of the captured image, and finds the preset gamma correction information according to the brightness value, thereby realizing the adjustment of the contrast of the captured image, and simultaneously adjusting the exposure to reduce the light caused by the lens stain. The halo at the place improves the quality of the photos taken.
实施例四Embodiment 4
图6为本发明实施例中镜头状态检测处理装置的另一种可选的结构示意图;本实施例提供的镜头状态检测处理装置,包括:FIG. 6 is a schematic diagram of another optional structure of a lens state detection processing device according to an embodiment of the present invention; the lens state detection processing device provided by the embodiment includes:
检测模块601,设置为从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;The detecting module 601 is configured to determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
获取模块602,设置为获取目标区块的第一亮度信息及第一特征信息;The obtaining module 602 is configured to acquire first brightness information and first feature information of the target block;
判断模块603,设置为根据第一亮度信息及第一特征信息,确定镜头是否异常;The determining module 603 is configured to determine whether the lens is abnormal according to the first brightness information and the first feature information;
第一响应模块604,设置为确定镜头异常时提示用户进行处理。 The first response module 604 is configured to prompt the user to perform processing when determining that the lens is abnormal.
本发明实施例,通过从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块,获取目标区块的第一亮度信息及第一特征信息,根据第一亮度信息及第一特征信息,确定镜头是否异常,确定镜头异常时提示用户进行处理,从而可以避免用户对镜头状态的实时检测,防止在镜头异常时造成所拍摄照片质量下降,实现对镜头状态的自动检测,如此,能提高拍摄照片的质量。In the embodiment of the present invention, the first brightness information and the first feature information of the target block are obtained by determining the target block that the feature information meets the first preset condition from the respective blocks of the captured image, according to the first brightness information and the first A feature information is used to determine whether the lens is abnormal, and the user is prompted to perform processing when determining that the lens is abnormal, thereby preventing the user from detecting the state of the lens in real time, preventing the quality of the photographed image from being degraded when the lens is abnormal, and realizing automatic detection of the lens state. Can improve the quality of the photos taken.
在上述实施例的基础上,判断模块603,具体设置为:根据预设的亮度信息与特征信息之间的对应关系,确定与第一亮度信息对应的第二特征信息;计算第一特征信息与第二特征信息的差值;判定差值是否满足第二预设条件;若是,则确定镜头异常;否则确定镜头正常。On the basis of the foregoing embodiment, the determining module 603 is specifically configured to: determine, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information; and calculate the first feature information and The difference of the second feature information; determining whether the difference satisfies the second preset condition; if yes, determining the lens abnormality; otherwise determining that the lens is normal.
在上述实施例的基础上,判断模块603,具体设置为:获取大气能见度信息;所根据第一亮度信息及第一特征信息,确定镜头是否异常,包括:根据大气能见度信息、第一亮度信息及第一特征信息,确定镜头是否异常。On the basis of the foregoing embodiment, the determining module 603 is specifically configured to: obtain atmospheric visibility information; determine whether the lens is abnormal according to the first brightness information and the first feature information, including: according to atmospheric visibility information, first brightness information, and The first feature information determines whether the lens is abnormal.
在上述实施例的基础上,图7为本发明实施例中镜头状态检测装置的又一种可选的结构示意图,图7示出的镜头状态检测装置也包括检测模块601、获取模块602、判断模块603、第一响应模块604,并且这些模块也具有上述实施例所记载的相应作用,同时,图7示出的镜头状态检测装置还包括:Based on the above embodiment, FIG. 7 is still another optional structural diagram of the lens state detecting device according to the embodiment of the present invention. The lens state detecting device shown in FIG. 7 also includes a detecting module 601, an obtaining module 602, and a judgment. The module 603, the first response module 604, and the modules also have the corresponding functions described in the above embodiments. Meanwhile, the lens state detecting device shown in FIG. 7 further includes:
第二响应模块605,根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与第一亮度信息对应的非线性补偿信息;根据非线性补偿信息,对捕获图像进行非线性补偿处理。The second response module 605 determines nonlinear compensation information corresponding to the first brightness information according to the correspondence between the previously acquired brightness information and the nonlinear compensation information; and performs nonlinear compensation processing on the captured image according to the nonlinear compensation information. .
在上述实施例的基础上,第二响应模块605,具体设置为:根据第一亮度信息与亮度等级之间的对应关系,确定与第一亮度信息对应的亮度等级;根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与亮度等级对应的伽马校正信息。On the basis of the foregoing embodiment, the second response module 605 is specifically configured to: determine, according to a correspondence between the first brightness information and the brightness level, a brightness level corresponding to the first brightness information; according to the pre-acquired brightness level and The correspondence between the gamma correction information determines the gamma correction information corresponding to the brightness level.
在实际应用中,检测模块601、获取模块602、判断模块603、第一响应模块604、第二响应模块605均可由位于通信号码处理装置的中央处理 器(CPU)、微处理器(MPU)、数字信号处理器(DSP)、或现场可编程门阵列(FPGA)等实现。In an actual application, the detecting module 601, the obtaining module 602, the determining module 603, the first response module 604, and the second response module 605 can all be processed by the central processing unit located in the communication number processing device. Implemented by a CPU (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
实施例五Embodiment 5
本实施例记载一种计算机可读介质,可以为ROM(例如,只读存储器、FLASH存储器、转移装置等)、磁存储介质(例如,磁带、磁盘驱动器等)、光学存储介质(例如,CD-ROM、DVD-ROM、纸卡、纸带等)以及其他熟知类型的程序存储器;计算机可读介质中存储有计算机可执行指令,当执行指令时,引起至少一个处理器执行包括以下的操作:This embodiment describes a computer readable medium, which may be a ROM (eg, a read only memory, a FLASH memory, a transfer device, etc.), a magnetic storage medium (eg, a magnetic tape, a disk drive, etc.), an optical storage medium (eg, a CD- ROM, DVD-ROM, paper card, paper tape, etc.) and other well-known types of program memory; computer-readable medium storing computer-executable instructions that, when executed, cause at least one processor to perform operations including:
从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;Determining, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
获取目标区块的第一亮度信息及第一特征信息;Obtaining first brightness information and first feature information of the target block;
根据第一亮度信息及第一特征信息,确定镜头是否异常;Determining whether the lens is abnormal according to the first brightness information and the first feature information;
确定镜头异常时提示用户进行处理。Prompt the user to process when the lens is abnormal.
综上,本发明实施例,通过检测模块从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;获取模块获取目标区块的第一亮度信息及第一特征信息;判断模块根据第一亮度信息及第一特征信息,确定镜头是否异常;第一响应模块确定镜头异常时提示用户进行处理,由于对镜头状态的自动检测,同时在确定镜头异常时提示用户进行处理,避免了用户在忽略镜头状态的场景下进行拍摄,提高了用户拍摄照片的质量。In summary, in the embodiment of the present invention, the detecting module determines, from each block of the captured image, that the feature information meets the target block of the first preset condition; the acquiring module acquires the first brightness information and the first feature information of the target block; The determining module determines whether the lens is abnormal according to the first brightness information and the first feature information; the first response module prompts the user to perform processing when determining that the lens is abnormal, and prompts the user to perform processing when determining the lens abnormality due to automatic detection of the lens state. It avoids the user shooting in the scene of ignoring the lens state, which improves the quality of the photos taken by the user.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程 序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is directed to a method, apparatus (system), and computer program in accordance with an embodiment of the present invention. The flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
本发明实施例中,通过从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块,基于目标区块的第一亮度信息及第一特征信息确定镜头是否异常,在确定镜头异常时提示用户进行处理,实现了对镜头状态的自动检测,在确定镜头异常时提示用户进行处理或通过对捕获图像的非线性补偿,避免了因镜头污渍/刮伤引起的照片失真,如此,能提高拍摄照片的质量。 In the embodiment of the present invention, by determining, from each block of the captured image, that the feature information meets the target block of the first preset condition, determining whether the lens is abnormal based on the first brightness information and the first feature information of the target block, determining When the lens is abnormal, the user is prompted to perform processing, which realizes automatic detection of the lens state, prompts the user to process when determining the lens abnormality or nonlinearly compensates for the captured image, thereby avoiding photo distortion caused by lens stain/scratch. Can improve the quality of the photos taken.

Claims (10)

  1. 一种镜头状态检测方法,所述方法包括:A lens state detecting method, the method comprising:
    从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;Determining, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
    获取所述目标区块的第一亮度信息及第一特征信息;Obtaining first brightness information and first feature information of the target block;
    根据所述第一亮度信息及第一特征信息,确定镜头是否异常;Determining whether the lens is abnormal according to the first brightness information and the first feature information;
    确定所述镜头异常时提示用户进行处理。The user is prompted to perform processing when it is determined that the lens is abnormal.
  2. 根据权利要求1所述的方法,其中,所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:The method according to claim 1, wherein the determining whether the lens is abnormal according to the first brightness information and the first feature information comprises:
    根据预设的亮度信息与特征信息之间的对应关系,确定与所述第一亮度信息对应的第二特征信息;Determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information;
    计算所述第一特征信息与所述第二特征信息的差值;Calculating a difference between the first feature information and the second feature information;
    判定所述差值是否满足第二预设条件;Determining whether the difference satisfies a second preset condition;
    若是,则确定所述镜头异常;否则确定所述镜头正常。If yes, it is determined that the lens is abnormal; otherwise, the lens is determined to be normal.
  3. 根据权利要求2所述的方法,其中,所述方法还包括:The method of claim 2, wherein the method further comprises:
    获取大气能见度信息;Obtaining atmospheric visibility information;
    所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
    根据所述大气能见度信息、所述第一亮度信息及第一特征信息,确定所述镜头是否异常。Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
  4. 根据权利要求1所述的方法,其中,所述确定所述镜头异常时提示用户进行处理之后,所述方法还包括:The method of claim 1, wherein after the determining that the lens is abnormal, prompting the user to perform processing, the method further comprises:
    根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息;Determining nonlinear compensation information corresponding to the first brightness information according to a correspondence between the previously acquired brightness information and the nonlinear compensation information;
    根据所述非线性补偿信息,对所述捕获图像进行非线性补偿处理。And performing nonlinear compensation processing on the captured image according to the nonlinear compensation information.
  5. 根据权利要求4所述的方法,其中,所述根据预先获取的亮度信 息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息,包括:The method of claim 4, wherein said based on a pre-acquired brightness letter Determining the nonlinear compensation information corresponding to the first brightness information, comprising: a correspondence between the information and the nonlinear compensation information, including:
    根据所述第一亮度信息与亮度等级之间的对应关系,确定与所述第一亮度信息对应的亮度等级;Determining a brightness level corresponding to the first brightness information according to a correspondence between the first brightness information and a brightness level;
    根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与所述亮度等级对应的伽马校正信息。The gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
  6. 一种镜头状态检测装置,所述装置包括:A lens state detecting device, the device comprising:
    检测模块,设置为从捕获图像的各个区块中确定特征信息满足第一预设条件的目标区块;a detecting module, configured to determine, from each block of the captured image, a target block whose feature information satisfies a first preset condition;
    获取模块,设置为获取所述目标区块的第一亮度信息及第一特征信息;An acquiring module, configured to acquire first brightness information and first feature information of the target block;
    判断模块,设置为根据所述第一亮度信息及第一特征信息,确定镜头是否异常;The determining module is configured to determine whether the lens is abnormal according to the first brightness information and the first feature information;
    第一响应模块,设置为确定所述镜头异常时提示用户进行处理。The first response module is configured to prompt the user to perform processing when the lens is abnormal.
  7. 根据权利要求6所述的装置,其中,所述判断模块,具体设置为:The device according to claim 6, wherein the determining module is specifically configured to:
    根据预设的亮度信息与特征信息之间的对应关系,确定与所述第一亮度信息对应的第二特征信息;Determining, according to a correspondence between the preset brightness information and the feature information, second feature information corresponding to the first brightness information;
    计算所述第一特征信息与所述第二特征信息的差值;Calculating a difference between the first feature information and the second feature information;
    判定所述差值是否满足第二预设条件;Determining whether the difference satisfies a second preset condition;
    若是,则确定所述镜头异常;否则确定所述镜头正常。If yes, it is determined that the lens is abnormal; otherwise, the lens is determined to be normal.
  8. 根据权利要求7所述的装置,其中,所述判断模块,具体设置为:The device according to claim 7, wherein the determining module is specifically configured to:
    获取大气能见度信息;Obtaining atmospheric visibility information;
    所述根据所述第一亮度信息及第一特征信息,确定镜头是否异常,包括:Determining whether the lens is abnormal according to the first brightness information and the first feature information includes:
    根据所述大气能见度信息、所述第一亮度信息及第一特征信息,确定所述镜头是否异常。 Determining whether the lens is abnormal according to the atmospheric visibility information, the first brightness information, and the first feature information.
  9. 根据权利要求6所述的装置,其中,所述装置还包括:The apparatus of claim 6 wherein said apparatus further comprises:
    第二响应模块,根据预先获取的亮度信息与非线性补偿信息之间的对应关系,确定与所述第一亮度信息对应的非线性补偿信息;The second response module determines, according to the correspondence between the previously acquired luminance information and the nonlinear compensation information, nonlinear compensation information corresponding to the first luminance information;
    根据所述非线性补偿信息,对所述捕获图像进行非线性补偿处理。And performing nonlinear compensation processing on the captured image according to the nonlinear compensation information.
  10. 根据权利要求9所述的装置,其中,所述第二响应模块,具体设置为:The device according to claim 9, wherein the second response module is specifically configured to:
    根据所述第一亮度信息与亮度等级之间的对应关系,确定与所述第一亮度信息对应的亮度等级;Determining a brightness level corresponding to the first brightness information according to a correspondence between the first brightness information and a brightness level;
    根据预先获取的亮度等级与伽马校正信息之间的对应关系,确定与所述亮度等级对应的伽马校正信息。 The gamma correction information corresponding to the brightness level is determined according to a correspondence relationship between the brightness level acquired in advance and the gamma correction information.
PCT/CN2016/107732 2016-05-20 2016-11-29 Method and apparatus for detecting state of lens WO2017197865A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610343365.3A CN107404647A (en) 2016-05-20 2016-05-20 Camera lens condition detection method and device
CN201610343365.3 2016-05-20

Publications (1)

Publication Number Publication Date
WO2017197865A1 true WO2017197865A1 (en) 2017-11-23

Family

ID=60325693

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/107732 WO2017197865A1 (en) 2016-05-20 2016-11-29 Method and apparatus for detecting state of lens

Country Status (2)

Country Link
CN (1) CN107404647A (en)
WO (1) WO2017197865A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108347601B (en) * 2018-03-19 2020-06-19 云丁网络技术(北京)有限公司 Video occlusion detection method and related equipment
CN109640075B (en) * 2018-12-24 2020-10-09 维沃移动通信有限公司 Camera detection device and method and mobile terminal
CN111405177B (en) * 2020-03-09 2021-09-24 Oppo广东移动通信有限公司 Image processing method, terminal and computer readable storage medium
CN111493802B (en) * 2020-04-24 2023-04-25 北京凡星光电医疗设备股份有限公司 Endoscope lens flushing method and device and endoscope
CN112001271A (en) * 2020-08-05 2020-11-27 安徽智星交通科技股份有限公司 Construction site road cleaning method, device and system
CN113906726A (en) * 2020-08-17 2022-01-07 深圳市大疆创新科技有限公司 Imaging method, imaging device, movable object, and unmanned aerial vehicle
CN112348784A (en) * 2020-10-28 2021-02-09 北京市商汤科技开发有限公司 Method, device and equipment for detecting state of camera lens and storage medium
WO2022198508A1 (en) * 2021-03-24 2022-09-29 深圳市大疆创新科技有限公司 Lens abnormality prompt method and apparatus, movable platform, and readable storage medium
CN113409271B (en) * 2021-06-21 2022-02-11 广州文远知行科技有限公司 Method, device and equipment for detecting oil stain on lens
CN114025151B (en) * 2021-09-23 2023-11-14 北京鹰瞳科技发展股份有限公司 Fundus camera fault detection method, fundus camera fault detection device and storage medium
CN115243038B (en) * 2022-09-23 2023-01-24 北京小马易行科技有限公司 Method for monitoring roadside camera, server and automatic driving system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120026326A1 (en) * 2010-07-30 2012-02-02 Hitachi, Ltd. Surveillance camera system having camera malfunction detection function
CN103327219A (en) * 2012-03-21 2013-09-25 浙江大华技术股份有限公司 Video image contrast adjustment method and device
CN104424632A (en) * 2013-08-23 2015-03-18 浙江大华技术股份有限公司 Video contrast abnormity detection method and device
CN104424633A (en) * 2013-08-23 2015-03-18 浙江大华技术股份有限公司 Video contrast abnormity detection method and device
CN104424645A (en) * 2013-08-30 2015-03-18 现代摩比斯株式会社 Image identification device and method of vehicle

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120026326A1 (en) * 2010-07-30 2012-02-02 Hitachi, Ltd. Surveillance camera system having camera malfunction detection function
CN103327219A (en) * 2012-03-21 2013-09-25 浙江大华技术股份有限公司 Video image contrast adjustment method and device
CN104424632A (en) * 2013-08-23 2015-03-18 浙江大华技术股份有限公司 Video contrast abnormity detection method and device
CN104424633A (en) * 2013-08-23 2015-03-18 浙江大华技术股份有限公司 Video contrast abnormity detection method and device
CN104424645A (en) * 2013-08-30 2015-03-18 现代摩比斯株式会社 Image identification device and method of vehicle

Also Published As

Publication number Publication date
CN107404647A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
WO2017197865A1 (en) Method and apparatus for detecting state of lens
CN107370958B (en) Image blurs processing method, device and camera terminal
WO2019183813A1 (en) Image capture method and device
CN105208281B (en) A kind of night scene image pickup method and device
US9813635B2 (en) Method and apparatus for auto exposure value detection for high dynamic range imaging
CN106454077B (en) Shooting method, shooting device and terminal
CN106534677B (en) Image overexposure optimization method and device
US8368783B2 (en) Method for adjusting shooting parameters of digital camera
CN110519485B (en) Image processing method, image processing device, storage medium and electronic equipment
JP6559229B2 (en) Image processing apparatus, imaging apparatus, image processing method, and storage medium storing image processing program of image processing apparatus
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
CN110033418A (en) Image processing method, device, storage medium and electronic equipment
CN108364275B (en) Image fusion method and device, electronic equipment and medium
JP6563751B2 (en) Image processing apparatus and image processing method
US20090041377A1 (en) Method and system for defect image correction
WO2019019904A1 (en) White balance processing method and apparatus, and terminal
CN106603929B (en) Screen light supplementing photographing method and system based on mobile terminal
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
WO2013114803A1 (en) Image processing device, image processing method therefor, computer program, and image processing system
KR101072945B1 (en) Apparatus for balancing flashed image color using depth estimation and method therefor
WO2018126671A1 (en) Intelligent photographing method and apparatus, and intelligent terminal
JP5619882B2 (en) Lens roll-off correction operation using values corrected based on luminance information
JP2010183460A (en) Image capturing apparatus and method of controlling the same
JP2008263313A (en) Image processing apparatus and image processing program
KR102136716B1 (en) Apparatus for Improving Image Quality and Computer-Readable Recording Medium with Program Therefor

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16902244

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16902244

Country of ref document: EP

Kind code of ref document: A1