




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、配套課件數(shù)字圖像處理 編程框架、理論分析、實(shí)例應(yīng)用和源碼實(shí)現(xiàn)數(shù)字圖像處理1幾何變換,就是一個像素的值保持不變,但它的位置發(fā)生改變,并且這種改變符合一定的幾何數(shù)學(xué)特性。不同的幾何數(shù)學(xué)特性,就決定了幾何變換的類型,例如簡單的幾何變換包括平移、旋轉(zhuǎn)、鏡像、轉(zhuǎn)置、縮放和切變,而復(fù)雜的幾何變換包括仿射變換、投影變換和非剛體變換。數(shù)字圖像處理2數(shù)字圖像處理3數(shù)字圖像處理4平移旋轉(zhuǎn)鏡像轉(zhuǎn)置切變縮放數(shù)字圖像處理5xy0s(x,y)t(x,y)(xs,ys)(xt,yt)dxdy向前映射向后映射數(shù)字圖像處理6數(shù)字圖像處理7CTMatrix CImageProcessing:Image_translation(
2、const CTMatrix& color_image, long delta_x, long delta_y )long image_height = color_image.Get_height();long image_width = color_image.Get_width();long new_height = image_height + abs( delta_y );long new_width = image_width + abs( delta_x );CTMatrix translated_image( new_height, new_width );for( i
3、nt row = 0; row new_height; row + )for( int column = 0; column 0 )row_mapped = row - delta_y;int column_mapped = column;if( delta_x 0 )column_mapped = column - delta_x;if( color_image.Is_point_valid( CImagePoint( row_mapped, column_mapped ) ) )translated_image row column = color_image row_mapped col
4、umn_mapped ;elsetranslated_image row column = RGB_TRIPLE( 128, 128, 128 );return translated_image;數(shù)字圖像處理8void CDigitalImageProcessingDoc:OnGeometrytransformImagetranslation()/ TODO: Add your command handler code hereif( m_image.IsColorImage()long delta_x = 60;long delta_y = 30;CTMatrix translated_im
5、age = CImageProcessing:Image_translation( m_image.Get_color_image(), delta_x, delta_y );m_image.ImportFrom( translated_image );UpdateAllViews(NULL);數(shù)字圖像處理9向前映射向后映射數(shù)字圖像處理10數(shù)字圖像處理11xy0s(x,y)t(x,y)(xs,ys)(xt,yt)數(shù)字圖像處理12數(shù)字圖像處理13向前映射向后映射數(shù)字圖像處理14數(shù)字圖像處理15CTMatrix CImageProcessing:Image_mirror( const CTMatr
6、ix& color_image, bool is_horizontal )long image_height = color_image.Get_height();long image_width = color_image.Get_width();CTMatrix dest_image( image_height, image_width );for( long row = 0; row image_height; row + )for( long column = 0; column image_width; column + )long source_row = row;long
7、 source_column = column;if( is_horizontal = true )source_column = image_width - column - 1;elsesource_row = image_height - row - 1;dest_image row column = color_image source_row source_column ;return dest_image;數(shù)字圖像處理16數(shù)字圖像處理17數(shù)字圖像處理18CTMatrix CImageProcessing:Image_transpose( const CTMatrix& co
8、lor_image )long image_height = color_image.Get_height();long image_width = color_image.Get_width();CTMatrix dest_image( image_width, image_height );for( long row = 0; row image_width; row + )for( long column = 0; column image_height; column + )long source_row = column;long source_column = row;dest_i
9、mage row column = color_image source_row source_column ;return dest_image;數(shù)字圖像處理19逆時針旋轉(zhuǎn)90度垂直鏡像旋轉(zhuǎn)轉(zhuǎn)置數(shù)字圖像處理20 xy0s(x,y)t(x,y)(xs,ys)(xt,yt)HsHtWsWtSV=Ht/HsSH=Wt/Ws向前映射向后映射數(shù)字圖像處理21數(shù)字圖像處理22CTMatrix CImageProcessing:Image_zoom( const CTMatrix& color_image, double horizontal_scale, double vertical_scal
10、e )long source_height = color_image.Get_height();long source_width = color_image.Get_width();long dest_height = long( source_height * vertical_scale );long dest_width = long( source_width * horizontal_scale );CTMatrix dest_image( dest_height, dest_width );for( int dest_row = 0; dest_row dest_height;
11、 dest_row + )for( int dest_column = 0; dest_column dest_width; dest_column + )long source_row = long( dest_row / vertical_scale );long source_column = long( dest_column / horizontal_scale );if( color_image.Is_point_valid( CImagePoint( source_row, source_column ) ) )dest_image dest_row dest_column =
12、color_image source_row source_column ;elsedest_image dest_row dest_column = RGB_TRIPLE( 128, 128, 128 );return dest_image;數(shù)字圖像處理23切變,是一種坐標(biāo)系的扭曲變換,進(jìn)行非均勻的拉伸。切變的時候,角度會發(fā)生變化,但面積卻保持不變。數(shù)字圖像處理24xy0s(x,y)t(x,y)(xs,ys)(xt,yt)HsHtWsWtHt=Hs+s2WsWt=Ws+s1Hs向前映射向后映射數(shù)字圖像處理25數(shù)字圖像處理26仿射變換投影變換非剛體變換數(shù)字圖像處理27平移變換圖像旋轉(zhuǎn)圖像縮放仿
13、射變換,是一種二維坐標(biāo)到二維坐標(biāo)之間的線性變換,保持二維圖形的“平直性”(即變換后直線還是直線,不會打彎,圓弧還是圓弧)和“平行性”(即保證二維圖形間的相對位置關(guān)系不變,平行線還是平行線,相交直線之間的夾角不變)仿射變換可以理解為:1)對坐標(biāo)進(jìn)行縮放、旋轉(zhuǎn)和平移后取得的新坐標(biāo)值;2)經(jīng)過對坐標(biāo)軸的縮放、旋轉(zhuǎn)和平移后原坐標(biāo)在新坐標(biāo)系中的值。數(shù)字圖像處理28數(shù)字圖像處理29數(shù)字圖像處理30CTMatrix CImageProcessing:Image_affine( const CTMatrix& color_image, double m00, double m01, double m0
14、2, double m10, double m11, double m12 )long source_height = color_image.Get_height();long source_width = color_image.Get_width();long dest_height = source_height * 2;long dest_width = source_width * 2;CTMatrix dest_image( dest_height, dest_width );for( int dest_row = 0; dest_row dest_height; dest_ro
15、w + )for( int dest_column = 0; dest_column dest_width; dest_column + )int source_column = int( m00 * dest_column + m01 * dest_row + m02 );int source_row = int( m10 * dest_column + m11 * dest_row + m12 );if( color_image.Is_point_valid( CImagePoint( source_row, source_column ) ) )dest_image dest_row dest_column = color_image source_row source_column ;elsedest_image dest_row dest_column = RGB_TRIPLE( 128, 128, 128
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年黨章黨史國史國情知識競賽題庫及答案(共190題)
- 溶血三項(xiàng)在新生兒溶血檢測中的靈敏度及特異度分析
- 學(xué)院食材采購 投標(biāo)方案(技術(shù)方案)
- 電商平臺具體業(yè)務(wù)
- 中醫(yī)護(hù)理學(xué)(第5版)課件 第一節(jié) 中藥方劑基本常識
- 電子商務(wù)安全交易規(guī)范手冊
- 公路建設(shè)項(xiàng)目工程可行性研究報告編制辦法
- 系統(tǒng)可行性分析包括哪些內(nèi)容
- 農(nóng)產(chǎn)品加工與綜合利用技術(shù)手冊
- 品牌建設(shè)與營銷策略實(shí)施方案
- GB/T 15819-2006灌溉用聚乙烯(PE)管材由插入式管件引起環(huán)境應(yīng)力開裂敏感性的試驗(yàn)方法和技術(shù)要求
- GB/T 12996-2012電動輪椅車
- 變壓器的維護(hù)及檢修技能培訓(xùn)課件
- 大雁考上郵遞員新課件
- 《材料分析測試技術(shù)》全套教學(xué)課件
- 消防水池 (有限空間)作業(yè)安全告知牌及警示標(biāo)志
- 船舶保險投標(biāo)文件模板
- (完整版)形式發(fā)票模版(國際件通用)
- 施工二次結(jié)構(gòu)模板技術(shù)交底(一)
- 報關(guān)實(shí)務(wù)完整版課件全套ppt最全電子教案整書教案教學(xué)設(shè)計教學(xué)教程
- GM∕T 0036-2014 采用非接觸卡的門禁系統(tǒng)密碼應(yīng)用指南
評論
0/150
提交評論