CN102509259A - Image scaling method based on directions of pixels in image - Google Patents
Image scaling method based on directions of pixels in image Download PDFInfo
- Publication number
- CN102509259A CN102509259A CN2011102978265A CN201110297826A CN102509259A CN 102509259 A CN102509259 A CN 102509259A CN 2011102978265 A CN2011102978265 A CN 2011102978265A CN 201110297826 A CN201110297826 A CN 201110297826A CN 102509259 A CN102509259 A CN 102509259A
- Authority
- CN
- China
- Prior art keywords
- image
- gap
- pixel point
- pixel
- gaps
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000012217 deletion Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 6
- 239000011159 matrix material Substances 0.000 claims description 6
- 230000001174 ascending effect Effects 0.000 claims description 3
- 230000000694 effects Effects 0.000 description 4
- 230000037430 deletion Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
The invention discloses an image scaling method based on the directions of pixels in an image. The image scaling method comprises the specific steps of: (1) inputting an original image; (2) calculating the energy of the original image; (3) calculating directions of various pixels in the original image; (4) determining interstices in the image according to the directions of the various pixels in the original image; and (5) calculating the energy values of the interstices in the image, selecting N interstices with minimum energy values, deleting the N interstices with minimum energy values, and obtaining a scaled image. According to the method, a plurality of interstices in the image are obtained once by using the directions of the various pixels during the process of image scaling, and the scaling operation speed can be increased; secondarily, the problem of the intersecting of the interstices can be automatically solved by a priority window adopted in the method, and the forming of intersected interstices is inhibited; and compared with the scaling method proposed by Rubinstein et al, the image scaling speed of the scaling method disclosed by the invention is obviously increased.
Description
Technical Field
The invention relates to the technical field of image zooming processing, in particular to an image zooming method based on the direction of pixel points in an image.
Background
With the rapid development of multimedia technology, display devices with different sizes of video display windows such as mobile phones, wide screen televisions, huge LEDs and the like are increasingly commonly applied in our lives, people require that the size of a display image is adapted to the size of the display window of the display device, and simultaneously require that key contents in the image can be clearly displayed, a text "zoom the image based on the content by using a slit method" published in the 3 rd phase of the computer association graphic article, volume 26, of the book of the computer association graphic article published by the 3 rd month in 2007, by Shai Avidan and Ariel Shamir et al, proposes a slit method based on image contents, deletes (or copies) all pixel points on a found slit by finding the smallest energy in the image to realize the reduction (or increase) of the image size, and the method proposes a new image zooming method and a concept of the slit, but the result of image zooming is easy to generate distortion, and the scaling run time is long.
The "improved seam cutting algorithm suitable for video adaptation" published in volume 27, phase 3 of the computer association graphic newspaper published by Rubinstein et al in 8.2008 discloses that the removal of a seam in an image may introduce new energy to the image, the introduced new energy is called forward energy, and the seam which minimizes the forward energy is solved, wherein the scaling method specifically comprises the following steps:
(1) defining an energy value for each pixel point in the image, wherein the energy value reflects the importance of the pixel point, and points with larger energy are more important;
(2) searching a vertical (or horizontal) gap which enables the introduced energy to be minimum from the image, wherein the vertical (or horizontal) gap refers to a curve from top to bottom (or from left to right) in the image, each row (or column) in the image has and only has one pixel point on the curve, any two adjacent rows of pixel points on the curve are adjacent, and the energy of the gap is defined as the sum of the energies of all the pixel points on the gap;
(3) deleting or copying all pixel points on the gaps in the image to realize the reduction or increase of the image size;
(4) the above steps are repeated until the image with the required size is obtained, the image zooming effect of the method is good, but the dynamic planning method is adopted when the gap is solved, and the dynamic planning is needed to be carried out once when one gap is solved, so that more time is spent when the size of the image is changed greatly.
In summary, the conventional image scaling method based on the gap has the problems of low image scaling efficiency and more time consumption, and the wide application of the image scaling technology of the gap is influenced.
Disclosure of Invention
The present invention is directed to overcome the problems in the prior art, and provides an image scaling method based on the direction of a pixel point in an image, which can reduce the scaling operation time and improve the image scaling efficiency while ensuring the image scaling quality.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
an image scaling method based on pixel point directions in an image comprises the following specific steps:
(1) inputting an original image;
(2) calculating the energy of the original image;
(3) calculating the direction of each pixel point in the original image;
(4) determining a gap in the image according to the direction of each pixel point in the image;
(5) calculating the energy value of the gap in the image, and selecting the minimum energy valueStrip gap, minimum energy value of deletionAnd (5) strip gaps to obtain the zoomed image.
The step (2) of calculating the energy of the original image comprises the following steps:
firstly, converting an image into a gray image, and then calculating the gradient amplitude of the gray image, wherein the calculation formula is as follows:
wherein,the energy of the image is represented by,、representing coordinates of pixel points,A gray-scale image is represented by a gray-scale image,the sign of the absolute value is represented,、represent images respectively at,The partial derivative in the direction, the energy value of the corresponding pixel point position in the energy of the image is the energy value of each pixel point.
The step (3) of calculating the direction of each pixel point in the original image includes the following specific steps:
(3-1) calculating the gradient direction of each pixel point in the image, wherein the calculation formula is as follows:
wherein,,,、represent images respectively at,The partial derivative in the direction of the light,which represents the inverse tangent of the light beam,representing coordinates of pixel pointsThe direction of the gradient of (d);
(3-2) calculating the direction of each pixel point in the image, wherein the calculation formula is as follows:
(3)
wherein,representing coordinates of pixel pointsThe direction of the gradient of (a) is,the gradient direction is changed to the tangential direction,all tangential directions are directed below the horizontal,representing coordinates of pixel pointsIn the direction of (c).
The step (4) of determining the gap in the image according to the direction of each pixel point in the image includes the following specific steps:
(4-1) defining gaps in the image, which are specifically as follows:
defining a gap in the vertical direction, and the expression is as follows:
(4)
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
defining a gap in the horizontal direction, and the expression is as follows:
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
(4-2) setting each pixel point in the first row in the image as the starting point of each gap respectively;
(4-3) finding the next pixel point of the gap in the image by using the priority window:
(4-3-1), defining a priority window in the image:
defining the priority window in the image as a 2 x 5 matrix window, wherein the elements of the 2 nd row in the matrix window are respectively: 5. 3, 1, 2, 4, which represent different priorities of the element positions, wherein the priorities with the highest priorities of 1, 2, 3, 4, 5 are sequentially reduced, and the priorities with the lowest priorities of 5 are sequentially reduced;
(4-3-2), determining the position of the priority window in the image:
if the direction of the starting point points to the pixel point at the lower left of the starting point, the starting point is positioned at the 4 th column position of the 1 st row in the priority window;
if the direction of the starting point points to the pixel point right below the starting point, the starting point is positioned at the position of the 1 st row and the 3 rd column in the priority window;
if the direction of the starting point points to the pixel point at the lower right of the starting point, the starting point is positioned at the 2 nd row position of the 1 st row in the priority window;
determining the position of the starting point in the priority window, and then determining the position of the priority window in the image;
(4-3-3), determining the position of the next pixel point forming the gap in the image:
in the priority window, setting a pixel point where the highest-order element 1 is located in the image as a next pixel point for forming a gap, and then judging whether the position of the highest-order element 1 in the image is occupied by other gaps in the image or not;
if the position of the highest-order element 1 in the image is not occupied by other gaps in the image, the pixel point at which the position of the highest-order element 1 in the image is located is the next pixel point forming the gap;
if the position of the highest order element 1 in the image is occupied by other slits, then the pixel point at the position of element 2 in the image is the next pixel point to form a slit;
if the position of priority element 2 in the image is occupied by other slots, then the pixel at the position of element 3 in the image is the next pixel to form a slot;
if the position of priority element 3 in the image is occupied by other slots, then the pixel at the position of element 4 in the image is the next pixel to form a slot;
if the position of precedence element 4 in the image is occupied by other slots, then the pixel at the position of element 5 in the image is the next pixel to form a slot;
if the 5 element positions of the 2 nd row in the priority window are occupied by other gaps in the image, stopping determining the position of the next pixel point forming the gap in the image, and finding the next pixel point of other gaps in the image by using the priority window;
(4-4) determining a gap in the image:
judging whether the next pixel point of the gap in the image is in the last line of the image or not, if the next pixel point of the gap in the found image is not in the last line of the image, taking the next pixel point of the gap in the image as a starting point, and turning to the step (4-3-2) to determine the new position of the priority window in the image; and if the next pixel point of the gap in the found image is in the last line of the image, forming a gap in the image by all the found pixel points, and similarly, repeating the steps, finding the next pixel point of other gaps in the image by using the priority window, and determining other gaps in the image.
Calculating the energy value of the gap in the image in the step (5), and selecting the energy value with the minimum energy valueStrip gap, minimum energy value of deletionAnd (3) strip gaps to obtain a zoomed image, which comprises the following specific steps:
(5-1) calculating the energy value of the gap in the image, wherein the calculation formula is as follows:
wherein,which represents a gap in the image or images,indicating a gapToThe number of the pixel points is one,indicating the first on the slitThe energy value of each pixel point is calculated,representing the total number of pixel points on the slit,representing an energy value of the gap;
(5-2) is provided withRespectively the height and width of the original image,the height and width of the target image to be obtained are respectively selected, so that the energy value is minimumA stripe gap, whose expression is:whereinis the width of the original image and,in order to be the width of the target image,in order to select the number of the gaps needing to be deleted, the energy values of the gaps in all the images are arranged in an ascending order, and the energy value is the smallestThe strip gap is a gap to be deleted;
(5-3) deleting gaps in the image to obtain a zoomed image, which comprises the following specific steps:
(5-3-2), finding out from the first line of the imageIn the imageThe positions at which the pixels of a row are located, wherein,,is the height of the original image; the first of the imageMoving the pixel points on the right of the positions of the pixel points of the line one by one to the left, and deleting the imageAll pixel points of a column; after completion, the width of the image is reduced by one, and the width of the image becomes;
(5-3-3) similarly, the same operation as in the step (5-3-2) is performed for the gaps in the other images to be deleted, and the width of the image is reducedThe width of the image becomesThe image is deleted from the original imageScaling the image after the low energy seam is striped.
Compared with the prior art, the image zooming method based on the pixel point direction in the image has the following advantages that: in the method, the direction of each pixel point is utilized in the image zooming process, gaps in a plurality of images are obtained at one time, and the zooming running speed can be improved; secondly, the priority window adopted by the method can automatically process the crossing problem of the gaps and inhibit the formation of the crossed gaps; the image zooming experiment shows that compared with the zooming method proposed by Rubinstein et al, the image zooming operation speed of the invention is obviously improved.
Drawings
FIG. 1 is a flow chart of an image scaling method based on pixel point directions in an image according to the present invention;
FIG. 2 is a flow chart of the image scaling method step (4) of the present invention;
FIG. 3 is a flow chart of the image scaling method step (5) of the present invention;
FIG. 4(a) is a schematic diagram of a priority window with a starting point in the image pointing to a pixel point to the lower left of the starting point;
FIG. 4(b) is a schematic view of a priority window in which the direction of a start point in an image points to a pixel point directly below the start point;
FIG. 4(c) is a schematic diagram of a priority window in which the direction of the origin in the image points to the pixel point to the lower right of the origin;
FIGS. 5(a) and 5 (b) are the original landscape image and the person image inputted in step (1);
FIGS. 6(a) and 6 (b) are the scaled images obtained in step (5);
FIGS. 7(a) and 7 (b) are prior art images obtained by scaling the images by the scaling method proposed by Rubinstein et al;
fig. 8 is a graph comparing the run times of the method of the present invention and the scaling method proposed by Rubinstein et al when scaling images to different sizes.
Detailed Description
Examples of the present invention will be described in further detail below with reference to the accompanying drawings.
As shown in fig. 1, fig. 2, and fig. 3, the image scaling method based on the pixel direction in the image of the present invention specifically includes the following steps:
(1) inputting an original image as shown in fig. 5(a) or (b);
(2) calculating the energy of the original image, and the steps are as follows:
firstly, converting an image into a gray image, and then calculating the gradient amplitude of the gray image, wherein the calculation formula is as follows:
wherein,the energy of the image is represented by,、representing coordinates of pixel points,A gray-scale image is represented by a gray-scale image,the sign of the absolute value is represented,、represent images respectively at,Partial derivative in direction, wherein the energy value of the position of a corresponding pixel point in the energy of the image is the energy value of each pixel point;
(3) calculating the direction of each pixel point in the original image, and the specific steps are as follows:
(3-1) calculating the gradient direction of each pixel point in the image, wherein the calculation formula is as follows:
(2)
wherein,,,、represent images respectively at,DirectionThe partial derivative of the sum of the above,which represents the inverse tangent of the light beam,representing coordinates of pixel pointsThe direction of the gradient of (d);
(3-2) calculating the direction of each pixel point in the image, wherein the calculation formula is as follows:
wherein,representing coordinates of pixel pointsThe direction of the gradient of (a) is,the gradient direction is changed to the tangential direction,all tangential directions are directed below the horizontal,representing coordinates of pixel pointsThe direction of (d);
(4) determining a gap in the image according to the direction of each pixel point in the image, wherein the method comprises the following specific steps:
(4-1) defining gaps in the image, which are specifically as follows:
defining a gap in the vertical direction, and the expression is as follows:
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
defining a gap in the horizontal direction, and the expression is as follows:
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
(4-2) setting each pixel point in the first row in the image as the starting point of each gap respectively;
(4-3) finding the next pixel point of the gap in the image by using the priority window:
(4-3-1), defining a priority window in the image:
defining the priority window in the image as a 2 x 5 matrix window, wherein the elements of the 2 nd row in the matrix window are respectively: 5. 3, 1, 2, 4, which represent different priorities of the element positions, wherein the priorities with the highest priorities of 1, 2, 3, 4, 5 are sequentially reduced, and the priorities with the lowest priorities of 5 are sequentially reduced;
(4-3-2), determining the position of the priority window in the image:
if the direction of the starting point points to the pixel point at the lower left of the starting point, the starting point is located at the 4 th column position of the 1 st row in the priority window, as shown in fig. 4 (a);
if the direction of the starting point points to the pixel point right below the starting point, the starting point is located at the position of the 1 st row and the 3 rd column in the priority window, as shown in fig. 4 (b);
if the direction of the starting point points to the pixel point at the lower right of the starting point, the starting point is located at the position of the 1 st row and the 2 nd column in the priority window, as shown in fig. 4 (c);
determining the position of the starting point in the priority window, and then determining the position of the priority window in the image;
(4-3-3), determining the position of the next pixel point forming the gap in the image:
in the priority window, setting a pixel point where the highest-order element 1 is located in the image as a next pixel point for forming a gap, and then judging whether the position of the highest-order element 1 in the image is occupied by other gaps in the image or not;
if the position of the highest-order element 1 in the image is not occupied by other gaps in the image, the pixel point at which the position of the highest-order element 1 in the image is located is the next pixel point forming the gap;
if the position of the highest order element 1 in the image is occupied by other slits, then the pixel point at the position of element 2 in the image is the next pixel point to form a slit;
if the position of priority element 2 in the image is occupied by other slots, then the pixel at the position of element 3 in the image is the next pixel to form a slot;
if the position of priority element 3 in the image is occupied by other slots, then the pixel at the position of element 4 in the image is the next pixel to form a slot;
if the position of precedence element 4 in the image is occupied by other slots, then the pixel at the position of element 5 in the image is the next pixel to form a slot;
if the 5 element positions of the 2 nd row in the priority window are occupied by other gaps in the image, stopping determining the position of the next pixel point forming the gap in the image, and finding the next pixel point of other gaps in the image by using the priority window;
(4-4) determining a gap in the image:
judging whether the next pixel point of the gap in the image is in the last line of the image or not, if the next pixel point of the gap in the found image is not in the last line of the image, taking the next pixel point of the gap in the image as a starting point, and turning to the step (4-3-2) to determine the new position of the priority window in the image; and if the next pixel point of the gap in the found image is in the last line of the image, forming a gap in the image by all the found pixel points, and similarly, repeating the steps, finding the next pixel point of other gaps in the image by using the priority window, and determining other gaps in the image.
(5) Calculating the energy value of the gap in the image, and selecting the minimum energy valueStrip gap, minimum energy value of deletionAnd (3) strip gaps to obtain a zoomed image, which comprises the following specific steps:
(5-1) calculating the energy value of each gap according to the energy of the image obtained in the step (2) and the gap in the image determined in the step (4), wherein the calculation formula is as follows:
where s denotes a gap in the image,indicating the second over the slit sThe number of the pixel points is one,indicating the first on the slitThe energy value of each pixel point, n represents the total number of pixel points on the slit,representing an energy value of the gap;
(5-2) is provided withRespectively, the height and width of the original image,the height and width of the target image to be obtained are respectively selected, so that the energy value is minimumA stripe gap, whose expression is:whereinis the width of the original image and,in order to be the width of the target image,for example, the height and width of the original image 5(a) are 706 and 1024 respectively, and the height and width of the target image to be obtained are 706 and 768 respectively, then 1024 + 768 slots with the minimum energy value need to be selected for deletion to reach the width of the target image, so that the slot with the minimum energy value is selectedIn the slit of the strip(ii) a Arranging the energy values of the gaps in all the images in ascending order, wherein the 256 gaps with the minimum energy values are the gaps to be deleted;
(5-3) deleting gaps in the image to obtain a zoomed image:
(5-3-2), finding out from the first line in the imageIn the imageThe positions at which the pixels of a row are located, wherein,,for the height of the original image, the first of the imageMoving pixels on the right side of the position where the pixel points of the row are located one by one leftwards, and deleting the firstAll pixel points are listed; after completion, the width of the image is reduced by one, and the width of the image becomesFor example, find out from the first line of FIG. 5(a)In (1) belong toThe positions at which the pixels of a row are located, wherein,moving the pixel points on the right of the position one by one to the left by one unit, deleting all the pixel points in the 1024 th row, and after the completion, reducing the width of the image by one, wherein the width of the image is changed into 1023;
(5-3-3) similarly, the same operation as in the step (5-3-2) is performed for the gaps in the other images to be deleted, and the width of the image is reducedThe width of the image becomesFor example, after the same deletion operation is performed in step (5-3-2) for the slits in the remaining image to be deleted in fig. 5(a), the width of the image is reduced by 256, and the width of the image becomes 768, which is a scaled image obtained by deleting 256 low-energy slits from fig. 5(a), as shown in fig. 6 (a).
In order to verify the effect of the image scaling method based on the direction of the pixel points in the image, the simulation experiment carried out on the scaling method is realized by programming on a PC test platform with a CPU (Central processing Unit) of 2.0GHz and a memory of 1G. As shown in fig. 7(a), (b), two images are scaled images by the scaling method proposed by Rubinstein et al; as shown in fig. 6(a) and (b), in the drawings, two images are scaled by the scaling method of the present invention, and it can be seen that the display effect of scaling is almost the same. However, at the running time of image scaling, the same image is compared with the scaling method proposed by Rubinstein et al according to the method of the present invention at different scales, and the comparison result is shown in fig. 8, in which the horizontal axis represents the image scaling and the vertical axis represents the running time of image scaling, and the two solid curves are: the solid line with boxes is the runtime curve of the scaling method proposed by Rubinstein et al, and the solid line with dots is the runtime curve of the scaling method of the present invention. As can be seen from the comparison result in the figure, the method reduces the scaling operation time and improves the scaling operation efficiency.
In order to verify the zooming effect of the image zooming method based on the pixel point direction in the image, the zooming method is compared with the zooming method proposed by Rubinstein et al in the prior art, and 80 standard test images are respectively zoomed according to three different zooming ratios of 50%, 75% and 125%, and the zooming operation speed is shown in the data in the table 1.
TABLE 1 comparison of operating speeds of the scaling method of the present invention with existing scaling methods
It can be seen from the above table that, when the images with the same size are respectively zoomed by three zoom scales, the zoom operation speed of the present invention is obviously improved.
Claims (5)
1. An image scaling method based on pixel point directions in an image is characterized by comprising the following specific steps:
(1) inputting an original image;
(2) calculating the energy of the original image;
(3) calculating the direction of each pixel point in the original image;
(4) determining a gap in the image according to the direction of each pixel point in the image;
2. The method according to claim 1, wherein the step (2) of calculating the energy of the original image comprises the following steps:
firstly, converting an image into a gray image, and then calculating the gradient amplitude of the gray image, wherein the calculation formula is as follows:
(1)
wherein,the energy of the image is represented by,、representing coordinates of pixel points,A gray-scale image is represented by a gray-scale image,the sign of the absolute value is represented,、represent images respectively at,The partial derivative in the direction, the energy value of the corresponding pixel point position in the energy of the image is the energy value of each pixel point.
3. The image scaling method based on the pixel point direction in the image according to claim 2, wherein the step (3) of calculating the direction of each pixel point in the original image comprises the following specific steps:
(3-1) calculating the gradient direction of each pixel point in the image, wherein the calculation formula is as follows:
wherein,,,、represent images respectively at,The partial derivative in the direction of the light,which represents the inverse tangent of the light beam,representing coordinates of pixel pointsThe direction of the gradient of (d);
(3-2) calculating the direction of each pixel point in the image, wherein the calculation formula is as follows:
4. The image scaling method based on the pixel point direction in the image according to claim 3, wherein the step (4) of determining the gap in the image according to the direction of each pixel point in the image comprises the following specific steps:
(4-1) defining gaps in the image, which are specifically as follows:
defining a gap in the vertical direction, and the expression is as follows:
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
defining a gap in the horizontal direction, and the expression is as follows:
wherein,representing a gap in the image that is represented by,representing the mapping in the vertical direction and the horizontal direction respectively,corresponding to the height and width of the original image respectively,represents the sign of the absolute value;
(4-2) setting each pixel point in the first row in the image as the starting point of each gap respectively;
(4-3) finding the next pixel point of the gap in the image by using the priority window:
(4-3-1), defining a priority window in the image:
defining the priority window in the image as a 2 x 5 matrix window, wherein the elements of the 2 nd row in the matrix window are respectively: 5. 3, 1, 2, 4, which represent different priorities of the element positions, wherein the priorities with the highest priorities of 1, 2, 3, 4, 5 are sequentially reduced, and the priorities with the lowest priorities of 5 are sequentially reduced;
(4-3-2), determining the position of the priority window in the image:
if the direction of the starting point points to the pixel point at the lower left of the starting point, the starting point is positioned at the 4 th column position of the 1 st row in the priority window;
if the direction of the starting point points to the pixel point right below the starting point, the starting point is positioned at the position of the 1 st row and the 3 rd column in the priority window;
if the direction of the starting point points to the pixel point at the lower right of the starting point, the starting point is positioned at the 2 nd row position of the 1 st row in the priority window;
determining the position of the starting point in the priority window, and then determining the position of the priority window in the image;
(4-3-3), determining the position of the next pixel point forming the gap in the image:
in the priority window, setting a pixel point where the highest-order element 1 is located in the image as a next pixel point for forming a gap, and then judging whether the position of the highest-order element 1 in the image is occupied by other gaps in the image or not;
if the position of the highest-order element 1 in the image is not occupied by other gaps in the image, the pixel point at which the position of the highest-order element 1 in the image is located is the next pixel point forming the gap;
if the position of the highest order element 1 in the image is occupied by other slits, then the pixel point at the position of element 2 in the image is the next pixel point to form a slit;
if the position of priority element 2 in the image is occupied by other slots, then the pixel at the position of element 3 in the image is the next pixel to form a slot;
if the position of priority element 3 in the image is occupied by other slots, then the pixel at the position of element 4 in the image is the next pixel to form a slot;
if the position of precedence element 4 in the image is occupied by other slots, then the pixel at the position of element 5 in the image is the next pixel to form a slot;
if the 5 element positions of the 2 nd row in the priority window are occupied by other gaps in the image, stopping determining the position of the next pixel point forming the gap in the image, and finding the next pixel point of other gaps in the image by using the priority window;
(4-4) determining a gap in the image:
judging whether the next pixel point of the gap in the image is in the last line of the image or not, if the next pixel point of the gap in the found image is not in the last line of the image, taking the next pixel point of the gap in the image as a starting point, and turning to the step (4-3-2) to determine the new position of the priority window in the image; and if the next pixel point of the gap in the found image is in the last line of the image, forming a gap in the image by all the found pixel points, and similarly, repeating the steps, finding the next pixel point of other gaps in the image by using the priority window, and determining other gaps in the image.
5. The method according to claim 4, wherein said step (5) of calculating the energy value of the gap in the image selects the one with the smallest energy valueStrip gap, minimum energy value of deletionAnd (3) strip gaps to obtain a zoomed image, which comprises the following specific steps:
(5-1) calculating the energy value of the gap in the image, wherein the calculation formula is as follows:
(6)
wherein,which represents a gap in the image or images,indicating a gapToThe number of the pixel points is one,indicating the first on the slitThe energy value of each pixel point is calculated,representing the total number of pixel points on the slit,representing an energy value of the gap;
(5-2) is provided withRespectively the height and width of the original image,the height and width of the target image to be obtained are respectively selected, so that the energy value is minimumA stripe gap, whose expression is:whereinis the width of the original image and,in order to be the width of the target image,in order to select the number of the gaps needing to be deleted, the energy values of the gaps in all the images are arranged in an ascending order, and the energy value is the smallestThe strip gap is a gap to be deleted;
(5-3) deleting gaps in the image to obtain a zoomed image, which comprises the following specific steps:
(5-3-2), finding out from the first line of the imageIn the imageThe positions at which the pixels of a row are located, wherein,,is the height of the original image; the first of the imageMoving the pixel points on the right of the positions of the pixel points of the line one by one to the left, and deleting the imageAll pixel points of a column; after completion, the width of the image is reduced by one, and the width of the image becomes;
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110297826 CN102509259B (en) | 2011-09-28 | 2011-09-28 | Image scaling method based on directions of pixels in image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110297826 CN102509259B (en) | 2011-09-28 | 2011-09-28 | Image scaling method based on directions of pixels in image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102509259A true CN102509259A (en) | 2012-06-20 |
CN102509259B CN102509259B (en) | 2013-04-03 |
Family
ID=46221337
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110297826 Expired - Fee Related CN102509259B (en) | 2011-09-28 | 2011-09-28 | Image scaling method based on directions of pixels in image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102509259B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106530232A (en) * | 2016-11-10 | 2017-03-22 | 河北工业大学 | Image zooming method |
CN108447067A (en) * | 2018-03-19 | 2018-08-24 | 哈尔滨工业大学 | It is a kind of that the visible images sea horizon detection method being fitted with RANSAC is cut out based on energy seam |
CN109961079A (en) * | 2017-12-25 | 2019-07-02 | 北京君正集成电路股份有限公司 | Image detecting method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7228008B2 (en) * | 2002-09-17 | 2007-06-05 | Samsung Electronics Co., Ltd. | Method for scaling a digital image in an embedded system |
CN101179671A (en) * | 2006-11-10 | 2008-05-14 | 上海奇码数字信息有限公司 | Image scaling device and image scaling method |
CN102129666A (en) * | 2010-12-31 | 2011-07-20 | 华亚微电子(上海)有限公司 | Image scaling method and device |
-
2011
- 2011-09-28 CN CN 201110297826 patent/CN102509259B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7228008B2 (en) * | 2002-09-17 | 2007-06-05 | Samsung Electronics Co., Ltd. | Method for scaling a digital image in an embedded system |
CN101179671A (en) * | 2006-11-10 | 2008-05-14 | 上海奇码数字信息有限公司 | Image scaling device and image scaling method |
CN102129666A (en) * | 2010-12-31 | 2011-07-20 | 华亚微电子(上海)有限公司 | Image scaling method and device |
Non-Patent Citations (1)
Title |
---|
薛银珠等: "Video retargeting using optimized crop-and-scale", 《JOURNAL OF SHANGHAI UNIVERSITY》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106530232A (en) * | 2016-11-10 | 2017-03-22 | 河北工业大学 | Image zooming method |
CN106530232B (en) * | 2016-11-10 | 2019-09-06 | 河北工业大学 | A kind of image-scaling method |
CN109961079A (en) * | 2017-12-25 | 2019-07-02 | 北京君正集成电路股份有限公司 | Image detecting method and device |
CN109961079B (en) * | 2017-12-25 | 2021-06-04 | 北京君正集成电路股份有限公司 | Image detection method and device |
CN108447067A (en) * | 2018-03-19 | 2018-08-24 | 哈尔滨工业大学 | It is a kind of that the visible images sea horizon detection method being fitted with RANSAC is cut out based on energy seam |
Also Published As
Publication number | Publication date |
---|---|
CN102509259B (en) | 2013-04-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7079143B2 (en) | Waveform drawing system and method | |
US8582952B2 (en) | Method and apparatus for identifying video transitions | |
US10656811B2 (en) | Animation of user interface elements | |
US8565554B2 (en) | Resizing of digital images | |
US9582610B2 (en) | Visual post builder | |
US9159155B2 (en) | Image rendering | |
US9715501B2 (en) | Dimensional conversion in presentations | |
JP2007304576A (en) | Rendering of translucent layer | |
CN107257452A (en) | A kind of image processing method, device and computing device | |
US20130106884A1 (en) | Multiple image buffer simulation | |
CN104461439A (en) | Information processing method and electronic equipment | |
US8726185B1 (en) | Method and apparatus for rendering overlapped objects | |
CN102509259A (en) | Image scaling method based on directions of pixels in image | |
CN105427235A (en) | Image browsing method and system | |
CN111489410B (en) | Method and device for drawing shot point data of observation system | |
CN103188554A (en) | Image coding method and image coding system | |
US8704850B2 (en) | Two-dimensional object packing | |
CN110807113B (en) | Non-iterative elimination method for rectangular primitive overlap in visual layout | |
CN108389208B (en) | Intelligent image adaptive display method based on semantic segmentation | |
CN104517273A (en) | Image super-resolution processing method and apparatus | |
Wu et al. | Fast and improved seam carving with strip partition and neighboring probability constraints | |
US8861894B2 (en) | Methods and apparatus for edge-aware pixel data generation | |
JP6326914B2 (en) | Interpolation apparatus and interpolation method | |
US20140040719A1 (en) | Browser-based text fitting | |
US11532106B2 (en) | Color gradient capture from source image content |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130403 Termination date: 20150928 |
|
EXPY | Termination of patent right or utility model |