CN107194901B - Image processing method, image processing device, computer equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN107194901B
CN107194901B CN201710624507.8A CN201710624507A CN107194901B CN 107194901 B CN107194901 B CN 107194901B CN 201710624507 A CN201710624507 A CN 201710624507A CN 107194901 B CN107194901 B CN 107194901B
Authority
CN
China
Prior art keywords
defogging
transmittance
image
black
channel
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
CN201710624507.8A
Other languages
Chinese (zh)
Other versions
CN107194901A (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 CN201710624507.8A priority Critical patent/CN107194901B/en
Publication of CN107194901A publication Critical patent/CN107194901A/en
Application granted granted Critical
Publication of CN107194901B publication Critical patent/CN107194901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/70
    • G06T5/73
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The invention relates to an image processing method, an image processing device, a computer device and a computer readable storage medium. The method comprises the following steps: shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image; acquiring a maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value; obtaining an original transmittance according to the atmospheric light value; and defogging the color image according to the atmospheric light value and the original transmittance. The calculated amount of the obtained atmospheric light value is small, and the defogging efficiency is improved.

Description

Image processing method, image processing device, computer equipment 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, an image processing apparatus, a computer device, and a computer-readable storage medium.
Background
With the rapid development of electronic technology, various electronic devices are provided with cameras, and users can record the seen scenery or the self-portrait images at any time and any place through the cameras. Due to the influence of the environment, fog often exists in the shot image, and the quality of the image is reduced. The traditional defogging method obtains the atmospheric light value, and has complex calculation and low defogging efficiency.
Disclosure of Invention
Embodiments of the present invention provide an image processing method, an image processing apparatus, a computer device, and a computer-readable storage medium, which can reduce the amount of computation and improve defogging efficiency.
An image processing method comprising:
shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image;
acquiring a maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value;
obtaining an original transmittance according to the atmospheric light value;
and defogging the color image according to the atmospheric light value and the original transmittance.
An image processing apparatus comprising:
the image acquisition module is used for shooting the same scene through the black-and-white camera to acquire a plurality of black-and-white images and shooting the same scene through the color camera to acquire a color image;
the first acquisition module is used for acquiring the maximum brightness value corresponding to each black-and-white image, carrying out weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value;
the second acquisition module is used for acquiring the original transmittance according to the atmospheric light value;
and the defogging processing module is used for performing defogging processing on the color image according to the atmospheric light value and the original transmittance.
A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the image processing method.
One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the image processing method.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram illustrating an exemplary environment in which an image processing method may be implemented;
FIG. 2 is a flow diagram of a method of image processing in one embodiment;
FIG. 3 is a flow chart of an image processing method in another embodiment;
FIG. 4 is a flowchart of an image processing method in another embodiment;
FIG. 5 is a flowchart of an image processing method in another embodiment;
FIG. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment;
FIG. 7 is a block diagram showing the construction of an image processing apparatus according to another embodiment;
FIG. 8 is a block diagram showing the construction of an image processing apparatus according to another embodiment;
FIG. 9 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 acquisition module may be referred to as a second acquisition module, and similarly, a second acquisition module may be referred to as a first acquisition module, without departing from the scope of the present disclosure. The first acquisition module and the second acquisition module are both acquisition modules, but they are not the same acquisition module.
Fig. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. As shown in fig. 1, the application environment includes a mobile terminal 110 with a black and white camera and a color camera and a scene 120. The method comprises the steps of shooting a scene 120 through a black-and-white camera on the mobile terminal 110 to obtain a plurality of black-and-white images, then shooting the same scene through a color camera to obtain a color image, obtaining a maximum brightness value corresponding to each black-and-white image, carrying out weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, taking the target brightness value as an atmospheric light value, obtaining an original transmittance according to the atmospheric light value, wherein the calculated amount of the atmospheric light value is small, and carrying out defogging processing on the color image according to the atmospheric light value and the original transmittance, so that the defogging efficiency is improved.
FIG. 2 is a flow diagram of a method of image processing in one embodiment. As shown in fig. 1, an image processing method includes:
step 202, shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image.
Specifically, a black-and-white camera refers to a camera for taking a black-and-white image. The color camera is a camera for taking a color image. For the same scene, the black-and-white camera can be shot by the black-and-white camera, and then the color image can be shot by the color camera. The scene is a place to be photographed, such as a zoo, a botanical garden, the sky, a coastline, or the like, or a place where a person is located.
A group of black and white images are shot for the same scene through a black and white camera. The set of black and white images has a plurality of black and white images.
And 204, acquiring the maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value.
Specifically, the brightness values of the pixel points in each black-and-white image are extracted, the brightness values are sorted from small to large or from large to small, and the maximum brightness value in each black-and-white image is screened out. Or, the brightness values of all the pixel points are directly compared, and the maximum brightness value of each black-and-white image is screened out.
The maximum brightness values of the black-and-white images are obtained, the weights of the black-and-white images can be set according to the shooting sequence, and the sum of the weights corresponding to all the black-and-white images is 1. For example, 5 black and white images are taken, and the corresponding weight setting may be 0.3, 0.2, 0.1, or the corresponding weight setting may be 0.2, etc., but is not limited thereto. And weighting and summing according to the maximum brightness value in the black-white image and the corresponding weight value to obtain a target brightness value, and taking the target brightness value as an atmospheric light value.
And step 206, acquiring the original transmittance according to the atmospheric light value.
Specifically, after the atmospheric light value is obtained, the original transmittance can be calculated through a dark primary color prior algorithm.
And 208, defogging the color image according to the atmospheric light value and the original transmittance.
Specifically, after the atmospheric light value and the original transmittance are obtained, the color image can be subjected to defogging treatment through a primary color prior algorithm.
The method for defogging the color image based on the dark channel prior algorithm comprises the following steps:
obtaining an atmospheric scattering model:
i (x) ═ j (x) t (x) + a (1-t (x)) formula (1)
Wherein, i (x) represents a fog-containing image which needs to be defogged, j (x) represents a fog-free image obtained after the fog-containing image is defogged, x represents the spatial position of a certain pixel in the image, t (x) is the original transmittance, and a is the atmospheric light value. The atmospheric light value can be obtained by calculating a black-and-white image, and can also be obtained by the corresponding relation between the atmospheric light value and the weather condition and the current time. In a normal case, the pixel with the maximum brightness value in the black-and-white image may be selected as the estimation of the atmospheric light value. In this embodiment, the atmospheric light value is obtained by capturing a black-and-white image with a black-and-white camera, and the maximum brightness value in the black-and-white image is used as the atmospheric light value. Assuming that a is a known value, there exists a channel with a very low channel value in three channels of RGB (Red, Green, Blue) in the color image, and the channel value is close to zero, then it can be obtained:
Figure BDA0001362510990000041
in the formula (2), Jdark(x) Representing dark channel images, Jc(y) denotes each color channel of the color image, and Ω (x) denotes a window centered on pixel x. The original transmittance can be obtained from equation (2), i.e.:
Figure BDA0001362510990000042
in the formula (3), the first and second groups,
Figure BDA0001362510990000043
namely the dark primary color value of the fog-containing image in the x field.
The atmospheric light value is substituted into the formula (3) to obtain the original transmittance, and the color image is used as I (x), and the atmospheric light value A and the original transmittance t (x) are substituted into the formula (1) to obtain the defogged color image J (x).
In the embodiment, the black-and-white images are shot through the black-and-white camera, the maximum brightness values in the black-and-white images are obtained, the maximum brightness values are weighted and summed to obtain the target brightness value, the target brightness value is used as the atmospheric light value, the calculated amount of the atmospheric light value is small, the speed is high, the original transmittance is obtained according to the atmospheric light value, the color image shot in the same scene is defogged according to the atmospheric light value and the original transmittance, the defogging efficiency is improved, the atmospheric light value is obtained according to the maximum brightness values of the black-and-white images, the calculation is more accurate, and the defogging is more accurate.
In one embodiment, a weight ω between 0 and 1 may be introduced to adjust the original transmittance, and the final defogging parameter, i.e. the transmittance expression, is as follows:
Figure BDA0001362510990000051
in the formula (4), Ic(y) three channels representing pixels R, G, B of preview image I (x); ω is called a defogging degree factor, and a smaller ω means a smaller defogging degree, and a larger ω means a larger defogging degree.
And (3) obtaining the transmittance by adopting a formula (4) according to the atmospheric light value and the defogging degree factor, and then substituting the color image as I (x), the atmospheric light value A and the original transmittance t (x) into the formula (1) to obtain the defogged color image J (x).
In addition, in order to secure the defogging effect, a threshold value t may be set for the transmittance0Then the scene without fog is:
Figure BDA0001362510990000052
fig. 3 is a flowchart of an image processing method in another embodiment. As shown in fig. 3, an image processing method, which is different from the method of fig. 2 in that defogging with different transmittances is adopted for different channels, includes:
step 302, shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image.
And 304, acquiring the maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value.
Specifically, the brightness values of all pixel points in the black-and-white image are extracted, the brightness values are sorted from small to large or from large to small, the maximum brightness value is screened out, and the maximum brightness value is used as an atmospheric light value.
And step 306, acquiring the original transmittance according to the atmospheric light value.
Specifically, after the atmospheric light value is obtained, the original transmittance can be calculated through a dark primary color prior algorithm.
Step 308, obtaining a transmittance factor of each of the three preset RGB channels.
For fog with the same concentration, the influence degree on the red, green and blue three wave bands is increased, and the transmissivity of the three wave bands of the red, green and blue is ranked as follows: the red band has the highest transmittance, the green band is the second order, and the blue band is the lowest; therefore, in the foggy area, the treatment intensity for the three RGB bands should be increased.
The thicker the fog concentration is, the greater the difference of the influence of the fog on the three RGB wave bands is, and the greater the difference of the processing intensity on the three RGB wave bands should be. Meanwhile, in the area without fog, the three RGB wave bands are not processed.
For this purpose, two adjustment coefficients, i.e. a transmission factor W, are introduced based on the original transmissionGAnd WB. With these two coefficients, different defogging intensities are applied to the RGB three bands.
T∈[0,1];TR=t
WG=(a+b*t)2;TG=WG*t
WB=(c+d*t)2;TB=WB*t
Where T is the raw transmittance extracted from the dark channel prior algorithm, TR、TG、TBRespectively, for the three bands of RGB, and different values of the transmittance represent different intensities of the treatment for the three bands. The parameters a, b, c and d can be selected according to actual conditions, for example, a can be 0.9, b can be 0.1, c can be 0.7 and d can be 0.3.
And 310, acquiring the wave band transmittance of each channel in the three RGB channels according to the transmittance factor and the original transmittance.
The wave band transmittance of the RGB three channels can be obtained according to the transmittance factor and the original transmittance.
And 312, performing defogging processing on each channel of RGB of the color image according to the atmospheric light value and the wave band transmittance of each channel of RGB.
According to the image processing method in the embodiment, the black-and-white image is shot through the black-and-white camera, the maximum brightness values in the multiple black-and-white images are obtained, the target brightness values are obtained through weighted summation, the target brightness values are used as the atmospheric light values, the calculated amount of the atmospheric light values is small, the speed is high, the atmospheric light values are obtained according to the maximum brightness values of the multiple black-and-white images, the calculation is more accurate, and the defogging is more accurate; and then obtaining an original transmittance according to the atmospheric light value, obtaining transmittance factors of RGB three channels, obtaining the wave band transmittance of each channel according to the transmittance factor adjustment and the original transmittance, and carrying out defogging treatment on the color image by adopting the wave band transmittance corresponding to each channel, so that the image is prevented from being bluish, the defogging efficiency is improved, and the true and natural color restoration is realized.
Fig. 4 is a flowchart of an image processing method in another embodiment. As shown in fig. 4, an image processing method, which is different from the method of fig. 2 in that a defogging level is increased, includes:
step 402, shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image.
Step 404, obtaining a maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value.
And 406, acquiring the original transmittance according to the atmospheric light value.
And 408, acquiring a defogging grade, and acquiring a corresponding defogging degree factor according to the defogging grade.
In one embodiment, the correspondence between different defogging levels and defogging degree factors may be set in advance. For example, 6 defogging levels may be provided for selection, each corresponding to a different defogging level factor, for example, when the defogging level is zero level, the defogging level factor ω 0 is 0.50; when the defogging grade is first grade, the defogging grade factor omega 1 is 0.60, and so on. The preset defogging degree factor corresponding to the defogging grade can be searched according to the defogging grade.
And step 410, performing defogging treatment on the color image according to the defogging degree factor, the atmospheric light value and the original transmittance.
And (3) calculating new transmittance by adopting a formula (4), and then carrying out defogging treatment on the color image according to the new transmittance and the atmospheric light value.
In the image processing method in the embodiment, the black-and-white image is shot by the black-and-white camera, the maximum brightness values in the multiple black-and-white images are obtained, the target brightness values are weighted and summed to obtain the target brightness value, the target brightness value is used as the atmospheric light value, the calculated amount of the atmospheric light value is small, the speed is high, the original transmittance is obtained according to the atmospheric light value, the defogging grade is obtained, the corresponding defogging degree factor is obtained according to the defogging grade, the original transmittance is adjusted according to the defogging degree factor to generate the new transmittance, and the corresponding defogging can be performed according to the defogging requirements of the user, so that the requirements of different users are met.
Fig. 5 is a flowchart of an image processing method in another embodiment. As shown in fig. 5, an image processing method includes:
step 502, shooting the same scene through a black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through a color camera to obtain a color image.
Step 504, obtaining the maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value.
Step 506, obtaining the original transmittance according to the atmospheric light value.
And step 508, acquiring a defogging grade, and acquiring a corresponding defogging degree factor according to the defogging grade.
Step 510, obtaining a transmittance factor of each of the three preset RGB channels.
And step 512, acquiring the wave band transmittance of each channel in the three RGB channels according to the transmittance factor, the defogging degree factor and the original transmittance.
And 514, performing defogging treatment on each channel of RGB of the color image according to the atmospheric light value and the wave band transmissivity of each channel of RGB.
Wherein steps 508 and 510 are not in sequence.
In the image processing method in the embodiment, the black-and-white image is shot by the black-and-white camera, the maximum brightness values in a plurality of black-and-white images are obtained, the target brightness values are weighted and summed to obtain the target brightness value, the target brightness value is used as the atmospheric light value, the calculated amount of the atmospheric light value is small, the speed is high, the original transmittance is obtained according to the atmospheric light value, the transmittance factors of three channels of RGB are obtained, the playing transmittance of each channel is obtained according to the transmittance factor adjustment and the original transmittance, the band transmittance corresponding to each channel is adopted to carry out defogging processing on the color image, the image is prevented from being bluish, the defogging efficiency is improved, and the true and natural color restoration; and corresponding defogging is carried out according to the defogging requirements of the users, so that the requirements of different users are met.
In one embodiment, the image processing method further includes: detecting the number of noise points of the color image after the defogging treatment; and if the number of the noise points is larger than a preset threshold value, carrying out noise reduction treatment on the color image after the defogging treatment.
Specifically, the preset threshold may be set as needed or obtained according to historical statistics. By reducing the noise of the image, the quality of the image is improved.
In one embodiment, the image processing method further includes: acquiring the brightness value of each pixel point in the color image after the defogging treatment; and if the brightness value is smaller than a preset brightness value, adjusting the brightness value to be the preset brightness value.
The preset brightness value may be an empirical value or set as needed. By adjusting the brightness value, the quality of the image after defogging can be improved.
FIG. 6 is a block diagram showing an example of the structure of an image processing apparatus. As shown in fig. 6, an image processing apparatus 600 includes an image capturing module 602, a first obtaining module 604, a second obtaining module 606, and a defogging processing module 608. Wherein:
the image capturing module 602 is configured to capture a same scene through a black-and-white camera to obtain a plurality of black-and-white images, and capture the same scene through a color camera to obtain a color image.
The first obtaining module 604 is configured to obtain a maximum brightness value corresponding to each black-and-white image, perform weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and use the target brightness value as an atmospheric light value.
The second obtaining module 606 is configured to obtain an original transmittance according to the atmospheric light value.
The defogging processing module 608 is configured to perform defogging processing on the color image according to the atmospheric light value and the original transmittance.
In the image processing device in this embodiment, a black-and-white image is captured by a black-and-white camera, maximum brightness values in a plurality of black-and-white images are obtained, a target brightness value is obtained by weighting and summing the maximum brightness values, the target brightness value is used as an atmospheric light value, the calculation amount of the atmospheric light value is small, the speed is high, an original transmittance is obtained according to the atmospheric light value, defogging is performed on a color image captured in the same scene according to the atmospheric light value and the original transmittance, the defogging efficiency is improved, the atmospheric light value is obtained according to the maximum brightness values of the black-and-white images, and the calculation is more accurate and the defogging is.
Fig. 7 is a block diagram showing the configuration of an image processing apparatus according to another embodiment. As shown in fig. 7, an image processing apparatus 700 includes an image acquisition module 702, a first acquisition module 704, a second acquisition module 706, a third acquisition module 708, a fourth acquisition module 710, and a defogging processing module 712. Wherein: the image acquisition module 702, the first acquisition module 704, and the second acquisition module 706 have the same functions as the corresponding modules in fig. 6.
The third obtaining module 708 is configured to obtain a transmittance factor of each of the three preset RGB channels after obtaining the original transmittance according to the atmospheric light value.
The fourth obtaining module 710 is configured to obtain a band transmittance of each of the three RGB channels according to the transmittance factor and the original transmittance.
The defogging processing module 712 is further configured to perform defogging processing on each channel of RGB of the color image according to the atmospheric light value and the band transmittance of each channel of RGB.
In the image processing device in this embodiment, a black-and-white image is captured by a black-and-white camera, maximum luminance values in a plurality of black-and-white images are obtained, a target luminance value is obtained by weighting and summing the maximum luminance values, the target luminance value is used as an atmospheric light value, the calculated amount of the atmospheric light value is small, the speed is high, an original transmittance is obtained according to the atmospheric light value, transmittance factors of three RGB channels are obtained, the band transmittance of each channel is obtained according to the transmittance factor adjustment and the original transmittance, and the band transmittance corresponding to each channel is used for defogging the color image, so that the image is prevented from being bluish, the defogging efficiency is improved, and the true and natural color restoration is realized.
Fig. 8 is a block diagram showing the configuration of an image processing apparatus according to another embodiment. As shown in fig. 8, an image processing apparatus 800 includes an image acquisition module 802, a first acquisition module 804, a second acquisition module 806, a defogging level acquisition module 808, and a defogging processing module 810. Wherein: the image acquisition module 802, the first acquisition module 804 and the second acquisition module 806 have the same functions as the corresponding modules in fig. 6.
The defogging level obtaining module 808 is configured to obtain a defogging level after obtaining the original transmittance according to the atmospheric light value.
The defogging processing module 810 is configured to perform defogging processing on the color image according to the defogging level, the atmospheric light value and the original transmittance.
In one embodiment, the image processing device comprises an image acquisition module, a first acquisition module, a second acquisition module, a third acquisition module, a defogging level acquisition module, a fourth acquisition module and a defogging processing module. The image acquisition module is used for shooting the same scene through the black-and-white camera to acquire a plurality of black-and-white images and shooting the same scene through the color camera to acquire a color image; the first acquisition module is used for acquiring the maximum brightness value corresponding to each black-and-white image, carrying out weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value; the second acquisition module is used for acquiring the original transmittance according to the atmospheric light value; the defogging grade acquisition module is used for acquiring a defogging grade and acquiring a corresponding defogging degree factor according to the defogging grade; the third acquisition module is used for acquiring the transmittance factor of each channel in the preset RGB three channels; the fourth acquisition module is used for acquiring the wave band transmittance of each channel in the RGB three channels according to the transmittance factor, the defogging degree factor and the original transmittance; and the defogging processing module is used for defogging each channel of RGB of the color image according to the atmospheric light value and the wave band transmissivity of each channel of RGB.
In one embodiment, the image processing apparatus may further include a detection module and a noise reduction module. The detection module is used for detecting the noise quantity of the color image subjected to defogging treatment; and the noise reduction module is used for performing noise reduction processing on the defogged color image if the number of the noise points is greater than a preset threshold value.
In one embodiment, the image processing apparatus may further include a brightness obtaining module and a brightness adjusting module. The brightness obtaining module is used for obtaining the brightness value of each pixel point in the color image after the defogging processing. The brightness adjusting module is used for adjusting the brightness value to be a preset brightness value if the brightness value is smaller than the preset brightness value.
The preset brightness value may be an empirical value or set as needed. By adjusting the brightness value, the quality of the image after defogging can be improved.
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 a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the image processing methods described in embodiments of the invention.
The embodiment of the invention also provides computer equipment. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions, which when executed by the processor, cause the processor to perform the image processing method described in embodiments of the present invention.
The embodiment of the invention also provides computer equipment. The computer device includes therein 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. 9 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 9, for convenience of explanation, only aspects of the image processing technique related to the embodiment of the present invention are shown.
As shown in fig. 9, the image processing circuit includes an ISP processor 940 and a control logic 950. The image data captured by the imaging device 910 is first processed by the ISP processor 940, and the ISP processor 940 analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of the imaging device 910. The imaging device 910 may include a camera having one or more lenses 912 and an image sensor 914. Image sensor 914 may include an array of color filters (e.g., Bayer filters), and image sensor 914 may acquire light intensity and wavelength information captured with each imaging pixel of image sensor 914 and provide a set of raw image data that may be processed by ISP processor 940. The sensor 920 may provide the raw image data to the ISP processor 940 based on the type of interface of the sensor 920. The sensor 920 interface may utilize a SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above. The sensor 920 may be used to provide parameters for image processing, such as anti-shake parameters, gain parameters, etc. Imaging device 910 may include a black and white camera and a color camera. The black-and-white camera collects black-and-white images, and the color camera collects color images of the same scene as the black-and-white camera.
The ISP processor 940 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 the ISP processor 940 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 940 may also receive pixel data from image memory 930. For example, raw pixel data is sent from the sensor 920 interface to the image memory 930, and the raw pixel data in the image memory 930 is then provided to the ISP processor 940 for processing. The image Memory 930 may be a part 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 920 interface or from the image memory 930, the ISP processor 940 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to or image memory 930 for additional processing before being displayed. ISP processor 940 receives processed data from image memory 930 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to a display 980 for viewing by a user and/or further processing by a graphics engine or GPU (graphics processing Unit). Further, the output of ISP processor 940 may also be sent to image memory 930 and display 980 may read image data from image memory 930. In one embodiment, image memory 930 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 940 may be transmitted to an encoder/decoder 970 for encoding/decoding image data. The encoded image data may be saved and decompressed prior to display on a display 980 device.
The ISP processed image data may be sent to a defogging module 960 to defogge the image before being displayed. The defogging module 960 obtains a maximum brightness value corresponding to each of the black-and-white images, performs weighting processing on the maximum brightness value corresponding to each of the black-and-white images to obtain a target brightness value, uses the target brightness value as an atmospheric light value, obtains an original transmittance according to the atmospheric light value, and performs defogging processing on the color image according to the atmospheric light value and the original transmittance. After the defogging module 960 defogges the image data, the defogged image data may be transmitted to the encoder/decoder 970 to encode/decode the image data. The encoded image data may be saved and decompressed prior to display on a display 980 device. It is understood that the image data processed by the defogging module 960 may be sent directly to the display 980 for display without passing through the encoder/decoder 970. The image data processed by the ISP processor 940 may also be processed by the encoder/decoder 970 and then processed by the defogging module 960. The defogging module 960 or the encoder/decoder 970 may be a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU) in the mobile terminal.
The statistical data determined by the ISP processor 940 may be transmitted to the control logic 950 unit. For example, the statistical data may include image sensor 914 statistics such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 912 shading correction, and the like. The control logic 950 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of the imaging device 910 and, in turn, control parameters based on the received statistical data. For example, the control parameters may include sensor 920 control parameters (e.g., gain, integration time for exposure control), camera flash control parameters, lens 912 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 912 shading correction parameters.
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 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 present 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 is applied to a mobile terminal with a black-and-white camera and a color camera, and comprises the following steps:
shooting the same scene through the black-and-white camera to obtain a plurality of black-and-white images, and shooting the same scene through the color camera to obtain a color image;
acquiring a maximum brightness value corresponding to each black-and-white image, performing weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value;
obtaining an original transmittance according to the atmospheric light value;
obtaining a transmittance factor of each channel in preset RGB three channels, wherein the transmittance factor in the R channel is 1, and the transmittance factor in the G channel is (a + b t)2And the transmissivity factor in the B channel is (c + d t)2The t is the original transmittance, and the values of a, b, c and d are obtained according to the actual condition;
acquiring the wave band transmittance of each channel in the three RGB channels according to the product of the transmittance factor and the original transmittance;
and carrying out defogging treatment on each channel of RGB of the color image according to the atmospheric light value and the wave band transmissivity of each channel of RGB.
2. The method of claim 1, wherein after the step of obtaining the raw transmittance from the atmospheric light value, the method further comprises:
acquiring a defogging grade, and acquiring a corresponding defogging degree factor according to the defogging grade;
the step of performing defogging processing on each channel of RGB of the color image according to the atmospheric light value and the wave band transmissivity of each channel of RGB comprises the following steps:
and carrying out defogging treatment on each channel of RGB of the color image according to the defogging degree factor, the atmospheric light value, the original transmittance and the wave band transmittance of each channel of RGB.
3. The method of claim 1, further comprising:
detecting the number of noise points of the color image after the defogging treatment;
and if the number of the noise points is larger than a preset threshold value, carrying out noise reduction treatment on the color image after the defogging treatment.
4. The method of claim 1, further comprising:
acquiring the brightness value of each pixel point in the color image after the defogging treatment;
and if the brightness value is smaller than a preset brightness value, adjusting the brightness value to be the preset brightness value.
5. An image processing apparatus, applied to a mobile terminal with a black-and-white camera and a color camera, comprising:
the image acquisition module is used for shooting the same scene through the black-and-white camera to acquire a plurality of black-and-white images and shooting the same scene through the color camera to acquire a color image;
the first acquisition module is used for acquiring the maximum brightness value corresponding to each black-and-white image, carrying out weighting processing on the maximum brightness value corresponding to each black-and-white image to obtain a target brightness value, and taking the target brightness value as an atmospheric light value;
the second acquisition module is used for acquiring the original transmittance according to the atmospheric light value;
a third obtaining module, configured to obtain a transmittance factor of each of preset RGB three channels, where the transmittance factor in the R channel is 1, and the transmittance factor in the G channel is (a + b × t)2And the transmissivity factor in the B channel is (c + d t)2The t is the original transmittance, and the values of a, b, c and d are obtained according to the actual condition;
the fourth acquisition module is used for acquiring the wave band transmittance of each channel in the three RGB channels according to the product of the transmittance factor and the original transmittance;
and the defogging processing module is used for defogging each channel of RGB of the color image according to the atmospheric light value and the wave band transmissivity of each channel of RGB.
6. The apparatus of claim 5, further comprising:
the defogging grade acquisition module is used for acquiring a defogging grade after the original transmittance is acquired according to the atmospheric light value, and acquiring a corresponding defogging degree factor according to the defogging grade;
and the defogging processing module is also used for defogging each channel of RGB of the color image according to the defogging degree factor, the atmospheric light value, the original transmittance and the wave band transmittance of each channel of RGB.
7. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 4.
8. A non-transitory computer-readable storage medium containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-4.
CN201710624507.8A 2017-07-27 2017-07-27 Image processing method, image processing device, computer equipment and computer readable storage medium Active CN107194901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710624507.8A CN107194901B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710624507.8A CN107194901B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, computer equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107194901A CN107194901A (en) 2017-09-22
CN107194901B true CN107194901B (en) 2020-01-10

