CN103559692B - Method and device for processing image - Google Patents

Method and device for processing image Download PDF

Info

Publication number
CN103559692B
CN103559692B CN201310571492.5A CN201310571492A CN103559692B CN 103559692 B CN103559692 B CN 103559692B CN 201310571492 A CN201310571492 A CN 201310571492A CN 103559692 B CN103559692 B CN 103559692B
Authority
CN
China
Prior art keywords
gradient
absolute value
vertical
horizontal
image
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
CN201310571492.5A
Other languages
Chinese (zh)
Other versions
CN103559692A (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 Gaohang Intellectual Property Operation Co ltd
JIAXING BEST ELECTRONIC TECHNOLOGY CO.,LTD.
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310571492.5A priority Critical patent/CN103559692B/en
Publication of CN103559692A publication Critical patent/CN103559692A/en
Application granted granted Critical
Publication of CN103559692B publication Critical patent/CN103559692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method and device for processing an image. The method comprises the steps that a first horizontal gradient of the image and a first vertical gradient of the image are obtained by the adoption of a first gradient computing method; a second horizontal gradient of the image and a second vertical gradient of the image are obtained by the adoption of a second gradient computing method; a final horizontal gradient of the image and a final vertical gradient of the image are obtained according to preset rules, the first horizontal gradient, the first vertical gradient, the second horizontal gradient and the second vertical gradient. According to the method and device for processing the image, the final horizontal gradient and the final vertical gradient are obtained through combination of the multiple gradient computing methods, normalization processing is conducted on the image by the adoption of the final horizontal gradient and the final vertical gradient, the facticity of the processed image can be improved and an original image is restored factually.

Description

Process the method and apparatus of image
Technical field
The present invention relates to image processing techniques, particularly relate to a kind of method and apparatus processing image.
Background technology
The method at existing process image edge has following several: the first is that neighbor (pixel) is poor Value method, the second is spaced pixels differential technique, and the third is by poor to Difference of Adjacent Pixels method and spaced pixels The simple superposition of value method.First method is used to can be good at processing the high frequency detail of black white image, but It is that the details to coloured image but can produce sawtooth class problem;Second method is used to can be good at processing The details of coloured image, but the high frequency detail of black white image can be produced trellis class problem;Use the 3rd The method of kind solves sawtooth class problem and the trellis class problem of image well.
In prior art, when processing image, one way in which can be taked at random to process, so Perhaps suitable method can not be chosen to process image, so that the image validity after Chu Liing reduces.
Summary of the invention
The present invention provides a kind of method and apparatus processing image, to avoid process figure in prior art as far as possible As time owing to randomly selecting the problem that processing mode causes image validity to reduce.
First aspect of the present invention provides a kind of method processing image, including:
The first gradient calculation method is used to obtain the first horizontal gradient and first vertical gradient of image;
The second gradient calculation method is used to obtain the second horizontal gradient and second vertical gradient of described image;
According to preset rules, described first horizontal gradient, described first vertical gradient, described second level Gradient and described second vertical gradient, obtain terminal level's gradient of described image and final vertical gradient.
In the implementation that the first is possible, according to first aspect, described according to preset rules, described First horizontal gradient, described first vertical gradient, described second horizontal gradient and described second vertical gradient, Obtain terminal level's gradient of described image and final vertical gradient, including:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
When the absolute value of described first greatest gradient is more than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described First horizontal gradient as described terminal level's gradient, and using described first vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is less than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described Second horizontal gradient as described terminal level's gradient, and using described second vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is equal to the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described The meansigma methods of the first horizontal gradient and the second horizontal gradient is as described terminal level's gradient, and by described The meansigma methods of the first vertical gradient and the second vertical gradient is as described final vertical gradient.
In the implementation that the second is possible, according to first aspect, described according to preset rules, described First horizontal gradient, described first vertical gradient, described second horizontal gradient and described second vertical gradient, Obtain terminal level's gradient of described image and final vertical gradient, including:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of the equation below described image of acquisition and final vertical gradient:
Described terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weight Value);
Described final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weight Value).
In the implementation that the third is possible, according to first aspect or implementation that the first is possible or The implementation that the second is possible, it is characterised in that obtaining terminal level's gradient and of described image After whole vertical gradient, also include:
Use described terminal level's gradient and described final vertical gradient that described image is processed.
Second aspect of the present invention provides a kind of device processing image, including:
First acquiring unit, for use first gradient calculation method obtain image the first horizontal gradient and First vertical gradient;
Second acquisition unit, for using the second gradient calculation method to obtain the second horizontal ladder of described image Degree and the second vertical gradient;
3rd acquiring unit, for according to preset rules, described first horizontal gradient, described first vertical Gradient, described second horizontal gradient and described second vertical gradient, obtain terminal level's ladder of described image Degree and final vertical gradient.
In the implementation that the first is possible, according to second aspect, described 3rd acquiring unit is specifically used In:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
When the absolute value of described first greatest gradient is more than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described First horizontal gradient as described terminal level's gradient, and using described first vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is less than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described Second horizontal gradient as described terminal level's gradient, and using described second vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is equal to the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described The meansigma methods of the first horizontal gradient and the second horizontal gradient is as described terminal level's gradient, and by described The meansigma methods of the first vertical gradient and the second vertical gradient is as described final vertical gradient.
In the implementation that the second is possible, according to second aspect, described 3rd acquiring unit is specifically used In:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of the equation below described image of acquisition and final vertical gradient:
Described terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weight Value);
Described final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weight Value).
In the implementation that the third is possible, according to second aspect or implementation that the first is possible or The implementation that the second is possible, also includes:
Processing unit, is used for using described terminal level's gradient and described final vertical gradient to described image Process.
As shown from the above technical solution, the method and apparatus processing image that the present invention provides, by combining Multiple gradient algorithm obtains terminal level's gradient and final vertical gradient, uses this terminal level's gradient and Image is normalized by whole vertical gradient, it is possible to increase the verity of the image after process, more Reduce original image truly.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that under, Accompanying drawing during face describes is some embodiments of the present invention, for those of ordinary skill in the art, On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Figure 1A is the schematic flow sheet of the method processing image according to one embodiment of the invention;
Figure 1B is the schematic diagram of differential technique;
Fig. 2 is the schematic flow sheet of the method processing image according to another embodiment of the present invention;
Fig. 3 is the schematic flow sheet of the method processing image according to further embodiment of this invention;
Fig. 4 is the structural representation of the device processing image according to yet another embodiment of the invention;
Fig. 5 is the structural representation of the device processing image according to another embodiment of the present invention;
Fig. 6 is the structural representation of the device processing image according to further embodiment of this invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention, Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise The every other embodiment obtained, broadly falls into the scope of protection of the invention.
Embodiment one
The present embodiment provides a kind of method processing image, for processing, the edge of image to carry The validity of hi-vision.The executive agent of the method processing image of the present embodiment is the device processing image.
As shown in Figure 1A, for the schematic flow sheet of the method processing image according to the present embodiment.
Step 101, uses the first gradient calculation method to obtain the first horizontal gradient of image and first vertical Gradient.
First gradient calculation method can be arbitrary in Difference of Adjacent Pixels method and spaced pixels differential technique Kind, it is also possible to it is by Difference of Adjacent Pixels method and spaced pixels differential technique simple superposition.Specifically how to use First horizontal gradient and first vertical gradient of the first gradient algorithm acquisition image belong to prior art, at this Repeat no more.
Specifically, as shown in Figure 1B, Difference of Adjacent Pixels method is:
Absolute value Grad_H=| Z20-Z21 |+| Z21-Z22 |+| Z22-Z23 |+| Z23-Z24 | of horizontal gradient
Absolute value Grad_V=| Z02-Z12 |+| Z12-Z22 |+| Z22-Z32 |+| Z32-Z42 | of vertical gradient
Spaced pixels differential technique is:
Absolute value Grad_H=| Z20-Z22 |+| Z21-Z23 |+| Z22-Z24 | of horizontal gradient
Absolute value Grad_V=| Z02-Z22 |+| Z12-Z32 |+| Z22-Z42 | of vertical gradient
By the concrete mode of Difference of Adjacent Pixels method and spaced pixels differential technique simple superposition it is:
Grad_H=|Z20-Z21|+|Z21-Z22|+|Z22-Z23|+|Z23-Z24|+|Z20-Z22|+|Z21- Z23|+|Z22-Z24|
Grad_V=|Z02-Z12|+|Z12-Z22|+|Z22-Z32|+|Z32-Z42|+|Z02-Z22|+|Z12- Z32|+|Z22-Z42|
Step 102, uses the second gradient calculation method to obtain the second horizontal gradient of image and second vertical Gradient.
Second gradient algorithm be equally the first gradient calculation method can be Difference of Adjacent Pixels method and Any one in pixel value difference method, it is also possible to be by Difference of Adjacent Pixels method and the letter of spaced pixels differential technique Single superposition.But this second gradient calculation method need to be different from the first gradient calculation method.Such as, when When one gradient calculation method is Difference of Adjacent Pixels method, the second gradient calculation method can be that spaced pixels is poor Value method;When the first gradient calculation method is spaced pixels differential technique, the second gradient calculation method can be Difference of Adjacent Pixels method.
Step 103, according to preset rules, the first horizontal gradient, the first vertical gradient, the second horizontal ladder Degree and the second vertical gradient, obtain terminal level's gradient of image and final vertical gradient.
Process image device can by combine multiple gradient algorithm obtain image terminal level's gradient and Final vertical gradient, then uses this terminal level's gradient and final vertical gradient to process image.
According to the method processing image of the present embodiment, obtain terminal level by combining multiple gradient algorithm Gradient and final vertical gradient, use this terminal level's gradient and final vertical gradient to process image, The verity of the image after process can be improved, reduce original image the most truly.
Embodiment two
The present embodiment provides a kind of method processing image based on embodiment one.
As in figure 2 it is shown, be the schematic flow sheet of the method processing image according to the present embodiment.
Step 201, uses the first gradient algorithm to obtain the first horizontal gradient and first vertical gradient of image.
In the present embodiment, the device processing image uses Difference of Adjacent Pixels method to obtain the first level of image Gradient and the first vertical gradient.
Step 202, uses the second gradient calculation method to obtain the second horizontal gradient of image and second vertical Gradient.
In the present embodiment, the device processing image uses spaced pixels differential technique to obtain the second level of image Gradient and the second vertical gradient.
Step 203, using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as One greatest gradient T1_MAX, another is as the first minimal gradient T1_MIN.
Step 204, using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as Two greatest gradient T2_MAX, another is as the second minimal gradient T2_MIN.
Step 205, as | T1_MAX | × | T2_MIN | > | T1_MIN | × | T2_MAX |, by the first water Flat gradient is as terminal level's gradient, and using the first vertical gradient as final vertical gradient;When During | T1_MAX | × | T2_MIN | < | T1_MIN | × | T2_MAX |, using the second horizontal gradient as final water Flat gradient, and using the second vertical gradient as final vertical gradient;When | T1_MAX | × During | T2_MIN |==| T1_MIN | × | T2_MAX |, average by the first horizontal gradient and the second horizontal gradient Value is as terminal level's gradient, and using the meansigma methods of the first vertical gradient and the second vertical gradient as Whole vertical gradient.
Step 206, uses terminal level's gradient and final vertical gradient to process image.
This process can be specifically that filtering and noise reduction processes, for example with terminal level's gradient and final vertical ladder Image can be added by degree in the sample value average of horizontal direction and the sample average of vertical direction of current point Weight average, tries to achieve the final weighted mean of current point, so that image is truer.It is assumed that horizontal direction Weights be Hweight, the weights of vertical direction are Vweight, the level side of current point (Green) To sample average be H_SamplesAverage, the sample standard deviation of the vertical direction of current point (Green) Value is V_SamplesAverage, then:
Hweight=Grad_V*Grad_V
Vweight=Grad_H*Grad_H
Filtering and noise reduction result is (H_SamplesAverage*Hweight+V_SamplesAverage *Vweight)/(Hweight+Vweight)
This process can also is that image enhancement processing.Specifically, terminal level's gradient is compared vertical with final The absolute value of gradient, and obtain the second order Grad on that direction of wherein maximum absolute value, then should Second order Grad zooms in and out according to preset ratio and is added to afterwards on the original value of picture point, to improve figure Picture element amount.Assume the original value of picture point be Original_C, Hgrad be terminal level's gradient, Vgrad For final vertical gradient, Adjustable_Weight is the configuration parameter of manually adjustable size, Sharpen_Metric is for strengthening metric, and Sharpened_C is enhanced value, then:
If | Hgrad | > | Vgrad |, make Sharpen_Metric=Grad_H*Adjustable_Weight
Otherwise, Sharpen_Metric=Vgrad*Adjustable_Weight is made
Sharpened_C=Original_C+Sharpen_Metric。
It is, of course, also possible to terminal level's gradient and the final vertical gradient of the present embodiment are applied to inverse Marseille Gram conversion (Demosaicing) in.It is assumed that the weights of horizontal direction are Hweight, vertical direction Weights are Vweight, and current point is that in horizontal direction, Green channel sample is equal for Green, H_GsubB Value deducts the difference obtained by Blue channel sample average, and V_GsubB is Green passage in vertical direction Sample average deducts the difference obtained by Blue channel sample average, and Esti_GsubB is Green passage Value deducts the difference obtained by Blue channel value, and H_GsubR is that in horizontal direction, Green channel sample is equal Value deducts the difference obtained by Red channel sample average, and V_GsubR is Green passage in vertical direction Sample average deducts the difference obtained by Red channel sample average, and Esti_GsubR is Green channel value Deducting the difference obtained by Red channel value, Interpolated_B is the Blue value that interpolation goes out, Interpolated_R is the Red value that interpolation goes out, then:
Hweight=Grad_V*Grad_V
Vweight=Grad_H*Grad_H
Esti_GsubB=(H_GsubB*Hweight+V_GsubB*Vweight)/(Hweight +Vweight)
Esti_GsubR=(H_GsubR*Hweight+V_GsubR*Vweight)/(Hweight +Vweight)
Interpolated_B=Original_G-Esti_GsubB
Interpolated_R=Original_G-Esti_GsubR
According to the method processing image of the present embodiment, by the first gradient calculation method is obtained the first water Flat gradient, the first vertical gradient and by the second gradient calculation method obtain the second horizontal gradient, second Vertical gradient, then judges to select which kind of gradient calculation method as processing this image according to preset rules Method so that selected gradient calculation method is more suitable for processing this image, is i.e. capable of at self adaptation Reason image.
Embodiment three
The present embodiment provides a kind of method processing image based on embodiment one.
As it is shown on figure 3, be the schematic flow sheet of the method processing image according to the present embodiment.
Step 301, uses the first gradient algorithm to obtain the first horizontal gradient and first vertical gradient of image.
In the present embodiment, the device processing image uses Difference of Adjacent Pixels method to obtain the first level of image Gradient and the first vertical gradient.
Step 302, uses the second gradient calculation method to obtain the second horizontal gradient of image and second vertical Gradient.
In the present embodiment, the device processing image uses spaced pixels differential technique to obtain the second level of image Gradient and the second vertical gradient.
Step 303, using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as One greatest gradient T1_MAX, another is as the first minimal gradient T1_MIN.
Step 304, using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as Two greatest gradient T2_MAX, another is as the second minimal gradient T2_MIN.
Step 305, according to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient).
Step 306, obtains terminal level's gradient of image according to weighted value and equation below vertical with final Gradient:
Terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weighted value);
Final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weighted value).
Step 307, uses terminal level's gradient and final vertical gradient to process image.
This process is similar to the process in embodiment two, does not repeats them here.
According to the method processing image of the present embodiment, by the first gradient calculation method is obtained the first water Flat gradient, the first vertical gradient and by the second gradient calculation method obtain the second horizontal gradient, second Vertical gradient, then obtains weighted value, and it is vertical with final to obtain terminal level's gradient according to this weighted value Gradient also processes image according to this terminal level's gradient and final vertical gradient, so that the image after Chu Liing Verity improve.
One of ordinary skill in the art will appreciate that: realize all or part of step of said method embodiment Can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer-readable Taking in storage medium, this program upon execution, performs to include the step of said method embodiment;And it is aforementioned Storage medium include: the various media that can store program code such as ROM, RAM, magnetic disc or CD.
Embodiment four
The present embodiment provides a kind of device processing image, for the method performing above-mentioned process image.
As shown in Figure 4, for the structural representation of the device processing image according to the present embodiment.This enforcement The structure of the device processing image of example specifically includes the first acquiring unit 401, second acquisition unit 402 With the 3rd acquiring unit 403.
Wherein, the first acquiring unit 401 is for using the first gradient calculation method to obtain the first water of image Flat gradient and the first vertical gradient;Second acquisition unit 402 obtains for using the second gradient calculation method Second horizontal gradient of image and the second vertical gradient;3rd acquiring unit 403 for according to preset rules, First horizontal gradient, the first vertical gradient, the second horizontal gradient and the second vertical gradient, obtain image Terminal level's gradient and final vertical gradient.
The concrete operation method of the device of this process image is consistent with embodiment one, does not repeats them here.
According to the device processing image of the present embodiment, obtain terminal level by combining multiple gradient algorithm Gradient and final vertical gradient, use this terminal level's gradient and final vertical gradient to process image, The verity of the image after process can be improved, reduce original image the most truly.
Alternatively, as it is shown in figure 5, the device processing image of the present embodiment can also include processing unit 501, image is carried out by this processing unit 501 specifically for using terminal level's gradient and final vertical gradient Process.
Embodiment five
The device processing image of embodiment four is done supplementary notes further by the present embodiment.
Alternatively, the present embodiment process image device in the 3rd acquiring unit 403 specifically for:
Using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as the first maximum ladder Degree, another is as the first minimal gradient;
Using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as the second maximum ladder Degree, another is as the second minimal gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum more than second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, using the first horizontal gradient as finally Horizontal gradient, and using the first vertical gradient as final vertical gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum less than second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, using the second horizontal gradient as finally Horizontal gradient, and using the second vertical gradient as final vertical gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum equal to second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, by the first horizontal gradient and the second water The meansigma methods of flat gradient is as terminal level's gradient, and by the first vertical gradient and the second vertical gradient Meansigma methods is as final vertical gradient.
Or, alternatively, the 3rd acquiring unit 403 in the device processing image of the present embodiment is concrete For:
Using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as the first maximum ladder Degree, another is as the first minimal gradient;
Using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as the second maximum ladder Degree, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of equation below acquisition image and final vertical gradient:
Terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weighted value);
Final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weighted value).
According to the device processing image of the present embodiment, by the first gradient calculation method is obtained the first water Flat gradient, the first vertical gradient and by the second gradient calculation method obtain the second horizontal gradient, second Vertical gradient, then judges to select which kind of gradient calculation method as processing this image according to preset rules Method or obtain terminal level's gradient and final vertical gradient by the weighted value obtained, and according to this Whole horizontal gradient and final vertical gradient process image so that selected gradient calculation method is more suitable for place Manage this image, be i.e. capable of self-adaptive processing image.
Embodiment six
The present embodiment provides another kind to process the device of image, for the method performing above-mentioned process image.
As shown in Figure 6, for the structural representation of the device processing image according to the present embodiment.This process The device 600 of image includes at least one processor 601, communication bus 602, memorizer 603 and extremely A few communication interface 604.
Wherein, communication bus 602 is used for realizing the connection between said modules and communicating, communication interface 604 For being connected with the network equipment and communicating.This bus can be ISA(Industry Standard Architecture, industry standard architecture) bus, PCI(Peripheral Component, outward Portion's apparatus interconnection) bus or EISA(Extended Industry Standard Architecture, Extended industry-standard architecture) bus etc..Bus can be one or more physical circuit, when being many Address bus, data/address bus, control bus etc. can be divided into during bar physical circuit.
Wherein, memorizer 603 is used for storing executable program code, and wherein, processor 501 is by reading In access to memory 603, the executable program code of storage runs the journey corresponding with executable program code Sequence, for:
The first gradient calculation method is used to obtain the first horizontal gradient and first vertical gradient of image;
The second gradient calculation method is used to obtain the second horizontal gradient and second vertical gradient of image;
Hang down according to preset rules, the first horizontal gradient, the first vertical gradient, the second horizontal gradient and second Vertical ladder degree, obtains terminal level's gradient of image and final vertical gradient.
Alternatively, processor 601 is transported by reading the executable program code of storage in memorizer 603 The row program corresponding with executable program code, for according to preset rules, the first horizontal gradient, the One vertical gradient, the second horizontal gradient and the second vertical gradient, obtain terminal level's gradient and of image Whole vertical gradient, specifically may is that
Using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as the first maximum ladder Degree, another is as the first minimal gradient;
Using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as the second maximum ladder Degree, another is as the second minimal gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum more than second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, using the first horizontal gradient as finally Horizontal gradient, and using the first vertical gradient as final vertical gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum less than second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, using the second horizontal gradient as finally Horizontal gradient, and using the second vertical gradient as final vertical gradient;
When the product of the absolute value of the first greatest gradient and the absolute value of the second minimal gradient is maximum equal to second During the product of the absolute value of gradient and the absolute value of the second minimal gradient, by the first horizontal gradient and the second water The meansigma methods of flat gradient is as terminal level's gradient, and by the first vertical gradient and the second vertical gradient Meansigma methods is as final vertical gradient.
Alternatively, processor 601 is transported by reading the executable program code of storage in memorizer 603 The row program corresponding with executable program code, for according to preset rules, the first horizontal gradient, the One vertical gradient, the second horizontal gradient and the second vertical gradient, obtain terminal level's gradient and of image Whole vertical gradient, specifically may is that
Using in the first horizontal gradient and the first vertical gradient one of maximum absolute value as the first maximum ladder Degree, another is as the first minimal gradient;
Using in the second horizontal gradient and the second vertical gradient one of maximum absolute value as the second maximum ladder Degree, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of equation below acquisition image and final vertical gradient:
Terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weighted value);
Final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weighted value).
Alternatively, processor 601 is next by reading the executable program code of storage in memorizer 603 Run the program corresponding with executable program code, for obtaining terminal level's gradient of image with final After vertical gradient, it is also possible to run by reading the executable program code of storage in memorizer 603 The program corresponding with executable program code, for:
Use terminal level's gradient and final vertical gradient that image is processed.
According to the device 600 processing image of the present embodiment, obtain final by combining multiple gradient algorithm Horizontal gradient and final vertical gradient, use this terminal level's gradient and final vertical gradient to carry out image Process, it is possible to increase the verity of the image after process, reduce original image the most truly.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill The essence of art scheme departs from the scope of various embodiments of the present invention technical scheme.

