CN105719242A - Picture rapid rotation method and system based on look-up table method - Google Patents

Picture rapid rotation method and system based on look-up table method Download PDF

Info

Publication number
CN105719242A
CN105719242A CN201610024010.8A CN201610024010A CN105719242A CN 105719242 A CN105719242 A CN 105719242A CN 201610024010 A CN201610024010 A CN 201610024010A CN 105719242 A CN105719242 A CN 105719242A
Authority
CN
China
Prior art keywords
numerical value
integer
cos
sin
picture
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.)
Pending
Application number
CN201610024010.8A
Other languages
Chinese (zh)
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.)
Guangzhou Sai Pu Electronic Science And Technology Co Ltd
Original Assignee
Guangzhou Sai Pu Electronic Science And Technology 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 Guangzhou Sai Pu Electronic Science And Technology Co Ltd filed Critical Guangzhou Sai Pu Electronic Science And Technology Co Ltd
Priority to CN201610024010.8A priority Critical patent/CN105719242A/en
Publication of CN105719242A publication Critical patent/CN105719242A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/604Rotation of a whole image or part thereof using a CORDIC [COordinate Rotation Digital Compute] device

Abstract

The invention discloses a picture rapid rotation method and system based on a look-up table method. The method comprises the following steps: storing values of various trigonometric functions from 0 degree to 360 degrees into a memory; according to each pixel coordinates after picture rotation, deriving corresponding pixel coordinates before the rotation; and according to the corresponding pixel coordinates before the rotation, each pixel obtaining a corresponding pixel value, and obtaining a picture after the rotation. The system comprises a function value storage unit, a coordinate deriving unit and a pixel obtaining unit. According to the invention, the values of the trigonometric functions are stored firstly, the values of the trigonometric functions can be rapidly read when the corresponding coordinates before the rotation is derived through the pixel coordinates after the rotation, and interpolation operation is avoided, such that the computational complexity is effectively mitigated, the operation time is greatly saved, and the pixel continuity can also be ensured. Therefore, the method and system provided by the invention can be widely applied to the field of computers.

Description

A kind of picture fast spin method based on look-up table and system
Technical field
Field of computer technology of the present invention, particularly relates to a kind of picture fast spin method based on look-up table and system.
Background technology
Existing picture rotation method is generally directed to the operational problem of trigonometric function, and the seriality in order to ensure pixel employs interpolation arithmetic, when large-sized picture is rotated operation by needs time, without the support that related hardware accelerates, it is very consuming time only by the operation of trigonometric function operation software, requires, particularly with those, the embedded device that response real-time is high.
Summary of the invention
In order to solve above-mentioned technical problem, it is an object of the invention to provide one and can alleviate amount of calculation, reduce a kind of picture fast spin method based on look-up table and the system of operation time.
The technical solution used in the present invention is:
A kind of picture fast spin method based on look-up table, comprises the following steps:
A, the numerical value of the various trigonometric functions of 0 °~360 ° is preserved to internal memory;
B, according to each pixel coordinate after picture rotation, derive pixel coordinate corresponding before rotating;
C, according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
As the further improvement of described a kind of picture fast spin method based on look-up table, described step B includes:
B1, operational pattern according to current computer, choose the derivation calculation of correspondence automatically;
B2, according to each pixel coordinate after the derivation calculation chosen and picture rotation, derive pixel coordinate corresponding before rotating.
As the further improvement of described a kind of picture fast spin method based on look-up table, described step B2 includes:
B21, when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
B22, when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
Of the present invention another solution is that
A kind of quick rotary system of the picture based on look-up table, including:
Function value memory element, is used for the numerical value by the various trigonometric functions of 0 °~360 ° and preserves to internal memory;
Coordinate derivation unit, for according to each pixel coordinate after picture rotation, deriving pixel coordinate corresponding before rotating;
Pixel acquisition unit, for according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
As the further improvement of described a kind of quick rotary system of the picture based on look-up table, described coordinate derivation unit includes:
Pattern chooses unit, for the operational pattern according to current computer, automatically chooses the derivation calculation of correspondence;
Derivation computing unit, for according to each pixel coordinate after the derivation calculation chosen and picture rotation, deriving pixel coordinate corresponding before rotating.
As the further improvement of described a kind of quick rotary system of the picture based on look-up table, described derivation computing unit includes:
Floating point calculating unit, for when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
Integer computing unit, for when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
The invention has the beneficial effects as follows:
A kind of picture fast spin method based on look-up table of the present invention and system are by adopting the numerical value first storing trigonometric function, the numerical value of trigonometric function can be quickly read during coordinate before pixel coordinate derivation corresponding rotation after rotation, avoid interpolation arithmetic, it is effectively reduced amount of calculation, it is greatly saved operation time, and also can guarantee that the seriality of pixel.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described further:
Fig. 1 is the flow chart of steps of a kind of picture fast spin method based on look-up table of the present invention;
Fig. 2 is the block diagram of a kind of quick rotary system of the picture based on look-up table of the present invention.
Detailed description of the invention
With reference to Fig. 1, a kind of picture fast spin method based on look-up table of the present invention, comprise the following steps:
A, the numerical value of the various trigonometric functions of 0 °~360 ° is preserved to internal memory;
B, according to each pixel coordinate after picture rotation, derive pixel coordinate corresponding before rotating;
C, according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
Preferably, it described step A can also be able to be the interval of 0.001 degree according to the interval that different accuracy requirement can be 1 degree, another according to different target machines, the form preserved is different, for there is no the machine of floating point arithmetic module, in order to improve arithmetic speed, then the mode being divided by by integer substitutes floating point arithmetic, and what at this time preserve is integer data.
Being further used as preferred embodiment, described step B includes:
B1, operational pattern according to current computer, choose the derivation calculation of correspondence automatically;
B2, according to each pixel coordinate after the derivation calculation chosen and picture rotation, derive pixel coordinate corresponding before rotating.
Preferably, in the embodiment of the present invention, derivation calculation is broadly divided into floating type and integer both of which, if target device CPU does not have floating point arithmetic module, then choose integer pattern and be calculated, namely adopt the mode of integral divide to replace floating point arithmetic to calculate trigonometric function value.
Being further used as preferred embodiment, described step B2 includes:
B21, when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
B22, when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
Reference Fig. 2, a kind of quick rotary system of the picture based on look-up table of the present invention, including:
Function value memory element, is used for the numerical value by the various trigonometric functions of 0 °~360 ° and preserves to internal memory;
Coordinate derivation unit, for according to each pixel coordinate after picture rotation, deriving pixel coordinate corresponding before rotating;
Pixel acquisition unit, for according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
Being further used as preferred embodiment, described coordinate derivation unit includes:
Pattern chooses unit, for the operational pattern according to current computer, automatically chooses the derivation calculation of correspondence;
Derivation computing unit, for according to each pixel coordinate after the derivation calculation chosen and picture rotation, deriving pixel coordinate corresponding before rotating.
Being further used as preferred embodiment, described derivation computing unit includes:
Floating point calculating unit, for when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
Integer computing unit, for when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
The present invention is by the coordinate before the derivation rotation of postrotational coordinate, it is possible to avoids interpolation arithmetic, makes the coordinate before and after rotation be mapped, without with interpolation arithmetic, saves operation time and in turn ensure that the seriality of pixel simultaneously.
And because CPU contains floating point arithmetic module on general desktop computer, the time phase difference of integer arithmetic and floating point arithmetic cost is very few.But on embedded device, general CPU is all without floating point arithmetic module, therefore, in order to improve the speed of service on embedded device, all of floating point arithmetic all converts integer number computing to, and the mode being namely divided by by two integer values realizes, and integer number computing is all done in last computing.
Adopting picture size in the test of the specific embodiment of the invention is that 6271*4180 carries out test rotation, conventional icon rotates and does not carry out taking more than 8500 milliseconds consuming time of table handling, and take this algorithm to take only more than 700 millisecond consuming time of table method, as can be seen here, the present invention can be greatly saved the calculating time, largely improves the real-time of big resolution chart rotation process.
Known from the discussion above, a kind of picture fast spin method based on look-up table of the present invention and system are by adopting the numerical value first storing trigonometric function, the numerical value of trigonometric function can be quickly read during coordinate before pixel coordinate derivation corresponding rotation after rotation, avoid interpolation arithmetic, it is effectively reduced amount of calculation, it is greatly saved operation time, and also can guarantee that the seriality of pixel.
It is above the preferably enforcement of the present invention has been illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement under the premise without prejudice to spirit of the present invention, and these equivalent deformation or replacement are all contained in the application claim limited range.

Claims (6)

1. the picture fast spin method based on look-up table, it is characterised in that comprise the following steps:
A, the numerical value of the various trigonometric functions of 0 °~360 ° is preserved to internal memory;
B, according to each pixel coordinate after picture rotation, derive pixel coordinate corresponding before rotating;
C, according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
2. a kind of picture fast spin method based on look-up table according to claim 1, it is characterised in that: described step B includes:
B1, operational pattern according to current computer, choose the derivation calculation of correspondence automatically;
B2, according to each pixel coordinate after the derivation calculation chosen and picture rotation, derive pixel coordinate corresponding before rotating.
3. a kind of picture fast spin method based on look-up table according to claim 2, it is characterised in that: described step B2 includes:
B21, when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
B22, when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
4. the quick rotary system of the picture based on look-up table, it is characterised in that: including:
Function value memory element, is used for the numerical value by the various trigonometric functions of 0 °~360 ° and preserves to internal memory;
Coordinate derivation unit, for according to each pixel coordinate after picture rotation, deriving pixel coordinate corresponding before rotating;
Pixel acquisition unit, for according to pixel coordinate corresponding before rotating, each pixel obtains the pixel value of its correspondence, obtains postrotational picture.
5. a kind of quick rotary system of the picture based on look-up table according to claim 4, it is characterised in that: described coordinate derivation unit includes:
Pattern chooses unit, for the operational pattern according to current computer, automatically chooses the derivation calculation of correspondence;
Derivation computing unit, for according to each pixel coordinate after the derivation calculation chosen and picture rotation, deriving pixel coordinate corresponding before rotating.
6. a kind of quick rotary system of the picture based on look-up table according to claim 5, it is characterised in that: described derivation computing unit includes:
Floating point calculating unit, for when derivation calculation is floating type, its concrete derivation formula is:
Ix=cos (n) * i+sin (n) * j;
Jx=cos (n) * j-sin (n) * i;
Integer computing unit, for when derivation calculation is integer, its concrete derivation formula is:
Ix=[cos integer numerical value 1 (n)/cos integer numerical value 2] * i+ [sin integer numerical value 1 (n)/sin integer numerical value 2] * j;
Jx=[cos integer numerical value 1 (n)/cos integer numerical value 2] * j [sin integer numerical value 1 (n)/cos integer numerical value 2] * i;
Wherein, (i, j) postrotational coordinate is represented, (ix, jx) coordinate before rotating is represented, n represents the angle value of rotation, sin (n) and cos (n) represents the numerical value of the trigonometric function of the inquiry of angle n, cos integer numerical value 1 (n) and sin integer numerical value 1 (n) represents the integer data inquired of the angle n in time substituting floating point arithmetic in the way of integer is divided by, sin integer numerical value 2 is equal with cos integer numerical value 2, this value is according to required precision value, and the more high value of required precision is more big.
CN201610024010.8A 2016-01-13 2016-01-13 Picture rapid rotation method and system based on look-up table method Pending CN105719242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610024010.8A CN105719242A (en) 2016-01-13 2016-01-13 Picture rapid rotation method and system based on look-up table method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610024010.8A CN105719242A (en) 2016-01-13 2016-01-13 Picture rapid rotation method and system based on look-up table method

Publications (1)

Publication Number Publication Date
CN105719242A true CN105719242A (en) 2016-06-29

Family

ID=56147800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610024010.8A Pending CN105719242A (en) 2016-01-13 2016-01-13 Picture rapid rotation method and system based on look-up table method

Country Status (1)

Country Link
CN (1) CN105719242A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3474231A1 (en) * 2017-10-19 2019-04-24 Thomson Licensing Method and device for predictive encoding/decoding of a point cloud
EP3474232A1 (en) * 2017-10-19 2019-04-24 Thomson Licensing A method and device for encoding and decoding a rotation 2d/3d matrix
WO2019079093A1 (en) * 2017-10-19 2019-04-25 Interdigital Vc Holdings, Inc. Method and device for predictive encoding/decoding of a point cloud
CN112363652A (en) * 2020-11-27 2021-02-12 北京城市网邻信息技术有限公司 Information processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010053244A1 (en) * 2000-06-10 2001-12-20 Amkor Technology, Inc. Clamp for pattern recognition
CN102750669A (en) * 2012-05-29 2012-10-24 山东神思电子技术股份有限公司 Image rotation processing method
CN103226807A (en) * 2013-05-13 2013-07-31 天津大学 Image rotation method and device for dot matrix display equipment
CN103646232A (en) * 2013-09-30 2014-03-19 华中科技大学 Aircraft ground moving target infrared image identification device
CN103826068A (en) * 2014-03-03 2014-05-28 南京航空航天大学 Video image rotation method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010053244A1 (en) * 2000-06-10 2001-12-20 Amkor Technology, Inc. Clamp for pattern recognition
CN102750669A (en) * 2012-05-29 2012-10-24 山东神思电子技术股份有限公司 Image rotation processing method
CN103226807A (en) * 2013-05-13 2013-07-31 天津大学 Image rotation method and device for dot matrix display equipment
CN103646232A (en) * 2013-09-30 2014-03-19 华中科技大学 Aircraft ground moving target infrared image identification device
CN103826068A (en) * 2014-03-03 2014-05-28 南京航空航天大学 Video image rotation method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3474231A1 (en) * 2017-10-19 2019-04-24 Thomson Licensing Method and device for predictive encoding/decoding of a point cloud
EP3474232A1 (en) * 2017-10-19 2019-04-24 Thomson Licensing A method and device for encoding and decoding a rotation 2d/3d matrix
WO2019079093A1 (en) * 2017-10-19 2019-04-25 Interdigital Vc Holdings, Inc. Method and device for predictive encoding/decoding of a point cloud
CN111386551A (en) * 2017-10-19 2020-07-07 交互数字Vc控股公司 Method and device for predictive coding and decoding of point clouds
US11769275B2 (en) 2017-10-19 2023-09-26 Interdigital Vc Holdings, Inc. Method and device for predictive encoding/decoding of a point cloud
CN112363652A (en) * 2020-11-27 2021-02-12 北京城市网邻信息技术有限公司 Information processing method and device

Similar Documents

Publication Publication Date Title
CN105719242A (en) Picture rapid rotation method and system based on look-up table method
TW201523183A (en) System and method for compensating precision of rotating tables
WO2021120410A1 (en) Hough transform-based absolute phase noise removal method and apparatus, and storage medium
CN105574931A (en) Electronic map road drawing method and device
CN112085798B (en) Camera calibration method and device, electronic equipment and storage medium
US20190164254A1 (en) Processor and method for scaling image
TW201618039A (en) System and method for compensating a right angle margin of point clouds
JP2019040229A (en) Image processing apparatus, image processing method and program
CN116051600A (en) Optimizing method and device for product detection track
WO2018040726A1 (en) Method and device for obtaining angle-related value, and computer storage medium
CN102750669A (en) Image rotation processing method
CN108154477B (en) Image rotation method based on FPGA
EP2034444B1 (en) Method for rotating images
CN111340728B (en) Point cloud denoising method and device based on 3D point cloud segmentation and storage medium
Rodrigues et al. FPGA-based rectification of stereo images
CN116943979A (en) Dispensing track generation method, electronic equipment and storage medium
CN115661493A (en) Object pose determination method and device, equipment and storage medium
CN111223193B (en) Object rotation method, rotation device, terminal device, and computer-readable storage medium
Chen et al. A bucket-stream rbrief extraction architecture for slam applications on embedded platforms
CN115829846A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112927301A (en) Camera calibration method and device, computing equipment and readable storage medium
CN114119898A (en) Three-dimensional reconstruction method, device, equipment and storage medium
US20150178047A1 (en) Method of fast arctangent calculation pre and post processing
EP1208515A1 (en) Method for extracting zernike/pseudo-zernike moment
CN110009559B (en) Image processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160629