CN107317967B - Image processing method, image processing device, mobile terminal and computer readable storage medium - Google Patents

Image processing method, image processing device, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN107317967B
CN107317967B CN201710624485.5A CN201710624485A CN107317967B CN 107317967 B CN107317967 B CN 107317967B CN 201710624485 A CN201710624485 A CN 201710624485A CN 107317967 B CN107317967 B CN 107317967B
Authority
CN
China
Prior art keywords
image
blue sky
processed
defogging
blue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710624485.5A
Other languages
Chinese (zh)
Other versions
CN107317967A (en
Inventor
袁全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710624485.5A priority Critical patent/CN107317967B/en
Publication of CN107317967A publication Critical patent/CN107317967A/en
Application granted granted Critical
Publication of CN107317967B publication Critical patent/CN107317967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation

Abstract

The invention relates to an image processing method, an image processing device, a mobile terminal and a computer readable storage medium. The method comprises the following steps: acquiring an image to be processed; judging whether the image to be processed contains a blue sky or not, and if so, extracting a blue sky area in the image to be processed; and carrying out defogging treatment on the blue sky area. According to the image processing method, the image processing device, the mobile terminal and the computer readable storage medium, the saturation of the blue sky area in the image to be processed is automatically improved, the original information of the non-blue sky area is reserved, the other non-blue sky areas are not processed by mistake, and the image subjected to defogging processing of the blue sky area is more real and natural.

Description

Image processing method, image processing device, mobile terminal and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an image processing method and apparatus, a mobile terminal, and a computer-readable storage medium.
Background
Saturation refers to the vivid course of a color, also called the purity of the color, and depends on the ratio of chromatic and achromatic components (gray) in the color. In daily life, after a user takes a picture through an imaging device, such as a camera, the user often selects to adjust the saturation of the picture, so that the effect of the picture is better by improving the saturation of the picture. In the conventional method, the saturation of the picture is generally adjusted manually by a user, which is cumbersome to operate.
Disclosure of Invention
The embodiment of the invention provides an image processing method, an image processing device, a mobile terminal and a computer readable storage medium, which can automatically improve the saturation of a blue sky area in an image.
An image processing method comprising:
acquiring an image to be processed;
judging whether the image to be processed contains a blue sky or not, and if so, extracting a blue sky area in the image to be processed;
and carrying out defogging treatment on the blue sky area.
In one embodiment, the determining whether the image to be processed includes a blue sky includes:
acquiring shooting parameters related to the image to be processed;
and if the shooting parameters meet preset conditions, determining that the image to be processed contains a blue sky.
In one embodiment, the extracting the blue-sky region in the image to be processed includes:
converting the image to be processed from a first color space to a second color space;
acquiring a parameter range of each color parameter in the second color space matched with the blue sky;
and extracting the blue sky area in the image to be processed according to the parameter range of the color parameters matched with the blue sky.
In one embodiment, the defogging treatment on the blue sky area includes:
determining the fog concentration of the blue sky area;
selecting a correction factor matched with the fog concentration, and calculating according to the correction factor to obtain the transmissivity;
and carrying out defogging treatment on the blue sky area according to the transmissivity.
In one embodiment, the method further comprises:
acquiring the brightness value of the image subjected to defogging processing;
and if the brightness value is smaller than a preset threshold value, adjusting the brightness value of the image subjected to the defogging treatment to be the preset threshold value.
An image processing apparatus comprising:
the image acquisition module is used for acquiring an image to be processed;
the judging module is used for judging whether the image to be processed contains a blue sky or not;
the extraction module is used for extracting a blue sky area in the image to be processed if the image to be processed contains a blue sky;
and the defogging module is used for defogging the blue sky area.
In one embodiment, the determining module includes:
the acquisition unit is used for acquiring shooting parameters related to the image to be processed;
the determining unit is used for determining that the image to be processed contains a blue sky if the shooting parameters meet preset conditions;
the extraction module comprises:
the conversion unit is used for converting the image to be processed from a first color space to a second color space;
a parameter range obtaining unit, configured to obtain a parameter range in which each color parameter in the second color space matches a blue sky;
and the extraction unit is used for extracting the blue sky area in the image to be processed according to the parameter range of the color parameters matched with the blue sky.
In one embodiment, the defogging module includes:
the determining unit is used for determining the fog concentration of the blue sky area;
the calculation unit is used for selecting a correction factor matched with the fog concentration and calculating the transmittance according to the correction factor;
and the defogging unit is used for defogging the blue sky area according to the transmissivity.
In one embodiment, the apparatus further comprises:
the brightness acquisition module is used for acquiring the brightness value of the image subjected to defogging processing;
and the adjusting module is used for adjusting the brightness value of the image subjected to the defogging processing to be the preset threshold value if the brightness value is smaller than the preset threshold value.
A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method as set forth above.
The image processing method, the image processing device, the mobile terminal and the computer readable storage medium are used for acquiring the image to be processed, extracting the blue sky area in the image to be processed if the image to be processed contains the blue sky, defogging the blue sky area, automatically improving the saturation of the blue sky area in the image to be processed, and enhancing the blue sky of the image, so that the saturation of the image is not required to be manually adjusted by a user, the operation is simple and convenient, the original information of the non-blue sky area is reserved, the misprocessing is not carried out on other non-blue sky areas, and the image subjected to the defogging processing of the blue sky area is more real and natural.
Drawings
FIG. 1 is a block diagram of a mobile terminal in one embodiment;
FIG. 2 is a flow diagram illustrating a method for image processing according to one embodiment;
FIG. 3 is a schematic diagram of a process for extracting a blue sky region of an image to be processed according to an embodiment;
FIG. 4 is a schematic flow chart illustrating the defogging process performed on the extracted blue sky region in one embodiment;
FIG. 5 is a block diagram of an image processing apparatus in one embodiment;
FIG. 6 is a block diagram of an extraction module in one embodiment;
FIG. 7 is a block diagram of a defogging module in one embodiment;
FIG. 8 is a schematic diagram of an image processing circuit in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present invention. Both the first client and the second client are clients, but they are not the same client.
Fig. 1 is a block diagram of a mobile terminal in one embodiment. As shown in fig. 1, the mobile terminal includes a processor, a non-volatile storage medium, an internal memory and a network interface, a display screen, and an input device, which are connected through a system bus. The non-volatile storage medium of the mobile terminal stores an operating system and computer-executable instructions, and the computer-executable instructions are executed by the processor to implement the image processing method provided by the embodiment of the invention. The processor is used to provide computing and control capabilities to support the operation of the entire mobile terminal. The internal memory in the mobile terminal provides an environment for the execution of computer-readable instructions in the non-volatile storage medium. The network interface is used for network communication with the server. The display screen of the mobile terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the mobile terminal, or an external keyboard, a touch pad or a mouse. The mobile terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device. Those skilled in the art will appreciate that the architecture shown in fig. 1 is only a block diagram of a portion of the architecture associated with the subject application and does not constitute a limitation on the mobile terminal to which the subject application applies, and that a particular mobile terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
As shown in fig. 2, in one embodiment, there is provided an image processing method including the steps of:
step 210, acquiring an image to be processed.
The image to be processed may be any image, including a fog-containing image and a normal image without fog, wherein in a foggy weather, there are many particles such as water droplets in the atmosphere, the farther the object is from an imaging device, such as a camera, a video camera, etc., the greater the influence of the atmospheric particles on imaging, and the fog-containing image generally has problems of low contrast, low saturation, hue shift, etc., due to the influence of the atmospheric particles.
Step 220, determining whether the image to be processed includes a blue sky, if yes, performing step 230, and if not, performing step 250.
The mobile terminal obtains the image to be processed, whether the image to be processed contains the blue sky or not can be judged, if yes, the blue sky area in the image to be processed can be extracted, the blue sky in the image to be processed is enhanced, and the saturation of the blue sky is improved. In one embodiment, the mobile terminal may acquire shooting parameters associated with an image to be processed and determine whether the shooting parameters satisfy preset conditions, where the shooting parameters may include a shooting height, a shooting direction, a shooting distance, and the like of the imaging device when shooting the image to be processed, and the shooting direction may include an inclination angle, a rotation angle, and the like. The mobile terminal can acquire shooting parameters related to the image to be processed through a sensor such as a gyroscope, and the mobile terminal can preset conditions matched with a blue sky, wherein the conditions comprise range values of all the shooting parameters. The mobile terminal may compare the acquired shooting parameters with corresponding range values in the conditions, and determine whether the acquired shooting parameters meet preset conditions, for example, the preset conditions may include a shooting height greater than 1 meter, an inclination angle greater than 45 degrees, an upward rotation direction, and the like, but are not limited thereto.
If the acquired shooting parameters meet the preset conditions, it is indicated that the image to be processed contains the sky, the sky area in the image to be processed can be identified, RGB (red, green and blue color space) information of the sky area is extracted, and the RGB information of the sky area can be compared with a preset blue sky RGB information range, so that whether the sky is a blue sky or not is judged. And if the RGB information of the sky area accords with a preset blue sky RGB information range, determining that the image to be processed contains a blue sky.
In step 230, a blue sky region in the image to be processed is extracted.
If the image to be processed includes a blue sky, the mobile terminal may extract a blue sky region in the image to be processed, and in this embodiment, the blue sky region may only include a blue sky region and does not include other object targets such as a white cloud. The mobile terminal can extract pixel points of which the RGB information accords with a preset blue sky RGB information range in a sky area identified by the image to be processed to form a blue sky area.
And step 240, carrying out defogging treatment on the blue sky area.
In this embodiment, the mobile terminal may perform defogging processing on the extracted blue-sky region according to a defogging algorithm, where the defogging algorithm may include a defogging algorithm based on image enhancement and a defogging algorithm based on image restoration, the defogging algorithm based on image enhancement may include a defogging algorithm based on RetineX theory, a defogging algorithm based on histogram equalization, and the like, and the defogging algorithm based on image restoration may include a defogging algorithm based on an atmospheric scattering model, and the like. In this embodiment, the mobile terminal may perform defogging processing on the extracted blue-sky region through a dark primary color prior algorithm, where the dark primary color prior algorithm belongs to a defogging algorithm based on image restoration.
The dark channel prior algorithm adopts an atmospheric scattering model to describe an image to be processed, and the atmospheric scattering model can be shown as formula (1):
I(x)=J(x)t(x)+A(1-t(x)) (1);
wherein, I (x) represents an image to be processed, J (x) represents an image obtained by defogging the processed image, t (x) represents transmissivity, and A represents an atmospheric light value. For fog-free images, some pixels will always have at least one color channel in the three RGB channels with a very low value, which is close to zero. Thus, for any image, its dark channel image can be as shown in equation (2):
Figure BDA0001362508920000061
wherein, Jdark(x) Representing dark channel images, Jc(y) represents the value of the color channel and Ω (x) represents a window centered on pixel x. According to the formula (1) and the formula (2), the calculation formula of the transmittance can be derived as shown in the formula (3):
Figure BDA0001362508920000062
in real life, even in a fine day, there are some particles in the air, the object far away can still feel the existence of fog, and the existence of fog can make people feel the existence of depth of field, therefore, a correction factor between [0 and 1] can be introduced to adjust the obtained transmittance, and the transmittance can be calculated by formula (3) as formula (4):
Figure BDA0001362508920000063
wherein, ω represents a correction factor for transmittance adjustment, the correction factor can be selected according to the required defogging degree, and the smaller ω represents the smaller defogging degree, and the larger ω represents the larger defogging degree.
After the mobile terminal extracts the blue-sky area of the image to be processed, the dark channel image of the blue-sky area can be obtained according to the formula (2), and the atmospheric light value of the blue-sky area is obtained, wherein the mobile terminal can sort the pixel points of the dark channel image of the blue-sky area according to the brightness, extract the first 0.1% of the pixel points according to the brightness from large to small, determine the brightness value of the position corresponding to the extracted pixel points in the extracted blue-sky area, and take the brightness value of the pixel point with the highest brightness value as the atmospheric light value. After the mobile terminal obtains the atmospheric light value, the transmittance of the extracted blue-sky area can be calculated according to the formula (4), the transmittance is brought into the formula (1), and the blue-sky area after defogging processing is obtained. The mobile terminal can fuse the blue sky area after the defogging processing with other non-blue sky areas in the image to be processed to generate a processed image. The defogging treatment is carried out on the blue-sky area of the image to be processed, so that the blue-sky area can be enhanced, the saturation of the blue-sky area is improved, and the blue sky of the image to be processed is bluer.
According to the image processing method, the image to be processed is obtained, if the image to be processed contains the blue sky, the blue sky area in the image to be processed is extracted, the blue sky area is subjected to defogging processing, the saturation of the blue sky area in the image to be processed is automatically improved, the blue sky of the image is enhanced, the saturation of the image does not need to be manually adjusted by a user, the operation is simple and convenient, the original information of the non-blue sky area is reserved, the other non-blue sky areas are not subjected to error processing, and the image subjected to defogging processing of the blue sky area is more real and natural.
As shown in fig. 3, in one embodiment, the step 230 of extracting a blue sky region in the image to be processed includes the following steps:
step 302, converting the image to be processed from the first color space to the second color space.
If the mobile terminal determines that the image to be processed includes a blue sky, the image to be processed may be converted from a first color space to a second color space, in this embodiment, the first color space may be RGB, the second color space may be HSV (hue, saturation, and brightness color space), or another color space, which is not limited thereto. The mobile terminal can convert the image to be processed from RGB to HSV according to the conversion formula of RGB and HSV, and the conversion formula of RGB to HSV can be shown as formula (5):
Figure BDA0001362508920000071
Figure BDA0001362508920000072
V=max (5);
where max represents the maximum value of the pixel in the RGB color space and min represents the minimum value of the pixel in the RGB color space.
And 304, acquiring a parameter range of each color parameter in the second color space matched with the blue sky.
The mobile terminal may preset a parameter range in which each color parameter in the second color space matches the blue sky. In the HSV color space, the color parameters may include H (Hue), S (Saturation), and V (Value), where H is measured by angle, and has a Value range of 0 to 360 °, and is calculated counterclockwise from red, red is 0 °, green is 120 °, and blue is 240 °; s represents the degree that the color is close to the spectral color, the larger the proportion of the spectral color is, the higher the degree that the color is close to the spectral color is, the higher the saturation of the color is, the higher the saturation is, and the color is generally dark and bright; v represents the brightness degree of the color, and for the light source color, the brightness value is related to the brightness of the luminous body; for object colors, this value is related to the transmittance or reflectance of the object, and V is typically in the range of 0% (black) to 100% (white). The mobile terminal may preset H, S, V the parameter ranges for the three color parameters to match the blue sky.
And step 306, extracting the blue sky area in the image to be processed according to the parameter range of the color parameters matched with the blue sky.
The mobile terminal can acquire HSV information of each pixel in the sky area identified by the image to be processed, compares the HSV information of each pixel in the sky area with a preset parameter range matching with the blue sky in which H, S, V three color parameters are preset, extracts pixels of which HSV all meet the preset parameter range, and obtains the blue sky area of the image to be processed.
In this embodiment, the image to be processed may be converted from the first color space to the second color space, and the blue-sky region of the image to be processed is extracted, so that only the blue-sky region in the image to be processed is conveniently defogged, the saturation of the blue-sky region is extracted, and other non-blue-sky regions are not mistakenly processed, so that the image after the blue-sky region defogging processing is more real and natural.
As shown in fig. 4, in one embodiment, the step 240 of defogging the blue sky area includes the following steps:
step 402, determining the fog concentration of the blue sky area.
The mobile terminal can obtain the extracted dark channel image of the blue sky area according to the formula (2), determine the fog density of the blue sky area according to the dark channel image, and estimate the dark channel image as the fog density image of the blue sky area. In one embodiment, the depth of field information of the blue-sky region may also be obtained, and the fog concentration of the blue-sky region may be determined according to the depth of field information of the blue-sky region, wherein the fog concentration exponentially increases with increasing depth of field.
And step 404, selecting a correction factor matched with the fog concentration, and calculating the transmittance according to the correction factor.
The corresponding relation between the fog concentration and the correction factor omega can be established in advance, and the correction factor matched with the fog concentration of the blue sky area is selected, wherein the smaller the fog concentration of the blue sky area is, the smaller the defogging degree is required to be, the smaller the correction factor omega can be selected, and the larger the fog concentration of the blue sky area is, the larger the defogging degree is required to be, the larger the correction factor omega can be selected. In this embodiment, when the extracted fog concentration of the blue sky region is small, the correction factor ω may be selected to be 0.5, and an image with a good effect after blue sky enhancement may be obtained.
And 406, defogging the blue sky area according to the transmittance.
The mobile terminal can obtain the transmissivity of the blue sky area by calculating the selected correction factor matched with the fog concentration of the blue sky area in the formula (4), and obtain the blue sky area subjected to defogging according to the formula (1), and the mobile terminal can fuse the blue sky area subjected to defogging with other non-blue sky areas in the image to be processed to generate the processed image.
In this embodiment, the matched correction factor can be selected according to the extracted fog concentration of the blue sky region, and the blue sky region is defogged to different degrees according to the fog concentration of the blue sky region, so that the saturation of the blue sky region is improved better, and the image subjected to defogging processing of the blue sky region is more real and natural.
In one embodiment, the image processing method further includes: and acquiring a brightness value of the image subjected to the defogging treatment, and if the brightness value is smaller than a preset threshold, adjusting the brightness value of the image subjected to the defogging treatment to be the preset threshold.
The mobile terminal fuses the blue sky area after the defogging processing with other non-blue sky areas in the image to be processed to generate a processed image, can acquire the brightness value of the processed image, compares the brightness value with a preset threshold value, and judges whether the processed image needs to be brightened or not. If the brightness value of the processed image is greater than or equal to the preset threshold, the brightness processing is not required, and if the brightness value of the processed image is less than the preset threshold, the brightness processing may be performed on the processed image, and the brightness value of the processed image is adjusted to the preset threshold, where the preset threshold is used to represent an ideal brightness at which the image may have a better visual appearance, for example, the preset threshold may be 130, 132, and the like, but is not limited thereto.
In the embodiment, the brightness value of the image subjected to the defogging processing can be automatically adjusted, so that the image has a better visual display effect, the saturation of the image does not need to be manually adjusted by a user, and the operation is simple and convenient.
As shown in fig. 5, in one embodiment, an image processing apparatus 500 is provided and includes an image obtaining module 510, a determining module 520, an extracting module 530, and a defogging module 540.
An image obtaining module 510, configured to obtain an image to be processed.
The determining module 520 is configured to determine whether the image to be processed includes a blue sky.
In one embodiment, the determining module 520 includes an acquiring unit and a determining unit.
And the acquisition unit is used for acquiring shooting parameters related to the image to be processed.
And the determining unit is used for determining that the image to be processed contains the blue sky if the shooting parameters meet the preset conditions.
The extracting module 530 is configured to extract a blue-sky region in the image to be processed if the image to be processed includes a blue sky.
And the defogging module 540 is used for defogging the blue sky area.
The image processing device obtains the image to be processed, if the image to be processed contains the blue sky, the blue sky area in the image to be processed is extracted, the blue sky area is subjected to defogging processing, the saturation of the blue sky area in the image to be processed is automatically improved, the blue sky of the image is enhanced, the saturation of the image does not need to be manually adjusted by a user, the operation is simple and convenient, original information of the non-blue sky area is reserved, other non-blue sky areas are not subjected to error processing, and the image subjected to defogging processing of the blue sky area is more real and natural.
As shown in fig. 6, in one embodiment, the extraction module 530 includes a conversion unit 532, a parameter range obtaining unit 534, and an extraction unit 536.
A conversion unit 532 for converting the image to be processed from the first color space to the second color space.
The parameter range obtaining unit 534 is configured to obtain a parameter range in which each color parameter in the second color space matches the blue sky.
An extracting unit 536, configured to extract a blue-sky region in the image to be processed according to the parameter range where each color parameter matches the blue sky.
In this embodiment, the image to be processed may be converted from the first color space to the second color space, and the blue-sky region of the image to be processed is extracted, so that only the blue-sky region in the image to be processed is conveniently defogged, the saturation of the blue-sky region is extracted, and other non-blue-sky regions are not mistakenly processed, so that the image after the blue-sky region defogging processing is more real and natural.
As shown in fig. 7, in one embodiment, the defogging module 540 includes a determination unit 542, a calculation unit 544, and a defogging unit 546.
The determining unit 542 is configured to determine a fog concentration in the blue sky region.
And the calculating unit 544 is configured to select a correction factor matched with the fog concentration, and calculate the transmittance according to the correction factor.
A defogging unit 546 configured to perform defogging processing on the blue sky area according to the transmittance.
In this embodiment, the matched correction factor can be selected according to the extracted fog concentration of the blue sky region, and the blue sky region is defogged to different degrees according to the fog concentration of the blue sky region, so that the saturation of the blue sky region is improved better, and the image subjected to defogging processing of the blue sky region is more real and natural.
In one embodiment, the image processing apparatus 500 includes a brightness acquiring module and an adjusting module in addition to the image acquiring module 510, the determining module 520, the extracting module 530 and the defogging module 540.
And the brightness acquisition module is used for acquiring the brightness value of the image subjected to the defogging treatment.
And the adjusting module is used for adjusting the brightness value of the image subjected to the defogging processing to be the preset threshold value if the brightness value is smaller than the preset threshold value.
In the embodiment, the brightness value of the image subjected to the defogging processing can be automatically adjusted, so that the image has a better visual display effect, the saturation of the image does not need to be manually adjusted by a user, and the operation is simple and convenient.
The division of the modules in the image processing apparatus is merely for illustration, and in other embodiments, the recommendation information generation apparatus may be divided into different modules as needed to complete all or part of the functions of the recommendation information generation apparatus.
The embodiment of the invention also provides the mobile terminal. The mobile terminal includes an Image Processing circuit, which may be implemented using hardware and/or software components, and may include various Processing units defining an ISP (Image Signal Processing) pipeline. FIG. 8 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 8, for ease of explanation, only aspects of the image processing techniques related to embodiments of the present invention are shown.
As shown in fig. 8, the image processing circuit includes an ISP processor 840 and control logic 850. Image data captured by imaging device 810 is first processed by ISP processor 840, and ISP processor 840 analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of imaging device 810. Imaging device 810 may include a camera having one or more lenses 812 and an image sensor 814. Image sensor 814 may include an array of color filters (e.g., Bayer filters), and image sensor 814 may acquire light intensity and wavelength information captured with each imaging pixel of image sensor 814 and provide a set of raw image data that may be processed by ISP processor 840. The sensor 820 may provide raw image data to the ISP processor 840 based on the sensor 820 interface type. The sensor 820 interface may utilize a SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
The ISP processor 840 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and ISP processor 840 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
ISP processor 840 may also receive pixel data from image memory 830. For example, raw pixel data is sent from the sensor 820 interface to the image memory 830, and the raw pixel data in the image memory 830 is then provided to the ISP processor 840 for processing. The image Memory 830 may be a portion of a Memory device, a storage device, or a separate dedicated Memory within an electronic device, and may include a DMA (Direct Memory Access) feature.
Upon receiving raw image data from the sensor 820 interface or from the image memory 830, the ISP processor 840 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 830 for additional processing before being displayed. ISP processor 840 may also receive processed data from image memory 930 for image data processing in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to a display 880 for viewing by a user and/or further processing by a graphics engine or GPU (graphics processing Unit). Further, the output of ISP processor 840 may also be sent to image memory 830 and display 880 may read image data from image memory 830. In one embodiment, image memory 830 may be configured to implement one or more frame buffers. Further, the output of the ISP processor 840 may be transmitted to an encoder/decoder 870 for encoding/decoding the image data. The encoded image data may be saved and decompressed prior to display on a display 880 device.
The step of the ISP processor 840 processing the image data includes: the image data is subjected to VFE (Video FrontEnd) Processing and CPP (Camera Post Processing). The VFE processing of the image data may include modifying the contrast or brightness of the image data, modifying digitally recorded lighting status data, performing compensation processing (e.g., white balance, automatic gain control, gamma correction, etc.) on the image data, performing filter processing on the image data, etc. CPP processing of image data may include scaling an image, providing a preview frame and a record frame to each path. Among other things, the CPP may use different codecs to process the preview and record frames.
The ISP processed image data may be sent to a defogging module 860 for defogging the image before being displayed. The defogging module 860 may perform defogging processing or the like on the extracted blue sky region of the image to be processed. The defogging module 860 may be a Central Processing Unit (CPU), a GPU, a coprocessor, or the like. After the defogging module 860 defogges the image data, the defogged image data may be transmitted to the encoder/decoder 870 to encode/decode the image data. The encoded image data may be saved and decompressed prior to display on a display 880 device. It is understood that the image data processed by the defogging module 860 may be directly transmitted to the display 880 for display without passing through the encoder/decoder 870. The image data processed by ISP processor 840 may also be processed by encoder/decoder 870 and then processed by defogging module 860. The encoder/decoder can be a CPU, a GPU, a coprocessor or the like in the mobile terminal.
The statistics determined by ISP processor 840 may be sent to control logic 850 unit. For example, the statistical data may include image sensor 814 statistical information such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 812 shading correction, and the like. Control logic 850 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of imaging device 810 and control parameters of IPS processor 840 based on the received statistics. For example, the control parameters may include sensor 820 control parameters (e.g., gain, integration time for exposure control), camera flash control parameters, lens 812 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), as well as lens 812 shading correction parameters.
In the present embodiment, the image processing method described above can be realized using the image processing technique in fig. 8.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned image processing method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. An image processing method, comprising:
acquiring an image to be processed;
judging whether the image to be processed contains a blue sky or not, and if so, extracting a blue sky area in the image to be processed;
carrying out defogging treatment on the blue sky area;
the defogging treatment of the blue sky area comprises the following steps:
determining the fog concentration of the blue sky area;
selecting a correction factor matched with the fog concentration, and calculating according to the correction factor to obtain the transmissivity;
carrying out defogging treatment on the blue sky area according to the transmissivity;
the judging whether the image to be processed contains a blue sky or not comprises the following steps:
acquiring shooting parameters related to the image to be processed;
and if the shooting parameters meet preset conditions, determining that the image to be processed contains a blue sky.
2. The method according to claim 1, wherein the extracting the blue sky region in the image to be processed comprises:
converting the image to be processed from a first color space to a second color space;
acquiring a parameter range of each color parameter in the second color space matched with the blue sky;
and extracting the blue sky area in the image to be processed according to the parameter range of the color parameters matched with the blue sky.
3. The method of claim 1 or 2, further comprising:
acquiring the brightness value of the image subjected to defogging processing;
and if the brightness value is smaller than a preset threshold value, adjusting the brightness value of the image subjected to the defogging treatment to be the preset threshold value.
4. An image processing apparatus characterized by comprising:
the image acquisition module is used for acquiring an image to be processed;
the judging module is used for judging whether the image to be processed contains a blue sky or not;
the extraction module is used for extracting a blue sky area in the image to be processed if the image to be processed contains a blue sky;
the defogging module is used for defogging the blue sky area;
the defogging module comprises:
the determining unit is used for determining the fog concentration of the blue sky area;
the calculation unit is used for selecting a correction factor matched with the fog concentration and calculating the transmittance according to the correction factor;
the defogging unit is used for defogging the blue sky area according to the transmissivity;
the judging module comprises:
the acquisition unit is used for acquiring shooting parameters related to the image to be processed;
and the determining unit is used for determining that the image to be processed contains the blue sky if the shooting parameters meet preset conditions.
5. The apparatus of claim 4,
the extraction module comprises:
the conversion unit is used for converting the image to be processed from a first color space to a second color space;
a parameter range obtaining unit, configured to obtain a parameter range in which each color parameter in the second color space matches a blue sky;
and the extraction unit is used for extracting the blue sky area in the image to be processed according to the parameter range of the color parameters matched with the blue sky.
6. The apparatus of claim 4 or 5, further comprising:
the brightness acquisition module is used for acquiring the brightness value of the image subjected to defogging processing;
and the adjusting module is used for adjusting the brightness value of the image subjected to the defogging processing to be the preset threshold value if the brightness value is smaller than the preset threshold value.
7. A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the method according to any of claims 1 to 3.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 3.
CN201710624485.5A 2017-07-27 2017-07-27 Image processing method, image processing device, mobile terminal and computer readable storage medium Active CN107317967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710624485.5A CN107317967B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710624485.5A CN107317967B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107317967A CN107317967A (en) 2017-11-03
CN107317967B true CN107317967B (en) 2020-03-27

Family

ID=60175044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710624485.5A Active CN107317967B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107317967B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948618A (en) * 2017-12-11 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN109003237A (en) * 2018-07-03 2018-12-14 深圳岚锋创视网络科技有限公司 Sky filter method, device and the portable terminal of panoramic picture
CN109712126B (en) * 2018-12-21 2020-11-06 深圳市华星光电半导体显示技术有限公司 Picture identification method and device
CN109934781B (en) * 2019-02-27 2020-10-23 合刃科技(深圳)有限公司 Image processing method, image processing device, terminal equipment and computer readable storage medium
CN112434581A (en) * 2020-11-14 2021-03-02 武汉中海庭数据技术有限公司 Outdoor target color identification method and system, electronic device and storage medium
CN113239939A (en) * 2021-05-12 2021-08-10 北京杰迈科技股份有限公司 Track signal lamp identification method, module and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105450923A (en) * 2014-09-25 2016-03-30 索尼公司 Image processing method, image processing device and electronic device
US9710715B2 (en) * 2014-12-26 2017-07-18 Ricoh Company, Ltd. Image processing system, image processing device, and image processing method
CN104935902B (en) * 2015-06-02 2017-03-15 三星电子(中国)研发中心 Image color Enhancement Method, device and electronic equipment
CN105872373B (en) * 2016-03-31 2019-08-23 北京奇虎科技有限公司 A kind of automatic defogging photographic method, device and equipment
CN106131441B (en) * 2016-09-06 2020-06-02 北京小米移动软件有限公司 Photographing method and device and electronic equipment

Also Published As

Publication number Publication date
CN107317967A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107424198B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107451969B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107317967B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN108024107B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN108419028B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107509031B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107730446B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN107493432B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107481186B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
CN110121031B (en) Image acquisition method and device, electronic equipment and computer readable storage medium
CN107945106B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN108259754B (en) Image processing method and device, computer readable storage medium and computer device
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107194901B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN107682611B (en) Focusing method and device, computer readable storage medium and electronic equipment
CN107392870B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107563329B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN107454318B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN109191398B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107424134B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107341782B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN108737797B (en) White balance processing method and device and electronic equipment
CN107578372B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment

Legal Events

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