坐標轉換 計算機圖形學_計算機圖形學的轉換類型

坐標轉換 計算機圖形學

什么是轉型? (What is Transformation?)

Transformation refers to the mathematical operations or rules that are applied on a graphical image consisting of the number of lines, circles, and ellipses to change its size, shape, or orientation. It can also reposition the image on the screen.

轉換是指應用于圖形圖像的數學運算或規則,這些圖形由線,圓和橢圓的數量組成,以更改其大小,形狀或方向。 它還可以將圖像重新放置在屏幕上。

Transformations play a very crucial role in computer graphics.

轉換在計算機圖形學中起著至關重要的作用。

轉換類型 (Types of Transformations)

There are various types of transformations in computer graphics through which an image can be processed, edited ad altered. Some basic and most commonly used types of these transformations are:

計算機圖形學中有各種類型的轉換,可以通過這些轉換來處理圖像,編輯和更改圖像。 這些轉換的一些基本且最常用的類型是:

  1. Translation

    翻譯

  2. Rotation

    回轉

  3. Scaling

    縮放比例

  4. Reflection

    反射

  5. Shearing

    剪力

翻譯 (Translation)

Translation refers to a technique in which a point is shift from one place to another, whose distance is known.

翻譯是指一種技術,在該技術中,一個點從一個位置移動到另一個位置,該位置的距離是已知的。

Consider a point A(x1, y1) be shifted to another point B (x2, y2). Now we only know the shifting distance tx along x-axis and ty along y-axis.

考慮將點A(x 1 ,y 1 )移到另一個點B(x 2 ,y 2 )。 現在我們只知道沿x軸和叔?沿y軸的換檔距離t X。

Now, the new coordinates (x2, y2) can be calculated as:

現在,新的坐標(x 2 ,y 2 )可以計算為:

x2 = x1 + tx

x 2 = x 1 + t x

y2 = y1 + ty

y 2 = y 1 + t y

For example:

例如:

Suppose we want to shift a point with coordinates at A(30,100) and distance along x-axis is 10 units and 20 units along y-axis.

假設我們要移動一個坐標為A(30,100)的點,并且沿x軸的距離為10個單位,沿y軸的距離為20個單位。

Using translation:

使用翻譯:

Here tx = 10 ;

這里t x = 10;

and ty = 20

y = 20

New coordinates A(x2, y2):

新坐標A ' (x 2 ,y 2 ):

x2 = 30 + 10 = 130

x 2 = 30 + 10 = 130

y2 = 100 + 20 = 120

y 2 = 100 + 20 = 120

The point will be shifted to A(130, 120 ).

該點將移至A ' (130,120)。

回轉 (Rotation)

Rotation refers to mathematical operation in which the graphical object is rotated about an angle (θ) to the axis.

旋轉是指數學操作,其中圖形對象相對于軸旋轉角度(θ)。

Rotation is of two types: anti-clockwise and clockwise rotation.

旋轉有兩種類型:逆時針旋轉和順時針旋轉。

Suppose we want to rotate a point with coordinates A (x1, y1) clockwise through an angle θ about the origin

假設我們要繞著原點將坐標A(x 1 ,y 1 )的點順時針旋轉角度θ

Then the new coordinates A(x2, y2):

然后,新坐標A ' (x 2 ,y 2 ):

x2 = x1 cosθ + y1 sinθ

×2 = X 1 +COSθY 1SINθ

y2 = x1 sinθ - y1 cosθ

Y 2 = X 1SINθ - Y 1個 COSθ

縮放比例 (Scaling)

Scaling refers to a mathematical rule applied to change the size of the image.

縮放是指用于更改圖像大小的數學規則。

If the value of scaling factors is negative, the size is decreased and when the value is positive, the size of the image is increased.

如果縮放因子的值為負,則減小大小,而當值為正時,增大圖像的大小。

Suppose the point with coordinates A (x1, y1) is to be scaled by a factor sx along the x-axis and sy along the y-axis.

假設坐標為A(x 1, y 1 )的沿x軸縮放系數s x,沿y軸縮放y。

Hence the new coordinates after scaling will be:

因此,縮放后的新坐標將為:

x2 = x1 x sx

x 2 = x 1 xs x

y2 = y1 x sy

y 2 = y 1 xs y

Translation, rotation and scaling are termed as basic translations.