Claims (4)

1. the method processing image, it is characterised in that including:
The first gradient calculation method is used to obtain the first horizontal gradient and first vertical gradient of image;
The second gradient calculation method is used to obtain the second horizontal gradient and second vertical gradient of described image;
According to preset rules, described first horizontal gradient, described first vertical gradient, described second level Gradient and described second vertical gradient, obtain terminal level's gradient of described image and final vertical gradient;
Described second gradient calculation method need to be different from described first gradient calculation method;
Wherein: described according to preset rules, described first horizontal gradient, described first vertical gradient, institute State the second horizontal gradient and described second vertical gradient, obtain terminal level's gradient of described image with final Vertical gradient, including:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
When the absolute value of described first greatest gradient is more than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described First horizontal gradient as described terminal level's gradient, and using described first vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is less than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described Second horizontal gradient as described terminal level's gradient, and using described second vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is equal to the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described The meansigma methods of the first horizontal gradient and the second horizontal gradient is as described terminal level's gradient, and by described The meansigma methods of the first vertical gradient and the second vertical gradient is as described final vertical gradient;
Or, described according to preset rules, described first horizontal gradient, described first vertical gradient, Described second horizontal gradient and described second vertical gradient, obtain terminal level's gradient and of described image Whole vertical gradient, including:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of the equation below described image of acquisition and final vertical gradient:
Described terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weight Value);
Described final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weight Value).
The method of process image the most according to claim 1, it is characterised in that obtaining described figure After terminal level's gradient of picture and final vertical gradient, also include:
Use described terminal level's gradient and described final vertical gradient that described image is processed.
3. the device processing image, it is characterised in that including:
First acquiring unit, for use first gradient calculation method obtain image the first horizontal gradient and First vertical gradient;
Second acquisition unit, for using the second gradient calculation method to obtain the second horizontal ladder of described image Degree and the second vertical gradient;
3rd acquiring unit, for according to preset rules, described first horizontal gradient, described first vertical Gradient, described second horizontal gradient and described second vertical gradient, obtain terminal level's ladder of described image Degree and final vertical gradient;
Described second gradient calculation method need to be different from described first gradient calculation method;
Wherein: described 3rd acquiring unit specifically for:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
When the absolute value of described first greatest gradient is more than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described First horizontal gradient as described terminal level's gradient, and using described first vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is less than with the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described Second horizontal gradient as described terminal level's gradient, and using described second vertical gradient as described Whole vertical gradient;
When the absolute value of described first greatest gradient is equal to the product of the absolute value of described second minimal gradient When the absolute value of described second greatest gradient and the product of the absolute value of described second minimal gradient, by described The meansigma methods of the first horizontal gradient and the second horizontal gradient is as described terminal level's gradient, and by described The meansigma methods of the first vertical gradient and the second vertical gradient is as described final vertical gradient;
Or, described 3rd acquiring unit specifically for:
Maximum as first using in described first horizontal gradient and the first vertical gradient one of maximum absolute value Gradient, another is as the first minimal gradient;
Maximum as second using in described second horizontal gradient and the second vertical gradient one of maximum absolute value Gradient, another is as the second minimal gradient;
According to equation below acquisition weighted value:
Weighted value=(absolute value of absolute value × the second minimal gradient of the first greatest gradient)/(first Absolute value × the first of absolute value+the second greatest gradient of absolute value × the second minimal gradient of big gradient is The absolute value of little gradient);
According to weighted value and terminal level's gradient of the equation below described image of acquisition and final vertical gradient:
Described terminal level gradient=the first horizontal gradient × weighted value the+the second horizontal gradient × (1-weight Value);
Described final vertical gradient=the first vertical gradient × weighted value the+the second vertical gradient × (1-weight Value).
The device of process image the most according to claim 3, it is characterised in that also include:
Processing unit, is used for using described terminal level's gradient and described final vertical gradient to described image Process.
CN201310571492.5A 2013-11-13 2013-11-13 Method and device for processing image Active CN103559692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310571492.5A CN103559692B (en) 2013-11-13 2013-11-13 Method and device for processing image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310571492.5A CN103559692B (en) 2013-11-13 2013-11-13 Method and device for processing image

