CN103226807B - For image rotating method and the device of lattice display equipment - Google Patents

For image rotating method and the device of lattice display equipment Download PDF

Info

Publication number
CN103226807B
CN103226807B CN201310174904.1A CN201310174904A CN103226807B CN 103226807 B CN103226807 B CN 103226807B CN 201310174904 A CN201310174904 A CN 201310174904A CN 103226807 B CN103226807 B CN 103226807B
Authority
CN
China
Prior art keywords
image
pixel
mtd
mtr
memory
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.)
Expired - Fee Related
Application number
CN201310174904.1A
Other languages
Chinese (zh)
Other versions
CN103226807A (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.)
Tianjin University
Original Assignee
Tianjin University
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 Tianjin University filed Critical Tianjin University
Priority to CN201310174904.1A priority Critical patent/CN103226807B/en
Publication of CN103226807A publication Critical patent/CN103226807A/en
Application granted granted Critical
Publication of CN103226807B publication Critical patent/CN103226807B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The present invention relates to image procossing and display field, for proposing a kind of image rotating method for lattice display equipment and device, in the process realizing image rotation, make full use of the pixel value of original image, by one_to_one corresponding between itself and the pixel of rotated image, ensure the integrality of image, the problem that the operation efficiency that elimination interpolation arithmetic and multiplying bring is low, simultaneously, this fast algorithm is combined with image memory mechanism, apply to the real-time procedure for displaying of video image, be applicable to hardware implementing, for this reason, the technical solution used in the present invention is, for the image rotating method of lattice display equipment, the rotary course of image is comprised the steps: to be decomposed into three steps, after first time conversion, the horizontal ordinate of partial pixel is shifted an integer unit, after second time conversion, the ordinate of partial pixel is shifted an integer unit, after third time conversion, the horizontal ordinate of partial pixel is shifted an integer unit.The present invention is mainly used in image procossing.

Description

Image rotation method and device for dot matrix display equipment
Technical Field
The present invention relates to the field of image processing and display, and in particular, to the implementation of a fast image rotation algorithm, data storage, and image display of a dot matrix device, and more particularly, to an image rotation method and apparatus for a dot matrix display device.
Technical Field
Dot matrix display devices can be used to display information such as numbers, text, and images, and are widely used in both industrial and commercial fields. The resolution of an image displayed by a dot matrix display device is affected by the number of dots and the arrangement of the dots. Each display unit in a common dot matrix display device is respectively horizontally and vertically arranged in a row-column mode, and when an image rotates, an original smooth horizontal line appears in a fuzzy and sawtooth shape due to an inherent mode of dot matrix display, so that the definition of the image is influenced.
The rotation of the digital image is an important content in the field of digital image processing, and the application range of the rotation comprises the image processing fields of image matching, splicing and the like and the system application fields of video monitoring, investigation, tracking and the like. When the rotation of the digital image is applied to the field of image display in a dot matrix manner, the image rotation algorithm is required to have high real-time performance.
As shown in fig. 1, an image is represented in a two-dimensional coordinate system, and after an angle θ is rotated around an origin, the coordinates of each pixel point can be represented by the following formula:
<math> <mrow> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>sin</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>x</mi> </mtd> </mtr> <mtr> <mtd> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> </mrow> </math>
wherein x*、y*And the coordinates of the image pixel points after rotation are represented, and the coordinates of the image pixel points before rotation are represented by x and y.
Because the coordinate values representing the image pixels can only be integers, rounding operations are required when the formula is adopted to directly calculate, and therefore, empty points appear in the image range. Therefore, to avoid this phenomenon, it is common practice to determine the integer coordinates of each pixel point of the rotated image, as known information, using a formula
<math> <mrow> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>x</mi> </mtd> </mtr> <mtr> <mtd> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>sin</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> </mtd> </mtr> </mtable> </mfenced> </mrow> </math>
The corresponding coordinates of each pixel point in the image before rotation are solved, the coordinate values obtained by the method are usually not integers, and the pixel values of the image after rotation can be obtained only by carrying out interpolation calculation by using the values of the surrounding pixel points.
The calculation by using the rotation method needs a large amount of multiplication operation, and in order to reduce the time of the multiplication operation and improve the operation efficiency, an accumulation calculation mode can be adopted. Two adjacent in the same rowThe coordinate values of each pixel point are respectively (x)*,y*),(x*+1,y*) The coordinates in the image before rotation are (x, y), (x + cos θ, y-sin θ), respectively. For all pixel points of the same image, cos theta and sin theta are constants, and the method can simplify calculation.
The three-step translation method is another simplified mode of the rotation operation. This method decomposes the rotation matrix:
<math> <mrow> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>sin</mi> <mi>&theta;</mi> </mtd> <mtd> <mi>cos</mi> <mi>&theta;</mi> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> </mrow> </math>
the rotational transformation is decomposed into three one-dimensional transformations, each time only for x or y coordinates. And calculating the coordinate position of the pixel point of the rotated image in the image before rotation, and then calculating to obtain a new pixel value through interpolation.
The above methods for obtaining the rotated image all use interpolation calculation, and trigonometric function values are all decimal numbers, which includes a large number of multiplication operations, when hardware is adopted for realization, the interpolation operation needs to be cached, the complex interpolation algorithm and multiplication operation also reduce the execution efficiency of the system, and in the process of needing real-time display of the image, the methods cause a large amount of operation pressure on the system.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide an image rotation method and an image rotation device for dot matrix display equipment, wherein in the process of realizing image rotation, pixel values of an original image are fully utilized and are in one-to-one correspondence with pixels of a rotated image, the integrity of the image is ensured, and the problem of low operation efficiency caused by interpolation operation and multiplication operation is solved, meanwhile, the rapid algorithm is combined with an image storage mechanism and is applied to the real-time display process of a video image, and the method is suitable for hardware implementation, therefore, the technical scheme adopted by the invention is that the image rotation method for the dot matrix display equipment comprises the following steps: the image rotation process is decomposed into three steps, and the image rotation transformation adopts the following formula:
<math> <mrow> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>x</mi> </mtd> </mtr> <mtr> <mtd> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> </mrow> </math>
wherein x*、y*Representing the pixel coordinates of the image after rotation, and x and y representing the pixel coordinates of the image before rotation; theta is an angle of clockwise rotation of the image by taking the first pixel point at the upper left corner as an origin; after the rotation transformation is decomposed into three times of one-dimensional transformation, each transformation is one-time miscut transformation; let the coordinates obtained after the three-time transformation be (x) respectively1,y1),(x2,y2),(x*,y*) Then, then
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>=</mo> <mi>x</mi> <mo>-</mo> <mi>y</mi> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>=</mo> <mi>y</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>=</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>=</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> <mo>=</mo> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>-</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> <mo>=</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> </mtd> </mtr> </mtable> </mfenced> </math>
After the rotation, the abscissa of the image pixel changes twice, the ordinate changes once, and the image pixel undergoes coordinate translation transformation, and only translates a plurality of units in a one-dimensional direction aiming at the x or y coordinate each time; the method comprises the following steps of performing translation transformation on an original image, wherein the translation amount of x and y coordinates is subjected to rounding processing during each translation transformation, after the first transformation, the abscissa of a part of pixels is translated by an integer unit, after the second transformation, the ordinate of a part of pixels is translated by an integer unit, after the third transformation, the abscissa of a part of pixels is translated by an integer unit, so that an image generated after the third transformation has no empty points and does not need interpolation operation, and all pixel points of a new image are formed by pixel points in the original image.
The rounding processing is realized by a DDA (digital differential Analyzer) method, which specifically comprises the following steps: when calculating the coordinates of the first row of pixel points, accumulating by taking the pixel point coordinates at the original point as the original point, then determining whether the carry needs to be changed on the basis of the coordinate value of the previous pixel, and replacing the rounding operation after multiplication by using the method; when calculating the coordinate of the first row of pixel points, three times of rounding operation are required, namely
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <mi>y</mi> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> </mtable> </mfenced> </math>
When calculating the coordinates of other pixel points, accumulating by using the pixel coordinate of the first column of the row where the pixel point is positioned as a starting point, then determining whether carry is needed or not, and changing on the basis of the coordinate value of the previous pixel; two rounding operations are required when calculating the coordinates of the non-first-row pixel points, namely
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> </mtable> </mfenced> </math>
Thus, after sin theta and tan (theta/2) corresponding to the rotation angle are known, the coordinate values of the pixel points of the rotated image are directly calculated, and the pixel values of the rotated image are directly assigned by the original pixel values.
An image rotation apparatus for a dot matrix display device, comprising:
the total number of the parts is 8, and the parts are respectively a data input interface 301, a rotation angle input 302, a lookup table 303, an address generator 304, a memory interface 305, a memory 306, a reading interface 307 and an output interface 308;
the data input interface 301 provides original image data information, including a synchronization signal and the like, which is an original image to be rotated;
the rotation angle input 302 provides the rotation angle of the image or a corresponding label value for the lookup table;
the lookup table 303 stores angle information of image rotation, including information of sin θ and tan (θ/2), and storage space information matched with the size of the rotated image; in order to facilitate the address generator 304 to quickly calculate the address information of the rotated image, only the integer value obtained by multiplying the trigonometric function value by the integer power of 2 may be stored according to the requirement of calculation precision, and the trigonometric function value of any angle may be stored, including a positive number and a negative number;
after the address generator 305 obtains the rotation angle trigonometric function value transmitted by the lookup table 304 and the synchronization signal provided by the data input interface 301, it rapidly calculates a new coordinate value corresponding to each pixel of the rotated image, and converts the new coordinate value into an address value corresponding to the memory 306 according to the calculated coordinate value, and the address value and the image pixel value provided by the data interface 301 are transmitted to the memory interface 305 together;
the memory interface 305 and the memory 306 are jointly responsible for storing the rotated image data, before the rotated image is stored, the memory interface 305 firstly opens up a certain size of storage space in the memory 306 according to the storage space information transmitted by the lookup table 303, all values in the space are assigned to be black, after the data is stored, the memory stores the pixel value of the data input interface 301 into the corresponding address provided by the address generator 304, the image stored in the memory 306 is rotated, and the displayed image can be read out line by line;
the readout interface 307 reads out the image information from the memory 306 row by row, the pixel values not filling the full memory area will be displayed as black, and the output interface 308 will generate the corresponding synchronization signal and driving signal for output.
The internal interfaces of the address generator 305 are: the first row pixel judger 401 judges whether the pixel is a pixel of a first row according to the synchronization information provided by the data input interface 301, if the pixel is the pixel of the first row, the first row pixel longitudinal coordinate accumulator 402 accumulates the trigonometric function value provided by the lookup table 303, calculates the longitudinal coordinate value of the pixel and registers the longitudinal coordinate value, and then the first row pixel transverse coordinate accumulator 403 accumulates the transverse coordinate value of the pixel and calculates the transverse coordinate value of the pixel and registers the transverse coordinate value; if the pixel is not the first column of pixels, the non-first column of pixels ordinate accumulator 404 and the non-first column of pixels abscissa accumulator 405 perform accumulation calculation on the basis of the values registered by the first column of pixels ordinate accumulator 402 and the first column of pixels abscissa accumulator 403, respectively, to obtain the value of the horizontal and vertical coordinates of the pixel. The calculated coordinate values of the pixels are input into the address converter, and the coordinate values are output after being converted into corresponding address values of the memory 306.
The invention has the following technical effects:
1. the invention provides an image rotation method and device for a dot matrix display device. In the image rotation process realized by the method, the situation that the image has empty points after interpolation does not occur, the pixel values of the original image can be fully utilized to search the one-to-one correspondence relation between the pixel points of the image after rotation, and the interpolation operation process with complex calculation is avoided.
2. The lookup table technology is used for storing the value corresponding to the trigonometric function value of the rotation angle, small numerical values are not directly accumulated, and the calculation precision can be improved under the condition of using an accumulator with the same number of digits. The DDA method is adopted to replace the operation of rounding after multiplication, the use of a multiplier is avoided, the hardware calculation speed is improved, and the image rotation display process of any angle can be realized within the size allowable range of the lookup table.
3. The address of the rotated image in the memory is directly calculated, and the intermediate calculation result is prevented from being stored by a three-step rotation method. The memory dynamically opens up a storage area according to the image size value provided by the lookup table, so that the storage space is saved. And the mode of pre-storing numerical values and then writing in again is adopted, and after the writing in is finished, the display of the rotated image in the dot matrix display device can be realized according to the mode of reading out in sequence.
Drawings
FIG. 1 is a schematic view of image rotation.
FIG. 2 is a schematic diagram of a three-step rotary process.
Fig. 3 image rotation and reality device.
FIG. 4 address generator architecture.
Fig. 5 graphically shows the results.
Detailed Description
The invention provides an image rotation method and device for dot matrix display equipment, which do not need interpolation operation and a line cache mechanism, and can directly output images after rotation after storage according to lines.
The image rotation method adopted by the invention is based on a three-step rotation algorithm, the rotation process of the image is decomposed into three steps, and the image rotation transformation adopts a formula of
<math> <mrow> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mo>-</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mfenced open='[' close=']'> <mtable> <mtr> <mtd> <mi>x</mi> </mtd> </mtr> <mtr> <mtd> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> </mrow> </math>
Wherein x*、y*Indicating the coordinates of the image pixel after rotation, and x, y indicating the coordinates of the image pixel before rotation. Theta is an angle of clockwise rotation of the image by taking the first pixel point at the upper left corner as an origin. After the rotation transform is decomposed into three one-dimensional transforms, each transform is a miscut transform. Let the coordinates obtained after the three-time transformation be (x) respectively1,y1),(x2,y2),(x*,y*) Then, then
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>=</mo> <mi>x</mi> <mo>-</mo> <mi>y</mi> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>=</mo> <mi>y</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>=</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>=</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> </mtd> </mtr> <mtr> <mtd> <msup> <mi>x</mi> <mo>*</mo> </msup> <mo>=</mo> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>-</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <msup> <mi>y</mi> <mo>*</mo> </msup> <mo>=</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> </mtd> </mtr> </mtable> </mfenced> </math>
After the rotation, the abscissa of the image pixel changes twice, the ordinate changes once, and the image pixel undergoes coordinate translation transformation, and only translates a plurality of units in a one-dimensional direction aiming at the x or y coordinate each time.
In the process of realizing image rotation, in order to utilize original pixel point information of an image and avoid complexity of interpolation operation and hardware consumption caused by line cache, the invention carries out rounding processing on translation amounts of x and y coordinates during each translation transformation. As shown in fig. 2, after the first transformation, the abscissa of a part of pixels is translated by an integer number of units, after the second transformation, the ordinate of a part of pixels is translated by an integer number of units, and after the third transformation, the abscissa of a part of pixels is translated by an integer number of units, so that an image generated after the third transformation has no empty points and does not need to be subjected to interpolation operation, and all pixel points of a new image are formed by pixel points in an original image.
In order to avoid the hardware cost brought by multiplication operation and rounding operation, the invention adopts DDA (digital differential analyzer) method to avoid the application of a multiplier in a hardware circuit, and simultaneously, the rounding operation is realized quickly and efficiently. Because the coordinates of the pixel points at the original points do not change in the rotation process, the x coordinates of the pixels in the first row are the same, and the y coordinates are different, when the coordinates of the pixels in the first row are calculated, the coordinates of the pixels at the original points are used as the initial points for accumulation, and then whether the carry needs to be changed on the basis of the coordinate value of the previous pixel is determined, and the rounding operation after multiplication is replaced by the method. When calculating the coordinate of the first row of pixel points, three times of rounding operation are required, namely
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <mi>y</mi> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> </mtable> </mfenced> </math>
When calculating the coordinates of other pixel points, the pixel coordinates of the first column of the row where the pixel point is located are used as a starting point for accumulation, then whether carry is needed or not is determined, and change is carried out on the basis of the coordinate value of the previous pixel. Two rounding operations are required when calculating the coordinates of the non-first-row pixel points, namely
<math> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>&times;</mo> <mi>sin</mi> <mi>&theta;</mi> <mo>]</mo> </mtd> </mtr> <mtr> <mtd> <mi>round</mi> <mo>[</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>&times;</mo> <mi>tan</mi> <mrow> <mo>(</mo> <mi>&theta;</mi> <mo>/</mo> <mn>2</mn> <mo>)</mo> </mrow> <mo>]</mo> </mtd> </mtr> </mtable> </mfenced> </math>
Therefore, after sin theta and tan (theta/2) corresponding to the rotation angle are known, the coordinate values of the pixel points of the rotated image can be directly calculated, the image in the middle process of rotation does not need to be stored, and the pixel values of the rotated image are directly assigned by using the original pixel values.
In order to store and display the rotated image in real time, the image rotating and displaying device adopted by the invention is shown in fig. 3. There are 9 parts in total, which are a data input interface 301, a rotation angle input 302, a lookup table 303, an address generator 304, a memory interface 305, a memory 306, a readout interface 307, an output interface 308, and a display device 309, respectively.
The data input interface 301 provides raw image data information, including synchronization signals and the like, which is the raw image to be rotated.
The rotation angle input 302 provides the rotation angle of the image or a corresponding index value for the look-up table. The lookup table 303 stores angle information of image rotation, including information of sin θ and tan (θ/2), and storage space information matching the size of the image after rotation. In order to facilitate the address generator 304 to quickly calculate the address information of the rotated image, only the integer value obtained by multiplying the trigonometric function value by the integer power of 2 may be stored according to the requirement of calculation precision, and the trigonometric function value of any angle may be stored, including a positive number and a negative number.
After the address generator 305 obtains the rotation angle trigonometric function value delivered by the lookup table 304 and the synchronization signal provided by the data input interface 301, a new coordinate value corresponding to each pixel of the rotated image can be quickly calculated, and is converted into an address value corresponding to the memory 306 according to the calculated coordinate value, and the address value and the image pixel value provided by the data interface 301 are jointly delivered to the memory interface 305. The internal interface of the address generator 305 is shown in fig. 4. The first row pixel judger 401 judges whether the pixel is a pixel of the first row according to the synchronization information provided by the data input interface 301, if the pixel is the first row, the first row pixel ordinate accumulator 402 accumulates the trigonometric function values provided by the lookup table 303, calculates the ordinate value of the pixel and registers the ordinate value, and then the first row pixel abscissa accumulator 403 accumulates the ordinate value, calculates the abscissa value of the pixel and registers the abscissa value. If the pixel is not the first column of pixels, the non-first column of pixels ordinate accumulator 404 and the non-first column of pixels abscissa accumulator 405 perform accumulation calculation on the basis of the values registered by the first column of pixels ordinate accumulator 402 and the first column of pixels abscissa accumulator 403, respectively, to obtain the value of the horizontal and vertical coordinates of the pixel. The calculated coordinate values of the pixels are input into the address converter, and the coordinate values are output after being converted into corresponding address values of the memory 306.
The memory interface 305 and the memory 306 are collectively responsible for storage of the rotated image data. Before storing the rotated image, the memory interface 305 first opens up a certain amount of memory space in the memory 306 according to the memory space information passed by the look-up table 303 and assigns all values in this space to black. When starting to store data, the memory stores the pixel values of the data input interface 301 into the corresponding addresses provided by the address generator 304. The image stored in the memory 306 is the image that has been rotated and can be read out line by line for display.
The readout interface 307 reads out the image information in the memory 306 row by row, and the pixel values that do not fill the storage area at this time will be displayed as black. The output interface 308 will generate corresponding synchronization signals and driving signals to transfer the pixel information to the display device 309 for display. The image result of the display is shown in fig. 5, where no image information is filled in black.

Claims (2)

1. An image rotating apparatus for dot matrix display devices, characterized in that, there are 8 parts in total, which are a data input interface (301), a rotation angle input (302), a lookup table (303), an address generator (304), a memory interface (305), a memory (306), a readout interface (307), an output interface (308); wherein,
the data input interface (301) provides original image data information, including a synchronization signal and the like, which is an original image to be rotated;
the rotation angle input (302) provides the lookup table with the rotation angle of the image or a corresponding index value;
the lookup table (303) stores the angle information of image rotation, including information of sin theta and tan (theta/2) and storage space information matched with the size of the image after rotation; in order to facilitate the address generator (304) to rapidly calculate the address information of the rotated image, only an integer value obtained by multiplying a trigonometric function value by an integer power of 2 or a trigonometric function value of any angle is stored according to the requirement of calculation precision, wherein the trigonometric function value comprises a positive number and a negative number;
after the address generator (305) obtains the rotation angle trigonometric function value transmitted by the lookup table (304) and the synchronous signal provided by the data input interface (301), a new coordinate value corresponding to each pixel of the rotated image is rapidly calculated, the new coordinate value is converted into an address value corresponding to the memory (306) according to the calculated coordinate value, and the address value and the image pixel value provided by the data interface (301) are transmitted to the memory interface (305) together;
the memory interface (305) and the memory (306) are jointly responsible for storing the image data after rotation, before the image after rotation is stored, the memory interface (305) firstly opens up a certain size of storage space in the memory (306) according to the storage space information transmitted by the lookup table (303), all values in the space are assigned to be black, after the data is stored, the memory stores the pixel values of the data input interface (301) into the corresponding addresses provided by the address generator (304), the image stored in the memory (306) is rotated, and the displayed image can be read out line by line;
the reading interface (307) reads the image information in the memory (306) line by line, the pixel value which is not filled in the full memory area is displayed as black, and the output interface (308) generates corresponding synchronous signals and driving signals for output.
2. An image rotation apparatus for a dot matrix display device according to claim 1, wherein the internal interface of the address generator (305) is: a first row pixel judger (401) judges whether the pixel is a pixel of a first row according to the synchronous information provided by the data input interface (301), if the pixel is the pixel of the first row, a first row pixel longitudinal coordinate accumulator (402) accumulates the trigonometric function value provided by the lookup table (303), calculates the longitudinal coordinate value of the pixel and registers the longitudinal coordinate value, then a first row pixel transverse coordinate accumulator (403) accumulates the transverse coordinate value, calculates the transverse coordinate value of the pixel and registers the transverse coordinate value; if the pixel is judged to be not the first column of pixels, the non-first column of pixel ordinate accumulator (404) and the non-first column of pixel abscissa accumulator (405) carry out accumulation calculation on the basis of the values registered by the first column of pixel ordinate accumulator (402) and the first column of pixel abscissa accumulator (403) respectively to obtain the value of the horizontal and vertical coordinates of the pixel; the calculated coordinate values of the pixels enter an address converter, and the coordinate values are converted into corresponding address values of a memory (306) and then output.
CN201310174904.1A 2013-05-13 2013-05-13 For image rotating method and the device of lattice display equipment Expired - Fee Related CN103226807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310174904.1A CN103226807B (en) 2013-05-13 2013-05-13 For image rotating method and the device of lattice display equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310174904.1A CN103226807B (en) 2013-05-13 2013-05-13 For image rotating method and the device of lattice display equipment

Publications (2)

Publication Number Publication Date
CN103226807A CN103226807A (en) 2013-07-31
CN103226807B true CN103226807B (en) 2015-12-23

Family

ID=48837242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310174904.1A Expired - Fee Related CN103226807B (en) 2013-05-13 2013-05-13 For image rotating method and the device of lattice display equipment

Country Status (1)

Country Link
CN (1) CN103226807B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103826068A (en) * 2014-03-03 2014-05-28 南京航空航天大学 Video image rotation method
CN105719242A (en) * 2016-01-13 2016-06-29 广州市赛普电子科技有限公司 Picture rapid rotation method and system based on look-up table method
CN106408517B (en) * 2016-08-31 2019-07-26 天津大学 Quick image rotating method
CN106570827B (en) * 2016-08-31 2019-07-26 天津大学 The method and device for carrying out image rotation is converted using memory space address
CN107481301B (en) * 2017-08-07 2020-06-16 苏州速显微电子科技有限公司 Method for realizing digital image fan-shaped shade and application thereof
CN109685715B (en) * 2018-12-12 2023-07-21 中国航空工业集团公司西安航空计算技术研究所 Stepless rotation processing method for high-precision image in display system
CN111369446B (en) * 2018-12-26 2023-06-02 杭州海康威视数字技术股份有限公司 Image rotation method and device
CN116343714A (en) * 2023-03-01 2023-06-27 业成科技(成都)有限公司 Display screen rotation self-adaption method, device, computer equipment and storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
图形快速旋转的数值微分算法;张树林等;《东南大学学报》;19950731;第25卷(第4A期);第60-63页 *
基于GPU并行处理的图像快速旋转算法;李亚荣等;《大连交通大学学报》;20120630;第33卷(第3期);第63-66页 *
基于数字滤波的B-样条插值法在图像旋转中的应用;李开宇等;《南京航空航天大学学报》;20041031;第36卷(第5期);第633-637页 *
大转角下高质量图像旋转快速算法;汪国有等;《华中理工大学学报》;19990630;第27卷(第6期);第45-47页 *
流水线图像旋转ASIC设计与实现;赵尧;《中国优秀硕士学位论文全文数据 信息科技辑》;20111215;第2011年卷(第S2期);第I138-1633页 *

Also Published As

Publication number Publication date
CN103226807A (en) 2013-07-31

Similar Documents

Publication Publication Date Title
CN103226807B (en) For image rotating method and the device of lattice display equipment
CN110136066B (en) Video-oriented super-resolution method, device, equipment and storage medium
CN101388157B (en) Electronic map display method, apparatus and equipment
CN105354809B (en) A kind of pre-distortion method and device based on output image location of pixels index
EP0736841A1 (en) Method and apparatus for image rotation
CN110187314B (en) Radar primary information display method and system
CN111915673B (en) Image processing method, image processing device, terminal equipment and storage medium
CN111064906A (en) Domestic processor and domestic FPGA multi-path 4K high-definition video comprehensive display method
CN109146793B (en) Pipelined image chroma format conversion scaling rotation superposition system
CN110211039B (en) Image processing method and device
CN105516669B (en) A kind of airborne display device and method
Mondal et al. FPGA based accelerated 3D affine transform for real-time image processing applications
CN103389413B (en) A kind of real-time statistical method of spectral histogram
KR100806345B1 (en) 3-dimensional graphics accelerator and method reading texture data
CN108198125A (en) A kind of image processing method and device
CN109872268B (en) High code rate remote sensing satellite original data real-time quick-look method
CN106780291B (en) Real-time distortion image processing accelerating device
CN103533327B (en) DIBR (depth image based rendering) system realized on basis of hardware
CN106780288B (en) Hardware acceleration circuit that polygon was filled
Guo et al. Real-time image distortion correction system based on improved bilinear interpolation algorithm
WO2021071633A1 (en) Methods and apparatus for multiple lens distortion correction
US20070139717A1 (en) Method for reducing memory consumption when carrying out edge enhancement in multiple beam pixel apparatus
CN106991643B (en) Real-time line checking method and real-time line checking system with low resource consumption
CN106570827B (en) The method and device for carrying out image rotation is converted using memory space address
CN113409415B (en) Infrared image correlation display method and system based on temperature matrix

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151223