CN110097520A - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- Publication number
- CN110097520A CN110097520A CN201910375766.0A CN201910375766A CN110097520A CN 110097520 A CN110097520 A CN 110097520A CN 201910375766 A CN201910375766 A CN 201910375766A CN 110097520 A CN110097520 A CN 110097520A
- Authority
- CN
- China
- Prior art keywords
- image
- value
- processed
- channel value
- block
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000012545 processing Methods 0.000 claims abstract description 44
- 238000000034 method Methods 0.000 claims abstract description 27
- 239000003086 colorant Substances 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 7
- 238000000889 atomisation Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000000694 effects Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000005611 electricity Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000005291 magnetic effect Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 241001062009 Indigofera Species 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 210000003127 knee Anatomy 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
Embodiment of the disclosure discloses image processing method and device.One specific embodiment of this method includes: the color value of the pixel based on image to be processed, determines the dark channel value and bright channel value of image to be processed, wherein bright channel value, dark channel value are used to indicate the shading value of image to be processed;Based on identified bright channel value and dark channel value, the offset that color value adjustment is carried out to image to be processed is determined;Based on identified offset, adjust the pixel value of image to be processed, the image that obtains that treated, the color of the adjustable image to be processed of the embodiment, or defogging processing is carried out to the image or the heavier image of shade that there is atomization in captured image, goes Shadows Processing, to improve image image quality.
Description
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to image processing method and device.
Background technique
With the development of electronic technology, image processing techniques is widely used.User likes installing using terminal
Various image processing class application carry out image procossing.For example, user can beautify captured photo, image is removed
In noise etc.;The light levels of captured photo can also be adjusted;It can also remove unwanted in captured photo
Scenery (such as get rid of people) around target subject etc..
In associated picture processing technique, when image is excessive lightness or darkness, it usually needs carried out to the gray value of image whole
Adjustment, to reduce the lightness or darkness of image.
Summary of the invention
Embodiment of the disclosure proposes image processing method and device.
In a first aspect, embodiment of the disclosure provides a kind of image processing method, this method comprises: being based on figure to be processed
The color value of the pixel of picture determines the dark channel value and bright channel value of image to be processed, wherein bright channel value, dark channel value are used for
Indicate the shading value of image to be processed;Based on identified bright channel value and dark channel value, determines and color is carried out to image to be processed
It is worth the offset of adjustment;Based on identified offset, the pixel value of image to be processed is adjusted, the image that obtains that treated.
In some embodiments, the dark channel value of image to be processed is determined, comprising: image to be processed is divided into present count
Mesh block, each of preset number block block include preset number pixel;For in preset number block
Block, determine in the three-primary colours color value of pixel included by the block, the smallest color value;To minimum in identified each block
Color value summation, obtained summed result is determined as to the dark channel value of image to be processed.
In some embodiments, the bright channel value of image to be processed is determined, comprising: for the area in preset number block
Block determines in the three-primary colours color value of pixel included by the block, maximum color value;To maximum color in identified each block
Obtained summed result, is determined as the bright channel value of image to be processed by value summation.
In some embodiments, based on identified bright channel value and dark channel value, determine need to image to be processed into
The offset of row processing, comprising: determine the ratio of bright channel value and dark channel value;Based on ratio, preset bright channel with
The ratio of dark, dark channel value, determine offset.
In some embodiments, each of preset number block block includes a pixel.
In some embodiments, the ratio of preset bright channel and dark is based in historical sample image set
What the bright channel value of historical sample image and the ratio of dark channel value determined.
Second aspect, embodiment of the disclosure provide a kind of image processing apparatus, which includes: first determining single
Member is configured to the color value of the pixel based on image to be processed, determines the dark channel value and bright channel value of image to be processed,
In, bright channel value, dark channel value are used to indicate the shading value of image to be processed;Second determination unit is configured to based on institute really
Fixed bright channel value and dark channel value determine the offset that color value adjustment is carried out to image to be processed;Image processing unit is matched
It is set to the pixel value that image to be processed is adjusted based on identified offset, the image that obtains that treated.
In some embodiments, the first determination unit is further configured to: image to be processed is divided into preset number
A block, each of preset number block block include preset number pixel;For in preset number block
Block determines in the three-primary colours color value of pixel included by the block, the smallest color value;To the smallest in identified each block
Obtained summed result, is determined as the dark channel value of image to be processed by color value summation.
In some embodiments, the first determination unit is further configured to: for the block in preset number block,
It determines in the three-primary colours color value of pixel included by the block, maximum color value;To maximum color value in identified each block
Obtained summed result, is determined as the bright channel value of image to be processed by summation.
In some embodiments, the second determination unit is further configured to: determining the ratio of bright channel value and dark channel value
Value;Ratio, dark channel value based on ratio, preset bright channel and dark, determine offset.
In some embodiments, each of preset number block block includes a pixel.
In some embodiments, the ratio of preset bright channel and dark is based in historical sample image set
What the bright channel value of historical sample image and the ratio of dark channel value determined.
The third aspect, embodiment of the disclosure provide a kind of electronic equipment, which includes: one or more places
Manage device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors,
So that one or more processors realize the method as described in implementation any in first aspect.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program,
The method as described in implementation any in first aspect is realized when the computer program is executed by processor.
Embodiment of the disclosure provide image processing method and device, by the dark channel value of determination image to be processed,
Bright channel value determines the offset handled image to be processed, adjusts finally by identified offset to be processed
The pixel value of image, the image that obtains that treated, so as to adjust the color of image to be processed, or in captured image
There are the images of atomization or the heavier image of shade to carry out defogging processing, goes Shadows Processing, to improve image image quality.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the image processing method of the disclosure;
Fig. 3 is the process according to a kind of one embodiment of optional implementation of the image processing method of the disclosure
Figure;
Fig. 4 a- Fig. 4 b is the schematic diagram of an application scenarios of image processing method according to an embodiment of the present disclosure;
Fig. 5 is the structural schematic diagram according to one embodiment of the image processing apparatus of the disclosure;
Fig. 6 is adapted for the structural schematic diagram for realizing the electronic equipment of embodiment of the disclosure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase
Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the exemplary frame of the embodiment of the image processing method or image processing apparatus of the disclosure
Structure 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
The capture apparatus such as camera can be installed on terminal device 101,102,103, user can also be installed and such as clapped
Take the photograph class application.To which user can carry out image taking etc. by terminal device 101,102,103.Terminal device 101,102,
Various client applications are also equipped on 103.Such as web browser applications, video class are applied, content share class is applied,
Social category application etc., thus, user can also obtain image by the application.Terminal 101,102,103, which is also equipped with, such as to be schemed
As processing class application.To which user can be to the image obtained by shooting class application or the image obtained by other application
It is handled.Terminal device 101,102,103 can be interacted by network 104 with server 105, to receive or send message
Deng.
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard
When part, it can be the various electronic equipments that can receive user's operation, including but not limited to smart phone, tablet computer, electronics
Book reader, pocket computer on knee and desktop computer etc..It, can be with when terminal device 101,102,103 is software
It is mounted in above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing distribution in it
The multiple softwares or software module of formula service), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be the background server for supporting the client application installed on terminal device 101,102,103.
The image that terminal device 101,102,103 can will acquire is sent to server 105, so that server 105 carries out image
Processing, and image returns to terminal device 101,102,103 by treated.Alternatively, being installed to terminal device 101,102,103
Image processing class using each processing function provide support server.
It should be noted that server 105 can be hardware, it is also possible to software.When server is hardware, Ke Yishi
The distributed server cluster of ready-made multiple server compositions, also may be implemented into individual server.When server is software,
Multiple softwares or software module (such as providing multiple softwares of Distributed Services or software module) may be implemented into, it can also
To be implemented as single software or software module.It is not specifically limited herein.
It should be noted that image processing method provided by embodiment of the disclosure can by terminal device 101,102,
103 execute, and can also be executed by server 105.When the memory shared by the image is excessive, can use server to image at
Reason;When the ability of the image processor of terminal device processing image is enough, can be executed by terminal device 101,102,103.
Correspondingly, image processing apparatus is set in terminal device 101,102,103 or is set in server 105.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates the processes 200 according to one embodiment of the image processing method of the disclosure.It should
Image processing method the following steps are included:
Step 201, the color value of the pixel based on image to be processed, determine image to be processed dark channel value and bright channel
Value.
In the present embodiment, executing subject (such as the terminal device shown in FIG. 1 101,102,103 of image processing method
Or server 105) after getting image to be processed, can determine first image to be processed pixel color value.Figure
The color of picture is made of the channel three Color Channel R (Red, red), G (Green, green) channel, B (Blue, blue) channel,
The variation range of each Color Channel is (0~255).The color value of each pixel is by red color value, green color value and indigo plant
Color color value composition.The RGB color value is a value being derived from 0~255.
Herein, dark is the concept defined based on image defogging algorithm proposed by doctor He Kaiming.Specifically, dark
Channel value is the minimum value of luminous intensity in a certain region of image.It that is to say the smallest in the rgb value of all pixels in the region
Value.Bright channel value is the maximum value as luminous intensity in a certain region.It that is to say maximum in the rgb value of all pixels in the region
Value.In other words, above-mentioned two channel value, dark channel value are used to indicate the shading value of image.
In some optional implementations of the present embodiment, the dark channel value of image to be processed is determined, comprising: will be wait locate
Reason image is divided into preset number block;For the block in preset number block, pixel included by the block is determined
Three-primary colours color value in, the smallest color value;It sums to color value the smallest in identified each block, by obtained summed result
It is determined as the dark channel value of image to be processed.
Specifically, the preset number block can be artificially specified.The number is determined according to the size of image.Work as figure
As it is excessive when, the number of blocks of block can be increased, when image is smaller, it is possible to reduce the number of block, according to application scenarios
Need to set.Herein, each block includes multiple pixels.The number of pixel included by it is true according to the size of block
It is fixed.Then, for each of preset number block block, above-mentioned executing subject can be determined included by the block
In the RGB of pixel, the smallest color value.As an example, when including 1000 pixels, one of pixel in a certain block of image
Rgb value be respectively 10,100,100.The rgb value of rest of pixels is all larger than 10.It is thus possible to determine the smallest color in the block
Value is 10.Then, above-mentioned executing subject can sum to color value the smallest in identified each block, using summed result as to
Handle the dark channel value of image.For example, the minimum when above-mentioned image to be processed is made of 5 blocks, in 5 blocks
Color value is respectively 10,20,30.Then the dark channel value of image to be processed is 50.
In some optional implementations of the present embodiment, the bright channel value of image to be processed is determined, comprising: for upper
The block in preset number block is stated, is determined in the three-primary colours color value of pixel included by the block, maximum color value;To institute
Obtained summed result, is determined as the bright channel value of image to be processed by maximum color value summation in determining each block.
Specifically, for each of preset number block block, above-mentioned executing subject can determine the block
In the RGB of included pixel, maximum color value.As an example, when including 1000 pixels in a certain block of image, wherein
The rgb value of one pixel is respectively 10,100,200.The rgb value of rest of pixels is respectively less than 200.It is thus possible to determine the block
In maximum color value be 200.Then, above-mentioned executing subject can sum to color value maximum in identified each block, will ask
Bright channel value with result as image to be processed.For example, when above-mentioned image to be processed is made of 5 blocks, this 5
Maximum color value in block is respectively 220,200,180,70,100.Then the bright channel value of image to be processed is 770.
It can be circle etc. herein it is worth noting that, the shape of above-mentioned each block can be rectangle.For the ease of right
The segmentation of image, is usually shaped to square for block.In other words, picture corresponding to each side length in each block
The number of element is all the same.
Step 202, it based on identified bright channel value and dark channel value, determines and color value adjustment is carried out to image to be processed
Offset.
In the present embodiment, above-mentioned executing subject can determine that this is bright based on identified bright channel value and dark channel value
The ratio of channel value and dark channel value.Then, above-mentioned offset is determined based on the ratio.In general, the ratio is bigger, illustrate image
In brightness and darkness difference it is bigger namely brightness of image is excessively high, can suitably reduce brightness, so as to by above-mentioned image to
Reduce the direction offset of brightness.Herein, above-mentioned executing subject can be presented the image after multiple offsets, for user
Selection.Then, the corresponding color value migration result relative to image to be processed of image user selected is as above-mentioned offset
Amount.
It is above-mentioned based on identified bright channel value and dark channel value in some optional implementations of the present embodiment,
Determine the offset handled image to be processed, comprising: determine the ratio of bright channel value and dark channel value;Based on bright channel
Ratio, the dark channel value of value and the ratio of dark channel value, preset bright channel and dark, determine offset.
Specifically, above-mentioned executing subject can be previously provided with the standard value in bright channel Yu dark ratio.It is then possible to
It is compared by the ratio of identified bright channel value and dark channel value, with above-mentioned standard value, so that it is determined that image to be processed
Carry out the offset of color value adjustment.Herein, the difference between bright channel value and the ratio and standard value of dark channel value can be determined
Value.By the difference multiplied by above-mentioned dark channel value.Then, it multiplied by the number of the block divided after subtracting one for above-mentioned standard value, obtains
To second value.Finally, the quotient of above-mentioned difference and second value is determined as above-mentioned offset.
In some optional implementations of the present embodiment, the ratio of above-mentioned preset bright channel and dark is
What the ratio of bright channel value and dark channel value based on the historical sample image in historical sample image set determined.
Specifically, above-mentioned executing subject can shoot multiple samples for different light, weather based on Same Scene is directed to
This image.Multiple sample images for example can for shoot for strong light, for decreased light shooting, for the greasy weather shooting
, for the rainy day shooting, for clear sky weather shooting etc., be not specifically limited herein.Then, above-mentioned executing subject can
To be directed to each sample image, using bright channel value, the determination method of dark channel value as described above, each image is determined
Bright channel value, the ratio between dark channel value and bright channel value and dark channel value.In other words, each sample image is equal
Ratio between a corresponding bright channel value and dark channel value.To which above-mentioned executing subject, can after getting image to be processed
The ratio between the corresponding bright channel value of image and dark channel value to select the required effect showed.For example,
When needing to present the effect of image of strong light shooting, it is corresponding to can choose strong light sample image in historical sample image
Ratio between bright channel value and dark channel value, as the ratio between preset bright channel value and dark channel value.
The ratio in preset bright channel and dark is determined by the above method, image to be processed can be carried out
Effect is presented to obtain the different of image in processing.When needing to carry out such as prospect, background separation to image, can directly select
Ratio between the corresponding bright channel value of the high history image of prospect background contrast and dark channel value out, so that image more holds
It is easy to handle.Simultaneously as above-mentioned preset ratio can directly be directly acquired from historical sample image set to be needed
The image effect to be presented, so as to improve image processing speed.
Herein it is worth noting that, being helped secretly in order to prevent when determining the ratio between bright channel value and dark channel value
The case where road value is 0 can add a smoothing constant greater than 0 when being calculated to dark channel value.
Herein it is worth noting that, usually the color value in each channel of pixel is normalized for the ease of processing,
Also 0~255 is normalized between 0~1, to improve processing speed.
Step 203, based on identified offset, the pixel value of image to be processed is adjusted, the image that obtains that treated.
In the present embodiment, above-mentioned executing subject is after the offset obtained based on step 202, can will it is obtained partially
Shifting amount is added separately in each pixel value.In other words, offset is added directly to each of image to be processed pixel
Color value in.Herein, when above-mentioned each color value needs to subtract offset, after a certain channel subtracts offset be negative when,
0 is set by the color value in the channel at this time.When above-mentioned each color value needs to increase offset, when the color value in a certain channel is plus inclined
When after shifting amount more than 255,255 are set by the color value in the channel at this time.
The image processing method that embodiment of the disclosure provides, passes through the dark channel value of determination image to be processed, bright channel
Value determines the offset handled image to be processed, adjusts image to be processed finally by identified offset
Pixel value, the image that obtains that treated, so as to adjust the color of image to be processed, or to there are mists in captured image
The heavier image of the image or shade of change carries out defogging processing, goes Shadows Processing, to improve image image quality.
With further reference to Fig. 3, it illustrates a kind of processes 300 of the embodiment of optional implementation of the disclosure.Such as
In embodiment shown in Fig. 3, each of preset number block block described in step 202 includes a pixel.
The optional implementation specifically includes:
Step 301, it determines in the three primary colors color value of each pixel in image to be processed, the smallest color value.
Specifically, above-mentioned image to be processed is made of multiple pixels.Each pixel includes three primary colors color value.From
And it can determine the smallest color value of three primary colors color value in each pixel.
Step 302, it sums to color value the smallest in identified each pixel, obtained summed result is determined as wait locate
Manage the dark channel value of image.
Step 303, it determines in the three primary colors color value of each pixel in image to be processed, maximum color value.
Step 304, it sums to color value maximum in identified each pixel, obtained summed result is determined as wait locate
Manage the bright channel value of image.
Step 305, the ratio of bright channel value and dark channel value is determined.
The ratio of ratio, preset bright channel and dark step 306, based on bright channel value and dark channel value,
Dark channel value determines offset.
Specifically, offset m can be determined by following formula:
Wherein, R is based on the bright channel value of image to be processed and the ratio of dark channel value;R* is preset bright logical
The ratio of road value and dark channel value;∑IdarkFor dark channel value, D is the total number-of-pixels of image to be processed.
The specific processing of the ratio of preset bright channel value and dark channel value and brought beneficial effect can be with
With reference to the associated description in step 202, details are not described herein.
Step 307, based on identified offset, the pixel value of image to be processed is adjusted, the image that obtains that treated.
In the present embodiment, above-mentioned executing subject is after the offset obtained based on step 306, can will it is obtained partially
Shifting amount is added separately in each pixel value.In other words, offset is added directly to each of image to be processed pixel
Color value in.Herein, when above-mentioned each color value needs to subtract offset, after a certain channel subtracts offset be negative when,
0 is set by the color value in the channel at this time.When above-mentioned each color value needs to increase offset, when the color value in a certain channel is plus inclined
When after shifting amount more than 255,255 are set by the color value in the channel at this time.
From figure 3, it can be seen that the present embodiment does not draw image to be processed unlike embodiment shown in Fig. 2
Blockette is directly handled pixel, obtains bright channel value and dark channel value.So, the image less for pixel,
Offset determined by can making is more accurate, to improve treatment effect.
With further reference to Fig. 4 a- Fig. 4 b, it illustrates an application scenario diagrams of the image processing method of the disclosure.Fig. 4 a
For image to be processed.Wherein, the number of pixel included by the image to be processed is 600 × 400.As shown in fig. 4 a,
The scene overall brightness that image is presented is lower namely color is grey.Executing subject can use public affairs after getting Fig. 4 a
The method that offset is determined in formula (1), handles the image of Fig. 4 a, thus the image that obtains that treated.Wherein, Fig. 4 b is
Treated image.Fig. 4 a is compared with Fig. 4 b as can be seen that the overall brightness for the scene that Fig. 4 b is presented is greater than Fig. 4 a
The brightness of the scene presented.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides image processing apparatus
One embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to various electricity
In sub- equipment.
As shown in figure 5, image processing apparatus 500 provided in this embodiment includes that the first determination unit 501, second determines list
Member 502 and image processing unit 503.Wherein, the first determination unit 501 is configured to the color of the pixel based on image to be processed
Value, determines the dark channel value and bright channel value of image to be processed, wherein bright channel value, dark channel value are used to indicate figure to be processed
The shading value of picture;Second determination unit 502 is configured to based on identified bright channel value and dark channel value, and place is treated in determination
The offset that reason image is handled;Image processing unit 503 is configured to adjust to be processed based on identified offset
The pixel value of image, the image that obtains that treated.
In the present embodiment, in image processing apparatus 500: the first determination unit 501, the second determination unit 502 and image
The specific processing of processing unit 503 and its brought technical effect can respectively with reference in Fig. 2 corresponding embodiment step 201,
The related description of step 202 and step 203, details are not described herein.
In some optional implementations of the present embodiment, the first determination unit 501 is further configured to: will be wait locate
Reason image is divided into preset number block, and each of preset number block block includes preset number pixel;It is right
Block in preset number block determines in the three-primary colours color value of pixel included by the block, the smallest color value;To institute
Obtained summed result, is determined as the dark channel value of image to be processed by the smallest color value summation in determining each block.
In some optional implementations of the present embodiment, the first determination unit 501 is further configured to: for pre-
If the block in number block determines in the three-primary colours color value of pixel included by the block, maximum color value;To determining
Each block in the summation of maximum color value, obtained summed result is determined as to the bright channel value of image to be processed.
In some optional implementations of the present embodiment, the second determination unit 502 is further configured to: being determined bright
The ratio of channel value and dark channel value;Ratio, dark channel value based on ratio, preset bright channel and dark determine
Offset.
In some optional implementations of the present embodiment, each of preset number block block includes one
Pixel.
In some optional implementations of the present embodiment, the ratio of preset bright channel and dark is to be based on
What the bright channel value of the historical sample image in historical sample image set and the ratio of dark channel value determined.
The image processing apparatus that embodiment of the disclosure provides, passes through the dark channel value of determination image to be processed, bright channel
Value determines the offset handled image to be processed, adjusts image to be processed finally by identified offset
Pixel value, the image that obtains that treated, so as to adjust the color of image to be processed, or to there are mists in captured image
The heavier image of the image or shade of change carries out defogging processing, goes Shadows Processing, to improve image image quality.
Below with reference to Fig. 6, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1
Server) 600 structural schematic diagram.Terminal device in embodiment of the disclosure can include but is not limited to such as move electricity
Words, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia
Player), the mobile terminal and such as number TV, desktop computer etc. of car-mounted terminal (such as vehicle mounted guidance terminal) etc.
Fixed terminal.Terminal device shown in Fig. 6 is only an example, function to embodiment of the disclosure and should not use model
Shroud carrys out any restrictions.
As shown in fig. 6, electronic equipment 600 may include processing unit (such as central processing unit, graphics processor etc.)
601, random access can be loaded into according to the program being stored in read-only memory (ROM) 602 or from storage device 608
Program in memory (RAM) 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with electronic equipment
Various programs and data needed for 600 operations.Processing unit 601, ROM 602 and RAM603 are connected with each other by bus 604.
Input/output (I/O) interface 605 is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph
As the input unit 606 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration
The output device 607 of dynamic device etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.Communication device
609, which can permit electronic equipment 600, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 6 shows tool
There is the electronic equipment 600 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with
Alternatively implement or have more or fewer devices.Each box shown in Fig. 6 can represent a device, can also root
According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608
It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the implementation of the disclosure is executed
The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that the computer-readable medium of embodiment of the disclosure description can be computer-readable signal
Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with
System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than
Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires
Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable
Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited
Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints
What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its
It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave
The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted
With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between
Matter can also be any computer-readable medium other than computer readable storage medium, which can be with
It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter
The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable,
RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned terminal device;It is also possible to individualism, and not
It is fitted into the terminal device.Above-mentioned computer-readable medium carries one or more program, when said one or more
When a program is executed by the electronic equipment, so that the electronic equipment: the color value of the pixel based on image to be processed is determined to be processed
The dark channel value of image and bright channel value, wherein bright channel value, dark channel value are used to indicate the shading value of image to be processed;Base
In identified bright channel value and dark channel value, the offset that color value adjustment is carried out to image to be processed is determined;Based on determining
Offset, adjust the pixel value of image to be processed, the image that obtains that treated.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof
The computer program code of work, programming language include object oriented program language-such as Java,
Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language
Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence
Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or
It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet
Include local area network (LAN) or wide area network (WAN) --- it is connected to subscriber computer, or, it may be connected to outer computer (such as
It is connected using ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through
The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor
Including a kind of processor, including the first determination unit, the second determination unit and image processing unit.Wherein, the name of these units
Claim not constituting the restriction to the unit itself under certain conditions, for example, the first determination unit is also described as " being based on
The color value of the pixel of image to be processed determines the dark channel value of image to be processed and the unit of bright channel value ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member it should be appreciated that embodiment of the disclosure involved in invention scope, however it is not limited to the specific combination of above-mentioned technical characteristic and
At technical solution, while should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its be equal
Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but
It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.
Claims (14)
1. a kind of image processing method, comprising:
The color value of pixel based on image to be processed determines the dark channel value and bright channel value of the image to be processed, wherein institute
State bright channel value, the dark channel value is used to indicate the shading value of the image to be processed;
Based on identified bright channel value and dark channel value, the offset that color value adjustment is carried out to image to be processed is determined;
Based on identified offset, the pixel value of image to be processed is adjusted, the image that obtains that treated.
2. according to the method described in claim 1, wherein it is determined that the dark channel value of image to be processed, comprising:
The image to be processed is divided into preset number block, each of described preset number block block includes
Preset number pixel;
For the block in the preset number block, determine in the three-primary colours color value of pixel included by the block, it is minimum
Color value;
It sums to color value the smallest in identified each block, obtained summed result is determined as the image to be processed
Dark channel value.
3. according to the method described in claim 2, wherein it is determined that the bright channel value of image to be processed, comprising:
For the block in the preset number block, determine in the three-primary colours color value of pixel included by the block, it is maximum
Color value;
It sums to color value maximum in identified each block, obtained summed result is determined as the image to be processed
Bright channel value.
4. according to the method described in claim 1, wherein, described based on identified bright channel value and dark channel value, determining needs
Offset image to be processed is handled, comprising:
Determine the ratio of the bright channel value and dark channel value;
Based on the ratio, the ratio in preset bright channel and dark, the dark channel value, the offset is determined.
5. according to the method described in claim 2, wherein, each of described preset number block block includes a picture
Element.
6. according to the method described in claim 4, wherein, the ratio of the preset bright channel and dark is to be based on going through
What the bright channel value for the historical sample image that history sample image is concentrated and the ratio of dark channel value determined.
7. a kind of image processing apparatus, comprising:
First determination unit is configured to the color value of the pixel based on image to be processed, determines helping secretly for the image to be processed
Road value and bright channel value, wherein the bright channel value, the dark channel value are used to indicate the shading value of the image to be processed;
Second determination unit is configured to be determined based on identified bright channel value and dark channel value and carry out image to be processed
The offset of color value adjustment;
Image processing unit is configured to adjust the pixel value of image to be processed based on identified offset, after obtaining processing
Image.
8. device according to claim 7, wherein first determination unit is further configured to:
The image to be processed is divided into preset number block, each of described preset number block block includes
Preset number pixel;
For the block in the preset number block, determine in the three-primary colours color value of pixel included by the block, it is minimum
Color value;
It sums to color value the smallest in identified each block, obtained summed result is determined as the image to be processed
Dark channel value.
9. device according to claim 8, wherein first determination unit is further configured to:
For the block in the preset number block, determine in the three-primary colours color value of pixel included by the block, it is maximum
Color value;
It sums to color value maximum in identified each block, obtained summed result is determined as the image to be processed
Bright channel value.
10. device according to claim 8, wherein second determination unit is further configured to:
Determine the ratio of the bright channel value and dark channel value;
Based on the ratio, the ratio in preset bright channel and dark, the dark channel value, the offset is determined.
11. device according to claim 8, wherein each of described preset number block block includes one
Pixel.
12. according to the method described in claim 10, wherein, the ratio of the preset bright channel and dark is to be based on
What the bright channel value of the historical sample image in historical sample image set and the ratio of dark channel value determined.
13. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor
Such as method as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910375766.0A CN110097520B (en) | 2019-05-07 | 2019-05-07 | Image processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910375766.0A CN110097520B (en) | 2019-05-07 | 2019-05-07 | Image processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110097520A true CN110097520A (en) | 2019-08-06 |
CN110097520B CN110097520B (en) | 2021-09-14 |
Family
ID=67447139
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910375766.0A Active CN110097520B (en) | 2019-05-07 | 2019-05-07 | Image processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110097520B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110473282A (en) * | 2019-08-22 | 2019-11-19 | 腾讯科技(深圳)有限公司 | Dyeing treatment, device, computer equipment and the storage medium of object model |
CN111064963A (en) * | 2019-11-11 | 2020-04-24 | 北京迈格威科技有限公司 | Image data decoding method, device, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103020920A (en) * | 2013-01-10 | 2013-04-03 | 厦门大学 | Method for enhancing low-illumination images |
CN103077504A (en) * | 2013-01-10 | 2013-05-01 | 厦门大学 | Image haze removal method on basis of self-adaptive illumination calculation |
CN107527325A (en) * | 2017-08-15 | 2017-12-29 | 青岛海人机器人科技有限公司 | A kind of monocular underweater vision Enhancement Method preferential based on dark |
-
2019
- 2019-05-07 CN CN201910375766.0A patent/CN110097520B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103020920A (en) * | 2013-01-10 | 2013-04-03 | 厦门大学 | Method for enhancing low-illumination images |
CN103077504A (en) * | 2013-01-10 | 2013-05-01 | 厦门大学 | Image haze removal method on basis of self-adaptive illumination calculation |
CN107527325A (en) * | 2017-08-15 | 2017-12-29 | 青岛海人机器人科技有限公司 | A kind of monocular underweater vision Enhancement Method preferential based on dark |
Non-Patent Citations (6)
Title |
---|
JEHOIADA JACKSON等: "Hybrid Single Image Dehazing with Bright Channel and Dark Channel Priors", 《201 7 2ND INTERNTIONAL CONFERENCE ON IMAGE, VISION AND COMPUTING》 * |
KAIMING HE等: "Single Image Haze Removal Using Dark Channel Prior", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 * |
YANYANG YAN等: "Image Deblurring via Extreme Channels Prior", 《2017 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION》 * |
YINTING WANG等: "Automatic local exposure correctio n using bright channel prior for under-expose d images", 《SIGNAL PROCESSING》 * |
卢辉斌等: "基于亮通道和暗通道结合的图像去雾", 《光学学报》 * |
曹碧婷: "基于局部大气光评估的形态学去雾算法研究及应用", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110473282A (en) * | 2019-08-22 | 2019-11-19 | 腾讯科技(深圳)有限公司 | Dyeing treatment, device, computer equipment and the storage medium of object model |
CN111064963A (en) * | 2019-11-11 | 2020-04-24 | 北京迈格威科技有限公司 | Image data decoding method, device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110097520B (en) | 2021-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112241714B (en) | Method and device for identifying designated area in image, readable medium and electronic equipment | |
CN111260601B (en) | Image fusion method and device, readable medium and electronic equipment | |
CN112034984B (en) | Virtual model processing method and device, electronic equipment and storage medium | |
KR20140045370A (en) | Automatic exposure correction of images | |
CN110070495B (en) | Image processing method and device and electronic equipment | |
CN113962859B (en) | Panorama generation method, device, equipment and medium | |
CN109102484B (en) | Method and apparatus for processing image | |
CN110865862A (en) | Page background setting method and device and electronic equipment | |
CN110070515B (en) | Image synthesis method, apparatus and computer-readable storage medium | |
CN109308687A (en) | Method and apparatus for adjusting brightness of image | |
CN109784304A (en) | Method and apparatus for marking dental imaging | |
CN110097520A (en) | Image processing method and device | |
CN113473035A (en) | Ambient brightness determination method and device and electronic equipment | |
CN110211030A (en) | Image generating method and device | |
GB2595094A (en) | Method and device for processing image having animal face | |
CN110070585A (en) | Image generating method, device and computer readable storage medium | |
CN110349107A (en) | Method, apparatus, electronic equipment and the storage medium of image enhancement | |
CN110719407A (en) | Picture beautifying method, device, equipment and storage medium | |
CN112465940B (en) | Image rendering method and device, electronic equipment and storage medium | |
CN109510943A (en) | Method and apparatus for shooting image | |
US20230360286A1 (en) | Image processing method and apparatus, electronic device and storage medium | |
CN110555799A (en) | Method and apparatus for processing video | |
CN112700385A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN113256785B (en) | Image processing method, apparatus, device and medium | |
WO2022083081A1 (en) | Image rendering method and apparatus, and device and storage medium |
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 |