Specific embodiment
It is in order to be more clearly understood that the above objects, features and advantages of the present invention, below in conjunction with the accompanying drawings and concrete real
Apply mode to be further described in detail the present invention.It should be noted that in the case where not conflicting, the enforcement of the application
Feature in example and embodiment can be mutually combined.
Many details are elaborated in the following description in order to fully understand the present invention, but, the present invention may be used also
Implemented with being different from other modes described here using other, therefore, the present invention is not limited to following public concrete reality
Apply the restriction of example.
Fig. 1 shows the block diagram of the processing meanss of image edge acuity according to an embodiment of the invention.
As shown in figure 1, the processing meanss 100 of image edge acuity include:Acquiring unit 102, for the finger on image
2k pixel is obtained in determining pixel column or pixel column, wherein, 2k pixel is divided into both sides, and k pixel, k are included per side
∈N;Judging unit 104, for calculating the difference of the pixel value sum of side pixel and the pixel value sum of opposite side pixel
Value absolute value, and judge absolute difference whether more than or equal to default difference threshold;Processing unit 106, in difference
Absolute value carries out edge sharpening process to 2k pixel more than or equal in the case of default difference threshold.
In the technical scheme, by edge sharpening process being carried out to pixel on image, can eliminate image boundary mould
The unclear situation of paste.Wherein, for the selection of 2k pixel can be a row or column in image, or multiple pre-
Determine the pixel of row or multiple predetermined row.It is compared by the situation of the pixel value to both sides pixel, is realized to each area
The progressively edge sharpening of domain pixel is processed, and may finally reach carries out the purpose of edge sharpening process to whole image.
In above-mentioned technical proposal, acquiring unit 102 specifically for:From one end of specified pixel row or pixel column to another
End repeatedly obtains 2k pixel, and the starting point of the pixel for obtaining every time is separated by r with the starting point of the last pixel for obtaining
Individual pixel, wherein, k ∈ N and r >=1.
In the technical scheme, great progressive step-length is selected(Between the starting point of the pixel for being obtained before and after i.e. twice
Interval r)To judge according to the actual requirements.Different progressive step-lengths are selected according to the demand to different positioning precisions, such as gradually
Enter that step-length is bigger, required operand is less, but the positioning precision error of gradient boundaries is bigger;Progressive step in general sense
Length is less, and required operand is bigger, and advantage is that the positioning precision of gradient boundaries is higher, the image after Grads Sharp process
Quality is higher, the suitable progressive step-length of selection of will compromising between operation efficiency and process performance.But according to the spy of this algorithm
Point, if the progressive step-length for selecting is less than k, can double counting and the original sharpened depth of covering during calculating
Value, and larger error is produced, thus progressive step-length is preferably the arbitrary value between k to 2k, specifically still needs to essence as requested
Degree and operand are selected.
In above-mentioned technical proposal, acquiring unit 102 obtains the 2k on the specified pixel row or pixel column successively
Individual pixel.
In the technical scheme, 2k pixel continuously can be chosen successively, it is also possible to have one middle
It is a little to be spaced.By choosing 2k pixel successively, 2k pixel in specified pixel row or pixel column can all be carried out
Edge contrast, it is to avoid the pixel origination interval of Edge contrast, improves and sharpens effect.
In any of the above-described technical scheme, processing unit 106 includes:Pixel value comparing subunit 1062, for being in
In 2k pixel of specified pixel row, the pixel of k pixel of pixel value sum and right side to the k pixel in left side
Value sum is compared;Pixel value replaces subelement 1064, is less than the k on right side in the pixel value sum of the k pixel in left side
The minima of pixel value in the k pixel in left side in the case of the pixel value sum of individual pixel, is then taken, to replace a left side respectively
The pixel value of k pixel of side, takes the maximum of pixel value in the k pixel on right side, to replace the k picture on right side respectively
The pixel value of vegetarian refreshments;And left side k pixel pixel value sum more than right side k pixel pixel value sum
In the case of, then the maximum of pixel value in the k pixel in left side is taken, to replace the pixel value of the k pixel in left side, is taken
The minima of pixel value in the k pixel on right side, to replace the pixel value of the k pixel on right side.
In any of the above-described technical scheme, 106 pairs of 2k pixels in specified pixel row of processing unit carry out edge
The process of Edge contrast includes:The average pixel value of k pixel of upside is obtained, to replace k pixel of upside respectively
Pixel value;The average pixel value of k pixel of downside is obtained, to replace the pixel value of k pixel of downside respectively.
In the technical scheme, because human eye is quicker for the horizontal movement of object in nature is relative to vertical movement
Sense, so transverse gradients are sharpened and the process of longitudinal Grads Sharp is slightly different in this algorithm.
The flow chart that Fig. 2 shows the processing method of image edge acuity according to an embodiment of the invention.
The processing method of image edge acuity includes:Step 202, obtains in the specified pixel row or pixel column on image
2k pixel, k ∈ N;Step 204,2k pixel are divided into both sides, k pixel is included per side, and calculates side pixel
Pixel value sum and opposite side pixel pixel value sum absolute difference;Step 206, if absolute difference be more than or
Equal to default difference threshold, then edge sharpening process is carried out to 2k pixel.
In the technical scheme, by edge sharpening process being carried out to pixel on image, can eliminate image boundary mould
The unclear situation of paste.Wherein, for the selection of 2k pixel can be a row or column in image, or multiple pre-
Determine the pixel of row or multiple predetermined row.It is compared by the situation of the pixel value to both sides pixel, is realized to each area
The progressively edge sharpening of domain pixel is processed, and may finally reach carries out the purpose of edge sharpening process to whole image.
In above-mentioned technical proposal, step 202 includes:Repeatedly obtain from one end of specified pixel row or pixel column to the other end
2k pixel is taken, and the starting point of the pixel for obtaining every time is separated by r pixel with the starting point of the last pixel for obtaining,
Wherein, k ∈ N and r >=1.
In the technical scheme, great progressive step-length is selected(Between the starting point of the pixel for being obtained before and after i.e. twice
Interval r)To judge according to the actual requirements.Different progressive step-lengths are selected according to the demand to different positioning precisions, such as gradually
Enter that step-length is bigger, required operand is less, but the positioning precision error of gradient boundaries is bigger;Progressive step in general sense
Length is less, and required operand is bigger, and advantage is that the positioning precision of gradient boundaries is higher, the image after Grads Sharp process
Quality is higher, the suitable progressive step-length of selection of will compromising between operation efficiency and process performance.But according to the spy of this algorithm
Point, if the progressive step-length for selecting is less than k, can double counting and the original sharpened depth of covering during calculating
Value, and larger error is produced, thus progressive step-length is preferably the arbitrary value between k to 2k, specifically still needs to essence as requested
Degree and operand are selected.
In above-mentioned technical proposal, step 202 also includes:Obtain 2k pixel on specified pixel row or pixel column successively
Point.
In the technical scheme, 2k pixel continuously can be chosen successively, it is also possible to have one middle
It is a little to be spaced.By choosing 2k pixel successively, 2k pixel in specified pixel row or pixel column can all be carried out
Edge contrast, it is to avoid the pixel origination interval of Edge contrast, improves and sharpens effect.
In any of the above-described technical scheme, in step 206, edge is carried out to the 2k pixel in specified pixel row sharp
Changing the process for processing includes:If the pixel value sum of the k pixel in left side less than right side k pixel pixel value it
With then take the minima of pixel value in the k pixel in left side, with the pixel value of k pixel on the left of replacing respectively, take institute
The maximum of pixel value in the k pixel stated, to replace the pixel value of the k pixel on right side respectively;And if the k in left side
Pixel value sum of the pixel value sum of individual pixel more than the k pixel on right side, then take pixel in the k pixel in left side
The maximum of value, to replace the pixel value of the k pixel in left side, takes the minima of pixel value in the k pixel on right side, with
Replace the pixel value of the k pixel on right side.
In any of the above-described technical scheme, in step 206, edge is carried out to the 2k pixel in specified pixel row sharp
Changing the process for processing includes:The average pixel value of k pixel of upside is obtained, to replace k pixel of upside respectively
Pixel value;The average pixel value of k pixel of downside is obtained, to replace the pixel value of k pixel of downside respectively.
In the technical scheme, because human eye is quicker for the horizontal movement of object in nature is relative to vertical movement
Sense, so transverse gradients are sharpened and the process of longitudinal Grads Sharp is slightly different in this algorithm.
The flow chart that Fig. 3 shows the algorithm of image edge acuity according to an embodiment of the invention.
As shown in figure 3, gradient edge pixel value size variation speed in this algorithm middle finger image adjacent pixel regions
Degree.In foreground image and the respective inside of background image, user is it is desired that the gradient of the pixel value of neighbor becomes
Turn to 0 or a relatively small value;In the intersection of foreground and background, user wishes neighbouring pixel region pixel value ladder
Degree change is violent.Based on above principle, the image edge acuity algorithm after improvement mainly includes two big links:First, gradient boundaries
Positioning;2nd, image edge acuity.Wherein gradient boundaries positioning includes:The progressive step-length of gradient location window and position gates limit value are really
The fixed, positioning of gradient location window;Image edge acuity includes:Edge sharpening reference value is calculated, edge sharpening process.
Fig. 4 A and Fig. 4 B show the schematic diagram of the method for obtaining image slices vegetarian refreshments according to an embodiment of the invention.
Positioning gradient boundaries have used gradient location window in this algorithm, and gradient location window is divided into the location window of horizontal direction
With the location window in vertical direction, refer to the rectangular strip with several positioning taps respectively.Wherein, position tap and correspond to pixel
The position of point, the number of concrete positioning tap can be reset according to specific needs.It should be noted that ladder here
Degree location window and positioning tap are all virtual structures, in order to for the selection of pixel.Certainly, this is only the present invention
A kind of specific pixel for providing chooses form, and can also actually adopt other various ways, is such as directly selected
Take, but by arranging virtual gradient location window and positioning tap etc., it is clear that it is more convenient to understand and operate.Additionally, for positioning
The number of tap, it is also possible to be configured by user as needed.
As shown in Figure 4 A, horizontal gradient location window is divided into two from centre, six positioning tap on the left side(v1、v2、v3、
v4、v5、v6)Belong to left location window, six positioning tap on the right(v7、v8、v9、v10、v11、v12)Belong to right location window,
Two anchor windows will carry out localization process as different elementary cells when carrying out located lateral calculation process or so.
As shown in Figure 4 B, vertical gradient location window is also to be divided into two from centre, six positioning tap of top(h1、h2、
h3、h4、h5、h6)Belong to location window, six below position tap(H7, h8, h9, h10, h11, h12 belong to lower location window,
When longitudinal register computing is carried out, upper and lower two location windows will carry out localization process as different elementary cells in the same manner.
Fig. 5 shows the schematic diagram that the running orbit of location window according to an embodiment of the invention and step-length are selected.
As shown in figure 5, progressive step-length is location window a certain pixel region in the picture finish localization process after, arrive down
The distance that moved of position of one-time positioning process, and current location window center and next time between location window center
Unit pixel distance be known as the progressive step-length of gradient location window.Select different progressive according to the demand to different positioning precisions
Step-length, the progressive step-length of location window are bigger, and the operand wanted needed for position fixing process is less, but the positioning precision of gradient boundaries is missed
Difference is bigger;The progressive step-length of location window is less in general sense(Minimum 1 unit pixel distance), the fortune required for position fixing process
Calculation amount is bigger, and advantage is that the positioning precision of gradient boundaries is higher, and the picture quality after Grads Sharp process is higher.But
Apparently, it, so, because location window is 12 taps, is one group per 6 taps that actual effect is not to this algorithm, if select
Progressive step-length is less than if 6, meeting double counting and the original sharpened depth value of covering during calculating, and is produced
Larger error, so the design is according to the characteristics of algorithm, preferred progressive step-length 6 unit pixels and 12 unit pixels it
Between(It is of course apparent that can also be less than 6 or more than 12 unit pixels), will be according to reality as the great progressive step-length of selection
Border demand will be compromised between operation efficiency and process performance and select suitable progressive step-length to judge.
What is should be noted is a little, when using the borderline front 6 row pixel of image peripheral as the centre of location, to determine
Position window cannot launch, and as, in general display picture, user's focus of attention is often in the centre of image, boundary
Quantity of information it is few, so this algorithm directly starts positioning action from every a line or the 6th pixel per string.
The computing formula of transverse gradients boundary alignment:
WhenWhen, Vgradedge=1;
WhenWhen, Vgradedge=0。
Wherein, n is integer, and k gradient location windows side positions the number of tap, is the gradient difference that A is default single pixel,
f(Vn) be corresponding positioning tap pixel in the horizontal gradient location window grey decision-making, VgradedgeFor the transverse gradients side
The mark on boundary;The Vgrad when the center point of the gradient location window is in the gradient boundariesedge=1
In above-mentioned formula, kA is position threshold, is whether gradient location window judges the center of current window in ladder
Borderline Main Basiss are spent, generally, the gradient difference of the single pixel in gradient boundaries arbitrarily can be arranged, such as:16、
32nd, 64,128 etc., then accordingly, position threshold is 16k, 32k, 64k, 128k etc..
The computing formula of longitudinal gradient boundaries positioning:
WhenWhen, Hgradedge=1;
WhenWhen, Hgradedge=0。
Wherein, n is integer, and k gradient location windows side positions the number of tap, and A is the gradient difference of default single pixel, f
(Hn) be corresponding positioning tap pixel in longitudinal gradient location window grey decision-making, HgradedgeFor the transverse gradients side
The mark on boundary;The Hgrad when the center point of the gradient location window is in the gradient boundariesedge=1.Together
When, correspondingly, the position threshold in the formula is tA.
Fig. 6 A and Fig. 6 B show the schematic diagram of edge sharpening according to an embodiment of the invention.
As shown in Figure 6A, be Edge contrast image boundary at graded it is slow, be gradient angle α all the time.
As shown in Figure 6B, after edge sharpening is processed, the change of boundary is very violent, and the gradient angle beta after sharpening is more than sharp
Gradient angle α before change.
After processing through edge sharpening, the gradient angle of image gradient boundary will significantly become big, and boundary profile is more
Clearly.
Specific processing method is as follows:
Work as VgradedgeWhen=1, transverse gradients location window navigates to gradient boundaries, if the pixel in the left location window
Gray value cumulative and less than the gray value of pixel cumulative in the right location window and, take the picture in the left location window
First minima of the gray value of vegetarian refreshments, replaces the gray scale of the pixel in the left location window respectively with first minima
Value;First maximum of the gray value of pixel in the right location window, it is described right fixed to be replaced with first maximum respectively
The gray value of pixel in the window of position.
If the gray value of the pixel in the left location window cumulative and more than the ash of pixel in the right location window
Angle value cumulative and, take the second maximum of the gray value of pixel in the left location window, with second maximum point
Do not replace the gray value of the pixel in the left location window;In the right location window, the second of the gray value of pixel is minimum
Value, replaces the gray value of pixel in the right location window respectively with second minima.
Computing formula is:
And
Work as HgradedgeWhen=1, longitudinal gradient location window navigates to gradient boundaries, obtains the pixel in the upper location window
First meansigma methodss of the gray value of point, replace the gray scale of the pixel in the upper location window respectively with first meansigma methodss
Value;The second meansigma methodss of the gray value of pixel in the lower location window are obtained, replaces institute respectively with second meansigma methodss
State the gray value of the pixel in lower location window.
Computing formula is:
Because human eye is more sensitive for the horizontal movement of object in nature is relative to vertical movement, in this algorithm
Middle transverse gradients are sharpened and the process of longitudinal Grads Sharp is slightly different.
This algorithm passes sequentially through the links such as gradient boundaries positioning and image edge acuity, while vertical and horizontal are taken slightly
The Edge contrast mechanism of difference carries out calculation process to initial pictures, effectively improves prospect and background edge intersection in image
Blooming, make the 3D anaglyph visual effects for rendering out more preferable.So, compare some other image optimizations
Processing method, this paper algorithms can realize more gratifying image effect.
This algorithm can carry out edge sharpening process to the depth map during 2D conversion 3D, specially in depth map
The gray value of pixel is contrasted, it is also possible to be applied to the processing procedure of normal image, if RGB(RGB)Pixel,
Then respectively R, G, B three-component is calculated respectively with this algorithm, specially the pixel value to the pixel in R, G, B three-component
Contrasted.If Y, U, V pixel is in the same manner.
The preferred embodiments of the present invention are the foregoing is only, the present invention is not limited to, for the skill of this area
For art personnel, the present invention can have various modifications and variations.It is all within the spirit and principles in the present invention, made any repair
Change, equivalent, improvement etc., should be included within the scope of the present invention.