CN104331861B - Image rotating method and system - Google Patents

Image rotating method and system Download PDF

Info

Publication number
CN104331861B
CN104331861B CN201410648779.8A CN201410648779A CN104331861B CN 104331861 B CN104331861 B CN 104331861B CN 201410648779 A CN201410648779 A CN 201410648779A CN 104331861 B CN104331861 B CN 104331861B
Authority
CN
China
Prior art keywords
image
piecemeal
pixel
rotated
row
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
CN201410648779.8A
Other languages
Chinese (zh)
Other versions
CN104331861A (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.)
Vtron Group Co Ltd
Original Assignee
Vtron Technologies 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 Vtron Technologies Ltd filed Critical Vtron Technologies Ltd
Priority to CN201410648779.8A priority Critical patent/CN104331861B/en
Publication of CN104331861A publication Critical patent/CN104331861A/en
Application granted granted Critical
Publication of CN104331861B publication Critical patent/CN104331861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/602Rotation of whole images or parts thereof by block rotation, e.g. by recursive reversal or rotation

Landscapes

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

Abstract

The present invention provides a kind of image rotating method and system, and the image rotating method includes:Put in order, will be respectively stored in image to be rotated per a line pixel in image buffer storage area in default each size identical piecemeal by the row of image to be rotated;Wherein, the line number of the piecemeal is equal to the line number divided by default piecemeal width of the image to be rotated, and the columns of the piecemeal is equal to the columns divided by the piecemeal width of the image to be rotated;Put in order by piecemeal each described, extract the pixel of same position in each piecemeal, and the one-row pixels point in postrotational image is constituted according to the default anglec of rotation, obtain postrotational image.The treatment effeciency of the present invention is higher, the speed of image rotation processing.

Description

