CN109903224A - Image-scaling method, device, computer equipment and storage medium - Google Patents

Image-scaling method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109903224A
CN109903224A CN201910071588.2A CN201910071588A CN109903224A CN 109903224 A CN109903224 A CN 109903224A CN 201910071588 A CN201910071588 A CN 201910071588A CN 109903224 A CN109903224 A CN 109903224A
Authority
CN
China
Prior art keywords
original image
vegetarian refreshments
image vegetarian
value
neighborhood
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910071588.2A
Other languages
Chinese (zh)
Other versions
CN109903224B (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.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli Technology 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 Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN201910071588.2A priority Critical patent/CN109903224B/en
Publication of CN109903224A publication Critical patent/CN109903224A/en
Application granted granted Critical
Publication of CN109903224B publication Critical patent/CN109903224B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

This application involves a kind of image-scaling method, device, computer equipment and storage mediums.The described method includes: obtain mapping point of the interpolation pixel in original image in target image select around in default neighborhood each original image vegetarian refreshments pixel value;According to the pixel value of original image vegetarian refreshments, the edge gradient direction information and edge strength information of mapping point point are determined;Determine the weight of each original image vegetarian refreshments in neighborhood;According to edge gradient direction information, edge strength information and weight, the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood is determined;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolutional filtering weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, the pixel value of interpolation pixel in target image is determined.The marginal information of original image can be retained in scaling using this method, promote the quality for the target image that scaling obtains.

Description

Image-scaling method, device, computer equipment and storage medium
Technical field
This application involves technical field of image processing, more particularly to a kind of image-scaling method, device, computer equipment And storage medium.
Background technique
With the development of display technology, the demand to the image scaling techniques between different resolution is also being promoted, such as In high definition or ultra high-definition display technology, need by image scaling techniques by existing video resource zoom to matched size with Smaller screen or superelevation clear screen zoom in and out display, to meet display resolution requirement.
Traditional image-scaling method mainly has the interpolation method based on low-pass filtering and the interpolation method based on edge.Its Middle low-pass filtering interpolation method includes such as bilinear interpolation, bicubic interpolation.In traditional images interpolation algorithm, adjacent interpolation compared with Simply, easy to accomplish, using commonplace when early stage, but this method can generate apparent jagged edges in new images And mosaic phenomenon.Bilinear interpolation has smoothing function, can be efficiently against the deficiency of adjacent method, but understands the height of degraded image Frequency part, makes image detail fog.When amplification factor is relatively high, high-order interpolation, such as bicubic and cubic spline interpolation It is better than low order interpolation.
Traditional image-scaling method continues original image ash by the grey scale pixel value that interpolation arithmetic can be such that interpolation generates The continuity of variation is spent, to keep the deep or light variation nature of image obtained after scaling smooth.But in the picture, some pixels with Between adjacent pixel there is mutation in gray value, that is, there is gray scale discontinuity, these pixels with gray scale value mutation are exactly image The profile of middle description object or the edge pixel of texture image, in image amplification, to these with discontinuous gamma characteristic Pixel will certainly make the profile and texture of amplified image if generating the pixel newly increased using conventional interpolation algorithm Fuzzy, marginal information is lost, and leads to the poor image quality obtained after scaling.
Summary of the invention
Based on this, it is necessary to which in view of the above technical problems, image edge information can be retained by providing one kind, after promoting scaling Image-scaling method, device, computer equipment and the storage medium of the quality of obtained target image.
A kind of image-scaling method, which comprises
Obtain the interpolation pixel in target image;Determine mapping point of the interpolation pixel in original image Point, and obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;According in neighborhood The pixel value of each original image vegetarian refreshments determines the edge gradient direction information and edge strength information of mapping point point;According to reflecting The Gauss distance in coordinate points and neighborhood between each original image vegetarian refreshments is penetrated, determines the weight of each original image vegetarian refreshments in neighborhood; According to edge gradient direction information, edge strength information and weight, determine that the edge enhancing of each original image vegetarian refreshments in neighborhood declines Subtract compensation coefficient;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolution filter Wave weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, determine in target image to The pixel value of interpolating pixel point.
A kind of image scaling device, described device include:
Interpolation pixel obtains module, for obtaining the interpolation pixel in target image;
Neighborhood territory pixel obtains module, for determining mapping point point of the interpolation pixel in original image, and obtains In original image mapping point select around in default neighborhood each original image vegetarian refreshments pixel value;
Marginal information determining module determines mapping point point for the pixel value according to original image vegetarian refreshments each in neighborhood Edge gradient direction information and edge strength information;
Original weight determination module, for according to mapping point select and neighborhood in Gauss between each original image vegetarian refreshments away from From determining the weight of each original image vegetarian refreshments in neighborhood;
Enhance attenuation correction coefficient determination module, be used for according to edge gradient direction information, edge strength information and weight, Determine the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood;
Interpolation pixel pixel value determining module, for enhancing attenuation correction coefficient to each original pixels using edge The weight of point is weighted, and obtains convolutional filtering weight;According to the picture of each original image vegetarian refreshments in convolutional filtering weight and neighborhood The product of element value, determines the pixel value of interpolation pixel in target image.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device performs the steps of when executing the computer program
Obtain the interpolation pixel in target image;Determine mapping point of the interpolation pixel in original image Point, and obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;According in neighborhood The pixel value of each original image vegetarian refreshments determines the edge gradient direction information and edge strength information of mapping point point;According to reflecting The Gauss distance in coordinate points and neighborhood between each original image vegetarian refreshments is penetrated, determines the weight of each original image vegetarian refreshments in neighborhood; According to edge gradient direction information, edge strength information and weight, determine that the edge enhancing of each original image vegetarian refreshments in neighborhood declines Subtract compensation coefficient;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolution filter Wave weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, determine in target image to The pixel value of interpolating pixel point.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor It is performed the steps of when row
Obtain the interpolation pixel in target image;Determine mapping point of the interpolation pixel in original image Point, and obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;According in neighborhood The pixel value of each original image vegetarian refreshments determines the edge gradient direction information and edge strength information of mapping point point;According to reflecting The Gauss distance in coordinate points and neighborhood between each original image vegetarian refreshments is penetrated, determines the weight of each original image vegetarian refreshments in neighborhood; According to edge gradient direction information, edge strength information and weight, determine that the edge enhancing of each original image vegetarian refreshments in neighborhood declines Subtract compensation coefficient;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolution filter Wave weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, determine in target image to The pixel value of interpolating pixel point.
Above-mentioned image-scaling method, device, computer equipment and storage medium, it is corresponding original according to interpolation pixel Mapping point in image select around in default neighborhood each original image vegetarian refreshments pixel value, determine the edge ladder of mapping point point Spend directional information and edge strength information, the weight of original image vegetarian refreshments each in neighborhood is enhanced or is decayed enhanced or The weight of each original image vegetarian refreshments after decaying, and according to the weight and each original of each original image vegetarian refreshments after enhancing or decaying The pixel value of beginning pixel solves to obtain the pixel value of interpolation pixel.The phase before and after pixel can be kept in Interpolation Process Guan Xing, and the enterprising row interpolation in edge can handle in any direction, to keep the marginal information of original image, so that image is amplifying or is contracting The appearance for phenomena such as it is clear to keep after small, avoids jaggy distortion, remains the integrality and correlation of image edge information, makes The profile and texture of image after scaling are apparent, promote the quality of the target image obtained after scaling.
Detailed description of the invention
Fig. 1 is the flow diagram of image-scaling method in one embodiment;
Fig. 2 is the flow diagram of image-scaling method in another embodiment;
Fig. 3 is the schematic diagram in one embodiment;
Fig. 4 is the schematic diagram in one embodiment;
Fig. 5 is the schematic diagram in one embodiment;
Fig. 6 is the schematic diagram in one embodiment;
Fig. 7 is the schematic diagram in one embodiment;
Fig. 8 is the structural block diagram of image scaling device in one embodiment;
Fig. 9 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Image-scaling method provided by the present application, can be applied in terminal.Wherein, terminal can be, but not limited to be various Television set, personal computer, laptop, smart phone, tablet computer and portable wearable device etc..
In one embodiment, as shown in Figure 1, providing a kind of image-scaling method, include the following steps S110- S180:
S110 obtains the interpolation pixel in target image;
Wherein, target image is the image for obtain after image scaling to original image, and image difference is using original Known pixels point in image calculates the process of unknown pixel point in target image, and interpolation pixel is the mesh referred to after scaling The unknown pixel point for needing to be determined by calculation in logo image.
S120 determines mapping point point of the interpolation pixel in original image;
As illustratively, as shown in Figure 3, it is assumed that input original image low resolution zooms into high resolution target image, original image Wide high respectively Wsrc、hsrc, the wide high respectively W of target imagetar、htar.The then interpolation pixel that I row J is arranged in target image Coordinate value (Itar,Jtar) coordinate value of mapping point point in original image is (Isrc,Jsrc):
S130, obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;
Wherein, mapping point select around each original image vegetarian refreshments in default neighborhood, can the neighbour determine according to actual needs The quantity of original image vegetarian refreshments in domain, such as can be 2 × 2 around original image vegetarian refreshments, 3 × 4,3 × 3 or 6 × 6 etc. it is original Pixel.Original image vegetarian refreshments is more in the neighborhood of use, and the target image effect generated after scaling is better, and information is more complete, but Correspondingly operand also will increase, therefore the quantity of original image vegetarian refreshments in suitable neighborhood can be selected according to scaling situation.
As illustratively, as shown in figure 4, can choose interpolation pixel (Itar,Jtar) map and sit in original image Punctuate (Isrc,Jsrc) around 4 × 4 neighborhood in original image vegetarian refreshments, as neighborhood territory pixel.
S140 determines the edge gradient direction letter of mapping point point according to the pixel value of original image vegetarian refreshments each in neighborhood Breath and edge strength information;
Wherein, pixel value is the amount for characterizing pixel value, such as can be pixel leading in a certain color space Road value, by taking RGB color as an example, then the pixel value of pixel can be expressed as (R, G, B), wherein R, G, B are respectively RGB The channel value in three channels of color space.
In one embodiment, as shown in Fig. 2, S140 is determined and reflected according to the pixel value of original image vegetarian refreshments each in neighborhood The edge gradient direction information and edge strength information for penetrating coordinate points include S141-S142:
S141 determines the horizontal edge gradient value of mapping point point according to the pixel value of original image vegetarian refreshments each in neighborhood With corresponding horizontal edge intensity value;
In one embodiment, S141 determines mapping point point according to the pixel value of original image vegetarian refreshments each in neighborhood Horizontal edge gradient value and corresponding horizontal edge intensity value, comprising: calculate the pixel value of each original image vegetarian refreshments in neighborhood Mean value;Obtain the original image vegetarian refreshments of the default row in neighborhood in original image vegetarian refreshments;According to the original image vegetarian refreshments of default row in level The difference in direction determines the horizontal edge gradient value of mapping point point;According between the original image vegetarian refreshments and mean value of default row Difference determines the horizontal edge intensity value of mapping point point.
Further, in one embodiment, the original image vegetarian refreshments of the default row in neighborhood in original image vegetarian refreshments, packet are obtained It includes: obtaining in neighborhood in original image vegetarian refreshments, the original image vegetarian refreshments of the line number other than the first row and last line, as default Capable original image vegetarian refreshments.
As illustratively, with mapping point point (Isrc,Jsrc) around 4 × 4 neighborhood in for original image vegetarian refreshments, in neighborhood The mean value computation such as following formula of the pixel value of each original image vegetarian refreshments:
In above formula, avg is the mean value of the pixel value of each original image vegetarian refreshments in neighborhood, and i is original image vegetarian refreshments row in neighborhood Subscript, i value 0~3, j are original pixels point range subscript in neighborhood, j value 0~3, pi,jFor original image vegetarian refreshments (i, j) in neighborhood Pixel value.
Mapping point point (Isrc,Jsrc) horizontal edge gradient value calculating be shown below:
H_diff0=-1*p10-2*p11+2*p12+1*p13
H_diff1=-1*p20-2*p21+2*p22+1*p23
H_diff=h_diff0+h_diff1
In above formula, h_diff0 is the first row original image vegetarian refreshments difference in the horizontal direction in neighborhood, and h_diff1 is neighborhood Interior second row original image vegetarian refreshments difference in the horizontal direction, h_diff are the horizontal edge gradient value of mapping point point.
Mapping point point (Isrc,Jsrc) calculating of corresponding horizontal edge intensity value is shown below:
In above formula, h_var is horizontal edge intensity value, and abs is to take absolute value.
In above-described embodiment, for the easy horizontal edge gradient for calculating mapping point and selecting the original image vegetarian refreshments in 4 × 4 neighborhoods Value and corresponding horizontal edge intensity value, using the biggish the first row of correlation and the second row pixel in original image vegetarian refreshments in neighborhood Value calculate horizontal edge gradient value and horizontal edge intensity value (original image vegetarian refreshments is 0,1,2,3 row and 0 respectively in neighborhood, 1, 2,3 column).Since the correlation that the first row and secondary series of row every in neighborhood treat interpolating pixel point is higher than the 0th column and third Column, therefore use [- 1, -2,2,1]TMatrix calculate the first row and the second row original image vegetarian refreshments difference in the horizontal direction, According to the positive flat gradient direction of negative judgement marginal water of the sum of line direction difference.According to the pixel average in the neighborhood being calculated Corresponding difference is obtained to column pixel value each in the first row and the second row, and absolute value sums to obtain as differentiation edge horizontal direction The horizontal edge intensity value of strength information.
S142 determines the vertical edge gradient value of mapping point point according to the pixel value of original image vegetarian refreshments each in neighborhood With corresponding vertical edge intensity value.
In one embodiment, S142 determines mapping point point according to the pixel value of original image vegetarian refreshments each in neighborhood Vertical edge gradient value and corresponding vertical edge intensity value, comprising: calculate the pixel value of each original image vegetarian refreshments in neighborhood Mean value;Obtain the original image vegetarian refreshments of the default column in neighborhood in original image vegetarian refreshments;According to the original image vegetarian refreshments of default column vertical The difference in direction determines the vertical edge gradient value of mapping point point;According between the original image vegetarian refreshments and mean value of default column Difference determines the vertical edge intensity value of mapping point point.
In one embodiment, the original image vegetarian refreshments of the default column in neighborhood in original image vegetarian refreshments is obtained, comprising: obtain adjacent In domain in original image vegetarian refreshments, the original image vegetarian refreshments of the columns other than first row and last column, as the original of default column Pixel.
As illustratively, equally with mapping point point (Isrc,Jsrc) around 4 × 4 neighborhood in for original image vegetarian refreshments, it is adjacent The mean value computation such as following formula of the pixel value of each original image vegetarian refreshments in domain:
In above formula, avg is the mean value of the pixel value of each original image vegetarian refreshments in neighborhood, and i is original image vegetarian refreshments row in neighborhood Subscript, i value 0~3, j are original pixels point range subscript in neighborhood, j value 0~3, pi,jFor original image vegetarian refreshments (i, j) in neighborhood Pixel value.
Mapping point point (Isrc,Jsrc) vertical edge gradient value calculating be shown below:
V_diff0=-1*p01-2*p11+2*p21+1*p31
V_diff1=-1*p02-2*p12+2*p22+1*p32
V_diff=v_diff0+v_diff1
In above formula, v_diff0 is that for the first row original image vegetarian refreshments in the difference of vertical direction, v_diff1 is neighborhood in neighborhood For interior second row original image vegetarian refreshments in the difference of vertical direction, v_diff is the vertical edge gradient value of mapping point point.
Mapping point point (Isrc,Jsrc) calculating of corresponding vertical edge intensity value is shown below:
In above formula, v_var is vertical edge intensity value, and abs is to take absolute value.
In above-described embodiment, for the easy vertical edge gradient for calculating mapping point and selecting the original image vegetarian refreshments in 4 × 4 neighborhoods Value and corresponding vertical edge intensity value, using the biggish first row of correlation and secondary series pixel in original image vegetarian refreshments in neighborhood Value calculate vertical edge gradient value and vertical edge intensity value (original image vegetarian refreshments is 0,1,2,3 row and 0 respectively in neighborhood, 1, 2,3 column).Since the correlation that the first row of each column in neighborhood and the second row treat interpolating pixel point is higher than zero row and third Row, therefore difference of the original image vegetarian refreshments of first row and secondary series in vertical direction, root are calculated using the matrix of [- 1-2 2 1] According to the positive negative judgement edge-perpendicular gradient direction of the sum of column direction difference.According in the neighborhood being calculated pixel average with Each row pixel value obtains corresponding difference in first row and secondary series, and absolute value is summed to obtain as differentiating that edge-perpendicular direction is strong Spend the vertical edge intensity value of information.
S150, according to mapping point select and neighborhood in Gauss distance between each original image vegetarian refreshments, determine each in neighborhood The weight of a original image vegetarian refreshments;
As illustratively, mapping point select and neighborhood in Gauss distance between each original image vegetarian refreshments calculate such as following formula institute Show:
Wherein, (x, y) be using interpolation pixel as center 4*4 neighborhood in any original image vegetarian refreshments coordinate value, rsd (x, y) is the Gauss distance that the coordinate is between the original image vegetarian refreshments of (x, y) in mapping point point and neighborhood;
To take in 4 × 4 neighborhoods original image vegetarian refreshments as neighborhood territory pixel, then in this step, 16 original pixels Point is corresponding with 16 coordinate values (x, y), can calculate separately to obtain 16 Gauss distance rsd(x,y)。
According to rsd(x, y) determines that the weight of original image vegetarian refreshments in corresponding neighborhood is shown below:
Wherein, (x, y) is the coordinate value that original image vegetarian refreshments is corresponded in neighborhood, w(x,y)For rsd(x, y) corresponding weight, nxFor Normalization coefficient, rsd(x, y) is that for original image vegetarian refreshments with respect to the distance of interpolation pixel, σ is corresponding Gaussian Profile in neighborhood Standard deviation;
To take in 4 × 4 neighborhoods original image vegetarian refreshments as neighborhood territory pixel, then in this step, according to 16 Gausses Distance rsd16 weights of 16 original image vegetarian refreshments can be calculated in (x, y).
The above are the basic principles of weight calculation in this step, in practical applications, to simplify operation, in this step may be used Directly to obtain different Gausses apart from corresponding weight by the weight table that inquiry has been deposited.It specifically, can be first according to corresponding flat The Gaussian curve of sliding low-pass filtering, tables look-up according to the Gauss distance of each point in neighborhood and obtains corresponding weighted value, normalization coefficient nxIt is corresponding, it is the inverse of the sum of each point weight in neighborhood;
In the present embodiment, it can effectively show that each original image vegetarian refreshments is to current interpolation pixel in neighborhood by Gauss distance Weight is contributed, so that the correlation of interpolation pixel with original image vegetarian refreshments in original image neighborhood is remained to a certain extent, So that the picture edge characteristic in original image is retained to a certain extent.
S160 determines each original image vegetarian refreshments in neighborhood according to edge gradient direction information, edge strength information and weight Edge enhance attenuation correction coefficient;
In one embodiment, as shown in Fig. 2, S160 is according to edge gradient direction information, edge strength information and weight, Determine the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood, including S161-S163:
S161, the horizontal edge gradient value selected according to mapping point, horizontal edge intensity value and each original image vegetarian refreshments Weight determines the horizontal edge compensation coefficient of each original image vegetarian refreshments;
In one embodiment, S161 is according to the horizontal edge gradient value of mapping point point, horizontal edge intensity value and each The weight of a original image vegetarian refreshments determines the horizontal edge compensation coefficient of each original image vegetarian refreshments, comprising: according to mapping point point Horizontal edge gradient value determines the positive negativity of horizontal edge enhancing damped expoential;According to the horizontal edge intensity of mapping point point Value determines the size of the horizontal edge enhancing decaying truth of a matter;For each original image vegetarian refreshments, enhancing the decaying truth of a matter with horizontal edge is The truth of a matter carries out power operation and obtains the original using the product of horizontal edge enhancing damped expoential and the weight of the original image vegetarian refreshments as index The horizontal edge compensation coefficient of beginning pixel.
As illustratively, according to the horizontal edge gradient value of mapping point point, horizontal edge enhancing damped expoential is determined Positive negativity is shown below:
In above formula, h_signed is that horizontal edge enhances damped expoential.
According to the horizontal edge intensity value of mapping point point, the size of horizontal edge enhancing decaying truth of a matter α is determined;
For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter using horizontal edge, is referred to horizontal edge enhancing decaying The product of several and the original image vegetarian refreshments weight is index, carries out power operation and obtains the horizontal edge compensation coefficient of the original image vegetarian refreshments It is shown below:
In above formula, α ' (x, y) is the horizontal edge compensation coefficient for the original image vegetarian refreshments that coordinate is (x, y).
Above embodiments are the horizontal edge compensation coefficient calculated in this step S161 according to principle, in practical applications, In order to simplify operation, in one embodiment, horizontal edge gradient value of the S161 according to mapping point point, horizontal edge intensity value With the weight of each original image vegetarian refreshments, the horizontal edge compensation coefficient of each original image vegetarian refreshments is determined, comprising: according to mapping point The positive negativity of the horizontal edge gradient value of point, determines corresponding curve set;Curve set includes that enhancing of the slope of curve greater than zero is bent Line collection or the minus attenuation curve collection of the slope of curve;According to horizontal edge intensity value, select to correspond to from determining curve set Curve, the proportional example of horizontal edge intensity value slope of a curve order of magnitude corresponding with selection;From the curve of selection Middle inquiry is the corresponding ordinate of abscissa with the Gauss distance between each original image vegetarian refreshments and mapping point point, as each The horizontal edge compensation coefficient of original image vegetarian refreshments.
As illustratively, when the horizontal edge gradient value h_diff of mapping point point is greater than or equal to zero, it is determined as increasing Strong curve set;Wherein, enhance the enhancing curve in curve set including default number of branches, the corresponding value interval of every enhancing curve Horizontal edge gradient value h_diff;
As shown in figure 5, to enhance the schematic diagram of 7 enhancing curves in curve set in one embodiment, according to horizontal sides Edge intensity value h_var selects corresponding enhancing curve as follows from enhancing curve set:
As h_var < strength_level_th0, level0 curve is selected;
Level1 curve is selected as strength_level_th0≤h_var < strength_level_th1;
Level2 curve is selected as strength_level_th1≤h_var < strength_level_th2;
Level3 curve is selected as strength_level_th2≤h_var < strength_level_th3;
Level4 curve is selected as strength_level_th3≤h_var < strength_level_th4;
Level5 curve is selected as strength_level_th4≤h_var < strength_level_th5;
Level6 curve is selected as strength_level_th5≤h_var < strength_level_th6;
Level7 curve is selected as strength_level_th6≤h_var < strength_level_th7;
Level8 curve is selected as h_var >=strength_level_th7;
Wherein, strength_level_th0~7 represent the threshold value of preset value interval, can set according to demand It sets, the slope of corresponding curve level1~8 is incremented by successively;Wherein level0 slope of a curve is 0, i.e., right without enhancing α ' (x, y) value that each original image vegetarian refreshments (x, y) answered inquires in the curve is 1.
After having selected corresponding enhancing curve, from the enhancing curve of the selection inquire with each original image vegetarian refreshments with reflect The Gauss distance penetrated between coordinate points is the corresponding ordinate of abscissa, and the horizontal edge as each original image vegetarian refreshments corrects system Number.
When the horizontal edge gradient value h_diff of mapping point point is less than zero, it is determined as attenuation curve collection;Wherein, decay It include the attenuation curve of default number of branches, the horizontal edge gradient value h_ of the corresponding value interval of every attenuation curve in curve set diff;
As shown in fig. 6, the schematic diagram for 7 attenuation curves concentrated for attenuation curve in one embodiment, according to horizontal sides Edge intensity value h_var is concentrated from attenuation curve and is selected corresponding attenuation curve as follows:
As h_var < strength_level_th0, level0 curve is selected;
Level1 curve is selected as strength_level_th0≤h_var < strength_level_th1;
Level2 curve is selected as strength_level_th1≤h_var < strength_level_th2;
Level3 curve is selected as strength_level_th2≤h_var < strength_level_th3;
Level4 curve is selected as strength_level_th3≤h_var < strength_level_th4;
Level5 curve is selected as strength_level_th4≤h_var < strength_level_th5;
Level6 curve is selected as strength_level_th5≤h_var < strength_level_th6;
Level7 curve is selected as strength_level_th6≤h_var < strength_level_th7;
Level8 curve is selected as h_var >=strength_level_th7;
Wherein, strength_level_th0~7 represent the threshold value of preset value interval, can set according to demand It sets, the slope of corresponding curve level1~8 successively successively decreases (absolute value of slope is incremented by successively), and wherein level0 curve is oblique Rate is 0, i.e., without decaying, α ' (x, y) value that corresponding each original image vegetarian refreshments (x, y) inquires in the curve is 1。
After having selected corresponding attenuation curve, from the attenuation curve of the selection inquire with each original image vegetarian refreshments with reflect The Gauss distance penetrated between coordinate points is the corresponding ordinate of abscissa, and the horizontal edge as each original image vegetarian refreshments corrects system Number.
In other embodiments, the scheme of corresponding horizontal edge compensation coefficient is obtained above by curve inquiry, also Plurality of replaceable scheme, such as can be corresponding table by above-mentioned Curve transform, according to mapping point by way of tabling look-up The weight of the horizontal edge gradient value, horizontal edge intensity value and each original image vegetarian refreshments selected, inquiry determine each original pixels The horizontal edge compensation coefficient etc. of point.
S162, the vertical edge gradient value selected according to mapping point, vertical edge intensity value and each original image vegetarian refreshments Weight determines the vertical edge compensation coefficient of each original image vegetarian refreshments;
In one embodiment, S162 is according to the vertical edge gradient value of mapping point point, vertical edge intensity value and each The weight of a original image vegetarian refreshments determines the vertical edge compensation coefficient of each original image vegetarian refreshments, comprising: according to mapping point point The positive negativity of vertical edge gradient value, determines corresponding curve set;Curve set includes the enhancing curve set that the slope of curve is greater than zero Or the minus attenuation curve collection of the slope of curve;According to vertical edge intensity value, corresponding song is selected from determining curve set Line, the proportional example of vertical edge intensity value slope of a curve order of magnitude corresponding with selection;It is looked into from the curve of selection Asking with the Gauss distance between each original image vegetarian refreshments and mapping point point is the corresponding ordinate of abscissa, as each original The vertical edge compensation coefficient of pixel.
As illustratively, according to the vertical edge gradient value of mapping point point, vertical edge enhancing damped expoential is determined Positive negativity is shown below:
In above formula, v_signed is that vertical edge enhances damped expoential.
According to the vertical edge intensity value of mapping point point, the size of vertical edge enhancing decaying truth of a matter α is determined;
For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter using vertical edge, is referred to vertical edge enhancing decaying The product of several and the original image vegetarian refreshments weight is index, carries out power operation and obtains the vertical edge compensation coefficient of the original image vegetarian refreshments It is shown below:
In above formula, β ' (x, y) is the vertical edge compensation coefficient for the original image vegetarian refreshments that coordinate is (x, y).
Above embodiments are the vertical edge compensation coefficient calculated in this step S162 according to principle, in practical applications, In order to simplify operation, in one embodiment, vertical edge gradient value of the S162 according to mapping point point, vertical edge intensity value With the weight of each original image vegetarian refreshments, the vertical edge compensation coefficient of each original image vegetarian refreshments is determined, comprising: according to mapping point The positive negativity of the vertical edge gradient value of point, determines corresponding curve set;Curve set includes that enhancing of the slope of curve greater than zero is bent Line collection or the minus attenuation curve collection of the slope of curve;According to vertical edge intensity value, select to correspond to from determining curve set Curve, the proportional example of vertical edge intensity value slope of a curve order of magnitude corresponding with selection;From the curve of selection Middle inquiry is the corresponding ordinate of abscissa with the Gauss distance between each original image vegetarian refreshments and mapping point point, as each The vertical edge compensation coefficient of original image vegetarian refreshments.
As illustratively, when the vertical edge gradient value v_diff of mapping point point is greater than or equal to zero, it is determined as increasing Strong curve set;Wherein, enhance the enhancing curve in curve set including default number of branches, the corresponding value interval of every enhancing curve Vertical edge gradient value v_diff;
As shown in figure 5, to enhance the schematic diagram of 7 enhancing curves in curve set in one embodiment, according to vertical edges Edge intensity value v_var selects corresponding enhancing curve as follows from enhancing curve set:
As v_var < strength_level_th0, level0 curve is selected;
Level1 curve is selected as strength_level_th0≤v_var < strength_level_th1;
Level2 curve is selected as strength_level_th1≤v_var < strength_level_th2;
Level3 curve is selected as strength_level_th2≤v_var < strength_level_th3;
Level4 curve is selected as strength_level_th3≤v_var < strength_level_th4;
Level5 curve is selected as strength_level_th4≤v_var < strength_level_th5;
Level6 curve is selected as strength_level_th5≤v_var < strength_level_th6;
Level7 curve is selected as strength_level_th6≤v_var < strength_level_th7;
Level8 curve is selected as v_var >=strength_level_th7;
Wherein, strength_level_th0~7 represent the threshold value of preset value interval, can set according to demand It sets, the slope of corresponding curve level1~8 is incremented by successively, and wherein level0 slope of a curve is 0, i.e., right without enhancing β ' (x, y) value that each original image vegetarian refreshments (x, y) answered inquires in the curve is 1.
After having selected corresponding enhancing curve, from the enhancing curve of the selection inquire with each original image vegetarian refreshments with reflect The Gauss distance penetrated between coordinate points is the corresponding ordinate of abscissa, and the vertical edge as each original image vegetarian refreshments corrects system Number.
When the vertical edge gradient value v_diff of mapping point point is less than zero, it is determined as attenuation curve collection;Wherein, decay It include the attenuation curve of default number of branches, the vertical edge gradient value v_ of the corresponding value interval of every attenuation curve in curve set diff;
As shown in fig. 6, the schematic diagram for 7 attenuation curves concentrated for attenuation curve in one embodiment, according to vertical edges Edge intensity value v_var is concentrated from attenuation curve and is selected corresponding attenuation curve as follows:
As v_var < strength_level_th0, level0 curve is selected;
Level1 curve is selected as strength_level_th0≤v_var < strength_level_th1;
Level2 curve is selected as strength_level_th1≤v_var < strength_level_th2;
Level3 curve is selected as strength_level_th2≤v_var < strength_level_th3;
Level4 curve is selected as strength_level_th3≤v_var < strength_level_th4;
Level5 curve is selected as strength_level_th4≤v_var < strength_level_th5;
Level6 curve is selected as strength_level_th5≤v_var < strength_level_th6;
Level7 curve is selected as strength_level_th6≤v_var < strength_level_th7;
Level8 curve is selected as v_var >=strength_level_th7;
Wherein, strength_level_th0~7 represent the threshold value of preset value interval, can set according to demand It sets, the slope of corresponding curve level1~8 successively successively decreases (absolute value of slope is incremented by successively), and wherein level0 curve is oblique Rate is 0, i.e., without decaying, β ' (x, y) value that corresponding each original image vegetarian refreshments (x, y) inquires in the curve is 1。
After having selected corresponding attenuation curve, from the attenuation curve of the selection inquire with each original image vegetarian refreshments with reflect The Gauss distance penetrated between coordinate points is the corresponding ordinate of abscissa, and the vertical edge as each original image vegetarian refreshments corrects system Number.
In other embodiments, the scheme of corresponding vertical edge compensation coefficient is obtained above by curve inquiry, also Plurality of replaceable scheme, such as can be corresponding table by above-mentioned Curve transform, according to mapping point by way of tabling look-up The weight of the vertical edge gradient value, vertical edge intensity value and each original image vegetarian refreshments selected, inquiry determine each original pixels The vertical edge compensation coefficient etc. of point.
S163 is determined each according to the horizontal edge compensation coefficient and vertical edge compensation coefficient of each original image vegetarian refreshments The edge of original image vegetarian refreshments enhances attenuation correction coefficient.
It, can be according to the horizontal edge compensation coefficient α ' (x, y) and vertical edge of each original image vegetarian refreshments as illustratively Compensation coefficient β ' (x, y) determines the edge enhancing attenuation correction coefficient coe of each original image vegetarian refreshmentsijIt is shown below:
coeij=α ' (x, y) × β ' (x, y)
Wherein, i is original image vegetarian refreshments row subscript in neighborhood, and j is original pixels point range subscript in neighborhood, coeijFor original image The edge of vegetarian refreshments (i, j) enhances attenuation correction coefficient, and (x, y) is the coordinate value of original image vegetarian refreshments (i, j) in neighborhood.In neighborhood For 4 × 4 original image vegetarian refreshments, then i can be with value 0~3 with value 0~3, j.
S170 is weighted the weight of each original image vegetarian refreshments using edge enhancing attenuation correction coefficient, obtains convolution Filtering weighting;
As illustratively, for including 4 × 4 original image vegetarian refreshments in neighborhood, enhance attenuation correction coefficient using edge The weight of each original image vegetarian refreshments is weighted, convolutional filtering weight is obtained and is shown below:
Wherein, subscript ij, which is represented, corresponds to the i-th row jth column original image vegetarian refreshments in neighborhood, w00~w33Represent each original in neighborhood The corresponding enhanced weight of decaying of beginning pixel, wsad00~wsad33Represent the Gauss distance meter of each original image vegetarian refreshments in neighborhood Weight in obtained neighborhood before the decaying enhancing of each original image vegetarian refreshments,coe00~coe33 The edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood is represented,
S180 determines target figure according to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood The pixel value of interpolation pixel as in.
As illustratively, for including 4 × 4 original image vegetarian refreshments in neighborhood, according in convolutional filtering weight and neighborhood The product of the pixel value of each original image vegetarian refreshments determines that the pixel value of interpolation pixel in target image is shown below:
Wherein pixeli,jRepresent the pixel value of the i-th row jth column interpolation pixel in neighborhood, p00~p33Represent interpolation The pixel value of each original image vegetarian refreshments in 4 × 4 neighborhood of pixel.
If Fig. 7 is that convolutional filtering window scales process schematic, h_step and v_step are respectively horizontal direction and Vertical Square It is deviated to interpolation pixel stepping;Mapping point in original image is then searched for using interpolation pixel as convolution window center Original image vegetarian refreshments in the 4x4 neighborhood of periphery obtains the pixel value of interpolation pixel respectively after weighted sum normalization, above to be For the method that a convolution finds out an interpolation pixel, obtained by above method operation all to be inserted in target image It is worth the pixel value of pixel, that is, completes to scale original image to obtain the process of target image.
Above-mentioned image-scaling method is preset according to around the mapping point point in the corresponding original image of interpolation pixel The pixel value of each original image vegetarian refreshments in neighborhood determines the edge gradient direction information and edge strength information of mapping point point, The each original image vegetarian refreshments for the weight of original image vegetarian refreshments each in neighborhood being enhanced or being decayed after being enhanced or being decayed Weight, and solve to obtain according to the weight of each original image vegetarian refreshments after enhancing or decaying and the pixel value of each original image vegetarian refreshments The pixel value of interpolation pixel.It can keep the correlation before and after pixel in Interpolation Process, and can edge in any direction Enterprising row interpolation processing, to keep the marginal information of original image, so that image keeps clearly, avoiding sawtooth after zooming in or out The appearance of phenomena such as distortion remains the integrality and correlation of image edge information, the profile and line of the image after making scaling Manage the quality of apparent, to obtain after promotion scaling target image.
It should be understood that although each step in the flow chart of Fig. 1-3 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 1-3 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in figure 8, providing a kind of image scaling device 800, comprising: interpolation pixel Obtain module 810, neighborhood territory pixel obtains module 820, marginal information determining module 830, original weight determination module 840, enhancing Attenuation correction coefficient determination module 850 and interpolation pixel pixel value determining module 860, in which:
Interpolation pixel obtains module 810, for obtaining the interpolation pixel in target image;
Neighborhood territory pixel obtains module 820, for determining mapping point point of the interpolation pixel in original image, and obtains Take mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;
Marginal information determining module 830 determines mapping point for the pixel value according to original image vegetarian refreshments each in neighborhood The edge gradient direction information and edge strength information of point;
Original weight determination module 840, for according to mapping point select and neighborhood in height between each original image vegetarian refreshments This distance determines the weight of each original image vegetarian refreshments in neighborhood;
Enhance attenuation correction coefficient determination module 850, for according to edge gradient direction information, edge strength information and power Weight determines the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood;
Interpolation pixel pixel value determining module 860, for enhancing attenuation correction coefficient to each original using edge The weight of pixel is weighted, and obtains convolutional filtering weight;According to each original image vegetarian refreshments in convolutional filtering weight and neighborhood Pixel value product, determine the pixel value of interpolation pixel in target image.
In one embodiment, marginal information determining module 830 includes:
Horizontal edge information determination module determines that mapping is sat for the pixel value according to original image vegetarian refreshments each in neighborhood The horizontal edge gradient value of punctuate and corresponding horizontal edge intensity value;
Vertical edge information determination module determines that mapping is sat for the pixel value according to original image vegetarian refreshments each in neighborhood The vertical edge gradient value of punctuate and corresponding vertical edge intensity value.
In one embodiment, horizontal edge information determination module is used for: calculating the picture of each original image vegetarian refreshments in neighborhood The mean value of element value;Obtain the original image vegetarian refreshments of the default row in neighborhood in original image vegetarian refreshments;According to the original image vegetarian refreshments of default row Difference in the horizontal direction determines the horizontal edge gradient value of mapping point point;According to the original image vegetarian refreshments and mean value of default row Between difference, determine the horizontal edge intensity value of mapping point point.
In one embodiment, vertical edge information determination module is used for: calculating the picture of each original image vegetarian refreshments in neighborhood The mean value of element value;Obtain the original image vegetarian refreshments of the default column in neighborhood in original image vegetarian refreshments;According to the original image vegetarian refreshments of default column In the difference of vertical direction, the vertical edge gradient value of mapping point point is determined;According to the original image vegetarian refreshments and mean value of default column Between difference, determine the vertical edge intensity value of mapping point point.
In one embodiment, enhancing attenuation correction coefficient determination module 850 includes:
Horizontal edge compensation coefficient determining module, for the horizontal edge gradient value according to mapping point point, horizontal edge The weight of intensity value and each original image vegetarian refreshments determines the horizontal edge compensation coefficient of each original image vegetarian refreshments;
Vertical edge compensation coefficient determining module, for the vertical edge gradient value according to mapping point point, vertical edge The weight of intensity value and each original image vegetarian refreshments determines the vertical edge compensation coefficient of each original image vegetarian refreshments;
Edge enhances attenuation correction coefficient determination module, for the horizontal edge compensation coefficient according to each original image vegetarian refreshments With vertical edge compensation coefficient, the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments is determined.
In one embodiment, horizontal edge compensation coefficient determining module is used for: according to the horizontal edge of mapping point point Gradient value determines the positive negativity of horizontal edge enhancing damped expoential;According to the horizontal edge intensity value of mapping point point, water is determined The size of the pingbian edge enhancing decaying truth of a matter;For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter, with water using horizontal edge It is index that pingbian edge, which enhances damped expoential and the product of the weight of the original image vegetarian refreshments, carries out power operation and obtains the original image vegetarian refreshments Horizontal edge compensation coefficient.
In one embodiment, horizontal edge compensation coefficient determining module is used for: according to the horizontal edge of mapping point point The positive negativity of gradient value, determines corresponding curve set;Curve set includes that the slope of curve is oblique greater than zero enhancing curve set or curve The minus attenuation curve collection of rate;According to horizontal edge intensity value, corresponding curve, horizontal sides are selected from determining curve set The proportional example of edge intensity value slope of a curve order of magnitude corresponding with selection;Inquiry is from the curve of selection with each original Gauss distance between beginning pixel and mapping point point is the corresponding ordinate of abscissa, the water as each original image vegetarian refreshments Pingbian edge compensation coefficient.
In one embodiment, vertical edge compensation coefficient determining module is used for: according to the vertical edge of mapping point point Gradient value determines the positive negativity of vertical edge enhancing damped expoential;According to the vertical edge intensity value of mapping point point, determines and hang down The size of the straight edge enhancing decaying truth of a matter;For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter, to hang down using vertical edge It is index that straight edge, which enhances damped expoential and the product of the weight of the original image vegetarian refreshments, carries out power operation and obtains the original image vegetarian refreshments Vertical edge compensation coefficient.
In one embodiment, vertical edge compensation coefficient determining module is used for: according to the vertical edge of mapping point point The positive negativity of gradient value, determines corresponding curve set;Curve set includes that the slope of curve is oblique greater than zero enhancing curve set or curve The minus attenuation curve collection of rate;According to vertical edge intensity value, corresponding curve, vertical edges are selected from determining curve set The proportional example of edge intensity value slope of a curve order of magnitude corresponding with selection;Inquiry is from the curve of selection with each original Gauss distance between beginning pixel and mapping point point is the corresponding ordinate of abscissa, as hanging down for each original image vegetarian refreshments Straight edge compensation coefficient.
In one embodiment, original weight determination module is used for according to each original pixels in mapping point point and neighborhood Gauss distance between point, determines that the weight of each original image vegetarian refreshments in neighborhood is shown below:
Wherein, (x, y) is the coordinate value of original image vegetarian refreshments in neighborhood, rsd(x, y) be in neighborhood original image vegetarian refreshments it is opposite to The Gauss distance of interpolating pixel point, w(x,y)For the weight of original image vegetarian refreshments (x, y), nxFor normalization coefficient, σ is corresponding Gauss point The standard deviation of cloth.
In one embodiment, enhancing attenuation correction coefficient determination module 850 is used for according to edge gradient direction information, side Edge strength information and weight determine that the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in neighborhood is shown below:
In above formula, coeijEnhance attenuation correction coefficient for the edge of the i-th row jth column original image vegetarian refreshments in neighborhood, (x, y) is The coordinate value of i-th row jth column original image vegetarian refreshments, r in neighborhoodsd(x, y) be neighborhood in the i-th row jth column original image vegetarian refreshments relative to The positive negativity of the Gauss distance of interpolation pixel, h_signed is determining according to the positive negativity of horizontal edge gradient value, v_ The positive negativity of signed determines that the value size and horizontal edge intensity value of α is in just according to the positive negativity of vertical edge gradient value Correlation, value size and the vertical edge intensity value of β are positively correlated.
Specific about image scaling device limits the restriction that may refer to above for image-scaling method, herein not It repeats again.Modules in above-mentioned image scaling device can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in Figure 9.The computer equipment includes processor, the memory, network interface, display connected by system bus Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The network interface of machine equipment is used to communicate with external terminal by network connection.When the computer program is executed by processor with Realize a kind of image-scaling method.The display screen of the computer equipment can be liquid crystal display or electric ink display screen, The input unit of the computer equipment can be the touch layer covered on display screen, be also possible to be arranged on computer equipment shell Key, trace ball or Trackpad, can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 9, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory Computer program, the processor perform the steps of when executing computer program
Obtain the interpolation pixel in target image;Determine mapping point of the interpolation pixel in original image Point, and obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;According in neighborhood The pixel value of each original image vegetarian refreshments determines the edge gradient direction information and edge strength information of mapping point point;According to reflecting The Gauss distance in coordinate points and neighborhood between each original image vegetarian refreshments is penetrated, determines the weight of each original image vegetarian refreshments in neighborhood; According to edge gradient direction information, edge strength information and weight, determine that the edge enhancing of each original image vegetarian refreshments in neighborhood declines Subtract compensation coefficient;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolution filter Wave weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, determine in target image to The pixel value of interpolating pixel point.
In other embodiments, the image contracting of as above any one embodiment is also realized when processor executes computer program The step of putting method.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
Obtain the interpolation pixel in target image;Determine mapping point of the interpolation pixel in original image Point, and obtain mapping point in original image select around in default neighborhood each original image vegetarian refreshments pixel value;According in neighborhood The pixel value of each original image vegetarian refreshments determines the edge gradient direction information and edge strength information of mapping point point;According to reflecting The Gauss distance in coordinate points and neighborhood between each original image vegetarian refreshments is penetrated, determines the weight of each original image vegetarian refreshments in neighborhood; According to edge gradient direction information, edge strength information and weight, determine that the edge enhancing of each original image vegetarian refreshments in neighborhood declines Subtract compensation coefficient;The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolution filter Wave weight;According to the product of the pixel value of each original image vegetarian refreshments in convolutional filtering weight and neighborhood, determine in target image to The pixel value of interpolating pixel point.
In other embodiments, the image of as above any one embodiment is also realized when computer program is executed by processor The step of Zoom method.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (15)

1. a kind of image-scaling method, which comprises
Obtain the interpolation pixel in target image;
It determines mapping point point of the interpolation pixel in original image, and obtains mapping point described in original image Select the pixel value of each original image vegetarian refreshments in surrounding default neighborhood;
According to the pixel value of original image vegetarian refreshments each in the neighborhood, the edge gradient direction information of the mapping point point is determined With edge strength information;
According to the mapping point select and the neighborhood in Gauss distance between each original image vegetarian refreshments, determine in the neighborhood The weight of each original image vegetarian refreshments;
According to the edge gradient direction information, edge strength information and weight, each original image vegetarian refreshments in the neighborhood is determined Edge enhance attenuation correction coefficient;
The weight of each original image vegetarian refreshments is weighted using edge enhancing attenuation correction coefficient, obtains convolutional filtering power Weight;According to the product of the pixel value of each original image vegetarian refreshments in the convolutional filtering weight and the neighborhood, target image is determined Described in interpolation pixel pixel value.
2. the method according to claim 1, wherein the picture according to original image vegetarian refreshments each in the neighborhood Element value, determines the edge gradient direction information of the mapping point point and edge strength information includes:
According to the pixel value of original image vegetarian refreshments each in the neighborhood, determine the mapping point point horizontal edge gradient value and Corresponding horizontal edge intensity value;
According to the pixel value of original image vegetarian refreshments each in the neighborhood, determine the mapping point point vertical edge gradient value and Corresponding vertical edge intensity value.
3. according to the method described in claim 2, it is characterized in that, the picture according to original image vegetarian refreshments each in the neighborhood Element value, determine the mapping point point horizontal edge gradient value and corresponding horizontal edge intensity value, comprising:
Calculate the mean value of the pixel value of each original image vegetarian refreshments in the neighborhood;
Obtain the original image vegetarian refreshments of the default row in the neighborhood in original image vegetarian refreshments;
According to the original image vegetarian refreshments difference in the horizontal direction of the default row, the horizontal edge ladder of the mapping point point is determined Angle value;
According to the difference between the original image vegetarian refreshments and the mean value of the default row, the horizontal sides of the mapping point point are determined Edge intensity value.
4. according to the method described in claim 2, it is characterized in that, the picture according to original image vegetarian refreshments each in the neighborhood Element value, determine the mapping point point vertical edge gradient value and corresponding vertical edge intensity value, comprising:
Calculate the mean value of the pixel value of each original image vegetarian refreshments in the neighborhood;
Obtain the original image vegetarian refreshments of the default column in the neighborhood in original image vegetarian refreshments;
According to the original image vegetarian refreshments of the default column in the difference of vertical direction, the vertical edge ladder of the mapping point point is determined Angle value;
According to the difference between the original image vegetarian refreshments and the mean value of the default column, the vertical edges of the mapping point point are determined Edge intensity value.
5. the method according to claim 1, which is characterized in that described according to the edge gradient direction Information, edge strength information and weight determine the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in the neighborhood, packet It includes:
The weight of the horizontal edge gradient value, horizontal edge intensity value and each original image vegetarian refreshments selected according to the mapping point, Determine the horizontal edge compensation coefficient of each original image vegetarian refreshments;
The weight of the vertical edge gradient value, vertical edge intensity value and each original image vegetarian refreshments selected according to the mapping point, Determine the vertical edge compensation coefficient of each original image vegetarian refreshments;
According to the horizontal edge compensation coefficient and vertical edge compensation coefficient of each original image vegetarian refreshments, each original image vegetarian refreshments is determined Edge enhance attenuation correction coefficient.
6. according to the method described in claim 5, it is characterized in that, according to the horizontal edge gradient value of the mapping point point, The weight of horizontal edge intensity value and each original image vegetarian refreshments determines the horizontal edge compensation coefficient of each original image vegetarian refreshments, packet It includes:
According to the horizontal edge gradient value of mapping point point, the positive negativity of horizontal edge enhancing damped expoential is determined;
According to the horizontal edge intensity value of mapping point point, the size of the horizontal edge enhancing decaying truth of a matter is determined;
For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter using horizontal edge, with horizontal edge enhancing damped expoential and The product of the weight of the original image vegetarian refreshments is index, carries out power operation and obtains the horizontal edge compensation coefficient of the original image vegetarian refreshments.
7. according to the method described in claim 5, it is characterized in that, according to the horizontal edge gradient value of the mapping point point, The weight of horizontal edge intensity value and each original image vegetarian refreshments determines the horizontal edge compensation coefficient of each original image vegetarian refreshments, packet It includes:
According to the positive negativity of the horizontal edge gradient value of the mapping point point, corresponding curve set is determined;The curve set packet Include enhancing curve set or the slope of curve minus attenuation curve collection of the slope of curve greater than zero;
According to the horizontal edge intensity value, corresponding curve, the horizontal edge intensity value are selected from determining curve set With the corresponding proportional example of slope of a curve order of magnitude of selection;
From inquiry in the curve selected using the Gauss distance between each original image vegetarian refreshments and mapping point point as abscissa Corresponding ordinate, the horizontal edge compensation coefficient as each original image vegetarian refreshments.
8. according to the method described in claim 5, it is characterized in that, according to the vertical edge gradient value of the mapping point point, The weight of vertical edge intensity value and each original image vegetarian refreshments determines the vertical edge compensation coefficient of each original image vegetarian refreshments, packet It includes:
According to the vertical edge gradient value of mapping point point, the positive negativity of vertical edge enhancing damped expoential is determined;
According to the vertical edge intensity value of mapping point point, the size of the vertical edge enhancing decaying truth of a matter is determined;
For each original image vegetarian refreshments, the decaying truth of a matter is enhanced as the truth of a matter using vertical edge, with vertical edge enhancing damped expoential and The product of the weight of the original image vegetarian refreshments is index, carries out power operation and obtains the vertical edge compensation coefficient of the original image vegetarian refreshments.
9. according to the method described in claim 5, it is characterized in that, according to the vertical edge gradient value of the mapping point point, The weight of vertical edge intensity value and each original image vegetarian refreshments determines the vertical edge compensation coefficient of each original image vegetarian refreshments, packet It includes:
According to the positive negativity of the vertical edge gradient value of the mapping point point, corresponding curve set is determined;The curve set packet Include enhancing curve set or the slope of curve minus attenuation curve collection of the slope of curve greater than zero;
According to the vertical edge intensity value, corresponding curve, the vertical edge intensity value are selected from determining curve set With the corresponding proportional example of slope of a curve order of magnitude of selection;
From inquiry in the curve selected using the Gauss distance between each original image vegetarian refreshments and mapping point point as abscissa Corresponding ordinate, the vertical edge compensation coefficient as each original image vegetarian refreshments.
10. the method according to claim 1, which is characterized in that according to the mapping point point with it is described Gauss distance in neighborhood between each original image vegetarian refreshments determines the weight such as following formula institute of each original image vegetarian refreshments in the neighborhood Show:
Wherein, (x, y) is the coordinate value of original image vegetarian refreshments in neighborhood, rsd(x, y) is the original image that neighborhood internal coordinate value is (x, y) Gauss distance of the vegetarian refreshments with respect to interpolation pixel, w(x,y)For the weight for the original image vegetarian refreshments that coordinate value is (x, y), nxFor normalizing Change coefficient, σ is the standard deviation of corresponding Gaussian Profile.
11. the method according to claim 1, which is characterized in that believed according to the edge gradient direction Breath, edge strength information and weight determine that the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in the neighborhood is as follows Shown in formula:
In above formula, coeijEnhance attenuation correction coefficient for the edge of the i-th row jth column original image vegetarian refreshments in neighborhood, (x, y) is neighborhood The coordinate value of interior i-th row jth column original image vegetarian refreshments, rsd(x, y) is the i-th row jth column original image vegetarian refreshments in neighborhood relative to be inserted It is worth the Gauss distance of pixel, the positive negativity of h_signed is determined according to the positive negativity of horizontal edge gradient value, v_signed's Positive negativity determines that value size and the horizontal edge intensity value of α is positively correlated, β's according to the positive negativity of vertical edge gradient value Value size is positively correlated with vertical edge intensity value.
12. a kind of image scaling device, which is characterized in that described device includes:
Interpolation pixel obtains module, for obtaining the interpolation pixel in target image;
Neighborhood territory pixel obtains module, for determining mapping point point of the interpolation pixel in original image, and obtains Mapping point described in original image select around in default neighborhood each original image vegetarian refreshments pixel value;
Marginal information determining module determines that the mapping is sat for the pixel value according to original image vegetarian refreshments each in the neighborhood The edge gradient direction information and edge strength information of punctuate;
Original weight determination module, for according to the mapping point select and the neighborhood in height between each original image vegetarian refreshments This distance determines the weight of each original image vegetarian refreshments in the neighborhood;
Enhance attenuation correction coefficient determination module, be used for according to the edge gradient direction information, edge strength information and weight, Determine the edge enhancing attenuation correction coefficient of each original image vegetarian refreshments in the neighborhood;
Interpolation pixel pixel value determining module, for enhancing attenuation correction coefficient to each original pixels using the edge The weight of point is weighted, and obtains convolutional filtering weight;According to each original image in the convolutional filtering weight and the neighborhood The product of the pixel value of vegetarian refreshments determines the pixel value of interpolation pixel described in target image.
13. device according to claim 12, which is characterized in that the marginal information determining module includes:
Horizontal edge information determination module is reflected described in determination for the pixel value according to original image vegetarian refreshments each in the neighborhood Penetrate coordinate points horizontal edge gradient value and corresponding horizontal edge intensity value;
Vertical edge information determination module is reflected described in determination for the pixel value according to original image vegetarian refreshments each in the neighborhood Penetrate coordinate points vertical edge gradient value and corresponding vertical edge intensity value.
14. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the processor realizes any one of claims 1 to 11 described image Zoom method when executing the computer program Step.
15. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of image-scaling method described in any one of claims 1 to 11 is realized when being executed by processor.
CN201910071588.2A 2019-01-25 2019-01-25 Image scaling method and device, computer equipment and storage medium Active CN109903224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910071588.2A CN109903224B (en) 2019-01-25 2019-01-25 Image scaling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910071588.2A CN109903224B (en) 2019-01-25 2019-01-25 Image scaling method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109903224A true CN109903224A (en) 2019-06-18
CN109903224B CN109903224B (en) 2023-03-31

Family

ID=66944245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910071588.2A Active CN109903224B (en) 2019-01-25 2019-01-25 Image scaling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109903224B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738625A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Image resampling method, device, terminal and computer readable storage medium
CN111126254A (en) * 2019-12-23 2020-05-08 Oppo广东移动通信有限公司 Image recognition method, device, equipment and storage medium
CN111275730A (en) * 2020-01-13 2020-06-12 平安国际智慧城市科技股份有限公司 Method, device and equipment for determining map area and storage medium
CN111724304A (en) * 2020-06-12 2020-09-29 深圳市爱协生科技有限公司 Image scaling method and device, terminal equipment and storage medium
CN112037273A (en) * 2020-09-09 2020-12-04 南昌虚拟现实研究院股份有限公司 Depth information acquisition method and device, readable storage medium and computer equipment
CN112435171A (en) * 2021-01-28 2021-03-02 杭州西瞳智能科技有限公司 Reconstruction method of image resolution
CN112508790A (en) * 2020-12-16 2021-03-16 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium
CN112862673A (en) * 2019-11-12 2021-05-28 上海途擎微电子有限公司 Adaptive image scaling method, adaptive image scaling device and storage device
CN113365000A (en) * 2020-03-04 2021-09-07 爱思开海力士有限公司 Image sensing apparatus and method of operating the same
CN113781370A (en) * 2021-08-19 2021-12-10 北京旷视科技有限公司 Image enhancement method and device and electronic equipment
CN113808012A (en) * 2020-06-17 2021-12-17 京东方科技集团股份有限公司 Image processing method, computer device, and computer-readable storage medium
CN113365000B (en) * 2020-03-04 2024-06-04 爱思开海力士有限公司 Image sensing apparatus and method of operating the same

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216935A (en) * 2008-01-17 2008-07-09 四川虹微技术有限公司 Image amplification method based on spline function interpolation algorithm
CN101615288A (en) * 2008-06-27 2009-12-30 富士通株式会社 The equipment, method and the computer readable recording medium storing program for performing that are used for pixel interpolating
US20140016870A1 (en) * 2011-11-29 2014-01-16 Industry-Academic Cooperation Foundation, Yonsei Univesity Apparatus and method for interpolating image, and apparatus for processing image using the same
CN106251339A (en) * 2016-07-21 2016-12-21 深圳市大疆创新科技有限公司 Image processing method and device
CN107644398A (en) * 2017-09-25 2018-01-30 上海兆芯集成电路有限公司 Image interpolation method and its associated picture interpolating device
CN108805806A (en) * 2017-04-28 2018-11-13 华为技术有限公司 Image processing method and device
CN108961167A (en) * 2018-07-12 2018-12-07 安徽理工大学 A kind of Bayer-CFA interpolation method based on finite difference and gradient

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216935A (en) * 2008-01-17 2008-07-09 四川虹微技术有限公司 Image amplification method based on spline function interpolation algorithm
CN101615288A (en) * 2008-06-27 2009-12-30 富士通株式会社 The equipment, method and the computer readable recording medium storing program for performing that are used for pixel interpolating
US20140016870A1 (en) * 2011-11-29 2014-01-16 Industry-Academic Cooperation Foundation, Yonsei Univesity Apparatus and method for interpolating image, and apparatus for processing image using the same
CN106251339A (en) * 2016-07-21 2016-12-21 深圳市大疆创新科技有限公司 Image processing method and device
CN108805806A (en) * 2017-04-28 2018-11-13 华为技术有限公司 Image processing method and device
CN107644398A (en) * 2017-09-25 2018-01-30 上海兆芯集成电路有限公司 Image interpolation method and its associated picture interpolating device
CN108961167A (en) * 2018-07-12 2018-12-07 安徽理工大学 A kind of Bayer-CFA interpolation method based on finite difference and gradient

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738625A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Image resampling method, device, terminal and computer readable storage medium
CN110738625B (en) * 2019-10-21 2022-03-11 Oppo广东移动通信有限公司 Image resampling method, device, terminal and computer readable storage medium
CN112862673A (en) * 2019-11-12 2021-05-28 上海途擎微电子有限公司 Adaptive image scaling method, adaptive image scaling device and storage device
CN111126254A (en) * 2019-12-23 2020-05-08 Oppo广东移动通信有限公司 Image recognition method, device, equipment and storage medium
CN111275730A (en) * 2020-01-13 2020-06-12 平安国际智慧城市科技股份有限公司 Method, device and equipment for determining map area and storage medium
CN113365000B (en) * 2020-03-04 2024-06-04 爱思开海力士有限公司 Image sensing apparatus and method of operating the same
CN113365000A (en) * 2020-03-04 2021-09-07 爱思开海力士有限公司 Image sensing apparatus and method of operating the same
CN111724304A (en) * 2020-06-12 2020-09-29 深圳市爱协生科技有限公司 Image scaling method and device, terminal equipment and storage medium
CN111724304B (en) * 2020-06-12 2024-04-19 深圳市爱协生科技股份有限公司 Image scaling method and device, terminal equipment and storage medium
CN113808012A (en) * 2020-06-17 2021-12-17 京东方科技集团股份有限公司 Image processing method, computer device, and computer-readable storage medium
CN112037273A (en) * 2020-09-09 2020-12-04 南昌虚拟现实研究院股份有限公司 Depth information acquisition method and device, readable storage medium and computer equipment
CN112037273B (en) * 2020-09-09 2023-05-19 南昌虚拟现实研究院股份有限公司 Depth information acquisition method and device, readable storage medium and computer equipment
CN112508790B (en) * 2020-12-16 2023-11-14 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium
CN112508790A (en) * 2020-12-16 2021-03-16 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium
CN112435171A (en) * 2021-01-28 2021-03-02 杭州西瞳智能科技有限公司 Reconstruction method of image resolution
CN113781370A (en) * 2021-08-19 2021-12-10 北京旷视科技有限公司 Image enhancement method and device and electronic equipment

Also Published As

Publication number Publication date
CN109903224B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN109903224A (en) Image-scaling method, device, computer equipment and storage medium
EP3657431B1 (en) Image upscaling
US7822285B2 (en) Methods and systems for locally adaptive image processing filters
CN106485720A (en) Image processing method and device
US20090232213A1 (en) Method and apparatus for super-resolution of images
CN108109109B (en) Super-resolution image reconstruction method, device, medium and computing equipment
CN108154474A (en) A kind of super-resolution image reconstruction method, device, medium and equipment
JP2003274157A (en) Image processor, image processing method, image processing program, and computer readable recording medium with image processing program recorded
US9619862B2 (en) Raw camera noise reduction using alignment mapping
CN103167218A (en) Super-resolution reconstruction method and equipment based on non-locality
KR20110058854A (en) Dual lookup table design for edge-directed image scaling
US20200219229A1 (en) Edge-Aware Upscaling for Improved Screen Content Quality
Wen et al. Image superresolution using densely connected residual networks
CN110288521A (en) Image beautification method, device and electronic equipment
Sahito et al. Transpose convolution based model for super-resolution image reconstruction
Gour et al. Hardware accelerator for real-time image resizing
Hung et al. Image interpolation using convolutional neural networks with deep recursive residual learning
US9594955B2 (en) Modified wallis filter for improving the local contrast of GIS related images
CN103177420B (en) Based on image magnification method and the device of local features correlativity
CN112561802B (en) Interpolation method of continuous sequence images, interpolation model training method and system thereof
WO2020241337A1 (en) Image processing device
CN113570531A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN112767508A (en) Pseudo color display method, system, device, and medium for respiratory gated image
Huang et al. Learned scale-arbitrary image downscaling for non-learnable upscaling
CN112837254B (en) Image fusion method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 519000 No. 333, Kexing Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

Address before: Floor 1-107, building 904, ShiJiHua Road, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant