CN109658332B - Image amplification method and terminal based on streaming data processing - Google Patents

Image amplification method and terminal based on streaming data processing Download PDF

Info

Publication number
CN109658332B
CN109658332B CN201710933098.XA CN201710933098A CN109658332B CN 109658332 B CN109658332 B CN 109658332B CN 201710933098 A CN201710933098 A CN 201710933098A CN 109658332 B CN109658332 B CN 109658332B
Authority
CN
China
Prior art keywords
target
interpolation
magnification
coordinates
pixel points
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
Application number
CN201710933098.XA
Other languages
Chinese (zh)
Other versions
CN109658332A (en
Inventor
郭慧
姚毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN201710933098.XA priority Critical patent/CN109658332B/en
Publication of CN109658332A publication Critical patent/CN109658332A/en
Application granted granted Critical
Publication of CN109658332B publication Critical patent/CN109658332B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4023Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The application relates to an image amplification method and a terminal based on streaming data processing. The method comprises the following steps: obtaining an original image and a target magnification D 0 And executing S1-S3; s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2; s2, calculating the coordinates of the related original pixel points of the target pixel points in the original image according to the interpolation coordinates in sequence; after the coordinates of the relevant original pixel points of any one target pixel point are determined, the coordinates of the phase Guan Yuan pixel points are transmitted to the step S3; s3, determining the pixel value of the target pixel point according to the coordinate of the related original pixel point and the pixel value of the related original pixel point in sequence; and when the pixel values of all the target pixel points are obtained, generating a target amplified image. The method has the advantages of high data operation efficiency, short operation time and low consumption of terminal hardware resources, and is favorable for keeping the operation speed of the terminal and prolonging the service life of the terminal.

Description

Image amplification method and terminal based on streaming data processing
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image amplification method and a terminal based on streaming data processing.
Background
Image magnification refers to an image processing technique that obtains a high-pixel version of a low-pixel image from a single image, and is a common way in image processing. The detailed information in the image can be better observed by magnifying the image to a certain multiple.
In general, in the process of image enlargement, firstly, the pixel value of the original image is multiplied by the target enlargement ratio to obtain the coordinates of all target pixel points in the target enlarged image. And then, calculating the pixel value of each target pixel point to obtain a target amplified image. The process of calculating the pixel value of the target pixel point comprises the following steps: 1) Calculating the coordinate of each target pixel point in the original image according to the target amplification ratio, wherein the coordinate is usually a decimal; 2) Determining the coordinates of a plurality of original pixel points adjacent to a target pixel point in an original image by rounding the coordinates of the target pixel point in the original image; 3) And calculating the pixel value of the target pixel point by an interpolation algorithm according to the coordinate and the pixel value of the adjacent original pixel point.
However, in the above process, the pixel value of each target pixel point is usually calculated in a point-by-point calculation manner. That is to say, after the pixel value of the first target pixel point is obtained through the calculation of the steps 1) to 3), the step 1) to 3) is executed to calculate the pixel value of the second target pixel point, and so on until the pixel values of all the target pixel points are obtained through the calculation. The method has low data operation efficiency, long operation time and large consumption of terminal hardware resources, so that the operation speed of the terminal is reduced, and the method is particularly more obvious on terminals with low configuration.
Disclosure of Invention
The application provides an image amplification method and a terminal based on streaming data processing, and aims to solve the problems that in the prior art, the data operation efficiency is low, the operation time is long, the consumption of terminal hardware resources is large, and the operation speed of the terminal is slow.
In a first aspect of the present application, there is provided an image enlarging method based on streaming data processing, the method including:
obtaining an original image and a target magnification D of the original image 0 ,D 0 If the pixel number is more than 1, the pixel number of the original image is A multiplied by B, and A is the number of pixel points of each line of the original image; b is the number of each row of pixel points of the original image;
according to the target magnification factor D 0 Determining an interpolation magnification factor D and a sampling interval M;
according to the pixels A x B of the original image and the target magnification D 0 Determining destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the step (A),
Figure BDA0001429215740000011
according to the interpolation magnification D, the sampling interval M and the target coordinate (k) i ,k j ) Calculating the pixel values of all target pixel points through the steps S1 to S3:
s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2;
s2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; after the coordinates of the related original pixel points of any one target pixel point are determined, the coordinates of the related original pixel points are transmitted to the step S3;
s3, determining pixel values of all target pixel points according to the related original pixel point coordinates and the pixel values of the related original pixel points in sequence;
and when the pixel values of all the target pixel points are obtained, generating a target amplified image.
Optionally, the target magnification D is used 0 Determining an interpolation magnification D and a sampling interval M, comprising:
judging the target magnification D 0 Whether it is an integer;
if the magnification factor D is 0 Is an integer, then the interpolation magnification D = D 0 The sampling interval M =1;
if the target magnification D 0 Is decimal, and
Figure BDA0001429215740000021
is an integer, then the interpolation magnification is
Figure BDA0001429215740000022
The sampling interval pick>
Figure BDA0001429215740000023
If the target magnification D 0 Is decimal, and
Figure BDA0001429215740000024
in decimal, the interpolation magnification factor
Figure BDA0001429215740000025
The sampling interval/>
Figure BDA0001429215740000026
Optionally, the target magnification D is used 0 Determining an interpolation magnification D and a sampling interval M, comprising:
according to the target magnification factor D 0 Searching the interpolation magnification D and the sampling interval M from a preset first parameter list, wherein the first parameter list comprises the target magnification D 0 And the corresponding relation between the interpolation magnification factor D and the sampling interval M.
Optionally, the step S1 includes:
calculating the interpolation coordinate of the target pixel point in the interpolation picture frame
Figure BDA0001429215740000027
Wherein the content of the first and second substances,
Figure BDA0001429215740000028
Figure BDA0001429215740000029
optionally, the step S2 includes:
using a first formula
Figure BDA00014292157400000210
Determination of Q 1 And R 1 ,Q 1 Is the quotient of the first formula, R 1 Is the remainder of the first formula; in a second formula>
Figure BDA00014292157400000211
Determination of Q 2 And R 2 ,Q 2 Is the quotient of said second formula, R 2 Is the remainder of the second formula;
according to Q 1 And Q 2 Determining the target pixel point (k) in the original image i ,k j ) Adjacent four related original pixel points: (Q) 1 +1,Q 2 +1)、(Q 1 +1,Q 2 +2)、(Q 1 +2,Q 2 + 1) and (Q) 1 +2,Q 2 +2);
Optionally, in step S3, the determining the pixel values of all target pixel points according to the coordinates of the relevant original pixel points and the pixel values of the relevant original pixel points includes:
according to R 1 、R 2 And interpolating the magnification D to determine the target pixel point (k) i ,k j ) And (Q) 1 +1,Q 2 + 1) lateral distance dx and longitudinal distance dy;
the transverse distance
Figure BDA00014292157400000212
Said longitudinal distance pick>
Figure BDA00014292157400000213
Or, according to R 1 、R 2 And the interpolation magnification factor D, searching the transverse distance dx and the longitudinal distance dy from a preset second parameter list; the second parameter list comprises R 1 、R 2 D with dx and dy.
Optionally, the interpolation coordinate, the related original pixel point coordinate, and the pixel value corresponding to the target pixel point carry identification information, where the identification information is used to indicate the interpolation coordinate, the related original pixel point coordinate, and the target pixel point corresponding to the pixel value.
In a second aspect of the present application, there is provided an image magnification terminal based on streaming data processing, the terminal comprising:
an information acquisition unit for acquiring an original image and a target magnification D of the original image 0 ,D 0 If the pixel number is more than 1, the pixel number of the original image is A multiplied by B, and A is the number of pixel points of each line of the original image; b is the number of each row of pixel points of the original image;
a first determining unit for determining the target magnification D 0 Determining an interpolation amplification factor D and a sampling interval M;
a second determining unit for determining a target magnification D based on the pixels A × B of the original image 0 Determining destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the step (A),
Figure BDA0001429215740000031
a data processing unit for processing the interpolation magnification D, the sampling interval M and the target coordinate (k) i ,k j ) Calculating the pixel values of all target pixel points through the steps S1 to S3:
s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2;
s2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; after the coordinates of the related original pixel points of any one target pixel point are determined, the coordinates of the related original pixel points are transmitted to the step S3;
s3, determining pixel values of all target pixel points according to the related original pixel point coordinates and the pixel values of the related original pixel points in sequence;
and the image generation unit is used for generating a target amplified image when the pixel values of all target pixel points are acquired.
The technical scheme provided by the application comprises the following beneficial technical effects:
the application is based on interpolation magnification D, sampling interval M and target coordinate (k) i ,k j ) In the process of calculating the pixel value of each target pixel point in the target amplified image through the steps S1 to S3, the target coordinates are continuously transmitted to the step S1, the interpolation coordinates obtained through the calculation of the step S1 are continuously transmitted to the step S2, the coordinates of the related original pixel points obtained through the processing of the step S2 are continuously transmitted to the step S3, and the data continuously flow along the directions of the steps S1 to S3. The method has high data operation efficiency, short operation time, low consumption of terminal hardware resources, and is favorable for processing the dataThe service life of the terminal is prolonged while the running speed of the terminal is maintained.
Drawings
In order to more clearly describe the technical solution of the present application, the drawings required to be used in the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
Fig. 1 is a flowchart of an image enlarging method based on streaming data processing according to an embodiment of the present application.
Fig. 2 is an original image provided in an embodiment of the present application.
Fig. 3 is an enlarged image of a target provided in an embodiment of the present application.
Fig. 4 is a flowchart of another image enlarging method based on streaming data processing according to an embodiment of the present application.
Fig. 5 is an interpolated frame provided in an embodiment of the present application.
Detailed Description
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Example 1
Referring to fig. 1, a flowchart of an image magnifying method based on streaming data processing according to an embodiment of the present application includes steps S101 to S105. In this embodiment, an image enlarging method based on streaming data processing according to the present application will be described in detail, taking an original image with 4 × 4 pixels enlarged by 1.25 times as an example.
Step S101, obtaining an original image and a target enlargement of the original imageMultiple D 0 ,D 0 And if the number of the pixels of the original image is more than 1, the number of the pixels of each line of the original image is A multiplied by B, A is the number of the pixels of each line of the original image, and B is the number of the pixels of each column of the original image.
In this embodiment, a terminal acquires an original image, where pixels of the original image are 4 × 4, that is, the number of pixels in each row of the original image is 4, and the number of pixels in each column is also 4, specifically refer to fig. 2. Target magnification D of original image acquired by terminal 0 =1.25, the target magnification may be manually input by a keyboard, a touch screen, or the like, or may be obtained by recognizing an image magnification gesture on the touch screen, which is not limited in this application.
Step S102, according to the target magnification D 0 An interpolation magnification D and a sampling interval M are determined.
Alternatively, in the present application, step S102 may be implemented by the following method.
Judging the target magnification D 0 Whether the number is an integer;
if the magnification factor D is 0 Is an integer, then the interpolation magnification D = D 0 The sampling interval M =1.
If the target magnification D is 0 Is decimal, and
Figure BDA0001429215740000041
is an integer, then the interpolation magnification is
Figure BDA0001429215740000042
The sampling interval pick>
Figure BDA0001429215740000043
Wherein +>
Figure BDA0001429215740000044
For rounding down, e.g. based on>
Figure BDA0001429215740000045
If the target magnification D 0 Is decimal, and
Figure BDA0001429215740000046
in decimal, the interpolation magnification factor
Figure BDA0001429215740000047
The sampling interval pick>
Figure BDA0001429215740000048
In this embodiment, when the target magnification D is larger 0 Time = 1.25:
interpolation magnification
Figure BDA0001429215740000049
Sampling interval
Figure BDA00014292157400000410
Optionally, in the present application, step S102 may also be according to the target magnification D 0 Searching the interpolation magnification D and the sampling interval M from a preset first parameter list, wherein the first parameter list comprises the target magnification D 0 And the corresponding relation between the interpolation magnification factor D and the sampling interval M.
Step S103, according to the pixels A multiplied by B of the original image and the target magnification factor D 0 Determining the destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the process,
Figure BDA00014292157400000411
in this embodiment, the target coordinates of all target pixels of the target enlarged image are determined to be (k) based on 4 × 4 pixels of the original image i ,k j ) Wherein k is i =1,2,......,5;k j =1,2,......,5。
Step S104, according to the interpolation magnification factor D,The sampling interval M and the destination coordinate (k) i ,k j ) And calculating the pixel values of all target pixel points through the steps S1-S3. Please refer to fig. 4.
S1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; and after the interpolation coordinate of any one target pixel point is determined, transmitting the interpolation coordinate to the step S2.
The pixel value of the interpolation picture frame is DA multiplied by DB, wherein DA is the number of pixel points in each line of the interpolation picture frame, and DB is the number of pixel points in each row of the interpolation picture frame.
Calculating the interpolation coordinates of the target pixel points in the interpolation picture frame
Figure BDA00014292157400000412
The method comprises the following steps: calculating the abscissa of the interpolated coordinate ≥>
Figure BDA00014292157400000413
Calculating the ordinate of the interpolated coordinate
Figure BDA00014292157400000414
It should be noted that, in the present application, the target pixel points in the first row and the first column in the default target enlarged image are located in the first row and the first column in the interpolation frame.
In the present embodiment, the pixel value of the interpolation frame is 20 × 20, please refer to fig. 5 specifically. Taking a target pixel point with a target coordinate of (2,3) as an example, the abscissa X of the interpolation coordinate of the target pixel point i =1+(k i -1) · M =1+ (2-1) · 4=5; ordinate Y kj =1+(k j -1) · M =1+ (3-1) · 4=9. The coordinate of the target pixel point in the interpolated frame is (5,9).
And sequentially calculating the interpolation coordinate of each target pixel point in the interpolation picture frame according to the method, and after the interpolation coordinate of any one target pixel point is determined, transmitting the interpolation coordinate to the step S2. And then, continuously and sequentially calculating interpolation coordinates corresponding to the remaining target pixel points, and after the interpolation coordinate of any one target pixel point is determined, transmitting the interpolation coordinates to the step S2. And sequentially executing the steps until the interpolation coordinates of all the target pixel points are calculated.
Optionally, the interpolation coordinate carries identification information, and the identification information is used to indicate a target pixel point corresponding to the interpolation coordinate. Optionally, in this application, the identification information is a destination coordinate of the target pixel point.
It should be noted that, in the actual operation process of the method provided in the present application, the interpolation frame is not generated, the pixel value of each pixel point in the interpolation frame is not calculated, and the step S2 is performed only by the structural framework of the interpolation frame.
S2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; and after the coordinates of the related original pixel points of any one target pixel point are determined, transmitting the coordinates of the related original pixel points to the step S3.
The step of calculating the coordinates of the related original pixel points of the target pixel points in the original image comprises the following steps: using a first formula
Figure BDA0001429215740000051
Determination of Q 1 And R 1 ,Q 1 Is the quotient of the first formula, R 1 Is the remainder of the first formula. Takes a second formula->
Figure BDA0001429215740000052
Determination of Q 2 And R 2 ,Q 2 Is the quotient of said second formula, R 2 Is the remainder of the second formula. According to Q 1 And Q 2 Determining the target pixel point (k) in the original image i ,k j ) Adjacent four related original pixel points: (Q) 1 +1,Q 2 +1)、(Q 1 +1,Q 2 +2)、(Q 1 +2,Q 2 + 1) and (Q) 1 +2,Q 2 +2)。
In this embodiment, taking the target pixel point with the target coordinate of (2,3) as an example, the first oneA formula
Figure BDA0001429215740000053
Has a quotient of 0 and a remainder of 4. A second formula +>
Figure BDA0001429215740000054
Has a quotient of 1 and a remainder of 3. Therefore, Q in the present embodiment 1 =0,R 1 =4;Q 2 =1,R 2 And =3. The four related original pixel points adjacent to the target pixel point with the target coordinate of (2,3) in the original image are: (1,2), (1,3), (2,3), and (2,4).
And (4) calculating the coordinates of the relevant original pixel points of each target pixel point in the original image according to the method in sequence, and after the coordinates of the relevant original pixel points of any one target pixel point are determined, transmitting the coordinates of the relevant original pixel points to the step (S3). And then, continuously and sequentially calculating the coordinates of the relevant original pixel points corresponding to the remaining target pixel points, and after the coordinate of the relevant original pixel point of any one target pixel point is determined, transmitting the coordinate of the relevant original pixel point to the step S3. And sequentially executing the steps until the coordinates of the related original pixel points of all the target pixel points are calculated.
Optionally, the interpolation coordinate carries identification information, and the identification information is used to indicate a target pixel point corresponding to the interpolation coordinate. Optionally, in this application, the identification information is a destination coordinate of the target pixel point.
And S3, determining the pixel values of all the target pixel points according to the coordinates of the related original pixel points and the pixel values of the related original pixel points in sequence.
In said step, according to R 1 、R 2 And determining the target pixel point (k) in the original image by the interpolation magnification factor D i ,k j ) And (Q) 1 +1,Q 2 + 1) transverse distance dx and longitudinal distance dy,
Figure BDA0001429215740000055
or, according to R 1 、R 2 And the interpolation magnification factor D, searching the transverse distance dx and the longitudinal distance dy from a preset second parameter list; the second parameter list comprises R 1 、R 2 D with dx and dy.
In this embodiment, the horizontal distance between the pixel point with the destination coordinate (2,3) and the associated original pixel point coordinate (1,2)
Figure BDA0001429215740000061
Longitudinal distance->
Figure BDA0001429215740000062
The pixel value of the target pixel point can be calculated through various algorithms such as a bilinear interpolation algorithm, a linear interpolation algorithm, a wavelet algorithm and the like, and the method is not limited by the application. In this embodiment, the pixel value of the target pixel point is calculated according to a bilinear interpolation algorithm, which is specifically described as follows.
Obtaining four related original pixel points (1,2), (1,3), (2,3) and (2,4) of a target pixel point in an original image, and pixel values I corresponding to the four related original pixel points 1 、I 2 、I 3 And I 4
The pixel value corresponding to the target pixel point with the target coordinate of (2,3) is:
I (2,3) =(1-dx)·(1-dy)·I 1 +dx·(1-dy)·I 2 +(1-dx)·dy·I 3 +dx·dy·I 4
in this embodiment, the pixel value of each dot may be RGB (Red Green Blue), and the RGB color pattern is a color standard in the industry, and various colors are obtained by changing three color channels of Red, green, and Blue and superimposing them on each other. Of course, the pixel value may be other forms of numerical values representing the image pixel, and the application is not limited thereto.
Optionally, the pixel value carries identification information, and the identification information is used to indicate a target pixel point corresponding to the pixel value. Optionally, in this application, the identification information is a destination coordinate of the target pixel point.
It is noted that in steps S1-S3, each step still adopts the mode of streaming data processing. For example, step S1 includes a plurality of computing processes, and all data needs to be executed in sequence for all the computing processes. After any one of the data executes one of the calculation processes, the next process is entered. And sequentially executing the processes until all the data are executed to finish all the calculation processes in the step S1.
Step S105, when the pixel values of all the target pixel points are obtained, a target amplified image is generated.
And matching the pixel value of each target pixel point obtained in the step S104 with the target pixel point to generate a target amplified image. In this embodiment, the target enlarged image may be generated by matching the identification information of the pixel value with the target pixel point.
To sum up, the method provided by the application has the advantages of high data operation efficiency, short operation time and low consumption of terminal hardware resources, is favorable for keeping the operation speed of the terminal, and prolongs the service life of the terminal.
Example 2:
the embodiment of the application provides an image amplification terminal based on streaming data processing, which comprises:
an information acquisition unit for acquiring an original image and a target magnification D of the original image 0 ,D 0 If the pixel number is more than 1, the pixel number of the original image is A multiplied by B, and A is the number of pixel points of each line of the original image; b is the number of each row of pixel points of the original image;
a first determining unit for determining the target magnification D 0 Determining an interpolation magnification factor D and a sampling interval M;
a second determining unit for determining a target magnification D based on the pixels A × B of the original image 0 Determining destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the step (A),
Figure BDA0001429215740000063
a data processing unit for processing the interpolated magnification D, the sampling interval M and the target coordinate (k) i ,k j ) Calculating the pixel values of all target pixel points through the steps S1-S3:
s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2;
s2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; after the relevant original pixel point coordinates of any one target pixel point are determined, the relevant original pixel point coordinates are transmitted to the step S3;
s3, determining pixel values of all target pixel points according to the related original pixel point coordinates and the pixel values of the related original pixel points in sequence;
and the image generation unit is used for generating a target amplified image when the pixel values of all target pixel points are acquired.
Optionally, the first determining unit is further configured to:
judging the target magnification D 0 Whether the number is an integer;
if the magnification factor D is 0 Is an integer, then the interpolation magnification D = D 0 The sampling interval M =1;
if the target magnification D 0 Is decimal, and
Figure BDA0001429215740000071
is an integer, then the interpolation magnification is
Figure BDA0001429215740000072
The sampling spacing +>
Figure BDA0001429215740000073
If the target magnification D 0 Is smallIs counted, and
Figure BDA0001429215740000074
in decimal, the interpolation magnification factor
Figure BDA0001429215740000075
The sampling interval pick>
Figure BDA0001429215740000076
Optionally, the first determining unit is further configured to determine the target magnification D according to the target magnification 0 Searching the interpolation magnification D and the sampling interval M from a preset first parameter list, wherein the first parameter list comprises the target magnification D 0 And the corresponding relation between the interpolation magnification factor D and the sampling interval M.
Optionally, the data processing unit is further configured to calculate an interpolation coordinate of the target pixel point in the interpolation frame
Figure BDA0001429215740000077
Wherein it is present>
Figure BDA0001429215740000078
/>
Optionally, the data processing unit is further configured to:
using a first formula
Figure BDA0001429215740000079
Determination of Q 1 And R 1 ,Q 1 Is the quotient of the first formula, R 1 Is the remainder of the first formula; takes a second formula->
Figure BDA00014292157400000710
Determination of Q 2 And R 2 ,Q 2 Is the quotient, R, of said second formula 2 Is the remainder of the second formula;
according to Q 1 And Q 2 Determining the target pixel in the original imagePoint (k) i ,k j ) Adjacent four related original pixel points: (Q) 1 +1,Q 2 +1)、(Q 1 +1,Q 2 +2)、(Q 1 +2,Q 2 + 1) and (Q) 1 +2,Q 2 +2);
Optionally, the data processing unit is further configured to:
according to R 1 、R 2 And interpolating the magnification D to determine the target pixel point (k) i ,k j ) And (Q) 1 +1,Q 2 + 1) lateral distance dx and longitudinal distance dy;
the transverse distance
Figure BDA00014292157400000711
Said longitudinal distance pick>
Figure BDA00014292157400000712
Or, according to R 1 、R 2 And the interpolation magnification factor D, searching the transverse distance dx and the longitudinal distance dy from a preset second parameter list; the second parameter list comprises R 1 、R 2 D with dx and dy.
Optionally, the interpolation coordinate, the related original pixel point coordinate, and the pixel value corresponding to the target pixel point carry identification information, where the identification information is used to indicate the interpolation coordinate, the related original pixel point coordinate, and the target pixel point corresponding to the pixel value.
It is to be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
It will be understood that the present application is not limited to what has been described above and shown in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (6)

1. An image magnification method based on streaming data processing, the method comprising:
obtaining an original image and a target magnification D of the original image 0 ,D 0 If the pixel number is more than 1, the pixel number of the original image is A multiplied by B, and A is the number of pixel points of each line of the original image; b is the number of each row of pixel points of the original image;
according to the target magnification factor D 0 Determining an interpolation magnification factor D and a sampling interval M, specifically comprising:
judging the target magnification D 0 Whether the number is an integer;
if the magnification factor D is 0 Is an integer, then the interpolation magnification D = D 0 The sampling interval M =1;
if the target magnification D 0 Is decimal, and
Figure FDA0003970200770000011
is an integer, then the interpolation magnification is
Figure FDA0003970200770000012
The sampling interval pick>
Figure FDA0003970200770000013
If the target magnification D 0 Is decimal, and
Figure FDA0003970200770000014
in decimal, the interpolation magnification factor
Figure FDA0003970200770000015
The sampling interval pick>
Figure FDA0003970200770000016
Wherein it is present>
Figure FDA0003970200770000017
Is a rounded-down character;
according to the pixels A x B of the original image and the target magnification D 0 Determining destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the step (A),
Figure FDA00039702007700000110
according to the interpolation magnification D, the sampling interval M and the target coordinate (k) i ,k j ) Calculating the pixel values of all target pixel points through the steps S1 to S3:
s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2;
s2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; after the coordinates of the related original pixel points of any one target pixel point are determined, the coordinates of the related original pixel points are transmitted to the step S3;
s3, determining the pixel values of all the target pixel points according to the coordinates of the related original pixel points and the pixel values of the related original pixel points in sequence;
when the pixel values of all target pixel points are obtained, a target amplified image is generated;
in step S1 to step S3, each step adopts a streaming data processing mode.
2. The streaming-data-processing-based image magnification method as recited in claim 1, wherein the step S1 includes:
calculating the interpolation coordinates of the target pixel points in the interpolation picture frame
Figure FDA0003970200770000018
Wherein the content of the first and second substances,
Figure FDA0003970200770000019
3. the image magnification method based on streaming data processing according to claim 2, wherein the step S2 includes:
using a first formula
Figure FDA0003970200770000021
Determination of Q 1 And R 1 ,Q 1 Is the quotient of the first formula, R 1 Is the remainder of the first formula; takes a second formula->
Figure FDA0003970200770000022
Determination of Q 2 And R 2 ,Q 2 Is the quotient of said second formula, R 2 Is the remainder of the second formula; />
According to Q 1 And Q 2 Determining the target pixel point (k) in the original image i ,k j ) Adjacent four related original pixel points: (Q) 1 +1,Q 2 +1)、(Q 1 +1,Q 2 +2)、(Q 1 +2,Q 2 + 1) and (Q) 1 +2,Q 2 +2)。
4. The streaming-data-processing-based image magnification method as recited in claim 3, wherein the step S3 comprises:
according to R 1 、R 2 And determining the target pixel point (k) by the interpolation magnification D i ,k j ) And (Q) 1 +1,Q 2 + 1) lateral distance dx and longitudinal distance dy;
the transverse distance
Figure FDA0003970200770000023
Said longitudinal distance pick>
Figure FDA0003970200770000024
Or, according to R 1 、R 2 And the interpolation magnification factor D, searching the transverse distance dx and the longitudinal distance dy from a preset second parameter list; the second parameter list comprises R 1 、R 2 D with dx and dy.
5. The image amplification method based on streaming data processing according to claim 1, wherein the interpolation coordinates, the related original pixel point coordinates, and the pixel value corresponding to the target pixel point carry identification information, and the identification information is used to indicate the interpolation coordinates, the related original pixel point coordinates, and the target pixel point corresponding to the pixel value.
6. An image amplification terminal based on streaming data processing, comprising:
an information acquisition unit for acquiring an original image and a target magnification D of the original image 0 ,D 0 If the pixel number is more than 1, the pixel number of the original image is A multiplied by B, and A is the number of pixel points of each line of the original image; b is the number of each row of pixel points of the original image;
a first determining unit for determining the target magnification D 0 Determining interpolation magnification D and sampling interval M, in particularFor:
judging the target magnification D 0 Whether it is an integer;
if the magnification factor D is 0 Is an integer, then the interpolation magnification D = D 0 The sampling interval M =1;
if the target magnification D 0 Is decimal, and
Figure FDA0003970200770000025
is an integer, then the interpolation magnification is
Figure FDA0003970200770000026
The sampling interval pick>
Figure FDA0003970200770000027
If the target magnification D 0 Is decimal, and
Figure FDA0003970200770000028
in decimal, the interpolation magnification factor
Figure FDA0003970200770000029
The sampling interval pick>
Figure FDA00039702007700000210
Wherein +>
Figure FDA00039702007700000211
Is a rounded-down character;
a second determination unit for determining a target magnification D based on the pixels A × B of the original image 0 Determining the destination coordinates (k) of all target pixels of the target enlarged image i ,k j ) Wherein, in the step (A),
Figure FDA0003970200770000031
Figure FDA0003970200770000032
a data processing unit for processing the interpolation magnification D, the sampling interval M and the target coordinate (k) i ,k j ) Calculating the pixel values of all target pixel points through the steps S1 to S3:
s1, sequentially calculating interpolation coordinates of all target pixel points in an interpolation picture frame; after the interpolation coordinate of any one target pixel point is determined, the interpolation coordinate is transmitted to the step S2;
s2, calculating the related original pixel point coordinates of all the target pixel points in the original image according to the interpolation coordinates in sequence; after the coordinates of the related original pixel points of any one target pixel point are determined, the coordinates of the related original pixel points are transmitted to the step S3;
s3, determining pixel values of all target pixel points according to the related original pixel point coordinates and the pixel values of the related original pixel points in sequence;
the image generation unit is used for generating a target amplified image when pixel values of all target pixel points are acquired;
in step S1 to step S3, each step adopts a streaming data processing mode.
CN201710933098.XA 2017-10-10 2017-10-10 Image amplification method and terminal based on streaming data processing Active CN109658332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710933098.XA CN109658332B (en) 2017-10-10 2017-10-10 Image amplification method and terminal based on streaming data processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710933098.XA CN109658332B (en) 2017-10-10 2017-10-10 Image amplification method and terminal based on streaming data processing

Publications (2)

Publication Number Publication Date
CN109658332A CN109658332A (en) 2019-04-19
CN109658332B true CN109658332B (en) 2023-03-28

Family

ID=66108686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710933098.XA Active CN109658332B (en) 2017-10-10 2017-10-10 Image amplification method and terminal based on streaming data processing

Country Status (1)

Country Link
CN (1) CN109658332B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677554B (en) * 2019-10-31 2021-09-24 深圳市奥拓电子股份有限公司 Video amplification method and device, electronic equipment and storage medium
CN113096045A (en) * 2021-04-14 2021-07-09 深圳市元征科技股份有限公司 Bitmap stretching method, bitmap stretching device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006262305A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Pixel interpolator and pixel interpolation program
CN1901602A (en) * 2006-07-10 2007-01-24 宁波大学 Quick double linear interpolating method in image amplification process
CN102682424A (en) * 2012-01-07 2012-09-19 河南科技大学 Image amplification processing method based on edge direction difference
CN102760281A (en) * 2011-04-26 2012-10-31 撖龙 Image resizing method
CN103236035A (en) * 2013-03-28 2013-08-07 浙江大学 Image magnification algorithm on basis of zero-offset bilateral quadratic B-spline interpolation
CN106412548A (en) * 2016-10-21 2017-02-15 凌云光技术集团有限责任公司 Color error correction method and device applied to three-line array camera

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006262305A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Pixel interpolator and pixel interpolation program
CN1901602A (en) * 2006-07-10 2007-01-24 宁波大学 Quick double linear interpolating method in image amplification process
CN102760281A (en) * 2011-04-26 2012-10-31 撖龙 Image resizing method
CN102682424A (en) * 2012-01-07 2012-09-19 河南科技大学 Image amplification processing method based on edge direction difference
CN103236035A (en) * 2013-03-28 2013-08-07 浙江大学 Image magnification algorithm on basis of zero-offset bilateral quadratic B-spline interpolation
CN106412548A (en) * 2016-10-21 2017-02-15 凌云光技术集团有限责任公司 Color error correction method and device applied to three-line array camera

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图像插值放大方法的研究与应用;江风莲等;《制造业自动化》;20110110(第01期);全文 *

Also Published As

Publication number Publication date
CN109658332A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
JP5642653B2 (en) Adaptive color interpolation
CN106204441B (en) Image local amplification method and device
KR20180050054A (en) Electronic apparatus, display apparatus and control method thereof
CN109919847B (en) Method for improving quality of amplified image
CN109658332B (en) Image amplification method and terminal based on streaming data processing
CN109493826B (en) Electronic display boundary gain system and method
CN103546664A (en) Method and device for converting image resolution, and electronic device having the device
CN114298900A (en) Image super-resolution method and electronic equipment
JP6251029B2 (en) Control device, image processing device, control method, and program
WO2018049754A1 (en) Color gamut maintaining system and method
CN108230454B (en) Panorama picture cutting method and device and storage medium
CN104680484A (en) Image enhancement method and device
CN106296614B (en) Image processing apparatus and image processing method
WO2010051719A1 (en) Method for magnifying video image 4/3 times
US9619864B2 (en) Image processing apparatus and method for increasing sharpness of images
US8577185B2 (en) Apparatus and method for interpolating and rendering image on mobile devices
CN111093045B (en) Method and device for scaling video sequence resolution
CN110969675B (en) Method for simulating blurring of different-shape diaphragms of camera
JP2016158223A (en) Image compression device, image compression method and image compression program
JP2007286869A (en) Interpolation method and resolution conversion device
CN1965568A (en) Method and apparatus for vertically scaling pixel data
JP2016095667A (en) Image processing device and electronics apparatus
CN110825480A (en) Picture display method and device, electronic equipment and computer readable storage medium
US20120099801A1 (en) Sharpness in Digital Images
CN105447816A (en) Multichannel image magnification method and multichannel image magnification device

Legal Events

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

Address after: 100094 Beijing city Haidian District Cui Hunan loop 13 Hospital No. 7 Building 7 room 701

Applicant after: Lingyunguang Technology Co.,Ltd.

Address before: 100094 Beijing city Haidian District Cui Hunan loop 13 Hospital No. 7 Building 7 room 701

Applicant before: LUSTER LIGHTTECH GROUP Co.,Ltd.

GR01 Patent grant
GR01 Patent grant