Image rotating method and system
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of image rotating method, and a kind of rotation of image Transfer from one department to another system.
Background technology
In image processing field, it is often necessary to image is done and rotated, image rotation is usually first to be written to entire image In the buffering area of memory, in such as DDR (Double Data Rate, Double Data Rate synchronous DRAM), Ran Houcong Image reading is come out by the requirement of rotation in the image stored in DDR, image rotation operation is completed.DDR storages include row ground Location, column address, regional address, each row address saltus step and block address saltus step are required for multiple clock cycle to send address saltus step Order.
Traditional spinning solution is that by order corresponding with DDR address files image is write into DDR, such as Fig. 1 by image, is schemed In (i, j) represent a pixel, write instruction is sent during write-in, is started from first pixel (1,1), from top to bottom from a left side Turn right and successively write pixel into DDR by its position in the picture, this method write efficiency is high, as long as sending one Secondary address saltus step order can just complete the write operation of a line.
But its reading efficiency is extremely low, as shown in Fig. 2 being rotated by 90 ° to the right with the image of the row of 4 row 4 and to anticlockwise Illustrated exemplified by 90 °, Fig. 2 B are the pixel arrangement schematic diagram in image to be rotated, and Fig. 2A is image to be rotated to anticlockwise Image after 90 degree, Fig. 2 C are to the image after being rotated by 90 ° after rotation image;
In the image of the pixel of same row after rotation it is same in source images when as shown in Figure 2, due to image rotation Capable pixel is to obtain postrotational image;, need to be first from buffer area to obtain every a line pixel of rotated image A pixel is read in row, the second row is then jumped to again and reads a pixel;It that is to say, it is necessary to which often row is read from buffer area One pixel constitutes every a line pixel of rotated image, i.e., often read a pixel and be required for sending row address saltus step life Order, it may thus be appreciated that its row address transition times is line number and the product of columns, the overall efficiency of the read-write of this method when reading Very low, image rotation processing speed is slower.
The content of the invention
Based on this, the present invention provides a kind of image rotating method and system, and treatment effeciency is higher, the speed of image rotation processing Degree is very fast.
A kind of image rotating method, comprises the following steps:
Put in order by the row of image to be rotated, image buffer storage will be respectively stored in per a line pixel in image to be rotated In area in default each size identical piecemeal;Wherein, the line number of the piecemeal is removed equal to the line number of the image to be rotated With default piecemeal width, the columns of the piecemeal is equal to the columns divided by the piecemeal width of the image to be rotated;
Put in order by piecemeal each described, extract the pixel of same position in each piecemeal, and according to default The anglec of rotation constitutes the one-row pixels point in postrotational image, obtains postrotational image.
A kind of image rotating system, including:
Memory module, puts in order for the row by image to be rotated, and will distinguish in image to be rotated per a line pixel It is stored in image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal is waited to revolve equal to described Turn the line number divided by default piecemeal width of image, the columns of the piecemeal is equal to the columns of the image to be rotated divided by described Piecemeal width;
Extraction module, for being put in order by piecemeal each described, extracts the pixel of same position in each piecemeal, And the one-row pixels point in postrotational image is constituted according to the default anglec of rotation, obtain postrotational image.
Above-mentioned image rotating method and system, the pixel of same row is after rotation during due to image rotation, in source images Image in be same a line pixel;Image buffer storage zoning is divided into multiple size identical piecemeals, each piecemeal by the present invention Line number be equal to the line number divided by default piecemeal width of image rotate, the columns of the piecemeal be equal to described in wait to rotate The columns of image divided by the piecemeal width;When being stored to source images, every a line pixel of image to be rotated is stored in In each piecemeal;Then every a line pixel in image buffer storage area, is made up of multiple pixels of the first row of source images, then by Multiple pixels of second row of source images are constituted, by that analogy;Therefore when being rotated, extract same in each piecemeal every time The pixel of one position simultaneously constitutes the one-row pixels point in postrotational image, i.e. rotated image in reading according to the anglec of rotation During pixel, multiple pixels can be extracted from image buffer storage area often row pixel and constitute one-row pixels points, and prior art In per a line each pixel extracted from different rows, present invention significantly reduces the saltus step of row address, improve The efficiency of image rotation.
Brief description of the drawings
Fig. 1 is the arrangement schematic diagram of pixel in image.
Fig. 2 is to be rotated by 90 ° the image of the row of 4 row 4 and the schematic diagram that is rotated by 90 ° to the left to the right in conventional art.
Fig. 3 is schematic flow sheet of the image rotating method of the present invention in embodiment one.
Fig. 4 is the image schematic diagram that resolution ratio is 1027 × 768.
Fig. 5 is the schematic diagram that pixel is stored in buffer area using Fig. 3 methods by Fig. 4.
Fig. 6 is the schematic diagram that Fig. 4 is rotated by 90 °.
Fig. 7 is structural representation of the image rotating system of the present invention in embodiment three.
Embodiment
The present invention is described in further detail with reference to embodiment and accompanying drawing, but embodiments of the present invention are not limited to This.
Embodiment one,
As shown in figure 3, being schematic flow sheet of the image rotating method of the present invention in embodiment one, comprise the following steps:
Step S31, put in order by the row of image to be rotated, will be respectively stored in image to be rotated per a line pixel In image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal is equal to the image to be rotated Line number divided by default piecemeal width, the columns divided by the piecemeal that the columns of the piecemeal is equal to the image to be rotated be wide Degree;
Step S32, put in order by piecemeal each described, extract the pixel of same position in each piecemeal, and root The one-row pixels point in postrotational image is constituted according to the default anglec of rotation, postrotational image is obtained;
The image rotating method of the present embodiment, the pixel of same row is after rotation during due to image rotation, in source images Image in be same a line pixel;Image buffer storage zoning is divided into multiple size identical piecemeals by the present embodiment first, often The line number of individual piecemeal is equal to the line number divided by default piecemeal width of the image to be rotated, and the columns of the piecemeal is equal to described The columns of image to be rotated divided by the piecemeal width;
When treating rotation image storage, every a line pixel of image to be rotated is stored in each piecemeal;Then image Every a line pixel in buffer area, includes multiple pixels do not gone together in source images;For example, image buffer storage area includes Multiple piecemeals, then image buffer storage area the first row pixel, is made up of multiple pixels of the first row of source images, then by source images The second row multiple pixels constitute, by that analogy;Therefore when being rotated, same position in each piecemeal is extracted every time Pixel and the one-row pixels point in postrotational image, i.e. rotated image constituted according to the anglec of rotation reading pixel When, multiple pixels can be extracted from image buffer storage area often row pixel and constitute one-row pixels point, and it is each in the prior art Each pixel of row is extracted from different rows, and the present embodiment significantly reduces the saltus step of row address, improves image The efficiency of rotation.
For step S31, put in order, will respectively be deposited per a line pixel in image to be rotated by the row of image to be rotated Storage is in image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal is waited to rotate equal to described The line number of image divided by default piecemeal width, the columns of the piecemeal is equal to the columns of the image to be rotated divided by described point Block width;
The image buffer storage area of the present embodiment, refers to the storage region in memory (such as DDR), including row address, column address, Regional address etc.;In image processing field, image is done and the processing such as rotates, be all to open up a buffer area in memory to be used to deposit The pixel of image is stored up, the ranks size in image buffer storage area is identical with the ranks number of image to be rotated.
The piecemeal of the present embodiment, is the buffer zone of the formed objects one by one in described image buffer area;According to default Piecemeal width, the line number of the piecemeal is equal to the line number divided by default piecemeal width of the image to be rotated, the piecemeal Columns be equal to the columns divided by the piecemeal width of the image to be rotated;For example, being treated for resolution ratio for 1024 × 768 Image is rotated, default piecemeal width is 32, then piecemeal line number is 768/32=24 rows, and piecemeal columns arranges for 1024/32=32, Then storable pixel total number is equal to the pixel total number of a line of image to be rotated in each piecemeal, to ensure to wait to revolve Turn the pixel in image per a line to be all just stored in a piecemeal;Piecemeal width determines the size and number of piecemeal, It can be set according to the resolution sizes of image to be rotated, the present embodiment is not specifically limited.
Storing when the pixel of image is rotated, with the prior art image buffer storage area will be stored in per a line pixel In same a line in it is different, the present embodiment is that every a line pixel is stored in same piecemeal;
Specifically, it is described will be respectively stored in per a line pixel in image to be rotated it is default each in image buffer storage area Step in size identical piecemeal may include:
Many parts will be divided into according to the piecemeal width per a line pixel;
Every a pixel is stored in sequence in every a line of the piecemeal.
In the present embodiment, each size identical piecemeal in image buffer storage area, the line number of piecemeal is waited to rotate equal to described The line number of image divided by default piecemeal width, that is to say, in image buffer storage area in the row direction, averagely be divided by piecemeal width Many parts;Therefore one-row pixels point is averagely divided into M parts by the present embodiment according to piecemeal width, then per a pixel accordingly It is stored in a line of piecemeal;Store after the first row pixel, read the second row, the second row pixel is stored in second point In block, by that analogy, each row pixel is stored in sequence in piecemeal;The storing process of the pixel of second row and other rows Also in this way, being all divided into many parts per a line pixel, every a pixel is stored in sequence in every a line of the piecemeal In.
For step S32, put in order by piecemeal each described, extract the pixel of same position in each piecemeal, And the one-row pixels point in postrotational image is constituted according to the default anglec of rotation, obtain postrotational image;
During due to image rotation, as shown in Fig. 2 in the image of the pixel of same row being after rotation same in source images Capable pixel;The present embodiment is in storage, and every a line pixel of image to be rotated is stored in each piecemeal;Then scheme As every a line pixel in buffer area, include multiple pixels do not gone together in source images;For example, image buffer storage area includes Multiple piecemeals, then image buffer storage area the first row pixel, is made up of multiple pixels of the first row of source images, then by source figure Multiple pixels of second row of picture are constituted, by that analogy.
Specifically, the anglec of rotation in the present embodiment, refers to centered on the central point of image to be rotated to right rotation 90 Degree is rotated by 90 ° to the left;
It is described to be put in order by piecemeal each described, the pixel of same position in each piecemeal is extracted, and according to pre- If the anglec of rotation constitute one-row pixels point in postrotational image, the step of obtaining postrotational image may include:Work as institute The anglec of rotation is stated when being rotated by 90 ° to the left, to extract the pixel of the P position in each piecemeal;By all piecemeals extracted The pixel of same position constitutes the Q row pixels of rotated image;Wherein, the P is equal with Q;Each in Q row pixels Pixel put in order with each described piecemeal put in order it is opposite;
It may also comprise:When the anglec of rotation is, to during right rotation, to extract the pixel of the P position in each piecemeal; The pixel of all piecemeal same positions extracted is constituted to the Q row pixels of rotated image;Wherein, the Q is equal to institute State and add 1 after the columns of rotation image subtracts P;Each pixel puts in order and each Suo Shu points in Q row pixels Putting in order for block is identical;Above-mentioned P, Q represents the ranks number of pixel in image, and P, Q are positive integer.
As shown in Fig. 2 when image is rotated by 90 ° to the right, the pixel in source images per a line becomes in rotated image Each row, also, the first row to Nth row becomes Nth column in rotated image to first row in source images, and its order is firm It is good on the contrary, but in each column pixel incremental order it is identical with source images;
Similarly, when image is rotated by 90 ° to the left, the pixel in source images per a line becomes every in rotated image One row, the first row to Nth row becomes first row in the rotated image pixel into Nth column, but each column in source images Incremental order is opposite with source images.
The present embodiment is in storage, and every a line pixel of image to be rotated is sequentially stored in each piecemeal;Therefore exist When generating postrotational image, every a line pixel in postrotational image, is the pixel of the same position in each piecemeal What point was constituted;And include the pixel of multiple piecemeals in image buffer storage area per a line pixel, therefore can be from every row pixel In extract multiple pixels and constitute one-row pixels points, and per a line, each pixel is all from different rows in the prior art Extract, the present embodiment significantly reduces the saltus step of row address, improves the efficiency of image rotation.
Embodiment two,
The present embodiment is said so that resolution ratio carries out 90 ° of rotations for 1024 × 768 image using the method for embodiment one as an example It is bright;Resolution ratio 1024 × 768, refers to that every a line has 1024 pixels, each to show 768 pixels, image has 768 OK, 1024 row, i.e. line number are 768, and columns is 1024;As shown in figure 4, being the schematic diagram of the image to be rotated of the present embodiment;
First, put in order by the row of image to be rotated, figure will be respectively stored in per a line pixel in image to be rotated As in default each piecemeal in buffer area;
Schematic diagram after storage is as shown in Figure 5;The ranks size in image buffer storage area is identical with the ranks number of image to be rotated; The piecemeal width of the present embodiment is 32, then piecemeal line number is 768/32=24 rows, and piecemeal columns arranges for 1024/32=32, by Fig. 5 It can be seen that, image buffer storage area is arranged in order division by the piecemeal of 24 × 32 formed objects and constituted, storable in each piecemeal Pixel total number, equal to the one-row pixels point total number of image to be rotated;Specifically, piecemeal width can according to actual needs and Setting, the numerical value such as 16,24;Piecemeal width need to be the line number of image to be rotated and the common divisor of columns, to obtain integer value Piecemeal line number and columns.
As shown in figure 5, being that every a line pixel is stored in same piecemeal;Such as in Fig. 5 first piecemeal, storage Be (1,1), (2,1) ... (1024,1) pixel;Wherein, according to piecemeal width, line number and the columns difference of each piecemeal For 24 and 32, then the first row pixel is equally divided into 32 parts, and first piecemeal is respectively stored in per 32 pixels of portion In per a line;I.e. (1,1), (2,1) ... (32,1) pixel are stored in the first row of piecemeal, (32,1), (33,1) ... (64,1) pixel is stored in the second row of piecemeal, by that analogy;
Second piecemeal is come after first piecemeal, and the order of its columns is identical with first piecemeal;Second piecemeal Store the second row pixel of image to be rotated;As shown in figure 5, the second row pixel is (1,2), (2,2) ... (1024,2); Identical with first piecemeal, according to piecemeal width, the line number and columns of each piecemeal are respectively 32 and 24, then the second row pixel 32 parts are equally divided into, is respectively stored in per 32 pixels of portion in every a line of second piecemeal;I.e. (1,2), (2, 2) ... (32,2) pixel is stored in the first row of piecemeal, and (32,2), (33,2) ... (64,2) pixel are stored in piecemeal The second row, by that analogy.
Then, put in order by piecemeal each described, extract the pixel of same position in each piecemeal, and according to pre- If the anglec of rotation constitute one-row pixels point in postrotational image, obtain postrotational image;Postrotational image such as Fig. 6 Shown, Fig. 6 is the schematic diagram that Fig. 5 is rotated by 90 °, and Fig. 6 A are the schematic diagram being rotated by 90 ° to the left, and Fig. 6 B are showing for being rotated by 90 ° to the right It is intended to;
When image is rotated by 90 ° to the right, the pixel in source images per a line becomes each row in rotated image, Also, the first row to the 768th row becomes in rotated image in source images the 768th is arranged to first row, and it puts in order just It is good on the contrary, but in each column pixel incremental order it is identical with source images;
Similarly, when image is rotated by 90 ° to the left, the pixel in source images per a line becomes every in rotated image One row, the first row to the 768th row becomes first row in rotated image to the 768th row in source images, but pixel in each column The incremental order of point is opposite with source images.
The pixel of a line in postrotational image, is made up of each row pixel of source images;And in Figure 5 Image buffer storage area, every a line pixel of image to be rotated is stored in each piecemeal;It is then each in image buffer storage area Row pixel, includes multiple pixels do not gone together in source images;That is in Fig. 5, the first row is first piecemeal to the 24th In piecemeal, 32 pixels composition of each piecemeal;
Although Fig. 6 A and Fig. 6 B be different conversion directions, but in source images same row pixel image after rotation In be same a line pixel;When the every a line for the rotated image that pixel pie graph 6 is extracted in the image buffer storage area from Fig. 5 During pixel, constituted after the pixel for the same position that each piecemeal can be read respectively;Such as the first of Fig. 6 A rotated image OK, after the pixel of first position that each piecemeal can be read, according to the anglec of rotation being rotated by 90 ° to the left, constitute after rotation The first row pixel of image:(1,768) ... (1,2), (1,1);Second row of rotated image, can be read each piecemeal After the pixel of second position, constituted according to the anglec of rotation being rotated by 90 ° to the left;By that analogy;
Thus, it can be known that the present embodiment is when rotated, 32 pixels can be extracted from the often row pixel in image buffer storage area Point constitutes the one-row pixels point of rotated image, and the row address transition times that reading postrotational a line image needs are 768/32 =24 times.
Assuming that rotation image is treated, during write-in image buffer storage area when row address saltus step and reading required for row address saltus step Time is t, then required address bound-time writes row address bound-time for a two field picture when completing two field picture rotation (32 × 768t) reads row address bound-time (24 × 1024t) plus a two field picture
That is, 32 × 768t+24 × 1024t=49152t;
And traditional spinning solution is used, two field picture write-in row address bound-time is 768t, is needed during reading from every A line reads a pixel, reads row address bound-time 768x1024t, and total bound-time is 768t+768x1024t= 787200t, is 16 times of the present embodiment method;The present embodiment method significantly improves overall process efficiency.
Embodiment three,
As shown in fig. 7, be structural representation of the image rotating system of the present invention in embodiment three, including:
Memory module 71, puts in order for the row by image to be rotated, and will divide in image to be rotated per a line pixel It is not stored in image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal is equal to described treat The line number divided by default piecemeal width of image are rotated, the columns of the piecemeal is equal to columns divided by the institute of the image to be rotated State piecemeal width;
Extraction module 72, for being put in order by piecemeal each described, extracts the pixel of same position in each piecemeal Point, and the one-row pixels point in postrotational image is constituted according to the default anglec of rotation, obtain postrotational image;
The image rotating system of the present embodiment, the pixel of same row is after rotation during due to image rotation, in source images Image in be same a line pixel;Image buffer storage zoning is divided into multiple size identical piecemeals by the present embodiment first, often The line number of individual piecemeal is equal to the line number divided by default piecemeal width of the image to be rotated, and the columns of the piecemeal is equal to described The columns of image to be rotated divided by the piecemeal width;
When treating rotation image storage, every a line pixel of image to be rotated is stored in each piecemeal;Then image Every a line pixel in buffer area, includes multiple pixels do not gone together in source images;Such as image buffer storage area includes many Individual piecemeal, then image buffer storage area the first row pixel, is made up of multiple pixels of the first row of source images, then by source images Multiple pixels of second row are constituted, by that analogy;Therefore when being rotated, same position in each piecemeal is extracted every time Pixel simultaneously constitutes the one-row pixels point in postrotational image, i.e. rotated image in reading pixel according to the anglec of rotation When, multiple pixels can be extracted from image buffer storage area often row pixel and constitute one-row pixels point, and it is each in the prior art Each pixel of row is extracted from different rows, and the present embodiment significantly reduces the saltus step of row address, improves image The efficiency of rotation.
For memory module 71, put in order, will divide in image to be rotated per a line pixel by the row of image to be rotated It is not stored in image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal is equal to described treat The line number divided by default piecemeal width of image are rotated, the columns of the piecemeal is equal to columns divided by the institute of the image to be rotated State piecemeal width;
The image buffer storage area of the present embodiment, refers to the storage region in memory (such as DDR), including row address, column address, Regional address etc.;In image processing field, image is done and the processing such as rotates, be all to open up a buffer area in memory to be used to deposit The pixel of image is stored up, the ranks size in image buffer storage area is identical with the ranks number of image to be rotated.
The piecemeal of the present embodiment, is the buffer zone of the formed objects one by one in described image buffer area;According to default Piecemeal width, the line number of the piecemeal is equal to the line number divided by default piecemeal width of the image to be rotated, the piecemeal Columns be equal to the columns divided by the piecemeal width of the image to be rotated;For example, being treated for resolution ratio for 1024 × 768 Image is rotated, default piecemeal width is 32, then piecemeal line number is 768/32=24 rows, and piecemeal columns arranges for 1024/32=32, Then storable pixel total number in each piecemeal, equal to the pixel total number of a line of image to be rotated, is treated with guarantee Pixel in rotation image per a line is all just stored in a piecemeal;Piecemeal width determine piecemeal size and Number, can set, the present embodiment is not specifically limited according to the resolution sizes of image to be rotated.
Storing when the pixel of image is rotated, with the prior art image buffer storage area will be stored in per a line pixel In same a line in it is different, the present embodiment is that every a line pixel is stored in same piecemeal;
Specifically, the memory module 71 can be additionally used in:It will be divided into according to the piecemeal width per a line pixel Many parts, every a pixel is stored in sequence in every a line of the piecemeal;
In the present embodiment, each size identical piecemeal in image buffer storage area, the line number of the piecemeal is equal to described treat The line number divided by default piecemeal width of image are rotated, that is to say, in image buffer storage area in the row direction, be averaged by piecemeal width Many parts are divided;Therefore one-row pixels point is averagely divided into M parts by the present embodiment according to piecemeal width, then per a pixel pair It is stored in a line of piecemeal with answering;Store after the first row pixel, read the second row, the second row pixel is stored in the In two piecemeals, by that analogy, each row pixel is stored in sequence in piecemeal;The storage of the pixel of second row and other rows Every a pixel is stored in sequence in the every of the piecemeal by process also in this way, be all divided into many parts per a line pixel In a line.
For extraction module 72, put in order by piecemeal each described, extract the pixel of same position in each piecemeal Point, and the one-row pixels point in postrotational image is constituted according to the default anglec of rotation, obtain postrotational image;
During due to image rotation, as shown in Fig. 2 in the image of the pixel of same row being after rotation same in source images Capable pixel;The present embodiment is in storage, and every a line pixel of image to be rotated is stored in each piecemeal;Then scheme As every a line pixel in buffer area, include multiple pixels do not gone together in source images;As image buffer storage area includes Multiple piecemeals, then image buffer storage area the first row pixel, is made up of multiple pixels of the first row of source images, then by source images The second row multiple pixels constitute, by that analogy;
Specifically, the anglec of rotation in the present embodiment, refers to centered on the central point of image to be rotated to right rotation 90 Degree is rotated by 90 ° to the left;
The extraction module 72 can be used for:When the anglec of rotation is to be rotated by 90 ° to the left, P in each piecemeal is extracted The pixel of individual position;The pixel of all piecemeal same positions extracted is constituted to the Q row pixels of rotated image;Its In, the P is equal with Q;The phase that puts in order put in order with piecemeal each described of each pixel in Q row pixels Instead;
It can also be used for:When the anglec of rotation is, to during right rotation, to extract the pixel of the P position in each piecemeal; The pixel of all piecemeal same positions extracted is constituted to the Q row pixels of rotated image;Wherein, the Q is equal to institute State and add 1 after the columns of rotation image subtracts P;Each pixel puts in order and each Suo Shu points in Q row pixels Putting in order for block is identical;
As shown in Fig. 2 when image is rotated by 90 ° to the right, the pixel in source images per a line becomes in rotated image Each row, also, the first row to Nth row becomes Nth column in rotated image to first row in source images, and its order is firm It is good on the contrary, but in each column pixel incremental order it is identical with source images;
Similarly, when image is rotated by 90 ° to the left, the pixel in source images per a line becomes every in rotated image One row, the first row to Nth row becomes first row in the rotated image pixel into Nth column, but each column in source images Incremental order is opposite with source images.
The present embodiment is in storage, and every a line pixel of image to be rotated is sequentially stored in each piecemeal;Therefore exist When generating postrotational image, every a line pixel in postrotational image, is the pixel of the same position in each piecemeal What point was constituted;And include the pixel of multiple piecemeals in image buffer storage area per a line pixel, therefore can be from every row pixel In extract multiple pixels and constitute one-row pixels points, and per a line, each pixel is all from different rows in the prior art Extract, the present embodiment significantly reduces the saltus step of row address, improves the efficiency of image rotation.
Image rotating method of the present invention and system, during due to image rotation, the pixel of same row is in rotation in source images It is the pixel of same a line in image afterwards;Image buffer storage zoning is divided into multiple size identical piecemeals, Mei Gefen by the present invention The line number of block is equal to the line number divided by default piecemeal width of the image to be rotated, and the columns of the piecemeal is waited to revolve equal to described Turn the columns divided by the piecemeal width of image;When being stored to source images, every a line pixel of image to be rotated is storage In each piecemeal;Then every a line pixel in image buffer storage area, is made up of multiple pixels of the first row of source images, then It is made up of multiple pixels of the second row of source images, by that analogy;Therefore when being rotated, extract every time in each piecemeal The pixel of same position simultaneously constitutes the one-row pixels point in postrotational image, i.e. rotated image in reading according to the anglec of rotation During capture vegetarian refreshments, multiple pixels can be extracted from image buffer storage area often row pixel and constitute one-row pixels points, and existing skill Per a line, each pixel is extracted from different rows in art, present invention significantly reduces the saltus step of row address, is improved The efficiency of image rotation.
Embodiment described above only expresses the several embodiments of the present invention, and it describes more specific and detailed, but simultaneously Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (6)

1. a kind of image rotating method, it is characterised in that comprise the following steps:
Put in order, will be respectively stored in image to be rotated per a line pixel in image buffer storage area by the row of image to be rotated In default each size identical piecemeal;Wherein, the line number of the piecemeal is equal to the line number divided by advance of image rotate If piecemeal width, the columns of the piecemeal is equal to the columns divided by the piecemeal width of the image to be rotated;
Put in order by piecemeal each described, extract the pixel of same position in each piecemeal, and according to default rotation Angle constitutes the one-row pixels point in postrotational image, obtains postrotational image;
It is described to be respectively stored in default each size identical in image buffer storage area per a line pixel in image to be rotated Step in piecemeal includes:
Many parts will be divided into according to the piecemeal width per a line pixel;
Every a pixel is stored in sequence in every a line of the piecemeal;
The anglec of rotation is to be rotated by 90 ° to the right or be rotated by 90 ° to the left centered on the central point of image to be rotated.
2. image rotating method according to claim 1, it is characterised in that the arrangement by each piecemeal is suitable Sequence, extracts the pixel of same position in each piecemeal, and one in the postrotational image of default anglec of rotation composition Row pixel, the step of obtaining postrotational image includes:
When the anglec of rotation is to be rotated by 90 ° to the left, the pixel of the P position in each piecemeal is extracted;By what is extracted The pixel of all piecemeal same positions constitutes the Q row pixels of rotated image;Wherein, the P is equal with Q;Q row pixels In point each pixel put in order with each described piecemeal put in order it is opposite.
3. image rotating method according to claim 1, it is characterised in that the arrangement by each piecemeal is suitable Sequence, extracts the pixel of same position in each piecemeal, and one in the postrotational image of default anglec of rotation composition Row pixel, the step of obtaining postrotational image includes:
When the anglec of rotation is to be rotated by 90 ° to the right, the pixel of the P position in each piecemeal is extracted;By what is extracted The pixel of all piecemeal same positions constitutes the Q row pixels of rotated image;Wherein, the Q treats rotation figure equal to described The columns of picture, which is subtracted, adds 1 after P;The arrangement put in order with piecemeal each described of each pixel is suitable in Q row pixels Sequence is identical.
4. a kind of image rotating system, it is characterised in that including:
Memory module, puts in order for the row by image to be rotated, and will respectively be stored per a line pixel in image to be rotated In image buffer storage area in default each size identical piecemeal;Wherein, the line number of the piecemeal treats rotation figure equal to described The line number of picture divided by default piecemeal width, the columns of the piecemeal are equal to the columns divided by the piecemeal of the image to be rotated Width;
Extraction module, for being put in order by piecemeal each described, extracts the pixel of same position in each piecemeal, and root The one-row pixels point in postrotational image is constituted according to the default anglec of rotation, postrotational image is obtained;
The memory module is additionally operable to:Many parts will be divided into per a line pixel according to the piecemeal width, will be per a picture Vegetarian refreshments is stored in sequence in every a line of the piecemeal;
The anglec of rotation is to be rotated by 90 ° to the right or be rotated by 90 ° to the left centered on the central point of image to be rotated.
5. image rotating system according to claim 4, it is characterised in that the extraction module is additionally operable to:When the rotation Gyration is when being rotated by 90 ° to the left, to extract the pixel of m-th position in each piecemeal;All piecemeals extracted are same The pixel of position constitutes the nth row of pixels of rotated image;Wherein, the N is equal with M;Each pixel in nth row of pixels point Point put in order with each described piecemeal put in order it is opposite.
6. image rotating system according to claim 4, it is characterised in that the extraction module is additionally operable to:When the rotation Gyration is, to during right rotation, to extract the pixel of m-th position in each piecemeal;By all piecemeal same positions extracted Pixel constitute rotated image nth row of pixels;Wherein, the N is equal to after the shown columns after rotation image subtracts M and added Upper 1;In nth row of pixels point each pixel put in order with each described piecemeal put in order it is identical.
CN201410648779.8A 2014-11-14 2014-11-14 Image rotating method and system Active CN104331861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410648779.8A CN104331861B (en) 2014-11-14 2014-11-14 Image rotating method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410648779.8A CN104331861B (en) 2014-11-14 2014-11-14 Image rotating method and system

Publications (2)

Publication Number Publication Date
CN104331861A CN104331861A (en) 2015-02-04
CN104331861B true CN104331861B (en) 2017-10-10

Family

ID=52406582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410648779.8A Active CN104331861B (en) 2014-11-14 2014-11-14 Image rotating method and system

Country Status (1)

Country Link
CN (1) CN104331861B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551456A (en) * 2015-12-11 2016-05-04 中国航空工业集团公司西安航空计算技术研究所 DDR2 block storage method based on image rotation display
CN105787882A (en) * 2016-02-26 2016-07-20 广州市赛普电子科技有限公司 Picture rotation rapid presentation method
CN106530209A (en) * 2016-09-26 2017-03-22 深圳市振华微电子有限公司 FPGA-based image rotation method and apparatus
CN106530235B (en) * 2016-10-24 2019-06-28 深圳市前海视微科学有限责任公司 Image rotation processing method and device
CN106846255B (en) * 2017-02-23 2024-01-16 新岸线(北京)科技集团有限公司 Image rotation realization method and device
CN108492243B (en) * 2018-04-13 2021-08-27 福州新迪微电子有限公司 Image rotation device, system and method based on block processing
CN112581875A (en) * 2019-09-29 2021-03-30 浙江宇视科技有限公司 Information display method and device of module board
CN112650881A (en) * 2020-12-22 2021-04-13 深圳市子瑜杰恩科技有限公司 Monitoring data processing method and device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5598181A (en) * 1994-09-26 1997-01-28 Xerox Corporation Method and apparatus for rotating a digital image ninety degrees using a small auxiliary buffer
CN1905000A (en) * 2005-07-25 2007-01-31 精工爱普生株式会社 Method and apparatus for efficient image rotation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100620372B1 (en) * 2004-08-18 2006-09-08 삼성전자주식회사 Method for rotating image, computer and recoding media

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5598181A (en) * 1994-09-26 1997-01-28 Xerox Corporation Method and apparatus for rotating a digital image ninety degrees using a small auxiliary buffer
CN1905000A (en) * 2005-07-25 2007-01-31 精工爱普生株式会社 Method and apparatus for efficient image rotation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李兵 等.分块技术实现图像快速-高精度旋转.《光电工程》.2011,第38卷(第4期),第103-107页. *

Also Published As

Publication number Publication date
CN104331861A (en) 2015-02-04

Similar Documents

Publication Publication Date Title
CN104331861B (en) Image rotating method and system
US8482573B2 (en) Apparatus and method for processing data
GB2551922B (en) Virtual linebuffers for image signal processors
US10061537B2 (en) Data reordering using buffers and memory
CN106127721A (en) For showing graphics system and the method for the mixed image become by superimposed image lamination
JP2014050103A5 (en)
CN107346212A (en) Method for screening damaged data row and data storage device with damaged data row general table
CN103547995B (en) Short pointer
JP5359569B2 (en) Memory access method
CN106530209A (en) FPGA-based image rotation method and apparatus
CN106201363A (en) The memorizer of the random real time access of video flowing Pixel-level data and storage method
CN105488753B (en) A kind of pair of image carries out the method and device of two-dimension fourier transform or inverse transformation
CN102523439B (en) Video frame rate improving system and frame rate improving method
TWI239214B (en) Image data processing system and image data reading and writing method
CN104268225B (en) A kind of file system architecture and its generation and access mode of the addressing of the multidimensional free degree
US20120117305A1 (en) Method Of Storing Blocks Of Data In A Plurality Of Memory Devices For High Speed Sequential Read, A Memory Controller And A Memory System
EP2453360B1 (en) Method and apparatus for translating memory access address
JPH01283676A (en) Read-out processing system for window image data
CN105427235A (en) Image browsing method and system
JP2016033818A (en) Data processing method, apparatus, and system
US20090189919A1 (en) Image scaling method
US9329785B2 (en) Method of interleaving, de-interleaving, and corresponding interleaver and de-interleaver
US11972504B2 (en) Method and system for overlapping sliding window segmentation of image based on FPGA
KR102145288B1 (en) Device and method for creating stereograms with large viewing angle and high 2d image resolution
CN105551456A (en) DDR2 block storage method based on image rotation display

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Kezhu road high tech Industrial Development Zone, Guangzhou city of Guangdong Province, No. 233 510670

Patentee after: Wei Chong group Limited by Share Ltd

Address before: 510670 Guangdong city of Guangzhou province Kezhu Guangzhou high tech Industrial Development Zone, Road No. 233

Patentee before: Guangdong Weichuangshixun Science and Technology Co., Ltd.

CP03 Change of name, title or address