平移,旋轉和縮放稱為基本平移。

其他轉變 (Other Transformations)

The other two transformation techniques are as follows,

其他兩種轉換技術如下:

反射 (Reflection)

Reflection refers to the mirror image of the original graphical object. It is an 180o rotation operation.

反射是指原始圖形對象的鏡像。 這是一個180 o的旋轉操作。

Reflection can be done about following ways:

可以通過以下方式進行反思:

  • x-axis

    X軸

  • y-axis

    y軸

  • the origin and

    起源和

  • A plane perpendicular to the origin

    垂直于原點的平面

剪力 (Shearing)

Shearing is a transformation in which the shape of the object is slanted about the axis.

剪切是一種變換,其中對象的形狀圍繞軸傾斜。

In y-shearing:

在y剪切中:

The new-coordinates will be:

新的坐標將是:

x' = x

X' = x

y' = y + sy x

' = y + s y x

In x-shearing:

在x剪切中:

The new-coordinates will be:

新的坐標將是:

x' = x + sx y

x ' = x + s x y

y' = y

y'= y

翻譯自: https://www.includehelp.com/computer-graphics/types-of-transformations.aspx

坐標轉換 計算機圖形學

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/378567.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/378567.shtml
英文地址,請注明出處:http://en.pswp.cn/news/378567.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

win2003 IIS6配置PHP 5.3.3(fastCGI方式+eAccelerator)+ASP.NET 4.0(MVC3)

win2003 IIS6配置PHP 5.3.3(fastCGI方式eAccelerator)ASP.NET 4.0(MVC3) 直入正題。 這個環境的部署很有講究,折騰了一天,大概說一下思路: 自從哪個PHP的版本開始(5.2也不知道多少),就分了thread-safe版和n…

03-圖像特效

一、灰度處理 方法一:imread方法 彩色圖的顏色通道為3,即RGB;而灰度圖只有一個顏色通道。 import cv2 img0 cv2.imread(E:\Jupyter_workspace\study\data/cat.png,0) img1 cv2.imread(E:\Jupyter_workspace\study\data/cat.png,1) print…

解析linux根文件系統的掛載過程

------------------------------------------ 本文系本站原創,歡迎轉載!轉載請注明出處:http://ericxiao.cublog.cn/------------------------------------------ 一:前言前段時間在編譯kernel的時候發現rootfs掛載不上。相同的root選項設置舊版的image卻可以。為了…

SIFT講解(SIFT的特征點選取以及描述是重點)

目錄SIFT是什么?尺度空間理論SIFT特征點提取SIFT特征點描述SIFT是什么? SIFT ,即尺度不變特征變換( Scale-invariant feature transform,SIFT) ,一種特征描述方法。具有 尺度魯棒性 旋轉魯棒性 光照魯棒性 SIFT本身包括了特征點篩選及特征點…

操作系統多線程實現_操作系統中的線程實現

操作系統多線程實現Each process has an address space. There is one thread of control in every traditional OS. Sometimes, it is viable to have multiple threads of control in the similar address space which is running in quasi-parallel. Though they were separ…

mysql怎么消除冗余,mysql剔除冗余數據

mysql刪除冗余數據-- -- 1. 查詢冗余數據SELECT t.id FROM t_lifeservice_orders t WHERE t.orderStatus 2 GROUP BY t.channelCode, t.orderNum, t.orderStatus HAVING COUNT(t.orderStatus) > 1;-- -- 2. 定義刪除冗余數據存儲過程DROP PROCEDURE IF EXISTS proc_delete_…

04-圖像的形狀繪制

一、線段繪制 cv2.line(dst,(100,100),(400,400),(0,0,255),2,cv2.LINE_AA) 參數一:目標圖片數據 參數二:當前線段繪制的起始位置(也就是兩點確定一條直線) 參數三:當前線段繪制的終止位置(也就是兩點確定…

(1-e^(-j5w))/(1-e^(-jw))=e^(-j2w)*sin(5w/2)/sin(w/2)的證明過程

問題出現:《數字信號處理第三版》第90頁劉順蘭版 最后一步怎么得到的? 思路:觀察答案,有一個自然對數項。關鍵就是如何提取出這一項。 我的證明過程如下: 參考鏈接: 【和差化積】

php 移植 arm 精簡,php5.4.5移植到arm-linux摘要,lighttpd配置

php5.4.5移植到arm-linux摘要.因為有嵌入WEB服務的需求,再常識了N多的開源的嵌入服務后最終選擇了lighttpd.Apache太大支了,而且在arm上對swf的支持不好.其他的都不怎么理想.lighttpd的移植過程就省略了。這里只摘要了PHP移植,采用fastcgi與lighttpd 協作…

05-圖像的美化

一、彩色圖片直方圖 cv2.calcHist([image],[0],None,[256],[0.0,255.0]) 該方法的所有參數都必須用中括號括起來!!! 參數一:傳入的圖片數據 參數二:用于計算直方圖的通道,這里使用的是灰度直方圖&#xff…

java 檢查目錄是否存在_如何檢查Java目錄是否存在?

java 檢查目錄是否存在We are using the File class that is an abstract representation of file and directory path. To check if a directory exists we have to follow a few steps: 我們正在使用File類 ,它是文件和目錄路徑的抽象表示。 要檢查目錄是否存在&a…

Eclipse for android 中設置java和xml代碼提示功能(轉)

1、設置 java 文件的代碼提示功能 打開 Eclipse 依次選擇 Window > Preferences > Java > Editor - Content Assist > Auto activation triggers for Java ,設置框中默認是一個點, 現在將它改為: 以下為引用內容: .a…

MySQL 定時器EVENT學習

MySQL 定時器EVENT學習 MySQL從5.1開始支持event功能,類似oracle的job功能。有了這個功能之后我們就可以讓MySQL自動的執行數據匯總等功能,不用像以前需要操作的支持了。如linux crontab功能 。 創建測試表CREATE TABLE t( v VARCHAR(100) NOT NULL…

如何利用FFT(基2時間以及基2頻率)信號流圖求序列的DFT

直接用兩個例子作為模板說明: 利用基2時間抽取的FFT流圖計算序列的DFT 1、按照序列x[k]序號的偶奇分解為x[k]和x2[k],即x1[k]{1,1,2,1}, x2[k]{-1,-1,1,2} 2、畫出信號流圖并同時進行計算 計算的時候需要參考基本蝶形單元: 關鍵在于 (WN) k…

matlab4.0,matlab?4.0

4.1fort-9:0.5:9if(t>0)y-(3*t^2)5;fprintf(y%.2ft%.2f\n,y,t);elsey(3*t^2)5;fprintf(y%.2ft%.2f\n,y,t);endend編譯結果:y248.00t-9.00y221.75t-8.50y197.00t-8.00y173.75t-7.50y152.00t-7.00y131.75t-6.50y113.00t-6.00y95.75t-5.50y80.00t-5.00y65.75t-4.50y…

圖形學 射線相交算法_計算機圖形學中的陰極射線管

圖形學 射線相交算法陰極射線管 (Cathode Ray Tube) Ferdinand Barun of Strasbourg developed the cathode ray tube in the year 1897. It used as an oscilloscope to view and measure some electrical signals. But several other technologies exist and solid state mov…

Constructor總結

一個類如果沒有構造那么系統為我們在背后創建一個0參數的構造,但是一旦我們創建了但參數的構造,那么默認的構造就沒了。 View Code 1 using System;2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 6 namespace Console…

Python連接MySQL及一系列相關操作

一、首先需要安裝包pymysql(python3所對應) 我使用的是Anaconda全家桶,打開cmd,進入Anaconda下的Scripts文件夾下輸入命令:pip install pymysql進行下載安裝 二、我使用的編譯器為Anaconda所帶的Jupyter Notebook 1,在mysql中…

微機原理—可編程計數器/定時器8253概念詳解

目錄前言【1】定時處理方法1、定時的方法:2、定時和計數器【2】8253計數/定時器1、特點:2、芯片引腳以及電路:3、連接方式:4、工作原理:5、寄存器配置a、初始化操作(三個通道單獨初始化)b、讀出…

php靜態分析工具window,window_SpeedPHP框架核心調試工具,在日常的編程開發當中,開發 - phpStudy...

SpeedPHP框架核心調試工具在日常的編程開發當中,開發者經常會使用到對變量的調試,而sp框架提供的變量調試輸出函數——dump正好滿足了變量調試的需求。下面來介紹一下dump函數的使用方法。dump —— 變量格式化輸出函數用法:dump($vars, $out…