CN102034261B - Image filtering method and device - Google Patents
Image filtering method and device Download PDFInfo
- Publication number
- CN102034261B CN102034261B CN 200910178123 CN200910178123A CN102034261B CN 102034261 B CN102034261 B CN 102034261B CN 200910178123 CN200910178123 CN 200910178123 CN 200910178123 A CN200910178123 A CN 200910178123A CN 102034261 B CN102034261 B CN 102034261B
- Authority
- CN
- China
- Prior art keywords
- sampling
- layer
- color value
- sampling layer
- convex quadrangle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001914 filtration Methods 0.000 title claims abstract description 59
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000005070 sampling Methods 0.000 claims abstract description 192
- 238000013459 approach Methods 0.000 claims abstract description 20
- 230000000694 effects Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 45
- 241000282324 Felis Species 0.000 description 12
- 210000003462 vein Anatomy 0.000 description 5
- 238000013507 mapping Methods 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
The invention provides an image filtering method and device. The image filtering method comprises the following steps of: prefiltering an image to obtain a texture look-up table of the image, wherein the texture look-up table comprises texture array layers with different resolutions; projecting the pixel of a screen space, regarded as a square, to a texture space, and approaching a convex quadrilateral to the projection shape of the texture space; determining a sampling layer in the texture array layers of the texture look-up table according to the side length of the convex quadrilateral; approach a parallelogram to the convex quadrilateral at the sampling layer, sampling according to the parallelogram and acquiring the color value of the sampling layer according to a sampling point; and determining the final color value of the image according to the color value of the sampling layer. By using the image filtering method and device provided in the invention, clear effect can be achieved and no vague condition happens when texture is mapped to a screen.
Description
Technical field
Relate generally to image processing field of the present invention relates more specifically to the method and apparatus that texture image filters.
Background technology
In the process of texture filtering, in order to accelerate texture, reduce the calculating consumption of mapping process, often adopt the pre-filtering texture, each pixel only need to be extracted pre-filtered sampled point calculating seldom like this.Improved counting yield.Generally define pre-filtering with double integral.
Generally can adopt double integral definition pre-filtering in the prior art, be g (x, y)=∫ ∫ f (x, y) h (x-u, y-v) dudv, wherein f is input picture (texture image), g is output image, h is the filtrator kernel, the MIP-MAP pre-filtering is the texture array that texture image is expressed as different resolution, such as the texture image of a given resolution 521 * 512, texture space can be divided into 512 * 512 little squares by texture pixel, get each foursquare texture mean value as first order standard sample, being called is 0 layer, then texture space is divided into 256 * 256 little squares, gets each foursquare texture mean value as second level standard sample (4 neighbor color values of the first order average), filter and form the new images that only has a half-resolution, be called 1 layer.This processing procedure is continued on basis at new images, until image resolution ratio is 1 * 1, has so just formed pyramidal texture storage structure.In the Tri linear interpolation algorithm, the pixel of screen space is projected to texture space, the projection of shape of going to approach it with a square.And calculate the foursquare length of side.The length of side determines then to get respectively four samples and carry out bilinear interpolation on L and L+1 layer in pyramidal which layer L sampling, obtains two color values on the layer.Again these two values are being done linear interpolation.Obtain last pixel color value.Because done trilinear interpolation, be called as Tri linear interpolation or Trilinear Filtering.Trilinear Filtering is based upon on isotropic square filtering device basis.Yet the mapping of pixel has anisotropy, uses the meeting of isotropic Trilinear Filtering algorithm so that image becomes very fuzzy.
Algorithm based on anisotropic filtering has Feline (Fast Elliptical Lines for Anisotropic Texture Mapping) algorithm and FAST (Footprint Area Sampled Texture) algorithm.
Be illustrated in figure 1 as the perspective view of Feline algorithm, the Feline algorithm is to regard the pixel of screen space as one take this pixel as the center of circle, and a unit picture element is the circle of radius, and projecting to texture space is an ellipse.Be illustrated in figure 2 as the sampling synoptic diagram of Feline algorithm.Calculate ellipse short shaft radius and major axis radius, the angle of transverse and u axle reaches the sampling rate at the L layer.Which determine in layer sampling with minor axis radius.Minor axis radius and major axis radius determine the number of samples along transverse.The Feline algorithm approaches oval value along transverse with a plurality of isotropic Trilinear Filterings, has reduced like this hardware and has realized cost.Obtain good effect.Exactly because but the Feline algorithm has also used a plurality of isotropic Trilinear Filterings.So that at the hits of L layer with the same at L+1 layer hits.Yet the resolution of L+1 layer is the L layer half, the color value of L+1 layer is to be averaged by four pixel color value of L layer to obtain, because of the Feline algorithm at the hits of L layer with the same at L+1 layer hits, so the Feline algorithm is at L+1 layer over-sampling, to a certain extent fuzzy can appear in image.
Be illustrated in figure 3 as the perspective view of FAST algorithm, the FAST algorithm is to regard the pixel of screen space as take a unit picture element as the length of side square, and pixel projection is to texture space.Approach with parallelogram, calculate two length of sides and two diagonal angle length of sides of parallelogram, determining that with the minimum value in them in which layer sampling two length of sides of parallelogram determine number of samples, takes a sample in two limits along parallelogram when the L layer is taken a sample.Be illustrated in figure 4 as the sampling synoptic diagram of FAST algorithm.After this parallelogram sampling, all sampling spots are averaged, be resulting color value.Quantity in the sampling of L+1 layer is 1/4 of L layer.Sampling mode is the same with the L layer, at last the color value of L layer and L+1 layer is done linear interpolation.Obtained final color value.The FAST algorithm approaches the dimetric projection of screen space behind texture space with parallelogram, it is more accurate that yet in fact the dimetric projection of screen space approaches with convex quadrangle arbitrarily behind the texture space, when the parallelogram shape that adopts when convex quadrangle and FAST algorithm is more or less the same, error is very little, can not affect picture quality.But when the shape of convex quadrangle and parallelogram differed greatly, error can become greatly, thereby has influence on picture quality.
Therefore, need at present a kind of texture filtering scheme with higher picture quality.
Summary of the invention
In order one of to address the above problem, the present invention proposes a kind of image filtering method, may further comprise the steps: image is carried out pre-filtering, obtain the texture look-up table of described image, wherein said texture look-up table comprises the texture array layer with different resolution; Regard the pixel of screen space as dimetric projection to texture space, approach the projection of shape of described texture space with convex quadrangle; According to the minimum length of side of described convex quadrangle, in the texture array layer of described texture look-up table, determine the sampling layer; Approach described convex quadrangle at described sampling layer with parallelogram, be specially: the direction of determining a pair of adjacent edge of described parallelogram according to a pair of adjacent edge of described convex quadrangle; Determine the length of the adjacent edge of described parallelogram according to the summit of described convex quadrangle to the distance of the adjacent edge of described parallelogram, so that described convex quadrangle is included within the described parallelogram; According to the sampling of described parallelogram, obtain the color value of described sampling layer according to described sampling spot, be specially: take a sample according to described parallelogram at described sampling layer, obtain the sampling spot that is arranged in described parallelogram; Judge sampling spot whether in described convex quadrangle, if sampling spot at described convex quadrangle with this sampling spot of Nei Zecai, if sampling spot is beyond described convex quadrangle then abandon this sampling spot; The color value of described convex quadrangle with interior sampling spot averaged, obtain the color value of described sampling layer; Determine the final color value of described image according to the color value of described sampling layer.
The invention allows for a kind of image filtering device, comprising: the pre-filtering module, it is used for image is carried out pre-filtering, obtains the texture look-up table of described image, and wherein said texture look-up table comprises the texture array layer with different resolution; Projection module, it is used for regarding the pixel of screen space as dimetric projection to texture space, approaches the projection of shape of described texture space with convex quadrangle; Sampling layer determination module, it is used for the minimum length of side according to described convex quadrangle, determines the sampling layer in the texture array layer of described texture look-up table; Sampling module, it is used for approaching described convex quadrangle at described sampling layer with parallelogram, according to described parallelogram sampling, obtain the color value of described sampling layer according to described sampling spot, described sampling module comprises that parallelogram determines that submodule and color value determine submodule, wherein: described parallelogram is determined submodule, is used for determining according to a pair of adjacent edge of described convex quadrangle the direction of a pair of adjacent edge of described parallelogram; Determine the length of the adjacent edge of described parallelogram according to the summit of described convex quadrangle to the distance of the adjacent edge of described parallelogram, so that described convex quadrangle is included within the described parallelogram; Described color value is determined submodule, is used for taking a sample according to described parallelogram at described sampling layer, obtains the sampling spot that is arranged in described parallelogram; Judge sampling spot whether in described convex quadrangle, if sampling spot at described convex quadrangle with this sampling spot of Nei Zecai, if sampling spot is beyond described convex quadrangle then abandon this sampling spot; The color value of described convex quadrangle with interior sampling spot averaged, obtain the color value of described sampling layer; Final color value determination module, it is used for determining according to the color value of described sampling layer the final color value of described image.
Image filtering method proposed by the invention and device can so that texture presents clearly effect to screen, can not occur bluring.
Description of drawings
Above-mentioned and/or the additional aspect of the present invention and advantage are from obviously and easily understanding becoming the description of embodiment below in conjunction with accompanying drawing, wherein:
Fig. 1 is the perspective view of the Feline algorithm of prior art;
Fig. 2 is the sampling synoptic diagram of the Feline algorithm of prior art;
Fig. 3 is the perspective view of the FAST algorithm of prior art;
Fig. 4 is the sampling synoptic diagram of the FAST algorithm of prior art;
Fig. 5 is the process flow diagram of image filtering method according to an embodiment of the invention;
Fig. 6 is image pyramid synoptic diagram according to an embodiment of the invention;
Fig. 7 is the synoptic diagram of texture look-up table according to an embodiment of the invention;
Fig. 8 is perspective view according to an embodiment of the invention;
Fig. 9 is convex quadrangle synoptic diagram according to an embodiment of the invention;
Figure 10 is sampling layer synoptic diagram according to an embodiment of the invention;
Figure 11 is parallelogram synoptic diagram according to an embodiment of the invention;
Figure 12 is parallelogram synoptic diagram according to an embodiment of the invention;
Figure 13 is parallelogram synoptic diagram according to an embodiment of the invention;
Figure 14 is parallelogram synoptic diagram according to an embodiment of the invention;
Figure 15 is parallelogram sampling synoptic diagram according to an embodiment of the invention;
Figure 16 is sampling spot synoptic diagram according to an embodiment of the invention;
Figure 17 is sampling spot synoptic diagram according to an embodiment of the invention;
Figure 18 is sampling spot synoptic diagram according to an embodiment of the invention;
Figure 19 is sampling spot synoptic diagram according to an embodiment of the invention;
Figure 20 is the convex quadrangle synoptic diagram of adjacent samples layer according to an embodiment of the invention;
Figure 21 is the parallelogram sampling synoptic diagram of adjacent samples layer according to an embodiment of the invention;
Figure 22 is the linear interpolation synoptic diagram of adjacent samples layer according to an embodiment of the invention;
Figure 23 is the functional structure chart of image filtering device according to an embodiment of the invention;
The synoptic diagram of Figure 24 for using the Feline algorithm vein pattern to be carried out projection;
Figure 25 amplifies the distal-most end among Figure 24 5 times synoptic diagram;
The synoptic diagram of Figure 26 for using the FAST algorithm vein pattern to be carried out projection;
Figure 27 amplifies the distal-most end among Figure 26 5 times synoptic diagram;
Figure 28 is the synoptic diagram that vein pattern is carried out projection according to an embodiment of the invention;
Figure 29 amplifies the distal-most end among Figure 28 5 times synoptic diagram.
Embodiment
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining the present invention, and can not be interpreted as limitation of the present invention.
The present invention proposes a kind of method of image filtering, be illustrated in figure 5 as the process flow diagram of the image filtering method 500 of one embodiment of the present of invention.The method 500 may further comprise the steps:
S501: image is carried out pre-filtering, obtain the texture look-up table of image, wherein the texture look-up table comprises the texture array layer with different resolution.
As one embodiment of the present of invention, this step comprises carries out the MIP-MAP pre-filtering to texture image.With texture image be expressed as have different resolution the texture array as the texture look-up table.
Be illustrated in figure 6 as image pyramid synoptic diagram according to an embodiment of the invention.The MIP-MAP pre-filtering be first texture image is expressed as have different resolution the texture array as the texture look-up table, formed an image pyramid that resolution is successively decreased step by step.First order image resolution ratio is taken as 1/2nd of high one-level image.As shown in Figure 6, the resolution of original texture image is 256 * 256, texture space can be divided into 256 * 256 little squares according to texture pixel, gets each foursquare texture mean value as first order standard sample data, is referred to as 0 layer.The resolution that continues to get the second layer is half of ground floor.Namely texture space is divided into 128 * 128 little squares, gets each foursquare texture mean value as second level standard sample, be referred to as the 1st layer.By that analogy, until image resolution ratio is 1 * 1, after the texture process MP-MAP pre-filtering, the set of image will be stored in the MIP-MAP table.
Be illustrated in figure 7 as the synoptic diagram of texture image look-up table according to an embodiment of the invention, show the example of the storage mode of a MIP-MAP look-up table.If given texture image resolution is 256 * 256, then comprise red (R), green (G), blue (B) three-component whole MIP-MAP table can be stored in 512 * 512 the memory block.The memory size that the MIP-MAP table of a texture image needs is 4/3 times of the shared internal memory of this texture image.
S502: regard the pixel of screen space as dimetric projection to texture space, approach the projection of shape of texture space with convex quadrangle.
As one embodiment of the present of invention, in screen space.Pixel is seen as the square take a unit picture element as the length of side, and pixel is projected to texture space, approaches with convex quadrangle arbitrarily.
Be illustrated in figure 8 as perspective view according to an embodiment of the invention.Be seen as square take a unit picture element as the length of side in pixel of screen space (x, y), all pixels of screen space are all covered by square like this.Pixel is projected to texture space (u, v), approach with convex quadrangle arbitrarily, with all pixel projections of screen space behind texture space, the corresponding convex quadrangle of each pixel.At convex quadrangle corresponding to each pixel of texture space texture space is all covered.
S503: according to the length of side of convex quadrangle, in the texture array layer of texture look-up table, determine the sampling layer.
As one embodiment of the present of invention, calculate limit minimum in four limits of convex quadrangle, determine in which layer sampling with this minimum limit.
Be illustrated in figure 9 as convex quadrangle synoptic diagram according to an embodiment of the invention.In texture space (u, v), the four edges of convex quadrangle is called r1, r2, r3, r4.Four corresponding summits are 1,2,3,4.Obtain the length of this four edges: | r1|, | r2|, | r3|, | r4|.Obtain the minimum value of four length: r=min (| r1|, | r2|, | r3|, | r4|);
As one embodiment of the present of invention, determine in which layer sampling with r according to following formula:
Level=log
2(r), wherein r is the minimum length of side of convex quadrangle,
It is 1 o'clock such as r.The 0th layer of sampling, be 2 o'clock the 1st layer of sampling, be to take a sample at the second layer in 4 o'clock, the rest may be inferred.
If level is integer, then take a sample at the level layer.But r can not just be 2
nWhen r is not 2
nThe time, level is a floating number.We exist respectively
Layer sampling is the L layer.With
Layer sampling is the L+1 layer.Be sampling layer synoptic diagram according to an embodiment of the invention as shown in figure 10, showing r is not 2
nThe time, level is the situation of a floating number.
S504: approach described convex quadrangle at the sampling layer with parallelogram, according to the parallelogram sampling, obtain the color value of sampling layer according to sampling spot.
As one embodiment of the present of invention, with the limit r1 of convex quadrangle, limit r2 is as two initial limits of parallelogram.Longest distance with summit 2 and summit 3 to limit r1 determines that parallelogram limit R3 is to the distance of parallelogram limit r1.Longest distance with summit 3 and summit 4 to limit r2 determines parallelogram limit R4 to the distance of parallelogram limit r2, and so that convex quadrangle be included within the parallelogram fully.Figure 11-14 shows the synoptic diagram of four kinds of situations of parallelogram according to an embodiment of the invention.Four kinds of situations are as described below respectively:
1, as shown in figure 11, summit 2 to the distance of limit r1 more than or equal to the distance on the distance on summit 3 to limit r1 and summit 4 to the limit r2 distance more than or equal to summit 3 to limit r2.This situation arrives the distance of limit r1 as the distance of parallelogram R3 to parallelogram limit r1 with summit 2.The distance on summit 4 to limit r2 is as the distance of parallelogram limit R4 to parallelogram limit r2;
2, as shown in figure 12, the distance of summit 2 limit r1 is less than the distance on the distance of summit 3 limit r1 and summit 4 to the limit r2 distance more than or equal to summit 3 to limit r2.This situation arrives the distance of limit r1 as the distance of parallelogram R3 to parallelogram limit r1 with summit 3.The distance on summit 4 to limit r2 is as the distance of parallelogram limit R4 to parallelogram limit r2;
3, as shown in figure 13, the distance of summit 2 limit r1 is more than or equal to the distance on the distance of summit 3 limit r1 and summit 4 to the limit r2 distance less than summit 3 to limit r2.This situation arrives the distance of limit r1 as the distance of parallelogram R3 to parallelogram limit r1 with summit 2.The distance on summit 3 to limit r2 is as the distance of parallelogram limit R4 to parallelogram limit r2;
4, as shown in figure 14, the distance on summit 2 to limit r1 is less than the distance on summit 3 to limit r1, and the distance on summit 4 to limit r2 is less than the distance on summit 3 to limit r2.This situation arrives the distance of limit r1 as the distance of parallelogram R3 to parallelogram limit r1 with summit 3.The distance on summit 3 to limit r2 is as the distance of parallelogram limit R4 to parallelogram limit r2.
As one embodiment of the present of invention, take a sample according to parallelogram at the L layer, and judge sampling spot whether in convex quadrangle, as at convex quadrangle with interior this point of then adopting.Beyond at convex quadrangle, then abandon this point.To averaging a little with interior institute in protruding distortion.Obtained the color value at the L layer.
Be parallelogram sampling synoptic diagram according to an embodiment of the invention as shown in figure 15.As one embodiment of the present of invention, for parallelogram, we with R3 to r1 determine number of samples along limit r2 apart from length, R4 to r2 apart from the number of samples of length decision along limit r1.Be sampling synoptic diagram according to parallelogram such as Figure 15.
Be depicted as sampling synoptic diagram according to an embodiment of the invention such as Figure 16-19.We judge that the position of sampling spot is whether in convex quadrangle for each sampling spot.As at convex quadrangle with interior this point of then adopting.Beyond at convex quadrangle, then abandon this point.At last with the color value addition of the sampled point in the convex quadrangle.Again divided by the number of sampled point in convex quadrangle.So just obtained the color value at the L layer.
Figure 20 shows the synoptic diagram of adjacent samples layer according to an embodiment of the invention.At the L+1 layer, each limit length of side of convex quadrangle is half of L layer.Still the same with the L layer for the convex quadrangle at the L+1 layer.Approach with parallelogram, take a sample according to parallelogram, judge that sampled point is whether in convex quadrangle.Convex quadrangle is averaging the color value that has obtained the L+1 layer with all interior sampled points.
Because the resolution of L+1 layer is 1/2 of L layer, then the convex quadrangle shape at the L+1 layer is the same with the L layer.But each the limit length of side at the convex quadrangle of L+1 layer is 1/2 of L layer, as shown in figure 20.Figure 21 shows the sampling synoptic diagram of adjacent samples layer according to an embodiment of the invention.Convex quadrangle for the L+1 layer still approaches with parallelogram, samples according to parallelogram.As at convex quadrangle with interior this point of then adopting.Beyond at convex quadrangle, then abandon this point.Because each limit length of side of the convex quadrangle of L+1 layer is 1/2 of L layer, the shape of convex quadrangle is the same.Also be half of L layer in the parallelogram length of side of L+1 layer.So the total number of samples at the L+1 layer is 1/4 of L layer.As one embodiment of the present of invention, the sampling mode of L+1 layer can be identical at L layer sampling mode.Difference is that the quantity of taking a sample is different.
S505: the final color value of determining image according to the color value of sampling layer.
As one embodiment of the present of invention, the color value that L layer and L+1 layer are obtained is done linear interpolation and is obtained final color value.Figure 22 shows linear interpolation synoptic diagram according to an embodiment of the invention.If the color value that obtains at the L layer is color_l, the color value that obtains at the L+1 layer is color_l1, and so final color value color is:
color=color_l*(1-f)+color_l1*f,
Wherein, f is interpolation factor, according to formula
Determine that wherein r is the minimum length of side of convex quadrangle.
The present invention proposes a kind of image filtering device, is the functional structure chart of an embodiment of image filtering device as shown in figure 23.This image filtering device comprises:
The pre-filtering module, it is used for image is carried out pre-filtering, obtains the texture look-up table of described image, and wherein said texture look-up table comprises the texture array layer with different resolution;
Projection module, it is used for regarding the pixel of screen space as dimetric projection to texture space, approaches the projection of shape of described texture space with convex quadrangle;
Sampling layer determination module, it is used for the length of side according to described convex quadrangle, determines the sampling layer in the texture array layer of described texture look-up table;
Sampling module, it is used for approaching described convex quadrangle at described sampling layer with parallelogram, according to described parallelogram sampling, obtains the color value of described sampling layer according to described sampling spot;
Determination module, it is used for determining according to the color value of described sampling layer the final color value of described image.
As one embodiment of the present of invention, the pre-filtering module uses MIP-MAP that image is carried out pre-filtering.
As one embodiment of the present of invention, sampling layer determination module comprises: computing module, it is used for determining the minimum length of side r of described convex quadrangle, and calculates log
2(r); Judge module, it is used for judging log
2(r) whether be integer and definite described sampling layer, if log
2(r) be integer, then take a sample at a sampling layer, according to formula L=log
2(r) determine described sampling layer L, wherein L represents described sampling layer, and r is the minimum length of side of described convex quadrangle; If log
2(r) be floating number, then take a sample at two adjacent sampling layers, according to formula
Determine the first sampling layer L, according to formula
Determine the second sampling layer L+1, wherein L represents described the first sampling layer, and L+1 represents the second sampling layer, and r is the minimum length of side of described convex quadrangle,
Be downward rounding operation,
Be the computing that rounds up.
As one embodiment of the present of invention, sampling module comprises that parallelogram determines submodule, and it is used for determining according to a pair of adjacent edge of described convex quadrangle the direction of a pair of adjacent edge of described parallelogram; Determine the length of the adjacent edge of described parallelogram according to the summit of described convex quadrangle to the distance of described adjacent edge, so that described convex quadrangle is included within the described parallelogram.
As one embodiment of the present of invention, sampling module comprises that color value determines submodule, and it is used for taking a sample according to described parallelogram at described sampling layer, obtains the sampling spot that is arranged in described parallelogram; Judge sampling spot whether in described convex quadrangle, if sampling spot at described convex quadrangle with this sampling spot of Nei Zecai, if sampling spot is beyond described convex quadrangle then abandon this sampling spot; The color value of described convex quadrangle with interior sampling spot averaged, obtain the color value of described sampling layer.
As one embodiment of the present of invention, determination module is used for described final color value being defined as the color value of described sampling layer when a sampling layer is taken a sample; When two sampling layers are taken a sample, described the first sampling layer and the described second color value of taking a sample layer are carried out linear interpolation, obtain described final color value.
As one embodiment of the present of invention, determination module is done linear interpolation according to following formula to the color value of L layer and L+1 layer:
color=color_l*(1-f)+color_l1*f,
Wherein, color is described final color value, and color_l is the color value of described the first sampling layer L, and color_l1 is the color value of described the second sampling layer L+1, and f is interpolation factor, by formula
Obtain, wherein r is the minimum length of side of convex quadrangle.
Be the synoptic diagram that an alternate vein pattern of black and white lattice is adopted the projection of Feline algorithm as shown in figure 24.The distal-most end that Figure 25 shows among Figure 24 is amplified 5 times synoptic diagram.
Figure 26 is the synoptic diagram of the vein pattern that identical black and white lattice are alternate with the projection of FAST algorithm.The distal-most end that Figure 27 shows among Figure 26 is amplified 5 times synoptic diagram.
Figure 28 shows the synoptic diagram that adopts image filtering method of the present invention identical sample texture to be carried out projection.The distal-most end that Figure 29 shows among Figure 28 is amplified 5 times synoptic diagram.
Can be found out by Figure 24-29, adopt the resulting image of image filtering method proposed by the invention to have higher sharpness.
Embodiments of the invention propose to use arbitrarily, and convex quadrangle approaches pixel projection to the shape of texture space, which layer sampling minimum edge with convex quadrangle determines in, when taking a sample, the L layer still takes a sample according to the parallelogram mode of FAST algorithm, judge sampling spot whether in convex quadrangle, the point beyond convex quadrangle is then abandoned.So just got at convex quadrangle with interior sampling spot.Be half at the L layer on every limit of convex quadrangle of L+1 layer, sampling is still the same with L layer sampling mode, judges that sampling spot is whether in convex quadrangle.Because the convex quadrangle of L+1 layer is the L layer half.Then the number of samples at the L+1 layer should be 1/4 of L layer.Image filtering method proposed by the invention and device are used for texture, can so that texture presents very clearly effect to screen, can not occur bluring.
Although illustrated and described embodiments of the invention, for the ordinary skill in the art, be appreciated that without departing from the principles and spirit of the present invention and can carry out multiple variation, modification, replacement and modification to these embodiment that scope of the present invention is by claims and be equal to and limit.
Claims (10)
1. an image filtering method is characterized in that, may further comprise the steps:
Image is carried out pre-filtering, obtain the texture look-up table of described image, wherein said texture look-up table comprises the texture array layer with different resolution;
Regard the pixel of screen space as dimetric projection to texture space, approach the projection of shape of described texture space with convex quadrangle;
According to the minimum length of side of described convex quadrangle, in the texture array layer of described texture look-up table, determine the sampling layer;
Approach described convex quadrangle at described sampling layer with parallelogram, be specially: the direction of determining a pair of adjacent edge of described parallelogram according to a pair of adjacent edge of described convex quadrangle; Determine the length of the adjacent edge of described parallelogram according to the summit of described convex quadrangle to the distance of the adjacent edge of described parallelogram, so that described convex quadrangle is included within the described parallelogram;
According to the sampling of described parallelogram, obtain the color value of described sampling layer according to described sampling spot, be specially: take a sample according to described parallelogram at described sampling layer, obtain the sampling spot that is arranged in described parallelogram; Judge sampling spot whether in described convex quadrangle, if sampling spot at described convex quadrangle with this sampling spot of Nei Zecai, if sampling spot is beyond described convex quadrangle then abandon this sampling spot; The color value of described convex quadrangle with interior sampling spot averaged, obtain the color value of described sampling layer;
Determine the final color value of described image according to the color value of described sampling layer.
2. image filtering method according to claim 1 is characterized in that, described pre-filtering comprises the MIP-MAP pre-filtering.
3. image filtering method according to claim 2 is characterized in that, according to the minimum length of side of described convex quadrangle, determines that in the texture array layer of described texture look-up table the step of sampling layer comprises:
Determine the minimum length of side r of described convex quadrangle;
Calculate log
2(r);
If log
2(r) be integer, then take a sample at a sampling layer, according to formula T=log
2(r) determine described sampling layer T, wherein T represents described sampling layer, and r is the minimum length of side of described convex quadrangle;
If log
2(r) be floating number, then take a sample at two adjacent sampling layers, according to formula
Determine the first sampling layer L, according to formula
Determine the second sampling layer L+1, wherein L represents described the first sampling layer, and L+1 represents the second sampling layer, and r is the minimum length of side of described convex quadrangle,
Be downward rounding operation,
Be the computing that rounds up.
4. image filtering method according to claim 3 is characterized in that, determines that according to the color value of described sampling layer the step of the final color value of described image comprises:
If take a sample at a sampling layer, then described final color value is the color value of described sampling layer T;
If take a sample at two sampling layers, then the color value of described the first sampling layer L and described the second sampling layer L+1 carried out linear interpolation, obtain described final color value.
5. image filtering method according to claim 4 is characterized in that, according to following formula the color value of described the first sampling layer L and described the second sampling layer L+1 is done linear interpolation:
color=color_l*(1-f)+color_l1*f,
Wherein, color is described final color value, and color_l is the color value of described the first sampling layer L, and color_l1 is the color value of described the second sampling layer L+1, and f is interpolation factor, by formula
Determine that wherein r is the minimum length of side of convex quadrangle.
6. an image filtering device is characterized in that, comprising:
The pre-filtering module, it is used for image is carried out pre-filtering, obtains the texture look-up table of described image, and wherein said texture look-up table comprises the texture array layer with different resolution;
Projection module, it is used for regarding the pixel of screen space as dimetric projection to texture space, approaches the projection of shape of described texture space with convex quadrangle;
Sampling layer determination module, it is used for the minimum length of side according to described convex quadrangle, determines the sampling layer in the texture array layer of described texture look-up table;
Sampling module, it is used for approaching described convex quadrangle at described sampling layer with parallelogram, according to described parallelogram sampling, obtains the color value of described sampling layer according to described sampling spot, described sampling module comprises that parallelogram determines that submodule and color value determine submodule, wherein:
Described parallelogram is determined submodule, is used for determining according to a pair of adjacent edge of described convex quadrangle the direction of a pair of adjacent edge of described parallelogram; Determine the length of the adjacent edge of described parallelogram according to the summit of described convex quadrangle to the distance of the adjacent edge of described parallelogram, so that described convex quadrangle is included within the described parallelogram;
Described color value is determined submodule, is used for taking a sample according to described parallelogram at described sampling layer, obtains the sampling spot that is arranged in described parallelogram; Judge sampling spot whether in described convex quadrangle, if sampling spot at described convex quadrangle with this sampling spot of Nei Zecai, if sampling spot is beyond described convex quadrangle then abandon this sampling spot; The color value of described convex quadrangle with interior sampling spot averaged, obtain the color value of described sampling layer;
Final color value determination module, it is used for determining according to the color value of described sampling layer the final color value of described image.
7. image filtering device according to claim 6 is characterized in that, described pre-filtering module also is used for using MIP-MAP that image is carried out pre-filtering.
8. image filtering device according to claim 7 is characterized in that, described sampling layer determination module comprises:
Computing module, it is used for determining the minimum length of side r of described convex quadrangle, and calculates log
2(r);
Judge module, it is used for judging log
2(r) whether be integer and definite described sampling layer, if log
2(r) be integer, then take a sample at a sampling layer, according to formula T=log
2(r) determine described sampling layer T, wherein T represents described sampling layer, and r is the minimum length of side of described convex quadrangle; If log
2(r) be floating number, then take a sample at two adjacent sampling layers, according to formula
Determine the first sampling layer L, according to formula
Determine the second sampling layer L+1, wherein L represents described the first sampling layer, and L+1 represents the second sampling layer, and r is the minimum length of side of described convex quadrangle,
Be downward rounding operation,
Be the computing that rounds up.
9. image filtering device according to claim 8 is characterized in that, described final color value determination module is used for described final color value being defined as the color value of described sampling layer T when a sampling layer is taken a sample; When two sampling layers are taken a sample, described the first sampling layer L and the described second color value of taking a sample layer L+1 are carried out linear interpolation, obtain described final color value.
10. image filtering device according to claim 9 is characterized in that, described final color value determination module is done linear interpolation according to following formula to the color value of described the first sampling layer L and described the second sampling layer L+1:
color=color_l*(1-f)+color_l1*f,
Wherein, color is described final color value, and color_l is the color value of described the first sampling layer L, and color_l1 is the color value of described the second sampling layer L+1, and f is interpolation factor, by formula
Determine that wherein r is the minimum length of side of convex quadrangle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910178123 CN102034261B (en) | 2009-09-27 | 2009-09-27 | Image filtering method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910178123 CN102034261B (en) | 2009-09-27 | 2009-09-27 | Image filtering method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102034261A CN102034261A (en) | 2011-04-27 |
CN102034261B true CN102034261B (en) | 2013-01-02 |
Family
ID=43887113
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200910178123 Active CN102034261B (en) | 2009-09-27 | 2009-09-27 | Image filtering method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102034261B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6292193B1 (en) * | 1998-07-30 | 2001-09-18 | Compaq Computer Corporation | Techniques for anisotropic texture mapping using multiple space-invariant filtering operations per pixel |
CN101000651A (en) * | 2006-12-28 | 2007-07-18 | 上海电力学院 | Method for recognising multiple texture image |
-
2009
- 2009-09-27 CN CN 200910178123 patent/CN102034261B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6292193B1 (en) * | 1998-07-30 | 2001-09-18 | Compaq Computer Corporation | Techniques for anisotropic texture mapping using multiple space-invariant filtering operations per pixel |
CN101000651A (en) * | 2006-12-28 | 2007-07-18 | 上海电力学院 | Method for recognising multiple texture image |
Non-Patent Citations (3)
Title |
---|
JP特开2004-5228A 2004.01.08 |
周建林等.基于MIPMAP技术的纹理区域取样.《工程图学学报》.2006,(第4期),第115-119页. * |
韩慧健等.Mipmap映射技术中d值计算方法的探讨.《计算机应用》.2004,第24卷(第12期),第16-18页. * |
Also Published As
Publication number | Publication date |
---|---|
CN102034261A (en) | 2011-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2302900B1 (en) | Image processing device, image processing method, and program | |
US8406557B2 (en) | Method and apparatus for correcting lens shading | |
CN103733220B (en) | A kind of processing method based on bayer format-pattern and device | |
US8837853B2 (en) | Image processing apparatus, image processing method, information recording medium, and program providing image blur correction | |
US20080253652A1 (en) | Method of demosaicing a digital mosaiced image | |
US9105106B2 (en) | Two-dimensional super resolution scaling | |
CN103650486B (en) | Camera head and image generating method | |
WO2022061879A1 (en) | Image processing method, apparatus and system, and computer-readable storage medium | |
JP2003163939A (en) | Digital image processing method mounting adaptive mosaic reduction method | |
US7652700B2 (en) | Interpolation method for captured color image data | |
JP2010514052A (en) | Reducing position-dependent noise in digital images | |
US20100296737A1 (en) | Content-Adaptive Filter Technique | |
US11854157B2 (en) | Edge-aware upscaling for improved screen content quality | |
KR20100084458A (en) | Image interpolation method and apparatus using pattern characteristics of color filter array | |
US20190355105A1 (en) | Method and device for blind correction of lateral chromatic aberration in color images | |
TWI544785B (en) | Image downsampling apparatus and method | |
CN102034261B (en) | Image filtering method and device | |
CN112237002A (en) | Image processing method and apparatus | |
EP3882847A1 (en) | Content based anti-aliasing for image downscale | |
CN102034262A (en) | Texture filtering method and device based on anisotropy | |
Birchfield | Reverse-projection method for measuring camera MTF | |
CN117274060A (en) | Unsupervised end-to-end demosaicing method and system | |
US12133002B2 (en) | Image processing method and electronic device | |
CN101964907B (en) | Block removing device and method | |
CN102760288B (en) | Color matching method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |