CN108154477B - 一种基于fpga的图像旋转方法 - Google Patents
一种基于fpga的图像旋转方法 Download PDFInfo
- Publication number
- CN108154477B CN108154477B CN201711432876.3A CN201711432876A CN108154477B CN 108154477 B CN108154477 B CN 108154477B CN 201711432876 A CN201711432876 A CN 201711432876A CN 108154477 B CN108154477 B CN 108154477B
- Authority
- CN
- China
- Prior art keywords
- origin
- sinθ
- cosθ
- quadrant
- image
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 16
- 238000004364 calculation method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 2
- 241000533950 Leucojum Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/60—Rotation of whole images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/28—Indexing scheme for image data processing or generation, in general involving image processing hardware
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种基于FPGA的图像旋转方法,该方法包括:以待旋转图像中心为原点(XORIGIN,YORIGIN)建立XY坐标系,将原图像像素坐标(X0,Y0)分为四个象限,将图像旋转角度θ分为四种情况,根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y),在相应地址写入视频采集设备输入的数据,所述FPGA用于实施上述方法。相比传统的图像旋转算法很多符号运算和浮点运算,更加适合在FPGA中运行。在保证了图像旋转的实时性和流畅性的同时,仅用一块入门级FPGA即可实现,相比传统的GPU或DSP实现方式,降低了硬件成本,提高了资源利用效率。
Description
技术领域
本发明涉及图像处理技术领域,尤其涉及一种基于FGPA的图像旋转方法。
背景技术
随着图像处理技术的进步,以及工业电子设备和电子消费品的自动化和智能化水平的提高,越来越多的电子产品都搭载了图像处理专用的GPU或采用DSP来做图像处理算法,如此使电子产品的功能越来越强大,同时也使整机硬件成本变得越来越高,提高了硬件设计的复杂度。
图像旋转是目前较常用的一种图像处理算法。在实现实时的图像旋转功能时,因为需要每个像素依次处理,图像旋转算法的运算速度不能低于图像扫描的速度,为保证图像显示的实时性和流畅性,通常需要硬件上增加GPU或DSP实现算法,但传统图像旋转算法涉及到很多有符号运算和浮点运算,不适合在FPGA中实现。
发明内容
为了解决上述技术问题,本发明的目的是提供一种基于图像旋转方法。
本发明所采用的技术方案是:一种基于图像旋转方法,其包括:以待旋转图像中心为原点(XORIGIN,YORIGIN)建立XY坐标系,将原图像像素坐标(X0,Y0)分为四个象限,将图像旋转角度θ分为四种情况,根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y),在相应地址写入视频采集设备输入的数据。
进一步,所述根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y)具体包括:
(1)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(2)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(3)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(4)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(5)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(6)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(7)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(8)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(9)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(10)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(11)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(12)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(13)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(14)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(15)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(16)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
进一步,其还包括;
设置圆形显示边框,判断旋转后的图像像素地址(X,Y)是否在圆形显示边框内,如果该像素在圆形显示边框外,在相应地址写入黑色;如果该像素在圆形显示边框内,在相应地址写入视频采集设备输入的数据。
本发明的有益效果是:本发明根据像素所在象限和旋转角度值的不同分类计算旋转后的像素坐标,相比传统的图像旋转算法很多符号运算和浮点运算,更加适合在FPGA中运行。在保证了图像旋转的实时性和流畅性的同时,仅用一块入门级FPGA即可实现,相比传统的GPU或DSP实现方式,降低了硬件成本,提高了资源利用效率。
附图说明
下面结合附图对本发明的具体实施方式作进一步说明:
图1是本发明中一种基于图像旋转方法一具体实施例的流程图。
具体实施方式
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
一种基于图像旋转方法,其包括:以待旋转图像中心为原点(XORIGIN,YORIGIN)建立XY坐标系,将原图像像素坐标(X0,Y0)分为四个象限,将图像旋转角度θ分为四种情况,根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y),在相应地址写入视频采集设备输入的数据。
实施例
其总流程如图1所示,该流程为图像扫描中一个像素的处理流程。首先坐标地址顺序递增,同时更新图像旋转角度θ;然后,查表得到|sinθ|和|cosθ|;同时判断sinθ和cosθ的正负极性,并根据坐标地址和画面中心坐标的位置关系判断当前象限;最后,将参数代入公式计算出旋转后的像素地址,查表判断旋转后的地址是否在圆形边框内,然后对该像素进行缓存,如果该像素在边框外,在相应地址写入黑色,如果该像素在边框内,在相应地址写入视频采集设备输入的数据,完成对该像素的处理。由于显示器为方形,当图像旋转一定角度,画面外的无效数据部分进入画面,故增加圆形边框,边框外用黑色遮盖,避免出现无效数据,产生雪花。相比于传统的采用图像缩放和裁剪的方法,运算量更小,同时,圆形画面可显示比方形裁剪画面更多的内容。
图像旋转算法根据四个象限的不同和旋转角度的不同采用不同的变型公式,将数学运算拆分、简化并适应FPGA器件特点。根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y)如下:
图像旋转算法的数学公式为:X=X0cosθ+Y0sinθ,Y=-X0sinθ+Y0cosθ。其中,原始像素坐标为(X0,Y0),旋转角度为θ,旋转后坐标为(X,Y),式中的数值为有符号数。可将原始像素所在象限分为四种情况:当X0≥0且Y0≥0,原始像素坐标在第一象限;当X0<0且Y0≥0,原始像素坐标在第二象限;当X0<0且Y0<0,原始像素坐标在第三象限;当X0≥0且Y0<0,原始像素坐标在第四象限。将旋转角度分为四种情况:当θ∈[0,π/2)时,sinθ≥0,且cosθ≥0;当θ∈[π/2,π)时,sinθ≥0,且cosθ<0;当θ∈[π,3π/2)时,sinθ<0,且cosθ<0;当θ∈[3π/2,2π)时,sinθ<0,且cosθ≥0。
故可将任意时刻任意位置的像素分为16种类别,分别进行旋转算法的计算,图像旋转以图像中心为轴。将坐标原点移动到图像的坐下角第一个像素,设(XORIGIN,YORIGIN)为图像中心坐标(例如图像分辨率为1280*720,则有XORIGIN=640,YORIGIN=360),(X0-XORIGIN,Y0-YORIGIN)为原始像素坐标,(X,Y)为旋转后坐标。
在FPGA中用多路器易于实现象限和旋转角度不同时算法的变换,具体算法如下:
当原始像素坐标在第一象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第一象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第一象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第一象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第二象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第二象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第二象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第二象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第三象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第三象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第三象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第三象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第四象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
当原始像素坐标在第四象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第四象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|。
当原始像素坐标在第四象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
上述算法的最终计算公式用HDL语言应表示为:设变量S,S为以上16种情况的序号减一,S属于[0,15],
X=(S[1:0]==S[3:2])?(XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|):
(S[1:0]==~S[3:2])?(XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|):
(S[0]==S[2])?(XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|):(XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|);
Y=(S[1:0]==~S[3:2])?(YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|):(S[1:0]==(~S[3:2])+2’b1)?YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|):(S[1:0]==(~S[3:2])+2’b2)?(YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|):(YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|)。
以上是对本发明的较佳实施进行了具体说明,但本发明创造并不限于所述实施例,熟悉本领域的技术人员在不违背本发明精神的前提下还可做作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。
Claims (1)
1.一种基于FPGA的图像旋转方法,其特征在于,其包括:
以待旋转图像中心为原点(XORIGIN,YORIGIN)建立XY坐标系,先将原图像像素坐标(X0,Y0)分为四个象限,将图像旋转角度θ分为四种情况,根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同情况,再采用不同算法计算旋转后像素坐标(X,Y),最后在相应地址写入视频采集设备输入的数据;
设置圆形显示边框,判断旋转后的图像像素地址(X,Y)是否在圆形显示边框内,如果该像素在圆形显示边框外,在相应地址写入黑色;如果该像素在圆形显示边框内,在相应地址写入视频采集设备输入的数据;
所述根据原图像像素坐标(X0,Y0)所在象限和图像旋转角度θ的不同分类计算旋转后像素坐标(X,Y)具体包括:
(1)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(2)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(3)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(4)当X0≥0且Y0≥0,原始像素坐标在第一象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(5)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(6)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(7)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(8)当X0<0且Y0≥0,原始像素坐标在第二象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(9)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[0,π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(10)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[π/2,π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(11)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[π,3π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(12)当X0<0且Y0<0,原始像素坐标在第三象限,且θ∈[3π/2,2π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(13)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[0,π/2)时:
X=XORIGIN+|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|;
(14)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[π/2,π)时:
X=XORIGIN-|X0-XORIGIN||cosθ|-|Y0-YORIGIN||sinθ|,
Y=YORIGIN+|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(15)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[π,3π/2)时:
X=XORIGIN-|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|-|Y0-YORIGIN||cosθ|;
(16)当X0≥0且Y0<0,原始像素坐标在第四象限,且θ∈[3π/2,2π)时:
X=XORIGIN+|X0-XORIGIN||cosθ|+|Y0-YORIGIN||sinθ|,
Y=YORIGIN-|X0-XORIGIN||sinθ|+|Y0-YORIGIN||cosθ|。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711432876.3A CN108154477B (zh) | 2017-12-26 | 2017-12-26 | 一种基于fpga的图像旋转方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711432876.3A CN108154477B (zh) | 2017-12-26 | 2017-12-26 | 一种基于fpga的图像旋转方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108154477A CN108154477A (zh) | 2018-06-12 |
CN108154477B true CN108154477B (zh) | 2021-12-21 |
Family
ID=62461982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711432876.3A Active CN108154477B (zh) | 2017-12-26 | 2017-12-26 | 一种基于fpga的图像旋转方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108154477B (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109658337B (zh) * | 2018-11-21 | 2023-03-24 | 中国航空工业集团公司洛阳电光设备研究所 | 一种图像实时电子消旋的fpga实现方法 |
CN111028129B (zh) * | 2019-11-18 | 2023-09-15 | 中国航空工业集团公司西安航空计算技术研究所 | 一种面向gpu像素矩形缩放翻转算法的tlm微结构 |
CN111223414A (zh) * | 2020-02-17 | 2020-06-02 | 深德彩光电(深圳)有限公司 | 一种可任意角度安装的显示模组 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1589034A (zh) * | 2004-08-13 | 2005-03-02 | 袁宁 | 一种视频信号影像播放的方法及其装置 |
CN102507148A (zh) * | 2011-10-17 | 2012-06-20 | 南京理工大学 | 多象限光电探测器检测系统 |
CN102982507A (zh) * | 2012-10-30 | 2013-03-20 | 广东威创视讯科技股份有限公司 | 视频图像处理的方法及装置 |
CN103345765A (zh) * | 2013-07-19 | 2013-10-09 | 南京理工大学 | 基于dsp+fpga的移动平台下运动目标检测装置及其方法 |
CN106504182A (zh) * | 2016-11-02 | 2017-03-15 | 山东正晨科技股份有限公司 | 一种基于fpga的直线特征提取系统 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110134120A1 (en) * | 2009-12-07 | 2011-06-09 | Smart Technologies Ulc | Method and computing device for capturing screen images and for identifying screen image changes using a gpu |
-
2017
- 2017-12-26 CN CN201711432876.3A patent/CN108154477B/zh active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1589034A (zh) * | 2004-08-13 | 2005-03-02 | 袁宁 | 一种视频信号影像播放的方法及其装置 |
CN102507148A (zh) * | 2011-10-17 | 2012-06-20 | 南京理工大学 | 多象限光电探测器检测系统 |
CN102982507A (zh) * | 2012-10-30 | 2013-03-20 | 广东威创视讯科技股份有限公司 | 视频图像处理的方法及装置 |
CN103345765A (zh) * | 2013-07-19 | 2013-10-09 | 南京理工大学 | 基于dsp+fpga的移动平台下运动目标检测装置及其方法 |
CN106504182A (zh) * | 2016-11-02 | 2017-03-15 | 山东正晨科技股份有限公司 | 一种基于fpga的直线特征提取系统 |
Non-Patent Citations (4)
Title |
---|
Real-time detection of rotated patterns using FPGA;Yoshifumi Tanida 等;《2009 International Conference on Field-Programmable Technology》;20100112;第316-319页 * |
基于SOPC技术的视频图像处理系统的设计;杜焕勇;《中国优秀硕士学位论文全文数据库 信息科技辑》;20110915(第09期);第I138-735页 * |
实时图像旋转系统的研究与FPGA实现;王金辉;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130715(第07期);第I138-807页 * |
数字下变频中基于CORDIC算法的NCO设计;刘刚 等;《无线电工程》;20171205;第47卷(第12期);第71-74页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108154477A (zh) | 2018-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108154477B (zh) | 一种基于fpga的图像旋转方法 | |
US11195253B2 (en) | Equatorial stitching of hemispherical images in a spherical image capture system | |
CN100336076C (zh) | 图像提供方法和设备 | |
CN103035016B (zh) | 投影机球形显示及旋转输出图像的处理方法 | |
CN104200427A (zh) | 一种消除图像边缘锯齿的方法 | |
CN111105391B (zh) | 一种基于深度神经网络增广训练的表面缺陷检测方法 | |
CN110705563B (zh) | 一种基于深度学习的工业零件关键点检测方法 | |
CN103826068A (zh) | 一种视频图像旋转方法 | |
CN103543923A (zh) | 控件的点击事件处理方法及系统 | |
CN103035015B (zh) | 投影机球形显示输出图像的处理方法 | |
CN113506305B (zh) | 三维点云数据的图像增强方法、语义分割方法及装置 | |
Luo et al. | Improved Harris corner detection algorithm based on canny edge detection and Gray difference preprocessing | |
US20170148145A1 (en) | Sharpening Algorithm For Images based on Polar Coordinates | |
CN106952216B (zh) | 一种基于imx6图形处理器的直线检测方法 | |
CN100574360C (zh) | 一种获得差分图像的预处理方法 | |
CN106910230B (zh) | 一种雷达背景视频绘制方法 | |
Tang et al. | A simple illumination map estimation based on Retinex model for low-light image enhancement | |
CN112508790B (zh) | 一种图像插值方法、装置、设备及介质 | |
CN105513011A (zh) | 图像缩放方法 | |
Li et al. | A robust and high-precision edge segmentation and refinement method for high-resolution images | |
Park et al. | A 1.5 nJ/pixel super-resolution enhanced FAST corner detection processor for high accuracy AR | |
Zhang et al. | A novel monocular visual odometer method based on Kinect and improved SURF algorithm | |
CN104318519B (zh) | 一种基于边缘替代法的图像去雾方法 | |
Li et al. | Design of multi direction real-time online edge detection system based on fpga | |
CN102779331B (zh) | 图像增强方法及其装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |