Summary of the invention
Therefore, a kind of low image processor for calculating cost and manufacturing cost is needed, to solve existing interpolation technique
Problem.
The one side of present disclosure provides a kind of image processor, includes gradient information computing element, walking direction
Element, direction interpolation element and image hybrid element.Gradient information computing element handles input image, to generate input image
In the corresponding gradient value of multiple input pixels and gradient angle;Walking direction element is according to the corresponding gradient value of input pixel
Multiple interpolation angle and directions, which are generated, with gradient angle trusts angle value;Direction interpolation element according to interpolation angle to input image into
Line direction interpolation processing, and generate first image different from input image resolution ratio;Image hybrid element receives the first image
With input image through the second image caused by image interpolation processing, and angle value is trusted according to direction and mixes the first image and second
Image is as image output.
In an embodiment, input pixel includes the multiple first input pixels being located in the first range, walking direction member
Gradient value and gradient angle of the part to compare the first input pixel and other the input pixels adjacent with the first input pixel, with
Generate one in the first interpolation angle and direction trust angle value in interpolation angle.
In an embodiment, input pixel includes that multiple second be located in the second range input pixels, and the second range
Comprising the first range, gradient angle of the walking direction element to compare the first interpolation angle with the second input pixel, to update
First interpolation angle.
In an embodiment, interpolation element in direction is to corresponding to multiple angular areas by the first interpolation angle of interpolation angle
In first angle section, and choose a sampling window in input pixel as multiple directions interpolation input pixel, according to first
Angular interval selectively carries out low-pass filtering treatment to direction interpolation input pixel, and further according to treated, direction interpolation is defeated
Enter the pixel value of pixel, generate the pixel value of the first pixel, wherein the first pixel corresponds to the first interpolation angle and is the first shadow
One of group pixel of picture.
In an embodiment, interpolation element in direction from multiple angle sampling windows to choose according to first angle section
One is used as sampling window, and angle sampling window includes that rectangular co-ordinate sampling window, Vertical Diagonal coordinate sampling window and horizontal diagonal are sat
Mark sampling window.
In an embodiment, interpolation element in direction is corresponding to the first interpolation angle to a second angle section, and root
Another pixel value of the first pixel is generated according to second angle section, the pixel value and another pixel value of the first pixel is mixed, with more
The pixel value of new first pixel.
In an embodiment, the angular interval is less than 30 degree.
In an embodiment, which also includes: an image interpolation element, to carry out to the input image
Image interpolation processing is to generate second image.
The another aspect of present disclosure provides a kind of image treatment method comprising the steps of: carries out to input image
Calculation process, to generate the corresponding gradient value of multiple input pixels and the gradient angle in input image;According to input picture
Gradient value corresponding to element and gradient angle, generate multiple interpolation angles and multiple directions trust angle value;According to interpolation angle,
Direction interpolation processing is carried out to input image, to generate the first image, wherein point of the resolution ratio of the first image and input image
Resolution is different;Image interpolation processing is carried out to generate with to the input image according to the first image corresponding to the trust angle value of direction
The second image weight, mix the first image and the second image as image output, and the resolution ratio of the second image and first
The resolution ratio of image is identical.
In an embodiment, calculate interpolation angle with direction trust angle value the step of include: compared with it is multiple first input pictures
The gradient value and gradient angle of element and other the input pixels adjacent with the first input pixel, to generate one the in interpolation angle
One interpolation angle and direction trusts one in angle value, wherein the first input pixel includes the input picture being located in one first range
Element.
In an embodiment, calculating the step of angle value is trusted in interpolation angle and direction includes: compared with the first interpolation angle and
The gradient angle of multiple second input pixels, to update the first interpolation angle, wherein the second input pixel includes to be located at the second model
Interior input pixel is enclosed, and the second range includes the first range.
In an embodiment, the step of generating the first image, includes: the first interpolation angle of interpolation angle is corresponding at most
First angle section in a angular interval, and choose the input pixel in a sampling window and input picture as multiple directions interpolation
Element selectively carries out low-pass filtering treatment to direction interpolation input pixel, further according to treated according to first angle section
Direction interpolation inputs the pixel value of pixel, generates the pixel value of the first pixel, wherein the first pixel is corresponding to the first interpolation angle
It and is one of the group pixel of the first image.
In an embodiment, generate the first image the step of include: according to first angle section, from multiple angle sampling windows
Middle to choose one as sampling window, angle sampling window includes rectangular co-ordinate sampling window, Vertical Diagonal coordinate sampling window and level
To angular coordinate sampling window.
In an embodiment, the step of generating the first image, includes: the first interpolation angle is corresponding to a second angle area
Between, and according to another pixel value of the first pixel of second angle section generation, the pixel value of the first pixel of mixing and another pixel
Value, to update the pixel value of the first pixel.
In an embodiment, the angular interval is less than 30 degree.
In an embodiment, which also includes: carrying out image interpolation processing to the input image to generate
Second image.
Another aspect of the present invention provides a kind of image processor, includes gradient information computing element, walking direction member
Part and direction interpolation element, gradient information computing element handles input image, to generate multiple input pixels in input image
Corresponding gradient value and gradient angle;Walking direction element is generated according to the corresponding gradient value of input pixel and gradient angle
Multiple interpolation angle and directions trust angle value;Interpolation element in direction is to generate one first image, by the one first of interpolation angle
The corresponding first angle section into multiple angular intervals of interpolation angle, and the input pixel in a sampling window is chosen as more
A direction interpolation inputs pixel, according to first angle section, selectively carries out at low-pass filtering to direction interpolation input pixel
Reason generates the pixel value of the first pixel, wherein the first pixel pair further according to the pixel value of treated direction interpolation input pixel
It to the first interpolation angle and should be one of the group pixel of the first image.
Another aspect of the invention provides a kind of image treatment method comprising the steps of: carries out operation to input image
Processing, to generate the corresponding gradient value of multiple input pixels and the gradient angle in input image;According to input pixel institute
Corresponding gradient value and gradient angle, generate multiple interpolation angles and multiple directions trust angle value;One first image is generated, it will
The corresponding first angle section into multiple angular intervals of one first interpolation angle of interpolation angle, and choose in a sampling window
Input pixel as multiple directions interpolation input pixel, according to first angle section, selectively to direction interpolation input picture
Element carries out low-pass filtering treatment, further according to the pixel value of treated direction interpolation input pixel, generates the pixel of the first pixel
Value, wherein the first pixel correspondence is to the first interpolation angle and is one of the group pixel of the first image.
In conclusion image processor and method provided by present disclosure are allowed higher with low hardware implementation cost
The edge (edges) of the image output (output image) of resolution ratio is more careful, combines when carrying out direction interpolation processing
Low-pass filter makes the edge of different directions in image more smooth continuous, to reach more preferably image effect.Image processing dress
It sets and bonding position interpolation processing and image interpolation processing is come with direction trust angle value and multistage interpolation converging angular
As a result, further promoting the stability of image output quality.
Specific embodiment
In order to keep the narration of present disclosure more detailed with it is complete, can refer to appended attached drawing and various realities as described below
Example is applied, identical number represents the same or similar element in attached drawing.On the other hand, well-known element is not retouched with step
It is set forth in embodiment, causes unnecessary limitation to avoid to present disclosure.In addition, attached drawing is only for the purpose of description, not
It maps according to full size.
Fig. 1 is the block schematic diagram that a kind of image processor is painted according to present disclosure embodiment, wherein parallel four
Side shape square represents output or input data, Rectangular boxes represent hardware element.Image processor 100 is to receive input
Image 160, and the image output 165 that output resolution ratio is different from input image 160.For example, the resolution of input image 160
Rate 720p, that is, 1280x720 pixel (pixel), and the resolution ratio of image output 165 is 1080p, that is, 1920x1080 picture
The resolution ratio of element or input image 160 is 640x480 pixel, and the resolution ratio of image output 165 is 1280x960 picture
Element.In certain embodiments, received 160 resolution ratio of input image of image processor 100 is 5x5 pixel, and exports and differentiate
Rate belongs to the input of a full width image for the image output 165 or 100 received in sequence of image processor of 10x10 pixel
Image 160, and its image output 165 is full width image of the resolution ratio through changing.It is listed above merely illustrative, it is not limited to
Present disclosure.
Image processor 100 includes gradient information computing element 110, walking direction element 120, direction interpolation element
130, image interpolation element 140 and image hybrid element 150.Gradient information computing element 110 handles input image 160, with
Generate the corresponding gradient value of multiple input pixels and gradient angle in input image 160;Walking direction element 120 is according to defeated
Enter the corresponding gradient value of pixel and gradient angle generates multiple directions and trusts angle value 161 and interpolation angle 162, interpolation angle 162
It is related to edge direction in image, and direction trusts angle value 161 and then represents the possibility that interpolation angle 162 is correct edge direction
Property (likelihood), herein edge direction be edge normal direction;Direction interpolation element 130 is right according to interpolation angle 162
Input image 160 carries out direction interpolation processing, and generates first image 163 different from 160 resolution ratio of input image;Image is inserted
Complement part 140 does image interpolation processing to input image 160 and generates the second image 164;Image hybrid element 150 receives the first shadow
Picture 163 and the second image 164, and angle value 161 is trusted according to direction and mixes the first image 163 with the second image 164 as defeated
Image 165 out.As described above, image processor 100 trusts 161 bonding position interpolation processing of angle value and image interpolation with direction
Processing as a result, 165 quality of image output can be promoted, use to obtain sharp keen clearly image output 165.
In different embodiments, gradient information computing element 110, walking direction element 120, direction interpolation element 130,
Image interpolation element 140 and image hybrid element 150 can respectively can programs with specific function integrated circuit (ASIC) or scene
Planning logic lock array (FPGA) is done and electrical connection element 110~150 in fact, can be also integrated into image processor 100 and is
It unites single-chip (SoC), and element 110~150 are the function block in chip.In addition, in some embodiments, image processing
Device 100 also can be PC (PC) or microcontroller (microcontroller), and element 110~150 are with software
Or the functional module that firmware mode is realized, it is stored in the storage device of image processor 100, and by image processor
100 central processing unit or other processors execute.Those skilled in the art work as visual practical application request, with different hardware or
The technical idea of software realization present disclosure, however it is not limited to examples cited.
When the high resolution of image output 165 is in input image 160, image processor 100 is in image output
Increasing pixel in 165, pixel value corresponding to increased pixel makes the edge-smoothing in image output 165 and continuous,
And it reduces using zigzag or fuzzy edge caused by general image interpolation technique.In chromatic image, the pixel value of image
RGB (RGB) trichromatic intensity can be divided into again, or be divided into the intensity value of tone, saturation degree and brightness (HSV), in addition still
There are other pixel value representations, however it is not limited to examples cited.For purposes of illustration only, following pixel value will be with grayscale intensity value
Example, to illustrate the details of operation of image processor 100, those skilled in the art upon reading the present disclosure, can be public by institute
It opens content and is applied to chromatic image using different pixel values representation, is i.e. present disclosure is not limited with grey-tone image.
Gradient information computing element 110 is to carry out calculation process to input image 160, to generate in input image 160
Gradient value (gradient magnitude) and gradient angle (gradient angle) corresponding to each input pixel.Gradient value
It is bigger, indicate that the pixel and the value differences of neighborhood pixels are bigger in image, also that is, the pixel more may be corresponding into image
Fringe region, and gradient direction then correspond into image edge direction.In an embodiment, gradient information computing element 110
It is to do convolution with input image 160 using Sobel operand (operator) both vertically and horizontally
(convolution) operation, and using the average absolute value of vertical direction acquired results Dy and horizontal direction acquired results Dx as
Gradient value, and with vertical direction acquired results Dy divided by horizontal direction acquired results Dx, then tangent function is negated to it
(arctangent) to obtain gradient angle, operational formula is as follows:
GradientMagnitude=(| Dx |+| Dy |)/2,
GradientAngle=arctan (Dy/Dx)
In other embodiments, gradient information computing element 110 is obtained by vertical direction acquired results Dy and horizontal direction
As a result r.m.s. (RMS) value of Dx is as gradient value.
In another embodiment, gradient information computing element 110 is done using Perwitt operand and input image 160
Convolution algorithm, to obtain gradient value and gradient angle.In another embodiment, gradient information computing element 110 is to according to one
Gradient threshold value is filtered the corresponding gradient value of input pixel and gradient angle, also that is, gradient value is lower than gradient threshold
The part of value is considered as 0, is considered as edge to avoid by the variation of pixel value caused by noise jamming in digital image.For example, terraced
Spending threshold value can be 1/16th or 1/8th of maximum value in pixel value.Those skilled in the art can think and other operations
Member or calculation are to generate gradient information, however it is not limited to above example.
Walking direction element 120 according to from the received gradient value of gradient information computing element 110 and gradient angle to produce
Angle value 161 is trusted in raw multiple interpolation angles 162 and direction, and interpolation angle 162 represents edge direction, and angle value is trusted in direction
161 represent a possibility that interpolation angle 162 is correct edge direction.As described above, marginal portion in input image 160
It inputs pixel to correspond to higher gradient value, but due to including noise in digital image, directly uses gradient value and gradient direction
Judge that marginal portion and edge direction in input image 160 are likely to cause erroneous judgement.Therefore, in present disclosure, direction
Judgment component 120 not only relies on the gradient value of single input pixel and gradient direction is trusted to generate interpolation angle 162 and direction
Angle value 161, but reliable interpolation angle 162 is obtained using the gradient information of multiple input pixels, to promote image output
165 quality.
In an embodiment, input pixel includes the multiple first input pixels being located in the first range, as shown in Figure 2 A,
Input pixel P6, P7, P10, the P11 for including in first range 210 be first input pixel, and walking direction element 120 to
Compare the first input pixel and with the first adjacent input pixel of input pixel (input pixel P1~P5, P8~P9 and P12~
16) gradient value and gradient angle trust angle value 161 wherein to generate the first interpolation angle and direction in interpolation angle 162
First direction trust angle value, it is corresponding to center pixel 230 that the first interpolation angle and first direction of generation trust angle value,
In, the first image 163 that direction interpolation element 130 is exported will include center pixel 230.Specifically, walking direction element
120 calculate the gradient differential seat angle between the first input pixel (input pixel P6, P7, P10, P11) input pixel adjacent thereto, look for
Gradient angle person the most alike in first input pixel with neighbouring input pixel out, with its corresponding gradient angle and gradient value
It generates the first interpolation angle and first direction trusts angle value.Visual its of those skilled in the art needs to stipulate the first range 210
Size, Fig. 2A draw merely illustrative, are not intended to limit present disclosure.
In an embodiment, walking direction element 120 is calculated in the first input pixel (input pixel P6, P7, P10, P11)
The gradient angle difference of each and input pixel P1~P16, and using gradient value as weight, the first input picture is calculated accordingly
The trust angle value (Confidence) of element, and inserted using the gradient angle of trust angle value soprano in the first input pixel as first
Supplementary angle degree, and angle value is trusted as first direction using the trust angle value of trust angle value soprano in the first input pixel, first is defeated
Enter the trust angle value Confidence of the input pixel Pk in pixelkIt is calculated using following formula:
Confidencek=ΣI=1~16f(Magi)·f(AngDiffi,k), k=6,7,10,11
Magi: the gradient value of input pixel Pi
Angi: the gradient angle of input pixel Pi
AngDiffi,k: input pixel Pi and the gradient differential seat angle for inputting pixel Pk
Wherein gradient value output function f (Magi) and gradient differential seat angle output function f (AngDiffi,k) such as Fig. 2 B institute
Show.
Gradient value output function f (Magi) comprising threshold value Mag1 and threshold value Mag2, when the gradient value of input pixel Pi
When lower than threshold value Mag1, the judgement of walking direction element 120 input pixel Pi and edge (edge) of the non-corresponding into image, ladder
Angle value output function f (Magi) output valve be 0, and when input pixel Pi gradient value be higher than threshold value Mag2 when, direction is sentenced
The corresponding edge into image the disconnected judgement of element 120 input pixel Pi, gradient value output function f (Magi) output valve be 1, when
When inputting the gradient value of pixel Pi between threshold value Mag1 and threshold value Mag2, the judgement input picture of walking direction element 120
Plain Pi may correspond to the edge into image, gradient value output function f (Magi) output valve between 0~1.Gradient angle
Poor output function f (AngDiffi,k) then comprising threshold value Ang1 and threshold value Ang2, as input pixel Pi and input pixel Pk's
When the absolute value of gradient angle difference is less than threshold value Ang1, being considered as input pixel Pi with the gradient angle for inputting pixel Pk is phase
It is equidirectional, gradient differential seat angle output function f (AngDiffi,k) output valve be 1, when input pixel Pi and input pixel Pk ladder
When spending the absolute value of angle difference greater than threshold value Ang2, it is different for being considered as input pixel Pi from the gradient angle for inputting pixel Pk
Direction, gradient differential seat angle output function f (AngDiffi,k) output valve be 0, when input pixel Pi and input pixel Pk gradient
When the absolute value of angle difference is between threshold value Ang1 and threshold value Ang2, it is considered as input pixel Pi and inputs pixel Pk's
Gradient angle is similarity direction, gradient differential seat angle output function f (AngDiffi,k) output valve be 0~1 between.With above-mentioned calculation
The trust angle value Confidence for the input pixel Pk that formula is calculatedkThe gradient angle for representing input pixel Pk is represented comprising input
In the image capturing range of pixel P1~P16 a possibility that edge direction.
In an embodiment, the gradient value range of image is 0~255, gradient value output function f (Magi) in threshold value
Mag1 is 40 and threshold value Mag2 is 100, and the gradient angular range of image is 0 °~180 °, because angle has periodically, therefore angle
Poor range is 0 °~90 °, gradient differential seat angle output function f (AngDiffi,k) in threshold value Ang1 be 15 ° and threshold value Ang2
It is 30 °.Upon reading the present disclosure, visual application demand voluntarily stipulates numerical value shown in figure to those skilled in the art
Mag1, Mag2, Ang1 and Ang2, however it is not limited to above-mentioned examples cited.
In another embodiment, input pixel also includes multiple second input pixels in the second range 220, and the
Two ranges 220 include the first above-mentioned range 210, and walking direction element 120 is to compare the first interpolation angle and the second input
The gradient angle of pixel, to update the first interpolation angle, the second range 220 is as shown in Figure 2 A.Specifically, walking direction element
120 input second in pixel (input pixel P1~P16), and the difference of corresponding gradient angle and the first interpolation angle is less than one
The horizontal direction gradient value Dx of angle threshold value person adds up respectively with vertical gradient value Dy, then accumulation result is divided by and is taken
Arctan function updates the first interpolation angle with acquired results.In some embodiments, angle threshold value is 10 degree, in other
In embodiment, angle threshold value is 15 degree, and angle threshold value described above is merely illustrative, is not limited to present disclosure.
In this way, which walking direction element 120 finely tunes root with the gradient information for inputting pixel in biggish second range 220
According to the first interpolation angle acquired by pixel is inputted in the first range 210, the first interpolation angle of gained is made more to meet adjacent domain
Middle gradient direction, further decreases the interference of noise, and generates more stable the first smooth image 163 in edge.
Direction interpolation element 130 is to the interpolation angle 162 that is generated according to walking direction element 120, to input image 160
Direction interpolation processing is carried out, to generate the first image 163, and the resolution ratio of the resolution ratio of the first image 163 and input image 160
Difference, but it is identical as the resolution ratio of image output 165.Interpolation angle 162 corresponds to edge direction in input image 160, direction
Interpolation element 130 does direction interpolation according to interpolation angle 162, so that having by the first image 163 that complement point increases pixel than making
With the sharper keen clearly image quality of general image interpolation technique.
In an embodiment, as shown in Figure 3A, direction interpolation element 130 to walking direction element 120 is generated
The corresponding first angle section 320 into multiple angular intervals 310~360 of one interpolation angle 300, wherein the first interpolation angle
One in the 300 interpolation angles 162 generated for walking direction element 120.Angular interval 310~360 covers 90 degree, each angle
Spending section is 15 degree (less than 30 degree).Walking direction element 120 chooses the input pixel in a sampling window (window) as more
A direction interpolation inputs pixel, and selectively carries out low pass filtered to direction interpolation input pixel according to first angle section 320
Wave processing generates the pixel value of one first pixel further according to the pixel value of treated direction interpolation input pixel, wherein first
Pixel is one of the group pixel of the first image 163, and corresponding to the first interpolation angle 300.
The low-pass filtering treatment that direction interpolation element 130 carries out includes at low-pass filtering horizontally and vertically
Reason, direction interpolation element 130 input pixel with the direction interpolation in low-pass filtering treatment sampling window, make processing result closer to side
To the first interpolation angle 300 caused by judgment component 120.In this present embodiment, sampling selected by direction interpolation element 130
Window size is 4x4 pixel, and direction interpolation element 130 is according to first angle section 320, to sampling window center 2x2 pixel coverage
Interior direction interpolation input pixel does the processing of horizontal low pass wave.
In other embodiments, when interpolation angle 162 it is corresponding to angular interval 310 when, direction interpolation element 130 is also to taking
Direction interpolation input pixel in sample window center 2x2 pixel coverage does the processing of horizontal low pass wave, when interpolation angle is corresponding to angle
When spending section 350~360, the direction interpolation input pixel in 130 pairs of direction interpolation element sampling window center 2x2 pixel coverages is done
Vertical low pass processing.Those skilled in the art, can modify according to application demand (such as sampling window range) or retouching progress is low
The range of pass filter processing and direction, however it is not limited to present disclosure examples cited.
Specifically, direction interpolation element 130 angular interval according to corresponding to interpolation angle 162 selectivity inserts direction
It mends after input pixel does low-pass filtering treatment, treated direction interpolation input pixel with one is included by direction interpolation element 130
The sampling window of coefficient (coefficient) does convolution algorithm, also that is, each pixel is corresponded to one in the sampling window of 4x4 pixel
Coefficient obtains the weight and (weighted of the pixel value of direction interpolation input pixel using coefficient corresponding to sampling window as weight
Sum), with the pixel value of the first pixel of generation.For example, sampling window coefficient can be formulated according to Lanczos interpolation algorithm, or
It is to be formulated according to spline interpolation (spline interpolation) algorithm, those skilled in the art can design according to actual demand
The coefficient of mask, however it is not limited to present disclosure examples cited.
In another embodiment, direction interpolation element 130 is also according to first angle section 320 from different angle sampling windows
Middle selection sampling window, as shown in Figure 3B, angle sampling window include rectangular co-ordinate sampling window 370, horizontal diagonal coordinate sampling window 380
And Vertical Diagonal coordinate sampling window 390, angular interval 310 and angular interval 360 are corresponding to rectangular co-ordinate sampling window 370, angle
It spends section 320 and angular interval 330 is corresponded to horizontal diagonal coordinate sampling window 380, and angular interval 340 and angular interval 350
It then corresponds to Vertical Diagonal coordinate sampling window 390.Direction interpolation element 130 is according to the resulting interpolation angle of walking direction element 120
Degree 162, the input pixel needed for pixel value of the selection to generate the first pixel in input image 160, in this way, due to
Selected input pixel is to choose along edge direction, and direction interpolation element 130, which can avoid generated first image 163, mould
The edge of paste, thus promote the sharpness of image.
It is noted that above description is by taking angular interval 310~360 as an example, and angular interval 310A~360A is angle
The supplementary angle in section 310~360, those skilled in the art after reading above disclosure, can analogize out angular interval 310A~
The sampling window of 360A and the direction of low-pass filtering treatment, do not depart from the spirit and scope of present disclosure.
In another embodiment, direction interpolation element 130 is also to corresponding to second angle area by the first interpolation angle 300
Between, and according to another pixel value of the first pixel of second angle section generation, the pixel value of the first pixel of mixing and another pixel
Value, to update the pixel value of the first pixel.For example, when application scenarios need higher image smoothness, direction interpolation
Element 130 in addition to the first interpolation angle 300 is corresponding to first angle section 320, lean on for 300 times with the first interpolation angle by more selection
Close second angle section 310, and as described above, according to second angle section 310 decide whether carry out low-pass filtering treatment with
And the direction of low-pass filtering treatment is carried out, then with the corresponding angle sampling window selected directions interpolation in second angle section 310 input
Pixel, and another pixel value of the first pixel of calculated for pixel values according to selected direction interpolation input pixel.Then, direction
Centric angle of the interpolation element 130 further according to the first interpolation angle 300 and first angle section 320 and second angle section 310
Difference, the pixel value and another pixel value that mix the first pixel are the pixel value of the first new pixel.
Since direction interpolation element 130 generates the pixel value of the first pixel according to similar two angular intervals, defeated
When to enter image 160 be one of film or audio-visual equal continuous images, image output 165 produced by image processor 100
In continuous play, can avoid the marginal portion that angle persistently changes has the case where bounce, increases the stability of image and sharp keen
Degree.
In some embodiments, direction interpolation element 130 according to the first interpolation angle 300 and first angle section 320 and
The difference of the centric angle in second angle section 310, ratio is added the pixel value of the first pixel and another pixel value is new the
The pixel value (as the weight of pixel value and another pixel value and) of one pixel, wherein the weight of pixel value and another pixel value
It is inversely proportional, lifts with the first interpolation angle 300 and the angle difference in first angle section 320 and the center in second angle section 310
For example, the angle difference of the centric angle in first angle section 320 and the first interpolation angle 300 is 6 °, second angle section
The angle difference of 310 centric angle and the first interpolation angle 300 is 9 °, and therefore, the weight of pixel value and another pixel value is
0.6 and 0.4.Then, direction interpolation element 130 calculate pixel value and another pixel value weight and, use and update the first pixel
Pixel value.
Image hybrid element 150 is to the first image 163 and self imaging caused by receiving direction interpolation element 130
Interpolation element 140, which is received, carries out the second image 164 caused by image interpolation processing, and the second image 164 to input image 160
Resolution ratio it is identical as the resolution ratio of the first image 163.It is corresponding extremely that angle value 161 is trusted in direction produced by walking direction element 120
The weight of first image 163 and the second image 164, image hybrid element 150 then mix the first image 163 and second according to weight
Image 164 is used as image output 165.For example, angle value 161 is trusted as the first image in direction by image hybrid element 150
163 weight α, and the weight of the second image 164 is (1- α), image hybrid element 150 calculates the first image 163 and the second shadow
As 164 weight and as image output 165.Those skilled in the art can modify or retouch root after refering to present disclosure
The mode that angle value 161 generates weight is trusted according to direction, however it is not limited to above-mentioned example.
Image interpolation element 140 carries out traditional image interpolation processing, the two-wire including non-directional to input image 160
Property interpolation (bilinear interpolation) technology and bicubic interpolation (Bicubic interpolation) technology, or
Other non-linear image interpolation techniques, those skilled in the art can determine selection according to calculation resources or other design considerations
Image interpolation technique, example provided above are not limited to present disclosure.
In an embodiment, image processor 100 include gradient information computing element 110, walking direction element 120 with
And direction interpolation element 130, the function of each element is each as described above.In this embodiment, 130 recipient of direction interpolation element
The interpolation angle 162 exported to judgment component 120 carries out low-pass filtering treatment according to interpolation angle 162, inserts progress direction
The direction of processing is mended closer to interpolation angle 162 (that is, edge direction), often generated reducing by 165 fringe region of image output
Artifact (artifact) or fuzzy situation.
Image processor 100 is with the realization of low hardware cost, by small range to the edge for approaching input pixel on a large scale
Direction obtains stable and reliable interpolation angle 162, carries out direction interpolation processing according to interpolation angle 162, believes further according to direction
Appoint angle value 161 to mix acquired results with general image interpolation processing acquired results, high-quality is obtained with the operation of low complex degree
Image.Image processor 100 combines low-pass filtering treatment more to obtain the direction interpolation input pixel close to interpolation angle 162
Pixel value, and mix according to different angle section carry out the resulting pixel value of direction interpolation processing so that individual or continuous shadow
Sharp keen clearly image effect is all presented in the processing result of picture.
A kind of flow chart for image treatment method that Fig. 4 is painted according to present disclosure embodiment.Although it will be understood that stream
It is to be described the step of particular order for image treatment method 400 in journey figure, so this is not intended to limit mentioned by the present invention
In addition the tandem of step can increase or decrease the step in the implementation.In addition, illustrating for convenience and clearly, with Fig. 1
Shown in image processor 100 execute image treatment method 400 for be illustrated, but present disclosure not as
Limit.
In the operating process of image treatment method 400, image processor 100 carries out calculation process to input image,
To generate the corresponding gradient value of input pixel and the gradient angle (step S410) in input image.Input image can be black
White or chromatic image, and with operations such as Sobel operand, Perwitt operand or Laplacian operands vertically and horizontally
Member does convolution algorithm to input image to obtain gradient value and gradient angle, and is optionally filtered out with gradient threshold value too low
Gradient value, to ensure resulting gradient value and gradient direction not by noise jamming.Image processor 100 obtains gradient value and ladder
The details in direction is spent as described above, repeating no more in this.
Image processor 100 and gradient value and gradient angle according to corresponding to input pixel, generate multiple interpolation angles
Angle value (step S420) is trusted in degree and direction.In an embodiment, image processor 100 more multiple first inputs pixel
And the gradient value and gradient angle of other the input pixels adjacent with the first input pixel, it is inserted with generating first in interpolation angle
Angle value is trusted in supplementary angle degree and corresponding direction, and the first input pixel includes the input pixel being located in the first range.For example,
First range is 2x2 pixel as shown in Figure 2 A, according to the input pixel adjacent thereto of the input pixel in the first range, can be obtained pair
The gradient value and gradient of the first input pixel and other adjacent input pixels should be compared to the interpolation angle at the first range center
The details of angle in this as described above, repeat no more.
In another embodiment, image processor 100 is also to compare the first interpolation angle and multiple second input pictures
The gradient angle of element, to update the first interpolation angle, the second input pixel includes the input pixel being located in the second range, and the
Two ranges make interpolation angle more in this way, can expand the input pixel coverage to generate interpolation angle comprising the first range
Meet the edge direction in region, and obtains more stable direction interpolation result.Compare the first interpolation angle and the second input pixel
Gradient angle and update accordingly the first interpolation angle details and the first range and the second range setting, such as aforementioned reality
The description for applying example, repeats no more in this.
Image processor 100 carries out direction interpolation processing according to interpolation angle, to input image, to generate the first shadow
Picture, and the resolution ratio of the first image is different from the resolution ratio of input image (step S430).In an embodiment, image processing dress
100 are set by the corresponding first angle section into multiple angular intervals of the first interpolation angle in interpolation angle, chooses a sampling
Input pixel in window inputs pixel as direction interpolation, and according to first angle section, selectively inputs to direction interpolation
Pixel carries out low-pass filtering treatment, further according to the pixel value of treated direction interpolation input pixel, generates the picture of the first pixel
Element value, the first pixel are one of the group pixel of the first image, and corresponding to the first interpolation angle.Image processor 100 is right
Direction interpolation inputs the details that pixel carries out low-pass filtering treatment, and inputs picture according to the direction interpolation after low-pass filtering treatment
The details for the pixel value that the calculated for pixel values of element goes out the first pixel is repeated no more such as the explanation of above-described embodiment in this.
In another embodiment, image processor 100 is chosen according to first angle section from multiple angle sampling windows
One is used as sampling window, and wherein angle sampling window includes rectangular co-ordinate sampling window, Vertical Diagonal coordinate sampling window or horizontal diagonal
Coordinate sampling window chooses the details of angle sampling window and the specific embodiment of angle sampling window according to angular interval, such as above-mentioned
Illustrate in embodiment, is repeated no more in this.
In another embodiment, image processor 100 removes the pixel value that the first pixel is generated according to first angle section
Outside, also the first interpolation angle is corresponded to second angle section, and generates another picture of the first pixel according to second angle section
Element value mixes the pixel value and another pixel value of the first pixel, to update the pixel value of the first pixel.Image processor 100
By the first interpolation angle it is corresponding to second angle section, generate the first pixel another pixel value and mixed pixel value with it is another
The details of pixel value in this as described above, repeat no more.
It is another through mixing pixel value according to caused by first angle section and according to caused by second angle section
One pixel value, image treatment method 300 can generate the careful image in edge, and the edge of continuous image is avoided to generate bounce
Situation further promotes image quality.
First image is more carried out image interpolation with to input image after generating the first image by image processor 100
The mixing of second image caused by handling, the resolution ratio of the second image is identical as the resolution ratio of the first image, and is believed according to direction
Appoint the weight of the first image and the second image corresponding to angle value, mixes the first image and the second image as image output (step
Rapid S440).Angle value, which is trusted, according to direction generates the first image and the second image weight and the first image of mixing and the second image
Details as described above, being repeated no more in this.
In an embodiment, image treatment method 300 includes step S410~S430, in this embodiment, step S430
Operation in comprising with the interpolation of low-pass filtering treatment direction input pixel after calculate output pixel value again, in this way, direction insert
Mending image produced by handling has sharp keen smooth edge, can promote image output quality.
Bonding position interpolation processing and image interpolation processing as a result, allowing image processor 100 and image processing side
Method 300 generates clearly image with lower computation complexity.As previously mentioned, in some embodiments, image processor 100
And image treatment method 300 is filtered the corresponding gradient value of input pixel with gradient threshold value, therefore in input image
It is 0 that angle value is trusted in flat site direction in 160, when it is 0 that angle value is trusted in direction, can be omitted related with direction interpolation processing
Operation for example in image processor 100, can omit walking direction element 120 and direction interpolation element
130 calculation process can omit step S430~S440 in image treatment method 300, in this way, can further save
Spent computing resource.
Image processor and method provided by present disclosure allow high-resolution output with low hardware implementation cost
The edge of image is more careful, and low-pass filter is combined when carrying out direction interpolation processing, allows the edges of different directions in image
It is more smooth continuous, to reach more preferably image effect.Image processor and method more trust angle value and multistage with direction
The interpolation converging angular of section, bonding position interpolation processing is with image interpolation processing as a result, further promotion image output quality
Stability.
Although present disclosure is disclosed as above with embodiment, so it is not limited to present disclosure, Ren Heben
Field technical staff, in the spirit and scope for not departing from present disclosure, when various variation and retouching, therefore this public affairs can be done
The protection scope of content is opened subject to view as defined in claim.