Publications (2)

Publication Number Publication Date
CN103559692A CN103559692A (en) 2014-02-05
CN103559692B true CN103559692B (en) 2017-01-11

Family

ID=50013931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310571492.5A Active CN103559692B (en) 2013-11-13 2013-11-13 Method and device for processing image

Country Status (1)

Country Link
CN (1) CN103559692B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110298799B (en) * 2019-06-25 2021-02-23 福建工程学院 PCB image positioning correction method
CN114419045A (en) * 2022-03-30 2022-04-29 武汉中导光电设备有限公司 Method, device and equipment for detecting defects of photoetching mask plate and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6788826B1 (en) * 1998-11-10 2004-09-07 Agfa-Gevaert Method for correcting artefacts in a digital image
CN101727659A (en) * 2008-10-31 2010-06-09 比亚迪股份有限公司 Method and system for enhancing image edge
CN102034225A (en) * 2010-12-20 2011-04-27 天津大学 Edge mode-based image color component interpolating method
CN102938843A (en) * 2012-11-22 2013-02-20 华为技术有限公司 Image processing method, image processing device and imaging device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6788826B1 (en) * 1998-11-10 2004-09-07 Agfa-Gevaert Method for correcting artefacts in a digital image
CN101727659A (en) * 2008-10-31 2010-06-09 比亚迪股份有限公司 Method and system for enhancing image edge
CN102034225A (en) * 2010-12-20 2011-04-27 天津大学 Edge mode-based image color component interpolating method
CN102938843A (en) * 2012-11-22 2013-02-20 华为技术有限公司 Image processing method, image processing device and imaging device

Also Published As

Publication number Publication date
CN103559692A (en) 2014-02-05

Similar Documents

Publication Publication Date Title
CN108205804A (en) Image processing method, device and electronic equipment
CN109410123B (en) Deep learning-based mosaic removing method and device and electronic equipment
US9773297B2 (en) System and method for supporting image denoising based on neighborhood block dimensionality reduction
CN107767356B (en) Image processing method and device
CN105809642B (en) A method of the natural image based on L0 regularizations is blind to remove motion blur
CN104253929B (en) Vedio noise reduction method and its system
CN108734668B (en) Image color recovery method and device, computer readable storage medium and terminal
CN111445424B (en) Image processing method, device, equipment and medium for processing mobile terminal video
US9613405B2 (en) Scalable massive parallelization of overlapping patch aggregation
CN105763768A (en) Image processing method, device and system
CN105096330A (en) Image processing method capable of automatically recognizing pure-color borders, system and a photographing terminal
CN109584198B (en) Method and device for evaluating quality of face image and computer readable storage medium
JPWO2012004830A1 (en) Image processing device
CN110062282A (en) A kind of super-resolution video method for reconstructing, device and electronic equipment
CN109600605A (en) Detection method, electronic equipment and the computer program product of 4K ultra high-definition video
CN110503704A (en) Building method, device and the electronic equipment of three components
CN112991165B (en) Image processing method and device
CN103559692B (en) Method and device for processing image
CN102118547A (en) Image weighted filtering method
US9996948B2 (en) Image downsampling apparatus and method
US10158790B2 (en) Image processing apparatus, image processing system, and image processing method
WO2017096814A1 (en) Image processing method and apparatus
WO2013181425A1 (en) System and method to determine feature candidate pixels of an image
CN109345600A (en) A kind of local noise-reduction method, device and terminal based on tone
CN106470335B (en) Image processing method and image display method based on sub-pix sampling

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191212

Address after: 314200 2nd floor, No.135 Hongxia Road, Danghu street, Pinghu City, Jiaxing City, Zhejiang Province

Patentee after: JIAXING BEST ELECTRONIC TECHNOLOGY CO.,LTD.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20191212

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Method and device for processing image

Effective date of registration: 20221109

Granted publication date: 20170111

Pledgee: Danghu Branch of Zhejiang Pinghu Rural Commercial Bank Co.,Ltd.

Pledgor: JIAXING BEST ELECTRONIC TECHNOLOGY CO.,LTD.

Registration number: Y2022990000791

PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20170111

Pledgee: Danghu Branch of Zhejiang Pinghu Rural Commercial Bank Co.,Ltd.

Pledgor: JIAXING BEST ELECTRONIC TECHNOLOGY CO.,LTD.

Registration number: Y2022990000791

PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Methods and Devices for Image Processing

Granted publication date: 20170111

Pledgee: Danghu Branch of Zhejiang Pinghu Rural Commercial Bank Co.,Ltd.

Pledgor: JIAXING BEST ELECTRONIC TECHNOLOGY CO.,LTD.

Registration number: Y2024980010067