Family

ID=59884915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710624507.8A Active CN107194901B (en) 2017-07-27 2017-07-27 Image processing method, image processing device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107194901B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163804A (en) * 2018-06-05 2019-08-23 腾讯科技(深圳)有限公司 Image defogging method, device, computer equipment and storage medium
CN109741408A (en) * 2018-11-23 2019-05-10 成都品果科技有限公司 A kind of image and video caricature effect real-time rendering method
CN110458768B (en) * 2019-07-16 2022-03-01 上海联影智能医疗科技有限公司 Image processing method, computer device, and readable storage medium
CN111739041B (en) * 2020-05-18 2024-04-12 北京完美知识科技有限公司 Image frame clipping method, device and equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411774B (en) * 2011-08-08 2013-05-01 安科智慧城市技术(中国)有限公司 Processing method, device and system based on single-image defogging
KR101470831B1 (en) * 2013-05-28 2014-12-10 전남대학교산학협력단 Appatatus for image dehazing using the user controllable radical root operation
CN103761720B (en) * 2013-12-13 2017-01-04 中国科学院深圳先进技术研究院 Image defogging method and image demister

Also Published As

Publication number Publication date
CN107194901A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
US10757312B2 (en) Method for image-processing and mobile terminal using dual cameras
CN107948519B (en) Image processing method, device and equipment
EP3480783B1 (en) Image-processing method, apparatus and device
CN213279832U (en) Image sensor, camera and terminal
CN107451969B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN108712608B (en) Terminal equipment shooting method and device
CN108419028B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
JP6903816B2 (en) Image processing method and equipment
CN107509044B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN107194901B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN112118378A (en) Image acquisition method and device, terminal and computer readable storage medium
CN108717530B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
CN108322651B (en) Photographing method and device, electronic equipment and computer readable storage medium
CN107317967B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107800971B (en) Auto-exposure control processing method, device and the equipment of pan-shot
CN107341782B (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN108322648B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN110213462B (en) Image processing method, image processing device, electronic apparatus, image processing circuit, and storage medium
CN107454318B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107464225B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN109191398B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108600631B (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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant